<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- generator="FeedCreator 1.7.2-ppt (info@mypapit.net)" -->
<rss version="2.0">
    <channel>
        <title>MainelyDesign.com</title>
        <description>A blog mostly about web design and development in Maine</description>
        <link>http://www.mainelydesign.com</link>
        <lastBuildDate>Sun, 05 Feb 2012 16:12:57 +0100</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt (info@mypapit.net)</generator>
        <image>
            <url>http://www.mainelydesign.com/theme/mainelydesign/img/template/mainely-design-blog-logo.gif</url>
            <title>MainelyDesign.com Logo</title>
            <link>http://www.mainelydesign.com</link>
            <description><![CDATA[Feed provided by MainelyDesign.com. Click to visit.]]></description>
        </image>
        <item>
            <title>Forcing A Single Join in CakePHP Pagination</title>
            <link>http://www.mainelydesign.com/blog/view/forcing-a-single-join-in-cakephp-pagination</link>
            <description>&lt;p&gt;The devil's in the details... I was trying to make a really simple, dreadfully easy, database &lt;a href=&quot;http://book.cakephp.org/view/1047/Joining-tables&quot;&gt;join in my CakePHP&lt;/a&gt; web application.&amp;nbsp; I've forced joins in Cake before, using the 'joins' key in the options array for find calls and paginate calls with no issue.&amp;nbsp; It was late and for the first time I only wanted to use a single join.&amp;nbsp; I copied the join code from a much more complex web app and pasted it into my new 'joins' conditions.&amp;nbsp; And then... I got SQL errors.&amp;nbsp;
That query doesn't look right......&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 14 Oct 2011 09:25:00 +0100</pubDate>
        </item>
        <item>
            <title>Inserting NOW() into MySQL Using CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/inserting-now-into-mysql-using-cakephp</link>
            <description>&lt;p&gt;Great find.&amp;nbsp; If you want to insert NOW() into your query using CakePHP's save() or saveAll() functions, you can use the following expression:
$this-&amp;gt;data['Model']['custom_date_field'] = DboSource::expression('NOW()');

