Nice! My error handling and notification system has already helped my fix two bad links :)

I updated the error handling system for my "temporary" CMS on the site. I won't give away all the details, but it now does a much better job of notifying me when some attempts to visit a page that doesn't exist. In many cases, these errors are my fault. Of the two links I fixed, one of them was because I forgot to upload the page to an updated location and the other was an external link where I forgot to add the http://. Anyway, back to work!

updated the error handling system 10-1

Nice! My error handling and notification system has already helped my fix two bad links :)

I updated the error handling system for my "temporary" CMS on the site. I won't give away all the details, but it now does a much better job of notifying me when some attempts to visit a page that doesn't exist. In many cases, these errors are my fault. Of the two links I fixed, one of them was because I forgot to upload the page to an updated location and the other was an external link where I forgot to add the http://. Anyway, back to work!

updated the error handling system 10-1

Setting up the photo gallery today!

Working with WideImage today to create an image/media management system inside of my application's framework.

Do any of you have suggestions for the best way to organize a database schema to reference images in a file system?

My current approach is to run sha1_filename on the image to generate a filename, then store the image to the FS in an image folder path above the root.

I'm creating two sub folders to house the images based on the sha1_filename, for example:

83d8281665383fa968f34a91e7539b947d3a59d1.jpg is stored as
IMAGES_ROOT/83/d8/83d8281665383fa968f34a91e7539b947d3a59d1.jpg

My current reference table SQL looks something like this:

CREATE  TABLE IF NOT EXISTS `images` (
`id` INT(20) NOT NULL COMMENT 'image id' ,
`filename` VARCHAR(255) NOT NULL COMMENT 'relative path to file on FS' ,
`size` INT(8) NULL COMMENT 'file size' ,
`width` INT(5) NULL ,
`height` INT(5) NULL ,
`metadata` TEXT NULL COMMENT 'image meta' ,
`mime_type` VARCHAR(45) NOT NULL COMMENT 'mime type\n' ,
`caption` TEXT NULL COMMENT 'image caption' ,
`uploaded_by` INT(5) NULL ,
`created` DATETIME NOT NULL ,
`modified` DATETIME NULL ,
`live` TINYINT(1) NULL DEFAULT 1 COMMENT 'publicly visible?' ,
`deleted` TINYINT(1) NULL DEFAULT 0 COMMENT 'shown in listings' ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB

Eventually I'm going to add tags and  categories, but that can also be done later.

Thoughts?

 

Update 2/26
I ended up using  PHP Image Workshop instead.

Why? It's got a better website and um.. the code is newer.

Right now the photo gallery isn't finished, but it's up if you're interested.



 

I've uploaded over 500 photos. Enjoy!

Setting up the photo gallery today!

Working with WideImage today to create an image/media management system inside of my application's framework.

Do any of you have suggestions for the best way to organize a database schema to reference images in a file system?

My current approach is to run sha1_filename on the image to generate a filename, then store the image to the FS in an image folder path above the root.

I'm creating two sub folders to house the images based on the sha1_filename, for example:

83d8281665383fa968f34a91e7539b947d3a59d1.jpg is stored as
IMAGES_ROOT/83/d8/83d8281665383fa968f34a91e7539b947d3a59d1.jpg

My current reference table SQL looks something like this:

CREATE  TABLE IF NOT EXISTS `images` (
`id` INT(20) NOT NULL COMMENT 'image id' ,
`filename` VARCHAR(255) NOT NULL COMMENT 'relative path to file on FS' ,
`size` INT(8) NULL COMMENT 'file size' ,
`width` INT(5) NULL ,
`height` INT(5) NULL ,
`metadata` TEXT NULL COMMENT 'image meta' ,
`mime_type` VARCHAR(45) NOT NULL COMMENT 'mime type\n' ,
`caption` TEXT NULL COMMENT 'image caption' ,
`uploaded_by` INT(5) NULL ,
`created` DATETIME NOT NULL ,
`modified` DATETIME NULL ,
`live` TINYINT(1) NULL DEFAULT 1 COMMENT 'publicly visible?' ,
`deleted` TINYINT(1) NULL DEFAULT 0 COMMENT 'shown in listings' ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB

Eventually I'm going to add tags and catagories, but that can also be done later.

Thoughts?

Setting up the photo gallery today!

Working with WideImage today to create an image/media management system inside of my application's framework.

Do any of you have suggestions for the best way to organize a database schema to reference images in a file system?

My current approach is to run sha1_filename on the image to generate a filename, then store the image to the FS in an image folder path above the root.

I'm creating two sub folders to house the images based on the sha1_filename, for example:

83d8281665383fa968f34a91e7539b947d3a59d1.jpg is stored as
IMAGES_ROOT/83/d8/83d8281665383fa968f34a91e7539b947d3a59d1.jpg

My current reference table SQL looks something like this:

CREATE  TABLE IF NOT EXISTS `images` (
`id` INT(20) NOT NULL COMMENT 'image id' ,
`filename` VARCHAR(255) NOT NULL COMMENT 'relative path to file on FS' ,
`size` INT(8) NULL COMMENT 'file size' ,
`width` INT(5) NULL ,
`height` INT(5) NULL ,
`metadata` TEXT NULL COMMENT 'image meta' ,
`mime_type` VARCHAR(45) NOT NULL COMMENT 'mime type\n' ,
`caption` TEXT NULL COMMENT 'image caption' ,
`uploaded_by` INT(5) NULL ,
`created` DATETIME NOT NULL ,
`modified` DATETIME NULL ,
`live` TINYINT(1) NULL DEFAULT 1 COMMENT 'publicly visible?' ,
`deleted` TINYINT(1) NULL DEFAULT 0 COMMENT 'shown in listings' ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB

Eventually I'm going to add tags and  categories, but that can also be done later.

Thoughts?

Output Laravel 4 view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View

Output Laravel view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View

Output Laravel view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View

Output Laravel 4 view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View