Free PHP List Files in a Directory Script

Posted: March 19th, 2010 | No Comments

After finding a bunch of ugly scripts to display files in a directory, I finally created my own. It’s two simple files: index.php and icons.png. (might switch to .gif soon)  Grab the files at the address below and beautify your file listings.

Get it now at: http://www.halgatewood.com/free/file-directory-list/

I’ve also added a ‘freebies’ section to the lower right of the sidebar —–>
Check it out.

Read more »


eZPublish – Get Image File from Object using PHP

Posted: March 10th, 2010 | 2 Comments

Your doing some actually PHP in eZ Publish (in a module, class or whatever) and you need to find the image data for the Image Attribute of an object, here is what to do:

$node = eZContentObjectTreeNode::fetch( $node_id );
$dataMap = $node->dataMap();

$image_attribute = $dataMap['image'];
$image_array = $image_attribute->Content()->attribute('original');

$image_url = $image_array['url'];
  1. First get into the DataMap of your object or node.
  2. Change the ‘image’ of $dataMap['image'] to whatever the attribute_identifier of your image is.
  3. Change the ‘original’ of $image_pathobj->Content()->attribute(‘original‘); to whichever size of image you need to get.  The image array contents all the good information of that image, i.e. height, width, filesize, etc.
  4. Use the ‘url’ to get a full path to your image. Slap a “/” on the front or use ezurl() to display.

If you want to see the available image sizes, you can check them by debugging this value:

$image_sizes = $image_attribute->Content()->attributes();

Subtitles with FlowPlayer

Posted: January 18th, 2010 | No Comments

I recently built a subtitling system for a site that I am working on: khristos.org

It uses FlowPlayer with the built in Captions Plugin.  The interesting part is that I also built an admin section where clients can add the subtitles on their own. Click the image below to see what it looks like. You can also check out the video here.

FlowPlayer Captions Admin Interface

What’s also interesting is a Mashable article that explains how you can add Captions to your YouTube videos.

With the rising popularity of this subject and videos on the web, I figured it would be a good chance to give back to the community that has taken me so far.

Read more »


The Symfony command I can never remember

Posted: August 19th, 2009 | No Comments
$ php symfony i18n:extract frontend fr --auto-save

The i18n:extract task finds all strings that need to be translated in fr in the frontend application and creates or updates the corresponding catalogue.

The –auto-save option saves the new strings in the catalogue. You can also use the –auto-delete option to automatically remove strings that do not exist anymore.