Not sure how it works on MSSQL, but I will be testing that soon.
Cheers,-Kevin Wentworth&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 11 Aug 2011 23:16:00 +0100</pubDate>
        </item>
        <item>
            <title>Best PaginateCount for CakePHP - with Group By Support</title>
            <link>http://www.mainelydesign.com/blog/view/best-paginatecount-cakephp-with-group-by-support</link>
            <description>&lt;p&gt;I'm been muddling my way through pagination with multiple joins, and complex filtering.&amp;nbsp; I finally got it all working (more on that later, maybe....) when I noticed that I couldn't paginate my results.&amp;nbsp; Everything was working fine until I added a &quot;group&quot; parameter to the find call.&amp;nbsp; Instead of getting the right count, I got a count of 1!&amp;nbsp; A quick look at my sql log tables (at the bottom of the page) and I saw that I had actually returned all the mysql records that were needed!&amp;nbsp; If only there ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sun, 07 Aug 2011 17:03:00 +0100</pubDate>
        </item>
        <item>
            <title>CakePHP Error Messages Not Showing on Form</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-error-messages-not-showing-on-form</link>
            <description>&lt;p&gt;I ran into an issue today that I've run into before, except I couldn't remember what I did to fix it (hence this article).&amp;nbsp; I was using CakePHP validation rules to validate a user account details.&amp;nbsp; The CakePHP validation was properly failing (the form data wasn't being saved) and I could tell the validate array was set correctly because the required fields were having the class .required added to them.&amp;nbsp; The only problem?&amp;nbsp; No error messages were being output to the form.&amp;nbsp; The form validation w...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sun, 03 Apr 2011 12:40:00 +0100</pubDate>
        </item>
        <item>
            <title>Sorting Paginated Results Using a Related Model Field in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/sorting-paginated-results-using-a-related-model-field-in-cakephp</link>
            <description>&lt;p&gt;Time crunch, so this will be quick.&amp;nbsp; I didn't want to go hunting for how to sort paginated results in CakePHP using a related model field again.&amp;nbsp; I actually found my answer on Stack Overflow.&amp;nbsp; The original poster had it right, so I'm not sure if it was a CakePHP bug or what (I don't have an account or I would correct it... it's on the list of to-dos though).
Using a Related Model Field To Sort Paginated Results
&amp;lt;th&amp;gt;&amp;lt;?php echo $paginator-&amp;gt;sort('title'); ?&amp;gt;&amp;lt;/th&amp;gt;
&amp;lt;th&amp;gt;&amp;lt;?php echo $paginator-&amp;gt;so...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sun, 06 Feb 2011 22:12:00 +0100</pubDate>
        </item>
        <item>
            <title>Changing CakePHP's Model useTable on the Fly</title>
            <link>http://www.mainelydesign.com/blog/view/changing-cakephps-model-usetable-on-fly</link>
            <description>&lt;p&gt;I finally found an answer to/solution to something I've never been able to get around in CakePHP before: dynamically changing/setting the useTable value in a model.&amp;nbsp; You can't just say $this-&amp;gt;CakePHPModel-&amp;gt;useTable = 'cakephp_table_name';&amp;nbsp; Instead you have to use the following function:
Setting CakePHP Model useTable Dynamically
$this-&amp;gt;CakePHPModelName-&amp;gt;setSource('table_name');

Thanks to &lt;a href=&quot;http://givemecake.dev-work.com/2010/08/changing-models-usetable-from-controller/&quot;&gt;Give Me Cake&lt;/a&gt; for sharing.&amp;nbsp; This will work from the controller or the model.&amp;nbsp; I'm using it to build an...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 02 Nov 2010 17:12:00 +0100</pubDate>
        </item>
        <item>
            <title>The Funniest Error Message Ever - Thank You Eclipse</title>
            <link>http://www.mainelydesign.com/blog/view/funniest-computer-programming-error-message-ever</link>
            <description>&lt;p&gt;In a depature from my [normally] on-topic (i.e. dry) posts I had to post this error message up here. It made me laugh! I was working on the fattest CakePHP controller known to man (over 4,000 lines, I know... not skinny) when &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse&lt;/a&gt; ran into issues.&amp;nbsp; Eclipse gave a very descriptive error message, stating that it couldn't, well see for yourself:

&lt;strong&gt;Error Processing Dirty Regions?&amp;nbsp; Does that mean Eclipse only got to first base?&lt;/strong&gt;
Cheers,
-Kevin Wentworth&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 18 Oct 2010 18:34:00 +0100</pubDate>
        </item>
        <item>
            <title>Upgrading CakePHP Application to 1.3 (from 1.2)</title>
            <link>http://www.mainelydesign.com/blog/view/upgrading-cakephp-application-to-1-3-from-1-2</link>
            <description>&lt;p&gt;I've been waiting to publish a completed article until after I was done with my upgrade to CakePHP 1.3.&amp;nbsp; Well, it's taking a while.&amp;nbsp; I'm not blaming the CakePHP upgrade from 1.2 to 1.3 for taking so long.&amp;nbsp; I'm actually doing several large-scale changes to my code base, my server and my repository structure.&amp;nbsp; Until that time, I'm going to publish some notes I've been making for this article.
CakePHP $form-&amp;gt;create() ID Renames
Huge Gotcha!&amp;nbsp; We depend on the ID of the form to perform CSS trans...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 27 Sep 2010 21:33:00 +0100</pubDate>
        </item>
        <item>
            <title>Common SSH Commands (An Idiot's Guide)</title>
            <link>http://www.mainelydesign.com/blog/view/common-ssh-commands-an-idiots-guide</link>
            <description>&lt;p&gt;Well, I never thought I would be saying this, but I'm starting to love using SSH to manage certain elements of my server.&amp;nbsp; Now that I'm using ssh bash to make some updates to my server, I find myself constantly hunting for the simple commands.&amp;nbsp; I'm going to put all the commands I need below, because I'm the idiot and it's my guide.
Changing Directories / Navigating
cd /dir/to/go/to/
cd .. (up a directory; that's a space, then dot-dot)
cd - (back to last directory, space-hyphen)
dir&amp;nbsp; (lis...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sat, 25 Sep 2010 09:25:00 +0100</pubDate>
        </item>
        <item>
            <title>Using KDiff3 as Git GUI Merge Tool on Windows XP and Windows 7</title>
            <link>http://www.mainelydesign.com/blog/view/using-kdiff3-as-git-gui-merge-tool-on-windows-xp-windows-7</link>
            <description>&lt;p&gt;I've been looking for the silver bullet solution to using KDiff3 as my git mergetool on Windows (using Git GUI).&amp;nbsp; I've finally got a solution that works in every Windows environment I've tried:

Add the KDiff3 directory to your Windows System Path (e.g. C:\Program Files\KDiff3\)
Add kdiff3 as your Git mergetool (From Git Bash, run git config --global merge.tool kdiff3)
Add kdiff3 complete path to Git Config (From Git Bash, run git config --global meregtool.kdiff3.path &quot;C:/Program Files/KD...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 23 Sep 2010 13:39:00 +0100</pubDate>
        </item>
        <item>
            <title>Getting All ACL Permissions in One Lookup (CakePHP 1.3)</title>
            <link>http://www.mainelydesign.com/blog/view/getting-all-acl-permissions-in-one-lookup-cakephp-1-3</link>
            <description>&lt;p&gt;The biggest hurdle I've had to overcome migrating my CakePHP application from 1.2 to the much improved 1.3 branch involves Plugins and the ACL component.&amp;nbsp; A while back I noticed that my backend was kind of sluggish due to all of the ACL lookups (that happen with each request) so I &lt;a title=&quot;Speeding Up CakePHP's ACL Component with MySQL indexing&quot; href=&quot;/blog/view/speeding-up-cakephp-acl-component&quot;&gt;optimized my ACL database tables&lt;/a&gt;.&amp;nbsp; At that same time, I also discovered an incredible mysql query that would &lt;a href=&quot;http://www.neilcrookes.com/2009/02/26/get-all-acl-permissions/&quot;&gt;lookup all of the ACL permissions&lt;/a&gt; for a particular ARO.&amp;nbsp; This setup worked great... until I started upgrad...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sun, 19 Sep 2010 11:36:00 +0100</pubDate>
        </item>
        <item>
            <title>CakePHP 1.3 Improvements Over CakePHP 1.2</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-1-3-improvements-over-cakephp-1-2</link>
            <description>&lt;p&gt;I've been working on upgrading my CakePHP application to cake version 1.3.&amp;nbsp; It's a lot of work.&amp;nbsp; I find myself constantly consulting the CakePHP manual/book for answers.&amp;nbsp; There are many places to look for all of the improvements that were rolled into CakePHP 1.3 (at least coming from the 1.2 version).&amp;nbsp; For my own reference, I'm creating a list of all of the manual pages that reference improvements, new features and/or different ways of doing things in CakePHP 1.3.
CakePHP 1.3 Improvements
...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 09 Sep 2010 14:01:00 +0100</pubDate>
        </item>
        <item>
            <title>CURL on Windows Doesn't Work in PHP 5.2.14 ISAPI</title>
            <link>http://www.mainelydesign.com/blog/view/curl-not-working-windows-php-5-2-14-isapi</link>
            <description>&lt;p&gt;Just a quick post to let everyone know what I just found out- the version of CURL (php_curl.dll) that ships with PHP 5.2.14 for Windows ISAPI doesn't work!&amp;nbsp; That's right- it doesn't work.&amp;nbsp; I tried the MSI PHP installer package, manual installs, moving dll files into Windows and System32 directories all to no avail.&amp;nbsp; The culprit: a bad version of php_curl.dll (at least that's my best guess).&amp;nbsp; The &lt;em&gt;other&lt;/em&gt; culprit: using ISAPI, but I don't have time to figure out FastCGI at this point.
Here are s...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 07 Sep 2010 20:17:00 +0100</pubDate>
        </item>
        <item>
            <title>Global Mysql Find and Replace with CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/global-mysql-find-replace-with-cakephp</link>
            <description>&lt;p&gt;I'm moving my &lt;a title=&quot;Content Management System for Websites&quot; href=&quot;http://www.siteavenger.com&quot;&gt;Content Management System&lt;/a&gt; over to CakePHP 1.3.&amp;nbsp; I'll post an article about my experiences later.&amp;nbsp; Today I will focus on one and only one issue with the migration from Cake 1.2 to 1.3: the change of webroot/theme/ to webroot/theme/ to serve static content.&amp;nbsp; At first I was a little disapointed/scared at the prospects of making this change, but have since come to see the absolute brilliance in this approach.
Files, easy. Content (Mysql data), hard?
Moving all of my webroot/theme/...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 31 Aug 2010 09:03:00 +0100</pubDate>
        </item>
        <item>
            <title>Difference Between Truncate and Empty (Delete From) in Mysql</title>
            <link>http://www.mainelydesign.com/blog/view/difference-between-truncate-empty-delete-from-in-mysql</link>
            <description>&lt;p&gt;I use &lt;a href=&quot;http://www.navicat.com/&quot;&gt;Navicat&lt;/a&gt; for administering all of my MySQL databases.&amp;nbsp; It has a command that I always use- empty table.&amp;nbsp; I noticed today that all along there has been a command right below it for truncate table.&amp;nbsp; Hmmm.&amp;nbsp; I figured this would result in the same outcome and wondered what the difference is between emptying a mysql table and truncating the same table.
Use &lt;strong&gt;TRUNCATE TABLE&lt;/strong&gt; to Start Fresh
After doing some research I found out that when you truncate a MySQL table, you are actually dropping the ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 23 Jun 2010 14:30:00 +0100</pubDate>
        </item>
        <item>
            <title>Best Approach to Dynamic Javascript in CakePHP Views</title>
            <link>http://www.mainelydesign.com/blog/view/best-approach-to-dynamic-javascript-in-cakephp-views</link>
            <description>&lt;p&gt;I always knew in the back of my mind that there was a better way of creating dynamic javascript than the method I was using.&amp;nbsp; CakePHP has a great function as part of the $View controller:&amp;nbsp; $View-&amp;gt;addScript($jscript, false) will add a script block to your template header.&amp;nbsp; This is the command I use to send javascript created in a Cake view up to the header, which is where most javascript should live.&amp;nbsp; The best approach to adding dynamic javascript to your CakePHP views is to implement PHP's ou...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sat, 29 May 2010 12:36:00 +0100</pubDate>
        </item>
        <item>
            <title>Speeding Up Cakephp's ACL Component</title>
            <link>http://www.mainelydesign.com/blog/view/speeding-up-cakephp-acl-component</link>
            <description>&lt;p&gt;I came across a posting today that changed the performance of my application tremendously and reinforced a concept I had forgotten about- mysql indices. I didn't realize my app was running slow until I implemented the mysql indexes below- no formal benchmark testing, but I would say speed improved by about 300%.&amp;nbsp; The improvement was most noticeble when you are &lt;a href=&quot;http://book.cakephp.org/complete/641/Simple-Acl-controlled-Application#An-Automated-tool-for-creating-ACOs-647&quot;&gt;building your ACL using the CakePHP suggested method&lt;/a&gt;.
MySQL Query to Create CakePHP ACL Indexes
This code was originally found at &lt;a href=&quot;http://pastie.org/823086.txt&quot;&gt;ht...&lt;/a&gt;&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 28 May 2010 12:12:00 +0100</pubDate>
        </item>
        <item>
            <title>Best Free Mysql Zip code Database</title>
            <link>http://www.mainelydesign.com/blog/view/best-free-mysql-zip-code-database</link>
            <description>&lt;p&gt;I'm sure every developer reaches a point when they will need to use a mysql database of zip codes in the United States.&amp;nbsp; Say you want to make a store locator and show how many miles a customer is from your store, or if you have some custom php logic that uses zip codes, you will inevitably need a mysql database of zipcodes.&amp;nbsp;
The Best Free Mysql Zip Code Database
So here it is- my vote for the best &lt;a href=&quot;http://federalgovernmentzipcodes.us/&quot;&gt;database of zipcodes&lt;/a&gt; available in native mysql format on the Internet.&amp;nbsp; From my limited testin...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 20 Apr 2010 16:42:00 +0100</pubDate>
        </item>
        <item>
            <title>Controlling CakePHP Error Handling When Debug = 0</title>
            <link>http://www.mainelydesign.com/blog/view/controlling-cakephp-error-handling-when-debug-0</link>
            <description>&lt;p&gt;I finally had a client request a piece of functionality that required me to program CakePHP so I could better control the default error handling when the site is in production mode (i.e. debug is set to 0).&amp;nbsp; By default, CakePHP will throw a 404 page not found header whenever ANY errors occur on a production site with debug equal to zero.&amp;nbsp; This works great, most of the time.&amp;nbsp; But what about when you are having database connectivity issues?&amp;nbsp; Say when there are too many mysql connections to that...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 19 Apr 2010 16:27:00 +0100</pubDate>
        </item>
        <item>
            <title>Cache Results from Query in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-cache-query-results</link>
            <description>&lt;p&gt;I have a HUGE query that I wanted to cache.&amp;nbsp; I love CakePHP's caching functionality out of the box, but one thing is missing- you can't cache the results of a query.&amp;nbsp; Let me clarify.&amp;nbsp; You can cache the reults of a query, but only for that instance of a page load.&amp;nbsp; Using &lt;a href=&quot;http://book.cakephp.org/view/445/cacheQueries&quot;&gt;$this-&amp;gt;cacheQueries&lt;/a&gt; only caches the query to memory, which only lasts for the duration of the page load.&amp;nbsp; If you want to &lt;strong&gt;cache query results&lt;/strong&gt; to the file system, listen to &lt;a href=&quot;http://www.milesj.me/blog/read/34/cacheing-each-query-individually&quot;&gt;Miles&lt;/a&gt;.
Cache Query Results in CakePHP
You'll need to ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 24 Mar 2010 11:18:00 +0100</pubDate>
        </item>
        <item>
            <title>Setting Envelope-From in CakePHP's Email Component</title>
            <link>http://www.mainelydesign.com/blog/view/setting-envelope-from-header-cakephp-email-component</link>
            <description>&lt;p&gt;I've setup a form that allows customers to sign up for an email newsletter and receive a coupon. I wanted to be able to track the bounced messages in case a legitimate customer's coupon was bounced for whatever reason. As I've learned, setting up the &quot;return-path&quot; for an email message isn't as simple as setting $this-&amp;gt;Email-&amp;gt;return = 'email@domain.com';&amp;nbsp; You have to use an as yet undocumented feature... $this-&amp;gt;Email-&amp;gt;additionalParams;
Making PHP mail() include your return-path email address...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 22 Mar 2010 17:56:00 +0100</pubDate>
        </item>
        <item>
            <title>2 Neat Little PHP Tricks</title>
            <link>http://www.mainelydesign.com/blog/view/two-neat-little-php-tricks</link>
            <description>&lt;p&gt;In writing a function to &lt;a href=&quot;/blog/view/php-function-validate-bank-routing-number-checksum&quot;&gt;validate bank routing numbers&lt;/a&gt;, I came across two simple techniques, that I know I will need to use again:
PHP Trick 1: Remove All Characters Except Numbers from a String
A simple little regex does the trick:
$routingNumber = preg_replace('[\D]', '', $routingNumber);

PHP Trick 2: Loop Through a String Character by Character
Setting two variables in a for loop does the trick (that could be trick number 3...):
for ($i = 0, $j = strlen($routingNumber); $i &amp;lt; $j; $i...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 16 Mar 2010 16:15:00 +0100</pubDate>
        </item>
        <item>
            <title>PHP Function to Validate Bank Routing Numbers</title>
            <link>http://www.mainelydesign.com/blog/view/php-function-validate-bank-routing-number-checksum</link>
            <description>&lt;p&gt;I needed to validate that a Bank Routing Number was valid, much like the algorithms out there to check if a Credit Card number is valid.&amp;nbsp; I did a little searching and didn't find a PHP function that would do the trick.&amp;nbsp; I decided to write my own, based on this &lt;a href=&quot;http://www.brainjar.com/js/validation/&quot;&gt;javascript function&lt;/a&gt;, and publish it for anyone who wants to use it:
Function to Validate Bank Routing Numbers:
function checkRoutingNumber($routingNumber = 0) {
	$routingNumber = preg_replace('[\D]', '', $routingNumber); //only digit...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 16 Mar 2010 16:10:00 +0100</pubDate>
        </item>
        <item>
            <title>Use a Plugin Element Outside of the Plugin in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/use-plugin-element-outside-of-plugin-cakephp</link>
            <description>&lt;p&gt;Quick note- I had an element .ctp file that was part of a plugin.&amp;nbsp; I wanted to render that element across my entire Site Avenger site, including non-plugin layouts and themes.&amp;nbsp; I found out that you can send $this-&amp;gt;element() (formerly $this-&amp;gt;renderElement()) a 'plugin' parameter to accomplish this... otherise CakePHP will only look in the app-wide elements or themed elements folder.
Render Plugin Element in Application
echo $this-&amp;gt;element('mini_cart', array('plugin'=&amp;gt;'avorders'));
Cheers,-K...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Sat, 13 Mar 2010 13:03:00 +0100</pubDate>
        </item>
        <item>
            <title>Create a Checklist Group or Related Checkboxes in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/create-checklist-group-related-checkboxes-in-cakephp</link>
            <description>&lt;p&gt;This is an interesting one.&amp;nbsp; I needed to create a group of checkboxes.&amp;nbsp; In my mind, it's just like a radio button group, except with checkboxes.&amp;nbsp; The only difference should be that with radio buttons you can only select one, while with a checkbox group you should be able to select as many as you want.&amp;nbsp; To achieve a checklist group in CakePHP is a little convoluted.
First Step, Create an Input of type=&amp;gt;'select'
That's right, if you want to make a group of checkboxes that are related in CakeP...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 05 Mar 2010 12:38:00 +0100</pubDate>
        </item>
        <item>
            <title>Export to PDF from Microsoft Publisher</title>
            <link>http://www.mainelydesign.com/blog/view/export-pdf-from-microsoft-publisher</link>
            <description>&lt;p&gt;I have a client that sends me newsletters in Microsoft Publisher format.&amp;nbsp; I wanted to output the newsletter as a PDF, but wanted to keep the text for SEO and so users can copy and paste the text if needed.&amp;nbsp; Microsoft Publisher doesn't have an export to PDF function, so usually I would just do a File &amp;gt; Print and select Adobe PDF as the printer.&amp;nbsp; However, this would just be an &quot;image&quot; of the document, not the actual document with selectable text.&amp;nbsp; This is how you can get a PDF with rendered tex...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 05 Mar 2010 10:54:00 +0100</pubDate>
        </item>
        <item>
            <title>Which Submit Button was Clicked in CakePHP? Use Name.</title>
            <link>http://www.mainelydesign.com/blog/view/getting-name-submit-button-clicked-after-post-cakephp</link>
            <description>&lt;p&gt;If you want to have multiple submit buttons that make a form do different things there's a simple way to do this.&amp;nbsp; The name of the submit button that was clicked by the user will be sent (via POST) with all the other POSTed data.&amp;nbsp; This is very handy if you want to have a cancel button and continue button. In CakePHP the name of the button won't be in $this-&amp;gt;data, but it's easy enough to get...
Give the Submit Button a Name
echo $form-&amp;gt;submit('Checkout Now', array('name'=&amp;gt;'proceedToCheckout'...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 04 Mar 2010 12:01:00 +0100</pubDate>
        </item>
        <item>
            <title>PHP Break Out of All Foreach or While Loops</title>
            <link>http://www.mainelydesign.com/blog/view/php-break-out-all-foreach-loops-while-loops</link>
            <description>&lt;p&gt;Let's have some fun with PHP's break command... I didn't think it was possible.&amp;nbsp; I just learned (I've been programming PHP for like 7 years) that you can instruct break how many levels of nesting to break out of!&amp;nbsp; I'm not surprised that break in PHP allows you to specify the number of loops (or switch statements) to break out of, but I am surprised it took me this long to use it!
Control How Many Loops PHP's Break Command Breaks Out Of
It's easy to control, just add a number after the break...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 25 Feb 2010 14:44:00 +0100</pubDate>
        </item>
        <item>
            <title>Changing the Order Sequence of CakePHP Behaviors </title>
            <link>http://www.mainelydesign.com/blog/view/changing-order-sequence-cakephp-behaviors</link>
            <description>&lt;p&gt;For reasons too long to explain in this post, I have two behaviors that are run on the same pieces of data (a translate behavior and a settings import/export behavior).&amp;nbsp; One behavior is attached to the model using var $actsAs, while the other behavior is attached dynamically, during runtime using $this-&amp;gt;attachBehavior();.&amp;nbsp; I needed the &quot;hardcoded&quot; behavior to run after the dynamically attached behavior.&amp;nbsp; Here's what I did:
Changing the Order of CakePHP Behaviors via $actsAs
First, the simpl...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 25 Feb 2010 07:20:00 +0100</pubDate>
        </item>
        <item>
            <title>Getting a List of Database Tables in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/getting-database-table-names-from-within-cakephp-controller</link>
            <description>&lt;p&gt;I ran into an interesting problem today.&amp;nbsp; What I wanted to do was know if a table didn't exist in my CakePHP application.&amp;nbsp; What happens- a cakeError is thrown everytime a database table doesn't exist.&amp;nbsp; This is really annoying...I think it would be beneficial to be able to tell Controller::loadModel() to return false instead of an error message.&amp;nbsp; That's not the case.&amp;nbsp; Here's how I got around it (with thanks to &lt;a href=&quot;http://www.milesj.me/blog/read/75/Retrieving-Tables-Within-Your-Cake-Database&quot;&gt;Miles Johnson&lt;/a&gt;):
Use Cake's Database Connection Manager to Return a List of Database...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 23 Feb 2010 12:22:00 +0100</pubDate>
        </item>
        <item>
            <title>Best CSS Method for Using Image as Submit Button</title>
            <link>http://www.mainelydesign.com/blog/view/best-method-using-css-image-for-submit-button</link>
            <description>&lt;p&gt;I came across an interesting issue with web forms and CSS.&amp;nbsp; Surprisingly, the end result is much better than I expected.&amp;nbsp; I knew that using an image instead of a traditional form submit button (&amp;lt;input type=&quot;submit&quot;&amp;gt;; instead of &amp;lt;input type=&quot;image&quot;&amp;gt; or &amp;lt;input type=&quot;button&quot;&amp;gt;) would be a little challenging.&amp;nbsp; I like a challenge, plus I wanted to use the submit button because it's the standard approach to forms and I remember reading somewhere that input's of type image or button do not submit whe...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 03 Feb 2010 12:17:00 +0100</pubDate>
        </item>
        <item>
            <title>Weird Git Error After Upgrade: Repository not found.  Make sure you include the .git</title>
            <link>http://www.mainelydesign.com/blog/view/weird-git-error-repository-not-found-include-dot-git</link>
            <description>&lt;p&gt;This isn't a weird error in that I've never seen it (ususally when I forget to load up Pagaent before attempting Github push/pulls).&amp;nbsp; It's weird because everything was working perfectly and then I couldn't do anything from remote!&amp;nbsp; I upgraded msysgit recently and hadn't tried to do any remote commands until yesterday.&amp;nbsp; And I kept getting the following error in Git Gui:
ERROR:&amp;nbsp; site:support.github.com Repository not found.&amp;nbsp; Make sure you include the .git, e.g. git@github.com:defunkt/ambition....&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 02 Feb 2010 08:18:00 +0100</pubDate>
        </item>
        <item>
            <title>Using Git and Plink for SSH on Windows</title>
            <link>http://www.mainelydesign.com/blog/view/git-plink-for-ssh-on-windows</link>
            <description>&lt;p&gt;Well, I finally had an opportunity to install Git on Windows yet again.&amp;nbsp; It had been quite a while since my last time installing Git on Windows, so I was a little rusty and couldn't figure out how to get Git to use Plink for SSH.&amp;nbsp; It's actually quite simple and dependent on a Windows system variable.
Getting Git to use Plink for SSH on Windows
You need to create a system variable in Windows for &lt;strong&gt;GIT_SSH&lt;/strong&gt;:

Go to System Properties &amp;gt; Advanced Settings
Click the button for Environment Variabl...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 25 Jan 2010 11:11:00 +0100</pubDate>
        </item>
        <item>
            <title>Using Jquery for target=&quot;_blank&quot; and strict xHTML</title>
            <link>http://www.mainelydesign.com/blog/view/using-jquery-for-target-blank-window-strict-xhtml</link>
            <description>&lt;p&gt;If you like to see the little green check mark that &lt;a href=&quot;http://users.skynet.be/mgueury/mozilla/&quot;&gt;HTML Validator&lt;/a&gt; shows when your HTML is 100% valid, you'll love this little trick. Thanks to &lt;a href=&quot;http://www.badlydrawntoy.com/2009/03/03/replacing-target_blank-for-strict-xhtml-using-jquery-redux/&quot;&gt;badlydrawntoy.com&lt;/a&gt;.&amp;nbsp;
Target=&quot;_blank&quot; Breaks xHTML Strict Guidelines
When you include the target attribute, your HTML will break the standards guideline for xHTML strict.&amp;nbsp; If you are using this doctype, you must use jquery to make your markup valid: &amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 28 Dec 2009 15:27:00 +0100</pubDate>
        </item>
        <item>
            <title>12 Essential Photoshop Keyboard Shortcuts</title>
            <link>http://www.mainelydesign.com/blog/view/12-essential-photoshop-keyboard-shortcuts</link>
            <description>&lt;p&gt;I remember about 7 years ago watching my friend use Adobe Illustrator.&amp;nbsp; He was a communications design major and used his keyboard more than his mouse.&amp;nbsp; I was blown away when I realized how much time you could save by learning keyboard shortcuts for Adobe's products.&amp;nbsp; This is my list of the best Adobe Photoshop keyboard shortcuts for web designers.

&lt;strong&gt;CTRL + D&lt;/strong&gt; - Deselect (sometimes it's easier than clicking outside of the current selection)
&lt;strong&gt;CTRL + H&lt;/strong&gt; - Hide Selection/Guides/Slices. (I use thi...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 21 Dec 2009 17:05:00 +0100</pubDate>
        </item>
        <item>
            <title>CSS Min-Height Hack in Internet Explorer</title>
            <link>http://www.mainelydesign.com/blog/view/css-min-height-hack-internet-explorer-ie</link>
            <description>&lt;p&gt;Another day of web developing with CSS and another day of needing a hack for IE6 and IE7.&amp;nbsp; This isn't really a hack so much as it's a method of ordering statements in your CSS declaration that yields a working min-height declaration in Internet Explorer.&amp;nbsp; Well, I guess it's a hack (but I hate using them).
CSS min-height will be used in browsers that support it
In web browsers that support the min-height property, it will be used.&amp;nbsp; In browsers that don't support it, height will be used.&amp;nbsp; For...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 15 Dec 2009 10:18:00 +0100</pubDate>
        </item>
        <item>
            <title>CakePHP Translate Behavior - Lessons Learned</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-translate-behavior-lessons-learned</link>
            <description>&lt;p&gt;I've been working on setting up a multi-lingual web site for one of my clients.&amp;nbsp; I was excited at the opportunity to finally use CakePHP's built-in internationalization and locale functions.&amp;nbsp; However, I ran into some issues that I'm sure other newbies to internationaliztion will run into as well.&amp;nbsp; Here's some take-backs of what I learned while using the Translate Behavior in Cake...
&lt;em&gt;(&lt;strong&gt;Author's Note&lt;/strong&gt;: This posting is still a work in progress. I'm still implementing the translate behavior and ha...&lt;/em&gt;&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 15 Dec 2009 08:29:00 +0100</pubDate>
        </item>
        <item>
            <title>Upgrading Jquery UI Tabs and it Stopped Working</title>
            <link>http://www.mainelydesign.com/blog/view/jquery-ui-tabs-stopped-working-after-upgrade</link>
            <description>&lt;p&gt;I was upgrading the version of Jquery UI that I use with Site Avenger.&amp;nbsp; The last time I was in a rush, nothing seemed to work and I rolled the changes back.&amp;nbsp; This time, I took the time and decided to finally make this Jquery UI upgrade happen.&amp;nbsp; This time everything went swell, except my Jquery UI tabs plugin stopped working.&amp;nbsp; WTF?
Read the Jquery UI Upgrade Guide
In my search on Google for 'upgrading jquery ui tabs stopped working' I came across a nifty little support document from the Jque...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 09 Dec 2009 20:16:00 +0100</pubDate>
        </item>
        <item>
            <title>Viewing Rendered Email Messages in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/viewing-rendered-email-messages-debug-cakephp</link>
            <description>&lt;p&gt;For a while it's bugged me that I wasn't able to see the rendered output of my email messages that are sent using the CakePHP email component. I would change my code to use a remote smtp server but I still had to send messages.&amp;nbsp; Well, I finally figured out how to &quot;debug&quot; my emails sent using CakePHP.&amp;nbsp; Thanks to this &lt;a href=&quot;http://debuggable.com/posts/make-your-life-easier-with-these-five-cakephp-quicktips:48170ee5-0cc0-4815-af60-7c264834cda3-af60-7c264834cda3&quot;&gt;posting&lt;/a&gt; for finally putting all the pieces together...
Set $this-&amp;gt;Email-&amp;gt;delivery to 'debug'
The first step is to tell the CakePHP Email Component to deliver the message using i...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 09 Dec 2009 12:15:00 +0100</pubDate>
        </item>
        <item>
            <title>Cool Stuff with CakePHP: Cryptable Behavior</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-cool-stuff-cryptable-behavior</link>
            <description>&lt;p&gt;There is so much cool stuff out there that's already been done with CakePHP.&amp;nbsp; In an attempt to catalog it for my own use later, I'm going to start creating blog posts that highlight cool behaviors, components, etc. for CakePHP.&amp;nbsp; This is the first one.
From the &lt;a href=&quot;http://bakery.cakephp.org/articles/view/cryptable-behavior&quot;&gt;Bakery&lt;/a&gt;: &quot;A behavior that will automatically encrypt/decrypt specified fields in a model, using your choice of cipher, key, and IV.&quot;
&lt;a href=&quot;http://bakery.cakephp.org/articles/view/cryptable-behavior&quot;&gt;http://bakery.cakephp.org/articles/view/cryptable-behavior&lt;/a&gt;&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 20 Nov 2009 11:19:00 +0100</pubDate>
        </item>
        <item>
            <title>Jquery Accordion Menu - Expanding UL Menu</title>
            <link>http://www.mainelydesign.com/blog/view/jquery-accordion-menu-expanding-ul-menu</link>
            <description>&lt;p&gt;I looked around and found some &lt;a href=&quot;http://www.learningjquery.com/2007/03/accordion-madness&quot;&gt;interesting examples&lt;/a&gt; and &lt;a href=&quot;http://docs.jquery.com/UI/Accordion&quot;&gt;existing plugins&lt;/a&gt; for creating an accordion menu in Jquery.&amp;nbsp; What I was looking for was a nested unordered list (UL) that would collapse and expand based on which menu item was clicked.&amp;nbsp; If there wasn't a child UL, then the menu link should be clickable, instead of an accordion.&amp;nbsp; Sounds simple right?
Semantic HTML Markup
I wanted to keep my HTML clean, and for me that means using semantically correct UL/LI for presenting the menu/naviga...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 17 Nov 2009 13:25:00 +0100</pubDate>
        </item>
        <item>
            <title>Jquery Direct Descendant Selector (using the &gt;)</title>
            <link>http://www.mainelydesign.com/blog/view/jquery-direct-descendent-selector</link>
            <description>&lt;p&gt;I'd been struggling with a very &lt;a title=&quot;Jquery Accordion Menu Example&quot; href=&quot;/blog/view/jquery-accordion-menu-expanding-ul-menu&quot;&gt;simple accordion menu script&lt;/a&gt;.&amp;nbsp; The problem was that I couldn't stop all of the links from returning false, when I only wanted to top link to return false.&amp;nbsp; Let me show you my code:
$('div#sideNav li:has(ul) a').click(function() {
	return false;
});
What was going on (and correctly I might add) was all links contained in an li with a ul would return false, and wouldn't follow the link.&amp;nbsp; I wrote this convoluted function to parse out the href and change the wi...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 17 Nov 2009 13:08:00 +0100</pubDate>
        </item>
        <item>
            <title>What is the Difference Between Oblique and Italic in CSS?</title>
            <link>http://www.mainelydesign.com/blog/view/difference-between-oblique-italic-in-css</link>
            <description>&lt;p&gt;&lt;strong&gt;This answer was located at &lt;a href=&quot;http://www.webmasterworld.com/forum83/5491.htm&quot;&gt;WebMasterWorld.com&lt;/a&gt; on 11/12/09.&amp;nbsp; Answers written by &lt;a href=&quot;http://www.webmasterworld.com/profilev4.cgi?action=view&amp;amp;member=johnl&quot;&gt;johnl&lt;/a&gt;.&lt;/strong&gt;
I was reading up on the CSS font-style property, making sure the default value was normal.&amp;nbsp; In case you are wondering, the default font-style value is normal.&amp;nbsp; What struck me was a new value I've never used before: oblique.&amp;nbsp; Now I'm curious... what's the difference between oblique and italic as it pertains to CSS fonts?
As it turns out, not much!&amp;nbsp; Based on what I learned (from this excellently thorough for...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 12 Nov 2009 09:34:00 +0100</pubDate>
        </item>
        <item>
            <title>Auto Columns with Columnizer - My New Favorite Jquery Plugin</title>
            <link>http://www.mainelydesign.com/blog/view/auto-columns-columnizer-my-new-favorite-jquery-plugin</link>
            <description>&lt;p&gt;I was about to start coding a CakePHP helper that would analyze a bulleted list and split it into columns.&amp;nbsp; Starting to think about how I would approach this problem, my head began to hurt.&amp;nbsp; Then I found an awesome jQuery plugin- &lt;a title=&quot;Columnizer Jquery Plugin&quot; href=&quot;http://welcome.totheinter.net/columnizer-jquery-plugin/&quot;&gt;columnizer&lt;/a&gt;.
Unobtrusive Javascript Implementation
This is a perfect example of unobtrusive javascripting.&amp;nbsp; A browser without javascript sees one long list.&amp;nbsp; A javascript-enabled browser has an improved viewing experience...just the way it should be.
So simple to s...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 30 Sep 2009 10:37:00 +0100</pubDate>
        </item>
        <item>
            <title>CSS Small-Caps Working in IE Not in Firefox</title>
            <link>http://www.mainelydesign.com/blog/view/css-small-caps-not-working-in-firefox-only-ie</link>
            <description>&lt;p&gt;Another IE/FF Inconsistancy?
I thought I had ran into an interesting (and new) CSS bug.&amp;nbsp; I was using Trebuchet MS as my font for my H2s.&amp;nbsp; It was rendering perfect in Internet Explorer but not in Firefox.&amp;nbsp; In Firefox, all caps.&amp;nbsp; In IE, small-caps.&amp;nbsp; What gives?

C Stands for Cascading...
It turns out that I hadn't specifically told the H2 to display text as normal.&amp;nbsp; It was inheriting a style=&quot;text-transform: uppercase&quot; from another CSS style definition.&amp;nbsp; In IE, I guess font-variant trumps t...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 24 Sep 2009 11:03:00 +0100</pubDate>
        </item>
        <item>
            <title>A Really Good Implementation of Captcha</title>
            <link>http://www.mainelydesign.com/blog/view/example-really-good-implementation-captcha</link>
            <description>&lt;p&gt;&lt;strong&gt;Awesome Captcha Implementation&lt;/strong&gt;
I just experienced a version of &lt;a href=&quot;http://en.wikipedia.org/wiki/CAPTCHA&quot;&gt;Captcha&lt;/a&gt; that I actually like.&amp;nbsp; Instead of having to type in jumbled letters and phrases or answering simple questions, &lt;a href=&quot;http://www.cpawebsiteresources.com/app/support/index.asp&quot;&gt;Service2Client &lt;/a&gt;actually asks you to identify the color of the letter in a certain position.&amp;nbsp; Not only does it fool spambots (I would assume anyway) but it's pretty easy to understand.
&lt;strong&gt;Solves the Usability Problem&lt;/strong&gt;
It stumped me for a second, but once I figured it out, no problem.&amp;nbsp; I would try a different approac...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 22 Sep 2009 14:45:00 +0100</pubDate>
        </item>
        <item>
            <title>Faking Symlinks on Windows 2003</title>
            <link>http://www.mainelydesign.com/blog/view/faking-symlinks-on-windows-2003</link>
            <description>&lt;p&gt;My production server is a LAMP server.&amp;nbsp; I love it.&amp;nbsp; I have one cental location for my CakePHP application and symlink the folders I need to each individual hosting account.&amp;nbsp; It's pretty easy to do and very powerful.&amp;nbsp; I work on another server that is Windows 2003.&amp;nbsp; Everytime I sit down to do work, I bemoan not having the ability to create symlinks.&amp;nbsp; Turns out there is a way...
Junction Links are essentially Symlinks in Windows
Sweet! I don't care what a symlink is called on Windows, but it's...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 17 Sep 2009 16:25:00 +0100</pubDate>
        </item>
        <item>
            <title>Delete Dependent Just Deleted All My Records</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-delete-dependent-just-deleted-all-my-records</link>
            <description>&lt;p&gt;Oh man! I just deleted all my database records using $model-&amp;gt;del($id) with dependent=&amp;gt;true in the model association.&amp;nbsp; That wasn't supposed to happen!&amp;nbsp; It turns out to be an issue with how I specified my model association.&amp;nbsp; What's weird is that everything works fine except when I go to do the delete with cascade set to true.
Use an array for conditions when associating models
I was using some older model code and never changed it because everything worked fine.&amp;nbsp; However, the issue came down ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 17 Sep 2009 10:12:00 +0100</pubDate>
        </item>
        <item>
            <title>How do I reset the keys in a PHP array?</title>
            <link>http://www.mainelydesign.com/blog/view/how-php-reset-array-keys</link>
            <description>&lt;p&gt;&lt;strong&gt;This answer was located at &lt;a href=&quot;http://www.codingforums.com/showthread.php?t=17794&quot;&gt;CodingForums.com&lt;/a&gt; on 9/11/09.&amp;nbsp; Answers written by &lt;a href=&quot;http://www.codingforums.com/member.php?u=65891&quot;&gt;PHP6&lt;/a&gt; and &lt;a href=&quot;http://www.codingforums.com/member.php?u=2783&quot;&gt;Fou-Lu&lt;/a&gt;.&lt;/strong&gt;I had been hunting for an answer to the elusive question of how do I reset array keys in PHP.&amp;nbsp; I finally found the perfect (and thorough) answer here. There are 3 ways to reset array keys in PHP.&amp;nbsp; All of these solutions work with numerically indexed arrays only. To recap:
PHP Function: array_values()
$reset_array_keys = array_values($numerically_indexed_array);
PHP Function: array_merge()
$reset_ar...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 11 Sep 2009 14:00:00 +0100</pubDate>
        </item>
        <item>
            <title>Date Input Using Cakephp Form Helper</title>
            <link>http://www.mainelydesign.com/blog/view/date-input-using-cakephp-form-helper</link>
            <description>&lt;p&gt;I always forget what exactly needs to happen in order for CakePHP's form helper to work with date input fields.&amp;nbsp; I'm sick of tearing through old source code and looking at the &lt;a href=&quot;http://book.cakephp.org&quot;&gt;official CakePHP docementation site&lt;/a&gt;.&amp;nbsp; Here's how to get it to work...
Date Inputs Using the Form Helper:
$current_year = date('Y');
$max_year = $current_year + 2;
echo $form-&amp;gt;input('dateSelectBoxes', array('type'=&amp;gt;'date', 'selected'=&amp;gt;$unix_timestamp, 'empty'=&amp;gt;true, 'minYear'=&amp;gt;2009, 'maxYear'=&amp;gt;$max_year));

It's pr...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 09 Sep 2009 15:29:00 +0100</pubDate>
        </item>
        <item>
            <title>Invalid Date Value Error in MySQL</title>
            <link>http://www.mainelydesign.com/blog/view/invalid-date-value-mysql-error</link>
            <description>&lt;p&gt;I ran into an interesting issue with valid dates and MySQL on Windows.&amp;nbsp; I wrote a CakePHP import function that basically moves MySQL data from one DB to the other.&amp;nbsp; I never thought that I would see an error related to an invalid date, but I did.
What determines if a date value is invalid (read: warning) or unacceptable (read: error)?
It turns out to be based on the sql_mode you have specified for your MySQL server.&amp;nbsp; I found this extremely thorough description of the different MySQL sql_mode...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 09 Sep 2009 14:26:00 +0100</pubDate>
        </item>
        <item>
            <title>Cakephp's Flay Class is Amazing - Examples Included</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-flay-class-is-amazing</link>
            <description>&lt;p&gt;If you haven't checked out CakePHP's Flay class, &lt;a title=&quot;Flay Class API&quot; href=&quot;http://api.cakephp.org/class/flay/&quot;&gt;check it out&lt;/a&gt;. It's one of the best utility classes for text output in CakePHP.
I just noticed that my blog was using the same META description for all of my blog entries- not good for SEO.&amp;nbsp; Instead, I want to pull a fragment of the article copy and use that as my META description.&amp;nbsp; I currently use this convoluted way to get my summaries from the article copy, so I decided to try using the Flay class.&amp;nbsp; I've used it before but I'm glad I revisit...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 08 Sep 2009 21:31:00 +0100</pubDate>
        </item>
        <item>
            <title>Manually Installing MySQL on Windows 2003 Server</title>
            <link>http://www.mainelydesign.com/blog/view/manually-installing-mysql-on-windows-2003-server</link>
            <description>&lt;p&gt;I have been trying to install MySQL on a web server running Windows 2003 for quite a while now.&amp;nbsp; I was finally successful! Here's how I did it...
Does your server have a hard-coded IP address?
If so, you need to make localhost refer to the manually assigned IP address in your hosts file.&amp;nbsp; This file is located in C:\Windows\System32\drivers\etc.
Default hosts file will say:
127.0.0.1	localhost
Modify your hosts file to reflect the binded IP address (be sure to save your changes!):
10.1.1...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 02 Sep 2009 12:02:00 +0100</pubDate>
        </item>
        <item>
            <title>Using Exif in PHP on Windows</title>
            <link>http://www.mainelydesign.com/blog/view/using-exif-in-php-on-windows</link>
            <description>&lt;p&gt;I'm trying to use the exif functions in PHP on my Windows XP computer.&amp;nbsp; I want to read the meta data that is recorded by my digital camera (exif - &lt;a href=&quot;http://en.wikipedia.org/wiki/Exchangeable_image_file_format&quot;&gt;exchangeable image file format&lt;/a&gt;).&amp;nbsp; I like the idea of storing that exif data in the database, so it's searchable. I wasn't having any luck with exif_read_data(), but finally &lt;a href=&quot;http://us3.php.net/manual/en/ref.exif.php#75868&quot;&gt;found this posting&lt;/a&gt;.
You need to adjust your php.ini file.
Move extension=php_exif.dll below extension=php_mbstring.dll (which needs to be enabled too).&amp;nbsp; Your php.ini should lo...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 28 Aug 2009 09:40:00 +0100</pubDate>
        </item>
        <item>
            <title>Making Valid Email (mailto) links in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/making-valid-email-mailto-links-in-cakephp</link>
            <description>&lt;p&gt;It's easy to make an email address using the HTML's helper link() function.&amp;nbsp; All you need to do is have an email address appended with the string 'mailto:' (just like in regular ol' HTML).
Here's my quick and dirty function to attach it if it doesn't exist:
if(stristr($image['link'], '@') and stristr($image['link'], 'mailto') === false) {
	$address = 'mailto:'. $image['link'];
} else {
	$address = $image['link'];
}

echo '&amp;lt;p&amp;gt;'. $html-&amp;gt;link($image['link'], $address) . '&amp;lt;/p&amp;gt;';

I hope...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 25 Aug 2009 16:59:00 +0100</pubDate>
        </item>
        <item>
            <title>Changing Filetypes Shown in SWF Upload File Browser</title>
            <link>http://www.mainelydesign.com/blog/view/changing-filetypes-shown-in-swf-upload-file-browser</link>
            <description>&lt;p&gt;It's easy to change which file types are allowed to show up (and are displayed) when you browse for files to upload through SWF Upload.&amp;nbsp; &lt;a title=&quot;SWF Upload&quot; href=&quot;http://swfupload.org/&quot;&gt;SWF Upload&lt;/a&gt; makes it easy to upload multiple files in PHP.
I just had to hunt through some source files until I found this in my SWF Upload config. (goes in the new SWFUpload() function)
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
	var swfu;
	window.onload = function () {
		swfu = new SWFUpload({// File Upload Settings
			file_size_limit : &quot;8 MB&quot;,	// 2MB
			file_t...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 25 Aug 2009 16:17:00 +0100</pubDate>
        </item>
        <item>
            <title>Can I (Un) Sharpen an Image After Resizing it with GD in PHP?</title>
            <link>http://www.mainelydesign.com/blog/view/sharpen-photos-after-resizing-with-gd-library-php</link>
            <description>&lt;p&gt;&lt;strong&gt;This answer was located at &lt;a href=&quot;http://drupal.org/node/205035&quot;&gt;Drupal Forums &lt;/a&gt;on 8/25/09.&amp;nbsp; Answer written by &lt;a href=&quot;http://drupal.org/user/217068&quot;&gt;dpfiffe&lt;/a&gt;.&lt;/strong&gt;I've been toying with the idea of making my personal image gallery online, so I can tag, etc.&amp;nbsp; I want to store a large file and resize on demand, so I became interested in finding out how to sharpen after resizing an image in PHP, using GD Library.
&lt;a href=&quot;http://drupal.org/node/205035&quot;&gt;Read the full answer at Drupal Forums&lt;/a&gt;
&amp;nbsp;

&lt;strong&gt;Answer written by&amp;nbsp;&lt;a href=&quot;http://drupal.org/user/217068&quot;&gt;dpfiffe&lt;/a&gt;. See &lt;a href=&quot;http://drupal.org/node/205035&quot;&gt;Answer #2&lt;/a&gt; in context at Drupal Forums.&lt;/strong&gt;
&amp;nbsp;&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 25 Aug 2009 10:19:00 +0100</pubDate>
        </item>
        <item>
            <title>What are the elements of a good landing page?</title>
            <link>http://www.mainelydesign.com/blog/view/elements-of-an-effective-landing-page</link>
            <description>&lt;p&gt;&lt;strong&gt;This answer was located at &lt;a href=&quot;http://forums.seochat.com/google-adwords-more-39/new-website-google-says-landing-page-is-poor-can-t-252050.html&quot;&gt;SEO Chat&lt;/a&gt; on 8/24/09.&amp;nbsp; Answer written &lt;/strong&gt;&lt;strong&gt;by &lt;a href=&quot;http://forums.seochat.com/member.php?userid=33118&quot;&gt;new_seo&lt;/a&gt;.&lt;/strong&gt;This is an excellent example of a thorough forum answer.&amp;nbsp; The specific design elements, and expected user behavior, associated with an effective landing page are discussed.&amp;nbsp; This posting was supposed to be regarding Google's Rating of your landing page, however the author discusses a pretty well rounded approach to maximizing the effectiveness of your landing pages, so it's worth a read. &lt;a href=&quot;http://forums.seochat.com/google-adwords-more-39/new-website-google-says-landing-page-is-poor-can-t-252050.html&quot;&gt;&lt;em&gt;See &lt;/em&gt;&lt;/a&gt;&lt;a href=&quot;http://forums.seochat.com/google-adwords-more-39/new-website-google-says-landing-page-is-poor-can-t-252050.html&quot;&gt;&lt;em&gt;Answer #2&lt;/em&gt;&lt;/a&gt;.
The only thing ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 24 Aug 2009 11:31:00 +0100</pubDate>
        </item>
        <item>
            <title>Network Solutions' Flawed .htaccess and Mod_Rewrite Rules Implementation</title>
            <link>http://www.mainelydesign.com/blog/view/network-solutions-htaccess-mod_rewrite-rewriterule-flawed</link>
            <description>&lt;p&gt;I can't believe it!&amp;nbsp; I spent hours trying to get the mod_rewrite rules working in .htaccess on Network Solutions' servers.&amp;nbsp; Everything I tried didn't work.&amp;nbsp; Using the default .htaccess (from Cake distribution) failed.&amp;nbsp; I've used the distribution on several servers and never had any issue with the rewrite rules.&amp;nbsp; However, Network Solutions's mod_rewrite works differently than [all] other servers.
The target and destination file have to exist
Wait, the target file has to exist?&amp;nbsp; That's right....&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 06 Aug 2009 14:38:00 +0100</pubDate>
        </item>
        <item>
            <title>Cheatsheet for Creating .MOV Files from .VOB files (DVDs)</title>
            <link>http://www.mainelydesign.com/blog/view/cheatsheet-for-extracting-vob-to-mov-files</link>
            <description>&lt;p&gt;Every now and again I need to take a video from a promotional DVD and put it on a client's web site.&amp;nbsp; I use a handy &lt;a title=&quot;Flash Video Creator&quot; href=&quot;http://www.moyea.com/&quot;&gt;utility&lt;/a&gt; that will convert almost any video file into a flash video (.swf/.flv).&amp;nbsp; The hard part usually comes from having to rip the video from the DVD.&amp;nbsp;
I use &lt;a title=&quot;MediaCoder Web Site&quot; href=&quot;http://mediacoder.sourceforge.net/&quot;&gt;MediaCoder&lt;/a&gt;.&amp;nbsp; It's Open Source, easy to use, and extremely powerful.&amp;nbsp; The reason for my post, is to remember some settings.&amp;nbsp; These settings are the ones that worked for me.&amp;nbsp; I don't recommend them, but they successfully ri...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 30 Jul 2009 11:38:00 +0100</pubDate>
        </item>
        <item>
            <title>TinyMCE Doesn't Work in IE8</title>
            <link>http://www.mainelydesign.com/blog/view/tinymce-not-working-in-internet-explorer-ie8</link>
            <description>&lt;p&gt;I was training a client how to update their web site using &lt;a title=&quot;Site Avenger Content Management System&quot; href=&quot;http://www.siteavenger.com&quot;&gt;Site Avenger&lt;/a&gt; when the strangest thing happened- no copy was showing in TinyMCE.&amp;nbsp; No matter what I pasted the tiny editor would remain a nice, plain white.&amp;nbsp; I didn't think to try typing directly into TinyMCE.&amp;nbsp; No matter, a click on the HTML button to view the source revealed the content was in fact there, just not being shown within the TinyMCE editor.
Tell IE8 to Use Compatibility Mode
I found a &lt;a title=&quot;Telling IE8 to use compatibility mode&quot; href=&quot;http://www.ditii.com/2008/08/28/ie8-standards-mode-and-ie7-compatibility-mode/&quot;&gt;link&lt;/a&gt; to a neat snippet of code that w...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 24 Jul 2009 11:54:00 +0100</pubDate>
        </item>
        <item>
            <title>Phantom Whitespace Below Img in Firefox</title>
            <link>http://www.mainelydesign.com/blog/view/phantom-white-space-below-img-in-ff-only</link>
            <description>&lt;p&gt;I've come across this thing a few times before- there's a strange space below images in Firefox, but not in IE.&amp;nbsp; I finally found a nice &lt;a title=&quot;Fixing Whitespace Below Images in FireFox&quot; href=&quot;http://www.webdeveloper.com/forum/archive/index.php/t-68801.html&quot;&gt;explanation&lt;/a&gt; as to why it happens, which I wanted to post here.
Images are displayed inline by default.&amp;nbsp; When you are using an image as a block (like when you want an image to take up the entire top half of a page) you'll get some mysterious white space below the image, but only in Firefox.&amp;nbsp; For once, IE actually seems to render the CSS appropriately.
The fi...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 22 Jul 2009 10:24:00 +0100</pubDate>
        </item>
        <item>
            <title>Faking min-width CSS style in IE6 and IE7</title>
            <link>http://www.mainelydesign.com/blog/view/faking-min-width-css-style-in-internet-explorer</link>
            <description>&lt;p&gt;It's a hack... but it's needed to make a truly cross-browser fluid layout.&amp;nbsp; It's simple, if you want to implement min-width in IE6 and IE7, use the following CSS code: (I didn't create this originally, sorry, lost the source)
/*********************
**	IE 6.0 min-width hack
********************/
* html div#contentWrap {
	width:expression(((document.compatMode &amp;amp;&amp;amp; document.compatMode=='CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth) &amp;lt; 1000 ? &quot;840px&quot; : &quot;85%&quot;)...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 16 Jul 2009 13:50:00 +0100</pubDate>
        </item>
        <item>
            <title>Avoiding Flash (.flv) 404 Errors on IIS 6 (Windows 2003)</title>
            <link>http://www.mainelydesign.com/blog/view/fixing-flash-flv-404-errors-iis6</link>
            <description>&lt;p&gt;An interesting thing happens on Windows 2003 Server (IIS 6) when you try and play a .flv file through an embedded shockwave player...nothing.&amp;nbsp; Well, actually you get a 404 error.&amp;nbsp;
Fixing the .flv 404 error is simple
All you need to do is tell the IIS server that the MIME type for .flv exists.&amp;nbsp; Then, the web server can send the appropriate MIME-TYPE header when needed.
Adding the .FLV MIME type to Windowss 2003 / IIS 6&amp;nbsp;
You can modify the MIME type on the entire server by editing the prope...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 15 Jul 2009 11:11:00 +0100</pubDate>
        </item>
        <item>
            <title>Using Between with Date Ranges in Proper DB Date Format</title>
            <link>http://www.mainelydesign.com/blog/view/between-date-range-maintaining-proper-date-format</link>
            <description>&lt;p&gt;I need my CakePHP apps to run on both LAMP and Windows IIS using MSSQL Server.&amp;nbsp; Usually this isn't a problem because CakePHP does such a good job of database abstraction and database independence.&amp;nbsp; However, I came across a scenario the other day where I needed to select a date range using the BETWEEN SQL command.
Using CakePHP's BETWEEN function for date ranges
It's easy, if you only want to use MySQL.&amp;nbsp; Just do the following (note that the &quot;lesser&quot; or older date comes first):
array('Post.c...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 09 Jul 2009 11:56:00 +0100</pubDate>
        </item>
        <item>
            <title>Adding Anchors to Your CakePHP Generated Urls (#link)</title>
            <link>http://www.mainelydesign.com/blog/view/adding-anchors-to-cakephp-generated-urls</link>
            <description>&lt;p&gt;This may seem simple and trivial, but it took me a little while to figure out.&amp;nbsp; If it saves someone a little trial-and-error then great (I know I won't forget how to do it).
I needed to create a redirect in CakePHP that redirected to an inline, on-page anchor- &amp;lt;a name=&quot;destination&quot;&amp;gt;Scroll to Here&amp;lt;/a&amp;gt;.&amp;nbsp; Typing the link directly into the address bar of the browser, it would need to look like this: http://www.mainelydesign.com/blog/view/1219/#destination.&amp;nbsp; The #destination is what I needed to f...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 02 Jul 2009 09:02:00 +0100</pubDate>
        </item>
        <item>
            <title>Using CakePHP's Set Class to Make Select List Options</title>
            <link>http://www.mainelydesign.com/blog/view/using-cakephp-set-class-for-select-list-options</link>
            <description>&lt;p&gt;If you haven't become familar with any of the functionality of the CakePHP's Set class, I highly recommend you take a &lt;a title=&quot;Set:combine CakePHP documentation&quot; href=&quot;http://book.cakephp.org/view/662/combine&quot;&gt;peak&lt;/a&gt;.&amp;nbsp; I don't know too much about it and really only learn about it as I go.&amp;nbsp; Well, I finally found out how to do something that used to take several lines of code: creating options for a select list that includes the Model.id as the key, but has a concatenated string for the value, like 'Model.name - created by Model.userName'.
Using the Set class this is easy.&amp;nbsp; With Set::c...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 19 Jun 2009 11:22:00 +0100</pubDate>
        </item>
        <item>
            <title>Changing the CakePHP Model Schema on the Fly</title>
            <link>http://www.mainelydesign.com/blog/view/changing-cakephp-model-schema-on-the-fly</link>
            <description>&lt;p&gt;I have an interesting way of dynamically changing a model's validation on the fly.&amp;nbsp; I have a standard approach that involves contact forms, contest entries, etc. using a database to store which fields should be on a form.&amp;nbsp; I tweaked this over time, and recently needed to change the schema from text, which all answers have been up to this point (and IS the DB field type), to a type of date. I kept getting the error 'preg_replace expects parameter 2 to be a string, array given'.&amp;nbsp; Once I got the...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 11 Jun 2009 10:28:00 +0100</pubDate>
        </item>
        <item>
            <title>Displaying phpinfo() without CSS styles</title>
            <link>http://www.mainelydesign.com/blog/view/displaying-phpinfo-without-css-styles</link>
            <description>&lt;p&gt;I wanted logged in users to be able to see the output from phpinfo(); within Site Avenger.&amp;nbsp; The problem with using phpinfo() is that it outputs a full HTML page, CSS styles and all.&amp;nbsp; In the past this has been fine, but now I wanted to show the phpinfo() within the Site Avenger layout and CSS styles.&amp;nbsp; I came across a simple, yet highly effective solution...
Using Output Buffering to Capture PHPINFO()
The solution is as simple as turning on output buffering, capturing the echo'ed value of php...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 09 Jun 2009 10:18:00 +0100</pubDate>
        </item>
        <item>
            <title>Getting the File Path to the Vendor Folder</title>
            <link>http://www.mainelydesign.com/blog/view/getting-file-path-for-vendor-folder</link>
            <description>&lt;p&gt;I'm trying to use a library within my CakePHP application that needs a variable defined that contains the complete file path to the vendors folder.&amp;nbsp; This can be solved one of two ways- modify the library (which I don't want to do) or use the Configure::corePaths() function in CakePHP.
Best Option - using Configure::corePaths()
This is a great function I had not used until today.&amp;nbsp; If you call it with no parameters, you'll get all of the file paths that Cake will look in when &quot;building&quot; your ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Mon, 08 Jun 2009 16:47:00 +0100</pubDate>
        </item>
        <item>
            <title>Fixing the Default HP OfficeJet Scanner Settings (which suck)</title>
            <link>http://www.mainelydesign.com/blog/view/fixing-default-hp-officejet-scanner-settings</link>
            <description>&lt;p&gt;The default settings for my OfficeJet L7500 All-In-One Scanner suck!&amp;nbsp; I thought the scanner was junk.&amp;nbsp; Every photo I scanned, espcially glossy finished photos, were coming out looking like they were from a&amp;nbsp;1960s era camera: over-exposed and super high contrast.&amp;nbsp; Not good!&amp;nbsp; I thought I had good Photoshop skills, but even&amp;nbsp;they were no match for the over-exposed mess that HP was sending into Photoshop.

How did I improve the quality? Easy (usabilty rant- they should be the default settings, or...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 28 May 2009 23:11:00 +0100</pubDate>
        </item>
        <item>
            <title>Distinct vs. Group By in MySQL (and CakePHP)</title>
            <link>http://www.mainelydesign.com/blog/view/using-distinct-or-group-by-mysql-cakephp</link>
            <description>&lt;p&gt;An interesting problem- I am returning a list of files that have already been uploaded, so the user can link to an existing file.&amp;nbsp; This creates a new record (duplicate record).&amp;nbsp; The next time the user goes to select a file, there will now be two entries for the same file.&amp;nbsp; DISTINCT to the rescue, or so I thought.
DISTINCT applies to the whole select statement
This is confusing in its own right.&amp;nbsp; The &lt;a href=&quot;http://book.cakephp.org/view/73/Retrieving-Your-Data&quot;&gt;CakePHP book&lt;/a&gt; misleadingly demonstrates that you can setup the fields parameter like so:
$th...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 21 May 2009 11:27:00 +0100</pubDate>
        </item>
        <item>
            <title>Best Eclipse Feature: Link With Editor</title>
            <link>http://www.mainelydesign.com/blog/view/best-eclipse-feature-link-with-editor</link>
            <description>&lt;p&gt;I use Eclipse for all of my CakePHP development work.&amp;nbsp; I love that you can get code completion, class inheritance, and more by &lt;a title=&quot;CakePHP Bakery - Setting Up Eclipse to work with CakePHP&quot; href=&quot;http://bakery.cakephp.org/articles/view/setting-up-eclipse-to-work-with-cake&quot;&gt;following these steps&lt;/a&gt;.&amp;nbsp; I also loved that I could have 20 something files opened, and when I changed the active document in the editor, my PHP Explorer hierarchy would change in response.&amp;nbsp;
So, I upgraded my Eclipse to Ganymede, so I could download the latest PDT and install the Git plugin (which I haven't even tried yet).&amp;nbsp; Long story short, my PHP Explorer document h...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 21 May 2009 09:43:00 +0100</pubDate>
        </item>
        <item>
            <title>Dealing with MySQL Old-Style Passwords</title>
            <link>http://www.mainelydesign.com/blog/view/mysql-old-password-error</link>
            <description>&lt;p&gt;I ran into a problem I've seen before- &lt;em&gt;Client does not support authentication protocol requested by server; consider upgrading MySQL client.&lt;/em&gt; Last time I came across this MySQL error, it was a simple query to fix the issue (from &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/old-client.html&quot;&gt;dev.mysql.com&lt;/a&gt;):
UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd') WHERE Host = 'some_host' AND User = 'some_user';
FLUSH PRIVILEGES;
That didn't work... instead &lt;strong&gt;IT CRASHED THE SERVER&lt;/strong&gt;!&amp;nbsp; I was in a position that I couldn't upgrade the version of PHP (running PHP...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 20 May 2009 16:37:00 +0100</pubDate>
        </item>
        <item>
            <title>Changing Display Options in Model::find('list')</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-change-display-field-find-list</link>
            <description>&lt;p&gt;I wanted to change the displayed field that Cake automatically returns with a Model::find('list').&amp;nbsp; If you have a database column named title or name (I'm not sure of the full list), CakePHP will automatically return an array index by Model.id =&amp;gt; Model.name.&amp;nbsp; This usually works, but today I'm working with a database table that doesn't use that field- it's a table of uploaded files and uses the columns named 'src' or 'alt' to display information to the user.&amp;nbsp; I forgot how to do this, so I'm po...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 19 May 2009 10:49:00 +0100</pubDate>
        </item>
        <item>
            <title>Getting the CakePHP Version in Your Code</title>
            <link>http://www.mainelydesign.com/blog/view/getting-cakephp-version-in-code</link>
            <description>&lt;p&gt;I was sick and tired of having to FTP into my accounts and view the VERSION.txt file that comes with the Cake core to figure out what version of Cake I was running.&amp;nbsp; I did a quick search but wasn't finding anything.&amp;nbsp; I was about to dig in and hack something together, but tried the &lt;a title=&quot;CakePHP Application Programming Interface Documentation&quot; href=&quot;http://api.cakephp.org/&quot;&gt;CakePHP API&lt;/a&gt; as a last resort. Bingo!
To find out what CakePHP version you are running on, use the following command:
Configure::version();
A string of the version will be returned.&amp;nbsp; Simple, huh?&amp;nbsp; Dare I say, easy...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 14 May 2009 10:57:00 +0100</pubDate>
        </item>
        <item>
            <title>Naming a Text File .htaccess on Windows</title>
            <link>http://www.mainelydesign.com/blog/view/naming-htaccess-file-on-windows</link>
            <description>&lt;p&gt;A big pain- you can't just name a file .htaccess through Windows Explorer.&amp;nbsp; It complains that you need to supply a name!&amp;nbsp; No problem.
Here's how you can name a file .htaccess (only tested on Notepad, though hopefully it will work on more):

Load up your file in Notepad or create a new file in Notepad
Add your &lt;a title=&quot;Articles Tagged as .htaccess Related&quot; href=&quot;/blog/tags/tag:Htaccess&quot;&gt;.htaccess declarations&lt;/a&gt;
File &amp;gt; Save As
In the filename text box put &quot;.htaccess&quot; - with the double quotes (&quot;.htaccess&quot; exactly)
In the filetype select box choose 'All Files'
Save i...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 13 May 2009 12:15:00 +0100</pubDate>
        </item>
        <item>
            <title>Making Apache Parse .html files as .php Files</title>
            <link>http://www.mainelydesign.com/blog/view/making-apache-parse-html-as-php-files</link>
            <description>&lt;p&gt;When re-designing a site, or somehow being locked into a given web site structure that uses .html (or .htm) file extensions, it's a good idea to keep the file names the same (especially if the site has been around a while and has good search engine visibility).&amp;nbsp; Think you can't use PHP on .html or .htm web pages?&amp;nbsp; Think again.&amp;nbsp; With apache it's as easy as modifying the .htaccess file.
On a server with PHP 5, add this line to your .htaccess file:
AddHandler application/x-httpd-php5 .html .ht...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 13 May 2009 12:09:00 +0100</pubDate>
        </item>
        <item>
            <title>Keep Old Settings When Upgrading Eclipse</title>
            <link>http://www.mainelydesign.com/blog/view/upgrading-eclipse-moving-old-settings</link>
            <description>&lt;p&gt;I decided to upgrade my version of &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse&lt;/a&gt; to 3.4 (Ganymede) mainly so I could use the &lt;a href=&quot;http://git.or.cz/gitwiki/EclipsePlugin&quot;&gt;Git plugin&lt;/a&gt;.&amp;nbsp; I wanted to migrate my settings from one install to the other.&amp;nbsp; I know I had done this before, when I upgraded from 3.2 to 3.3, but forgot how.&amp;nbsp; So I don't have to scratch my head so much next time, here is how you can move your settings after you upgrade your version of Eclipse.
I'm using Windows XP.&amp;nbsp; Here's what I did:

Go into your old version of Eclipse and do a File &amp;gt; Export
Choose Gen...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 12 May 2009 13:02:00 +0100</pubDate>
        </item>
        <item>
            <title>Avoiding New Line Errors using Git on Windows</title>
            <link>http://www.mainelydesign.com/blog/view/avoid-git-new-line-errors-on-windows</link>
            <description>&lt;p&gt;I'm finally working on moving my code over to a version control system.&amp;nbsp; I've tried several times over the past few years to start using Subversion, but I never quite got into it.&amp;nbsp; After hearing so much about &lt;a title=&quot;Git Homepage&quot; href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt;, I decided I needed to start using it.&amp;nbsp; Luckily, most people tell you to forget everything about Subversion when using Git- no problem there!
I ran into a huge issue.&amp;nbsp; I created a new repository and wanted to add quite a large project (1,200+ files).&amp;nbsp; At the end of adding all the fi...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 12 May 2009 12:27:00 +0100</pubDate>
        </item>
        <item>
            <title>Pagination with MSSQL in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-pagination-mssql</link>
            <description>&lt;p&gt;One thing, and there are a few, that I can't stand about having to use PHP and MSSQL Server together is the lack of support for pagination.&amp;nbsp; With PHP and MySQL- no problem use limit.&amp;nbsp; MSSQL- can't do it without all these ugly sub-queries.&amp;nbsp; I have to give it to the CakePHP developers though, for the built-in support for pagination in MSSQL.&amp;nbsp; Albeit it is flawed, it works.
The problem with the CakePHP support for pagination in MSSQL is that on the last page of results you get a full result set...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 07 May 2009 16:36:00 +0100</pubDate>
        </item>
        <item>
            <title>From the Hip - Midcoast Maine User Group</title>
            <link>http://www.mainelydesign.com/blog/view/from-the-hip-midcoast-maine-user-group</link>
            <description>&lt;p&gt;Well, it finally happened! The Midcoast has a web design/interface design user group.&amp;nbsp; Last night was the first meeting of &lt;em&gt;From the Hip&lt;/em&gt;, an informal, agendas-not-allowed, information exchange session.&amp;nbsp; Some people from &lt;a title=&quot;Midcoast Magnet&quot; href=&quot;http://www.midcoastmagnet.com&quot;&gt;Midcoast Magnet&lt;/a&gt; helped organize the event, and now the group finally has legs!
&lt;strong&gt;Want to Get Involved?&lt;/strong&gt;For more on &lt;em&gt;From the Hip&lt;/em&gt;, the Midcoast Maine User Group for web and creative professionals, check out:

&lt;strong&gt;Google Group / Listserv:&lt;/strong&gt; &lt;a title=&quot;From the Hip Google Group&quot; href=&quot;http://groups.google.com/group/from-the-hip?hl=en&quot;&gt;http://groups.google.com/group/from-the-hip&lt;/a&gt;
&lt;strong&gt;T...&lt;/strong&gt;&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 07 May 2009 11:23:00 +0100</pubDate>
        </item>
        <item>
            <title>A tale of caution: naming CakePHP &quot;view&quot; functions</title>
            <link>http://www.mainelydesign.com/blog/view/properly-naming-cakephp-view-functions</link>
            <description>&lt;p&gt;Spoiler: functions that generate a view must be named using &lt;strong&gt;lower_case_with_underscores()&lt;/strong&gt;
I just ran into a very interesting problem.&amp;nbsp; I was testing out some of my plugins to make sure they were still working with Cake version 1.2.2.8120.&amp;nbsp; They worked fine except for one function.&amp;nbsp; I had a form that updates a shopping cart, changing the quantities of products placed in the cart.&amp;nbsp; When I hit the submit button to change the quantities, I was getting redirected to my site root.&amp;nbsp;
The first thin...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 06 May 2009 17:13:00 +0100</pubDate>
        </item>
        <item>
            <title>Getting Full Resolution Pictures out of MS Word (almost)</title>
            <link>http://www.mainelydesign.com/blog/view/getting-full-resolution-pictures-from-ms-word</link>
            <description>&lt;p&gt;People use what they know.&amp;nbsp; Most of the time I get photos embedded in an MS Word document for use on a web site.&amp;nbsp; My workaround to date has been to enlarge the picture (in Word) until it is as big as it gets (keeping quality) or the size I need.&amp;nbsp; I would then do a print screen and paste into Photoshop.&amp;nbsp;
I knew that there had to be a better way, but at least I was getting as much resolution as possible from the photo/picture.&amp;nbsp; Well I came across an interesting scenario today- I couldn't enlar...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Wed, 29 Apr 2009 11:14:00 +0100</pubDate>
        </item>
        <item>
            <title>Best Tiny Font for Web Graphics</title>
            <link>http://www.mainelydesign.com/blog/view/best-tiny-font-for-web-graphics</link>
            <description>&lt;p&gt;I finally found the perfect font for making really small, yet readable text in web graphics.&amp;nbsp; I've played around with plenty of fonts and usually arrive at a reasonable result.&amp;nbsp; In the past I would use Eurostyle with enough spacing to make it legible.&amp;nbsp; Now, I have a new go-to font for small typeface.&amp;nbsp; &lt;strong&gt;Introducing &lt;a title=&quot;Silkscreen font download&quot; href=&quot;http://kottke.org/plus/type/silkscreen/&quot;&gt;Silkscreen&lt;/a&gt;.&lt;/strong&gt;
Usage Notes (for Photoshop CS2):

It fails to render clean with pretty much any point size lower than 8
If the font looks blurry, turn off anti-aliasing
You can have...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 28 Apr 2009 17:03:00 +0100</pubDate>
        </item>
        <item>
            <title>Preformatted Text in TinyMCE </title>
            <link>http://www.mainelydesign.com/blog/view/performatted-text-tinymce-pre-tag</link>
            <description>&lt;p&gt;Now that I've got my blog up and running, I've been playing around with syntax highlighting of source code.&amp;nbsp; I really appreciate sites that serve up code samples in a nice format, so I've tried to comply with my own version of this best practice.
Getting &lt;a title=&quot;GeSHi - Generic Syntax Highlighter&quot; href=&quot;http://qbnz.com/highlighter/&quot;&gt;Geshi&lt;/a&gt; working, for syntax highlighting was one battle (I'll try and post what I came up with later). My real trouble came with using &amp;lt;pre&amp;gt;&amp;lt;/pre&amp;gt; tags for my code samples within &lt;a title=&quot;TinyMCE Homepage&quot; href=&quot;http://tinymce.moxiecode.com/&quot;&gt;TinyMCE&lt;/a&gt;.&amp;nbsp; I absolutely love TinyMCE! I did a lot of research on ...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Tue, 21 Apr 2009 10:26:00 +0100</pubDate>
        </item>
        <item>
            <title>$paginator-&gt;sort() error?</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-paginator-sort-error</link>
            <description>&lt;p&gt;I thought there was an error in the paginator view helper.&amp;nbsp; All of a sudden I could only sort a field ascending.&amp;nbsp; I (again) did a little research and came across a great thread on the CakePHP Google Group (&lt;a title=&quot; $paginator-&amp;gt;link sorting &amp;ndash; Is this a Bug? &quot; href=&quot;http://groups.google.com/group/cake-php/browse_thread/thread/d099dc194f13b6e7&quot;&gt;here&lt;/a&gt;).&amp;nbsp; Basically, as of 1.2.8120, you need (or should) specify the ModelName in your sort() function.&amp;nbsp; I had only been doing sort('id'), sort('name').&amp;nbsp; Now I am doing sort('ID', 'ModelName.id') and sort('Name', 'ModelName.name').&amp;nbsp; It's a little more work having to specify the label (otherw...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 17 Apr 2009 13:32:00 +0100</pubDate>
        </item>
        <item>
            <title>Transactional Support in CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-transactional-support</link>
            <description>&lt;p&gt;I just found out that CakePHP has transactional support built-in.&amp;nbsp; It should have been obvious, seeing how the saveAll() function has transaction support built-in too.&amp;nbsp; My first attempt at using it didn't work.&amp;nbsp; In my contoller/model I was doing the following:
$this-&amp;gt;Model-&amp;gt;begin();
if(!$this-&amp;gt;Model-&amp;gt;save($this-&amp;gt;data)) {
	$this-&amp;gt;Model-&amp;gt;rollback();
} else {
	$this-&amp;gt;Model-&amp;gt;commit();
}

Based on the API and my limited knowledge of inheritance, I figured this would work.&amp;nbsp; It didn't.&amp;nbsp; I wa...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 17 Apr 2009 11:50:00 +0100</pubDate>
        </item>
        <item>
            <title>saveAll() to save multiple records in 1 model</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-saving-multiple-records-one-model</link>
            <description>&lt;p&gt;I ran into another issue on something I thought would be simple: saving multiple records with the saveAll() command.&amp;nbsp; In case you don't know about it, &lt;a title=&quot;Saving Model Data at Cookbook&quot; href=&quot;http://book.cakephp.org/view/75/Saving-Your-Data&quot;&gt;saveAll()&lt;/a&gt; is one of the best functions in CakePHP.&amp;nbsp; It automatically supports transactions, HABTM saves, and certainly saves a lot of typing for almost every type of save you want to do.
There are a few gotchas.&amp;nbsp; Here what I ran into:

Inserting/creating new rows in the database, don't forget $this-&amp;gt;ModelName-&amp;gt;create() //no duh, right? Well,...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 17 Apr 2009 09:58:00 +0100</pubDate>
        </item>
        <item>
            <title>Checkbox - setting the default state</title>
            <link>http://www.mainelydesign.com/blog/view/cakephp-setting-default-checkbox-state</link>
            <description>&lt;p&gt;I ran across a rather simple problem (I thought) that took a little searching to figure out.&amp;nbsp; All I had to do was create a checkbox form input that I wanted to have checked by default.&amp;nbsp; I tried 'default'=&amp;gt;'checked', which didn't work.&amp;nbsp; I also tried 'checked'=&amp;gt;true and 'checked'=&amp;gt;1, but that works every time, even if validation fails and the user had unchecked the checkbox, it will be checked again (Not good usability).&amp;nbsp;
The solution lies in a less-than-automagic approach.&amp;nbsp; Too bad this reque...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Fri, 17 Apr 2009 08:31:00 +0100</pubDate>
        </item>
        <item>
            <title>Importing an Excel file into CakePHP</title>
            <link>http://www.mainelydesign.com/blog/view/importing-excel-file-into-cakephp</link>
            <description>&lt;p&gt;I needed to be able to upload an excel file, parse the file, and then add each row as a separate database entry.&amp;nbsp; I had this working for a CSV file using the php built-in function &lt;a title=&quot;PHP.net Function Definition&quot; href=&quot;http://php.net/fgetcsv&quot;&gt;fgetcsv()&lt;/a&gt;, but the client switched to using an excel file (instead of direct PHP access to the in-house database, we decided to have the client upload a CSV/Excel file).&amp;nbsp;
I did a little research and found the perfect solution- &lt;a title=&quot;PHP-Excel Reader at Sourceforge.net&quot; href=&quot;http://sourceforge.net/projects/phpexcelreader&quot;&gt;PHP-Excel Reader&lt;/a&gt;.&amp;nbsp; I saved this to my CakePHP vendors directory and had to make one modif...&lt;/p&gt;</description>
            <author>Kevin Wentworth</author>
            <pubDate>Thu, 16 Apr 2009 14:42:00 +0100</pubDate>
        </item>
    </channel>
</rss>

