SQL

April 26th, 2010 in Coding - 2 Comments

My ugliest SQL query — for posterity.

SELECT `wp_category`.`id` AS `category:id`, `wp_category`.`name` AS `category:name`, `wp_category`.`created` AS `category:created`, `wp_category`.`modified` AS `category:modified`, `wp_lib_items`.* FROM `wp_lib_items` LEFT OUTER JOIN `wp_lib_borrowers` ON (`wp_lib_items`.`id` = (SELECT `wp_b`.`id` FROM `wp_lib_borrowers` AS `wp_b` WHERE `wp_b`.`item_id` = wp_lib_items.id ORDER BY `wp_b`.`status` ASC LIMIT 1)) LEFT OUTER JOIN `wp_congregate_members` ON (`wp_lib_borrowers`.`member_id` = `wp_congregate_members`.`id`) LEFT JOIN `wp_lib_categories` AS `wp_category` ON (`wp_category`.`id` = `wp_lib_items`.`category_id`) ORDER BY IFNULL(NULLIF(`wp_lib_borrowers`.`due_date`, '0000-00-00'), '3333-33-33') DESC, `wp_lib_items`.`title` ASC LIMIT 10 OFFSET 0

Now I’m off to tango with PHP’s SplPriorityQueue.

Cultural Delight

April 25th, 2010 in Kohana, PHP - No Comments

A website I created for a local restaurant. My favorite part is the shopping cart functionality.

Design: Me
URL: culturaldelight.com

CongreGATE

April 25th, 2010 in Kohana, Wordpress - No Comments

I first started working on this in 2009 using WordPress as a base with a CodeIgniter backend. In early 2009 it became necessary to completely rewrite it because it wasn’t very extensible and there were a lot of bugs and duplicate code.

I decided to let WordPress handle the posts and pages as it used to, but use Kohana’s routes to handle other urls. Another issue we faced was that updating every installation was a nightmare, even though they all resided on the same server because every site used its own files. I modified it to use a central CDN for all common javascript, css and other media, as well as the same codebase.

By doing this, every update affects all the sites. In cases where custom functionality is needed for a client, we simply override with Kohana’s cascading file system.

I’ve learned more on this than on any other project before or after.

Design: DP Media Group.
URL: congregateonline.com

Please visit the link above for a full list of features.