<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Labs</title>
	<atom:link href="http://labs.iamkoa.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.iamkoa.net</link>
	<description>I break it. I fix it. You learn.</description>
	<pubDate>Sun, 27 Jul 2008 17:48:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>I Drove Through Fire (Yesterday)</title>
		<link>http://labs.iamkoa.net/2008/07/01/i-drove-through-fire-yesterday/</link>
		<comments>http://labs.iamkoa.net/2008/07/01/i-drove-through-fire-yesterday/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 18:55:42 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=75</guid>
		<description><![CDATA[It&#8217;s not everyday that you see a car in flames - it&#8217;s also somewhat rare to drive through fire. Yesterday, I killed two birds with one fiery stone. Read the entire story after the jump.


]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not everyday that you see a car in flames - it&#8217;s also somewhat rare to drive through fire. Yesterday, I killed two birds with one fiery stone. Read the entire story after the jump.</p>
<p><span id="more-75"></span><br />
<a href='http://labs.iamkoa.net/wp-content/uploads/2008/07/drove_through_fire.png'><img src="http://labs.iamkoa.net/wp-content/uploads/2008/07/drove_through_fire.png" alt="" title="drove_through_fire" width="447" height="795" class="alignnone size-full wp-image-76" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/07/01/i-drove-through-fire-yesterday/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TinyMCE &#038; Mootools Ajax.Form Class - Feel The Love</title>
		<link>http://labs.iamkoa.net/2008/05/31/tinymce-mootools-ajax-form/</link>
		<comments>http://labs.iamkoa.net/2008/05/31/tinymce-mootools-ajax-form/#comments</comments>
		<pubDate>Sat, 31 May 2008 18:34:47 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[mootools]]></category>

		<category><![CDATA[tinymce]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/?p=74</guid>
		<description><![CDATA[TinyMCE (Tiny) is regarded as one of the best open source, HTML WYSIWYG editors of our time - it&#8217;s powerful, relatively easy for browsers to digest, and free to use. The frustrations of using Tiny arise when you attempt to submit your Tiny-enhanced form via Ajax. Because your Tiny textarea inputs are converted to a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://tinymce.moxiecode.com/">TinyMCE</a> (Tiny) is regarded as one of the best open source, HTML WYSIWYG editors of our time - it&#8217;s powerful, relatively easy for browsers to digest, and free to use. The frustrations of using Tiny arise when you attempt to submit your Tiny-enhanced form via Ajax. Because your Tiny <code>textarea</code> inputs are converted to a mess of divs, spans, iframes, etc, <a href="http://demos.mootools.net/Ajax.Form">Mootools Ajax.Form</a> class fails to recognize the textarea. Fear not, there&#8217;s an easy workaround.</p>
<p><span id="more-74"></span></p>
<h2>The Workaround</h2>
<p>Below is a simple Javascript function you can use to convert Tiny-enhanced textareas back into regular form textareas:</p>
<pre><code>var fixTiny = function(properties) {
	var properties = properties || new Object();
	var instance = properties.instance || 'mce_editor_0';
	tinyMCE.execInstanceCommand(instance,'mceCleanup');
	tinyMCE.triggerSave(true,true);
	return true;
}</code></pre>
<h2>Using The Goods</h2>
<p>Using the above Javascript function is easy. Let&#8217;s assume we&#8217;re submitting two TinyMCE-enhanced textareas named &#8220;excerpt&#8221; and &#8220;body&#8221;, in a form with the id &#8220;myForm&#8221;. Here&#8217;s how to submit the form:</p>
<p>(The form submit code is taken directly from <a href="http://demos.mootools.net/Ajax.Form">this Mootools demos page</a>. Please refer to that page for further Ajax.Form reference.)</p>
<pre><code>$('myForm').addEvent('submit', function(e) {
	/**
	 * Prevent the submit event
	 */
	new Event(e).stop();

	<span class="highlight">fixTiny({instance:'excerpt'});
	fixTiny({instance:'body'});</span>

	/**
	 * This empties the log and shows the spinning indicator
	 */
	var log = $('log_res').empty().addClass('ajax-loading');

	/**
	 * send takes care of encoding and returns the Ajax instance.
	 * onComplete removes the spinner from the log.
	 */
	this.send({
		update: log,
		onComplete: function() {
			log.removeClass('ajax-loading');
		}
	});
});</code></pre>
<p>All of this code, including the <code>fixTiny</code> function should be placed within a <code>domready</code> event.</p>
<h2>Simple, Right?</h2>
<p>If I&#8217;ve missed anything, shout at me. You can also refer to the <a href="http://forum.mootools.net/">Mootools forums</a> for further examples of using both TinyMCE and the Ajax.Form class.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/05/31/tinymce-mootools-ajax-form/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Websites Dedicated To Design Inspiration: Web Showcasing, Typography, Digital Art</title>
		<link>http://labs.iamkoa.net/2008/02/13/websites-dedicated-to-design-inspiration-web-showcasing-typography-digital-art/</link>
		<comments>http://labs.iamkoa.net/2008/02/13/websites-dedicated-to-design-inspiration-web-showcasing-typography-digital-art/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 06:47:07 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[Art]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Inspiration]]></category>

		<category><![CDATA[beauty]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2008/02/13/websites-dedicated-to-design-inspiration-web-showcasing-typography-digital-art/</guid>
		<description><![CDATA[Personally speaking, preparing a new web design isn&#8217;t as simple as opening Photoshop. I need constant influence from many creative sources to keep my mind fresh on what&#8217;s hot and what&#8217;s not. When I need inspirational eye-candy, my sources include CSS galleries, digital prints, and typography demonstrations.
For those who have similar inspirational needs, allow me [...]]]></description>
			<content:encoded><![CDATA[<p>Personally speaking, preparing a new web design isn&#8217;t as simple as opening Photoshop. I need constant influence from many creative sources to keep my mind fresh on what&#8217;s hot and what&#8217;s not. When I need inspirational eye-candy, my sources include CSS galleries, digital prints, and typography demonstrations.</p>
<p>For those who have similar inspirational needs, allow me to lend a helping hand. I&#8217;ll list my personal favorite websites categorized by three major design pools: web showcasing, typography, and digital art.</p>
<p><span id="more-73"></span></p>
<h2>CSS / XHTML / Flash Showcases</h2>
<h5>Digital beauty in the form of web design&#8230;</h5>
<p>The easiest place to gather hordes of inspirational material is among the hundreds of CSS/XHTML and Flash showcase websites. Each of these showcase websites are dedicated to the programmers looking for inspiration through others works. Here are a few of the best:</p>
<h3><a href="http://cssvault.com/" target="_blank">CSS Vault</a> &#038; <a href="http://designshack.co.uk/" target="_blank">Design Shack</a></h3>
<p>Both <a href="http://cssvault.com/" target="_blank">CSS Vault</a> and <a href="http://designshack.co.uk/" target="_blank">Design Shack</a> have a huge collection of CSS-based websites that offer the common user the ability to comment and rate each submission. The Vault also showcases a load of css <a href="http://cssvault.com/resources/demos/">demos</a>, <a href="http://cssvault.com/resources/hacks/">hacks</a>, and <a href="http://cssvault.com/resources/tools/">tools</a>, while the Shack sports bitchin&#8217; <a href="http://designshack.co.uk/tutorials/">tutorials</a>.</p>
<h3><a href="http://designsnack.com/" target="_blank">Design Snack</a></h3>
<p>Although very similar to CSS Vault and Design Shack, <a href="http://designsnack.com/">Design Snack</a> uses cookies to award submissions a ranking on their website. Registered users of Design Snack can rate submissions, much the same way <a href="http://digg.com">Digg</a> users rate articles - the popular ratings get noticed and awarded, while the runts of the group are dropped from the website.</p>
<h3><a href="http://www.stylegala.com/" target="_blank">Stylegala</a></h3>
<p><a href="http://www.stylegala.com/">Stylegala</a> stands out from the rest by syndicating important design-related news directly onto their website. This, along with their groovy <a href="http://www.stylegala.com/features/">features</a> section, and wicked <a href="http://forum.stylegala.com/">forum</a> gives them a special place in my code-ridden heart.</p>
<h3><a href="http://www.thefwa.com/" target="_blank">FWA</a></h3>
<p>Without a doubt, <a href="http://www.thefwa.com/">FWA</a> is one of the most pristine Flash web awards on the net, showcasing over 2,300 websites in the last seven years. To be listed or better yet, receive Site Of The Day (S.O.T.D.) or Site Of The Month (S.O.T.M.) notoriety, is a real honor. Plenty of talent listed for the gawking.</p>
<h3><a href="http://alistapart.com/topics/design/" target="_blank">A List Apart - Design</a></h3>
<p>Because of the abundance of well-written articles on <a href="http://alistapart.com/topics/design/">A List Apart</a>, this website will no doubt appear once for each category. Though the website itself is pure beauty, A List Apart&#8217;s purpose is to provide meaningful web reads for us geeks. They succeed.</p>
<p><!-- typography --></p>
<h2>Typographic Hotness</h2>
<h5>It&#8217;s not what you say, but how you display it&#8230;</h5>
<p>It may not be the most interesting of topics, but typography is probably the most important detail of web design. The text spacing, positioning, color, size, and angle can make or break a designs (web or print related) appeal. When you&#8217;re in the mood for some typographic porn, these sites might tickle your fancy:</p>
<h3><a href="http://ilovetypography.com/" target="_blank">I Love Typography</a></h3>
<p><a href="http://ilovetypography.com/">I Love Typography</a> is hands down one of the best typography related websites - not only are endless examples archived for viewing pleasure, but its authors frequently attempt to explain <em>why</em> certain designs are more appealing than others.</p>
<h3><a href="http://typographica.org/" target="_blank">Typographica</a></h3>
<p><a href="http://typographica.org/">Typographica</a> says it best: &#8220;Typographica is a journal of typography featuring news, observations, and open commentary on fonts and typographic design.&#8221; One of my favorite typography journals.</p>
<h3><a href="http://www.alistapart.com/topics/design/typography/" target="_blank">A List Apart - Typography</a></h3>
<p>Once again <a href="http://www.alistapart.com/topics/design/typography/">A List Apart</a> makes it into my list of favorites - this time for typography. The first true typography article I ever read came from A List Apart: <a href="http://alistapart.com/articles/typography">Typography Matters</a>.</p>
<h3><a href="http://www.smashingmagazine.com/category/fonts/" target="_blank">Smashing Magazine</a></h3>
<p>Although <a href="http://www.smashingmagazine.com/category/fonts/">Smashing Magazine</a> spreads across each of these categories nicely, it&#8217;s typography section is especially nice. There generous gift of free fonts once a month and &#8220;Monday Inspiration&#8221; articles quickly have you dreaming with font.</p>
<h3><a href="http://blog.iso50.com/" target="_blank">ISO50</a></h3>
<p>Scott Hansen, a typography god, created <a href="http://blog.iso50.com/">ISO50</a> to display his visual works.<br />
Easily a print design prodigy, Scott has repeatedly inspired me to think outside and even beyond the box.</p>
<h3><a href="http://www.markboulton.co.uk/journal/comments/five_simple_steps_to_better_typography/" target="_blank">Mark Boulton</a></h3>
<p>Though <a href="http://www.markboulton.co.uk/journal/comments/five_simple_steps_to_better_typography/">Mark Boulton&#8217;s</a> website has plenty of useful information, this post in particular is one of the best crash courses in learning better typography habits that I&#8217;ve ever read. Take ten minutes to absorb the tips - be a better designer. As simple as that.</p>
<p><!-- art --></p>
<h2>Art, The Physical Kind</h2>
<h5>Inspiration that hangs from your walls&#8230;</h5>
<p>Yes, there are <em>many</em> kinds of art and no, I&#8217;m not defining art as anything you can hang on your wall. However, surrounding yourself with inspirational works <em>outside</em> of your computer can help in grasping real world print and design. Here are a few artists that inspire me on a daily basis:</p>
<h3><a href="http://dlanham.com/" target="_blank">David Lanham</a></h3>
<p>Digital artwork at its best. <a href="http://dlanham.com/">David Lanham</a> takes everything you thought you knew about artwork and makes it better - way better. The colors are amazing - the prints so perfectly detailed. Every print available for purchase also comes in digital form, as a desktop wallpaper, allowing you to capture the inspirational goodness on all mediums.</p>
<h3><a href="http://www.scottsaw.com/" target="_blank">Scott Saw</a></h3>
<p>Patterns are <a href="http://www.scottsaw.com/">Scott Saw&#8217;s</a> obsession. His work is littered with brilliantly colored stencils, covered with scenes of nature, mechanical objects, or spiritual innuendoes. I personally have a small collection of Scott&#8217;s work - I recommend starting your own.</p>
<h3><a href="http://www.processrecess.com/ target="_blank">ProcessRecess - James Jean</a></h3>
<p>A beautiful site coupled with amazing artwork you can actually buy - <a href="http://www.processrecess.com/">James Jean</a> works magic on a large number of different mediums, including glass and aluminum. His use of gradients makes him my personal hero.</p>
<h3><a href="http://www.555design.org/" target="_blank">Are Age - 555[Design]</a></h3>
<p><a href="http://www.555design.org">Are Age</a> is his art name and real-world art mixed with Photoshop skills is his art game. (I rhymed.) Less fiction, more life. Are Age delivers rich content saturated in complex detail. One of his works are sure to appear on my wall soon.</p>
<h2>What Did I Miss?</h2>
<h5>Add your favorite inspirations&#8230;</h5>
<p>Obviously my inspirations might differ from yours. Add the sites that inspire your creative by leaving a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/02/13/websites-dedicated-to-design-inspiration-web-showcasing-typography-digital-art/feed/</wfw:commentRss>
		</item>
		<item>
		<title>21 Must-Have Scripts For Your Favorite Javascript Library (jQuery, MooTools, Prototype)</title>
		<link>http://labs.iamkoa.net/2008/01/23/21-must-have-scripts-for-your-favorite-javascript-library-jquery-mootools-prototype/</link>
		<comments>http://labs.iamkoa.net/2008/01/23/21-must-have-scripts-for-your-favorite-javascript-library-jquery-mootools-prototype/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 22:28:45 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[jquery]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[mootools]]></category>

		<category><![CDATA[prototype]]></category>

		<category><![CDATA[reference]]></category>

		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2008/01/23/21-must-have-scripts-for-your-favorite-javascript-library-jquery-mootools-prototype/</guid>
		<description><![CDATA[In attempting to spruce up my knowledge of Javascript, I&#8217;ve been trolling around the net collecting scripts and tutorials for various Javascript libraries, mainly jQuery, MooTools, and Prototype. Of the three, MooTools seems to supply me with the most JS lovin&#8217; - it&#8217;s easy to learn, holds super powerful Ajax abilities, and is customizable to [...]]]></description>
			<content:encoded><![CDATA[<p>In attempting to spruce up my knowledge of Javascript, I&#8217;ve been trolling around the net collecting scripts and tutorials for various Javascript libraries, mainly <a href="http://jquery.com/">jQuery</a>, <a href="http://mootools.net/">MooTools</a>, and <a href="http://www.prototypejs.org/">Prototype</a>. Of the three, MooTools seems to supply me with the most JS lovin&#8217; - it&#8217;s easy to learn, holds super powerful Ajax abilities, and is customizable to the core. </p>
<p>After sorting through tons of scripts, I thought I&#8217;d share the best ones with you.</p>
<p><span id="more-58"></span></p>
<p>Each script is categorized based upon the Javascript library they use. A few links aren&#8217;t actually scripts, but rather reference sheets or links to other resource websites.</p>
<h2>jQuery (jq)</h2>
<p>&#8220;jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. It was released January 2006 at BarCamp NYC by John Resig.&#8221; - Wikipedia, 01/16/08</p>
<h3>Reference Sheet (jq)</h3>
<p>Each one of these reference sheets (cheat sheets) are crammed with functions and usage for jQuery. (They are slightly outdated. If you know of any jQuery reference sheets recently updated, please let me know.)<br />
=-=-=-=-=-=<br />
Reference Sheets (PDF): <a href="http://www.define-web.com/jquery_cheat_sheet/jquery_cheat_sheet_080306_v1.pdf">Page 1</a> - <a href="http://www.define-web.com/jquery_cheat_sheet/jquery_cheat_sheet_080306_v1_pg2.pdf">Page 2</a></p>
<h3>Multiple File Uploads (jq)</h3>
<p>The point of this AJAX-enabled script is to give the user a visual sandbox to add/delete uploads, all without ever reloading the page. The examples and documentation are topnotch.<br />
=-=-=-=-=-=<br />
<a href="http://www.fyneworks.com/jquery/multiple-file-upload/" target="_blank">Fyneworks - Multiple File Upload</a></p>
<h3>Table Sorting (jq)</h3>
<p>Sort table data by their parent category with Javascript - no page reloading, compact code, lots-o-fun.<br />
=-=-=-=-=-=<br />
<a href="http://motherrussia.polyester.se/jquery-plugins/tablesorter/" target="_blank">Polyester - Tablesorter</a></p>
<h3>A List of 240 Plugins (jq)</h3>
<p>Rather then regurgitating what&#8217;s already on the net, here&#8217;s a site that lists over 240 jQuery plugins and their respective links. It&#8217;s freaking huge.<br />
=-=-=-=-=-=<br />
<a href="http://www.sastgroup.com/jquery/240-plugins-jquery" target="blank">Sastgroup - 240 Plugins For jQuery</a></p>
<h2>MooTools (mt)</h2>
<p>&#8220;Mootools is a compact, modular, object-oriented JavaScript web application framework, intended to make the process of writing extensible and cross-browser compatible code more efficient.&#8221; - Wikipedia, 01/17/08</p>
<h3>Reference Sheet (mt)</h3>
<p>Being that MooTools is so simple to use, you may not even need a cheat sheet. But just in case, Snook has put together a colorful dab of MooTools knowledge for your enjoyment.<br />
=-=-=-=-=-=<br />
<a href="http://snook.ca/archives/javascript/mootools_r83_cheatsheet/" target="_blank">Snook - Mootools r83 Cheatsheet</a></p>
<h3>mooRainbow (mt)</h3>
<p>MooRainbow has to be one the best looking color pickers I&#8217;ve seen for the web that <em>isn&#8217;t</em> Flash. It&#8217;s almost an exact clone of the color picker used in Photoshop, and again, it&#8217;s for the web. Sweet stuff people, sweet stuff.<br />
=-=-=-=-=-=<br />
<a href="http://moorainbow.woolly-sheep.net/" target="_blank">Woolly Sheep - mooRainbow</a></p>
<h3>Mediabox (mt)</h3>
<p>Think of a <a href="http://www.huddletogether.com/projects/lightbox/" target="_blank">lightbox</a>, only comprising of streaming online media (like YouTube or Quicktime movies) instead of images. This is what we call a &#8216;mediabox&#8217;, and I love it.<br />
=-=-=-=-=-=<br />
<a href="http://iaian7.com/webcode/Mediabox" target="_blank">Ianian7 - Mediabox</a></p>
<h3>Slideshow (mt)</h3>
<blockquote><p>Taken from Electric Prism, &#8220;Slideshow is a javascript class to stream and animate the presentation of images on your website.&#8221;</p></blockquote>
<p>The presentation is similar to the default pan/zoom of Apple&#8217;s screensaver.<br />
=-=-=-=-=-=<br />
<a href="http://www.electricprism.com/aeron/slideshow/" target="_blank">Electric Prism - Slideshow</a></p>
<h3>Charts (mt)</h3>
<p>Easily create stylish charts and graphs of any combination of data, all with Javascript simplicity. If you have any data that needs presenting on your website, this script is well worth a download.<br />
=-=-=-=-=-=<br />
<a href="http://www.copix.org/index.php/wiki/Mootools/Charts/en" target="_blank">Copix - Charts &#038; Graphs</a></p>
<h3>Calendar / DatePicker (mt)</h3>
<p>Made by the same badasses that created Mediabox (above), this date picker is super-stylish and easy to integrate into your website. Never again should your web user have to manually insert a date.<br />
=-=-=-=-=-=<br />
<a href="http://www.electricprism.com/aeron/calendar/" target="_blank">Electric Prism - DatePicker</a></p>
<h3>FancyUpload (mt)</h3>
<p>FancyUpload is a stylish presentation of uploads and ability to add/remove your upload queue with a mouse click. Well worth a look for anyone presenting upload options on their site.<br />
=-=-=-=-=-=<br />
<a href="http://digitarald.de/project/fancyupload/" target="_blank">Digitarald - FancyUpload</a></p>
<h3>Library (mt)</h3>
<p>Keeping with what the header says, this is the motherload of MooTools information - a library for a library, if you will. It&#8217;s a complete reservoir of scripts, tutorials, and basic information relating to MooTools.<br />
=-=-=-=-=-=<br />
<a href="http://clientside.cnet.com/libraries/mootools/" target="_blank">CNET - MooTools Library</a></p>
<h3>Mocha UI (mt)</h3>
<p>Picture an entire user interface built entirely in Javascript. That&#8217;s Mocha UI - expandable, collapse, and minimize windows all while maintaing the feeling of being in a virtual operating system. It&#8217;s incredibly smooth, cross-browser compatible, and unbelievably small in size.<br />
=-=-=-=-=-=<br />
<a href="http://greghoustondesign.com/demos/mocha/" target="_blank">Greg Houston - Mocha</a></p>
<h3>MooTable (mt)</h3>
<p>Dress a simple table in a MooTable script and you instantly have the ability to sort any column with the click of the mouse. Easy to setup and extremely lightweight.<br />
=-=-=-=-=-=<br />
<a href="http://joomlicious.com/mootable/" target="_blank">Joomlicious - Mootable</a></p>
<h3>Reflection JS (mt)</h3>
<p>Reflection JS beautifully adds a perfect reflection to any image without the need for manual labor. The background opacity, height, and fade can be controlled as shown on the Reflections website.<br />
=-=-=-=-=-=<br />
<a href="http://www.digitalia.be/software/reflectionjs-for-mootools" target="_blank">Digitalia - Reflection JS</a></p>
<h3>Slimbox (mt)</h3>
<p>It&#8217;s identical to <a href="http://www.huddletogether.com/projects/lightbox2/">Lightbox v2.0</a>, only made for MooTools and a mere 7kb in size. It&#8217;s a must have for MooTool users needing <em>the</em> lightbox effect.<br />
=-=-=-=-=-=<br />
<a href="http://www.digitalia.be/software/slimbox" target="_blank">Digitalia - Slimbox</a></p>
<h3>MooFlow (mt)</h3>
<p>It&#8217;s <a href="http://en.wikipedia.org/wiki/Cover_Flow" target="_blank">coverflow</a> for the web, built on MooTools. The application is a little shaky, but will no doubt improve with time.<br />
=-=-=-=-=-=<br />
<a href="http://www.outcut.de/MooFlow/" target="_blank">Outcut - MooFlow</a></p>
<h2>Prototype (p)</h2>
<p>&#8220;&#8230; A JavaScript framework created by Sam Stephenson that provides an Ajax framework and other utilities.&#8221; - Wikipedia, 01/23/08</p>
<h3>Reference Sheet (p)</h3>
<p>Made by the same killer dude that created the MooTools cheat sheet, Snook delivers some Prototype help in the same yummy, cheat sheet fashion.<br />
=-=-=-=-=-=<br />
<a href="http://snook.ca/archives/javascript/prototype_1_5_0_cheatsheet/" target="_blank">Snook - Prototype Cheat Sheet</a></p>
<h3>Script.aculo.us (p)</h3>
<p>An obvious must-have for Prototype users. Script.aculo.us provides an amazing library of visual styles (including the ability to drag-and-drop) and works flawlessly on the Prototype library.<br />
=-=-=-=-=-=<br />
<a href="http://script.aculo.us/" target="_blank">Script.aculo.us</a></p>
<h3>Really Easy Field Validation (p)</h3>
<p>Exactly what the header says - convert any form into an instantly-validating machine.<br />
=-=-=-=-=-=<br />
<a href="http://tetlaw.id.au/view/javascript/really-easy-field-validation">Tetlaw - Really Easy Field Validation</a></p>
<h3>jsProgressBarHandler (p)</h3>
<p>Add a beautiful progress bar to your application and start singing songs of joy. This is by far the easiest (and best looking) progress bar script you&#8217;ll find on the internet.<br />
=-=-=-=-=-=<br />
<a href="http://www.bram.us/projects/js_bramus/jsprogressbarhandler/" target="_blank">Bram - jsProgressBarHandler</a></p>
<h3>EditInPlace (p)</h3>
<p>This is an excellent script in that it&#8217;s simple, yet extremely helpful. The techniques of EditInPlace are used in applications like <a href="http://www.basecamphq.com/" target="_blank">Basecamp</a> and <a href="http://facebook.com" target="_blank">Facebook</a>, and probably everywhere else on the internet.<br />
=-=-=-=-=-=<br />
<a href="http://editinplace.org/" target="_blank">EditInPlace</a></p>
<h3>Prototype Window (p)</h3>
<p>Prototype Windows is an extremely advanced version of Lightbox. Create popup windows on-the-fly with ajax calls, or via common href application. Anything&#8217;s possible.<br />
=-=-=-=-=-=<br />
<a href="http://prototype-window.xilinus.com/" target="_blank">Xilinus - Window/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/01/23/21-must-have-scripts-for-your-favorite-javascript-library-jquery-mootools-prototype/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Session-Based Flash Messages Look Better (CakePHP)</title>
		<link>http://labs.iamkoa.net/2008/01/13/session-based-flash-messages-look-better-cakephp/</link>
		<comments>http://labs.iamkoa.net/2008/01/13/session-based-flash-messages-look-better-cakephp/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 22:10:53 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[cakephp session messages alert flash]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2008/01/13/session-based-flash-messages-look-better-cakephp/</guid>
		<description><![CDATA[The CakePHP blog tutorial uses a rather archaic method of displaying user messages (like, &#8220;Your post has been saved.&#8220;) that needlessly breaks up the flow of your application. Rather than Cake&#8217;s typical method of displaying flash messages on a separate page (ugly), learn how to seamlessly display the same messages within your application and make [...]]]></description>
			<content:encoded><![CDATA[<p>The CakePHP <a href="http://manual.cakephp.org/appendix/blog_tutorial" target="_blank">blog tutorial</a> uses a rather archaic method of displaying user messages (like, &#8220;<a href='http://labs.iamkoa.net/wp-content/uploads/2008/01/your-post-has-been-saved_1200258861937.png' title='CakePHP Session-Based Messages - Part 3' target='_blank'>Your post has been saved.</a>&#8220;) that needlessly breaks up the flow of your application. Rather than Cake&#8217;s typical method of displaying flash messages on a separate page (ugly), learn how to seamlessly display the same messages <a href='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259770656.png' title='CakePHP Session-Based Messages - Part 4' target='_blank'>within your application</a> and make your users clap with joy.</p>
<p><span id="more-51"></span></p>
<h2>See What I Mean?</h2>
<p>Let me show you exactly what I&#8217;m talking about using some screen shots I took of my own application.</p>
<p>These first two screen shots show the index page and post page of my news application:</p>
<blockquote><p>(At the moment, nothing is posted on the index page.)<br />
<a href='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259990703.png' title='CakePHP Session-Based Messages - Part 1'><img src='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259990703.thumbnail.png' alt='CakePHP Session-Based Messages - Part 1' /></a></p></blockquote>
<blockquote><p>(A typical form allows the user to post a new news article&#8230;)<br />
<a href='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259749609.png' title='CakePHP Session-Based Messages - Part 2'><img src='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259749609.thumbnail.png' alt='CakePHP Session-Based Messages - Part 2' /></a></p></blockquote>
<p>When we post a new news article, the typical Cake method is to display a flash message on a separate page, forcing the user to temporally leave your application. This method is distracting for the user and makes your application feel broken up. (To return to the news index page, the user is forced to click the &#8220;Your post has been saved&#8221; message.)</p>
<blockquote><p>
<a href='http://labs.iamkoa.net/wp-content/uploads/2008/01/your-post-has-been-saved_1200258861937.png' title='CakePHP Session-Based Messages - Part 3'><img src='http://labs.iamkoa.net/wp-content/uploads/2008/01/your-post-has-been-saved_1200258861937.thumbnail.png' alt='CakePHP Session-Based Messages - Part 3' /></a></p></blockquote>
<p>Instead of the above method, let&#8217;s use the same messages in a Web 2.0 fashion. After a news article is posted, we can automatically redirect the user back to the index page AND display the message on the same page:</p>
<blockquote><p><a href='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259770656.png' title='CakePHP Session-Based Messages - Part 4'><img src='http://labs.iamkoa.net/wp-content/uploads/2008/01/coco-cms-news_1200259770656.thumbnail.png' alt='CakePHP Session-Based Messages - Part 4' /></a></p></blockquote>
<p>See what I mean? Allow me to show you how it&#8217;s done&#8230;</p>
<h2>Configure Your Layout</h2>
<p>In order to display the awesome-web-2.0-styled messages, we need to add a line of code to your <code>app/views/layouts/default.thtml</code> page, above the code which displays your layout content:</p>
<pre><code>&lt;?php
   if ($session-&gt;check('Message.flash')): $session-&gt;flash(); endif; <span class="highlight">// this line displays our flash messages</span>
   echo $content_for_layout;
?&gt;</code></pre>
<h2>Configure Your Controller</h2>
<p>Next comes the line you must add to your <code>app/controllers/news_controller.php</code> controller to display your message and redirect your user to a particular page:</p>
<pre><code>function add() {
...
   if ($this-&gt;News-&gt;save($this-&gt;data)) {
      $this-&gt;Session-&gt;setFlash('Your post has been saved.');
      $this-&gt;redirect('/news/index');
      <span class="highlight">//$this-&gt;flash('The News has been saved', '/news/index'); // this was the old way of doing things... yuck</span>
   }
}</code></pre>
<h2>All Done!</h2>
<p>Now when a flash message is displayed, it&#8217;ll be placed in a <code>div</code> (directly above the layout content) for easy style manipulation:</p>
<pre><code>&lt;div id="flashMessage" class="message"&gt;Your post has been saved.&lt;/div&gt;</code></pre>
<p>Easy as cake. If you have any questions or suggestions, please post.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2008/01/13/session-based-flash-messages-look-better-cakephp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updates &#038; Checkboxes &#038; Loadbars! Oh My!</title>
		<link>http://labs.iamkoa.net/2007/12/21/updates-checkboxes-loadbars-oh-my/</link>
		<comments>http://labs.iamkoa.net/2007/12/21/updates-checkboxes-loadbars-oh-my/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 19:22:02 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Inspiration]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Labs]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2007/12/21/updates-checkboxes-loadbars-oh-my/</guid>
		<description><![CDATA[Yep. I&#8217;m mixing programming references with The Wizard of Oz. Shut up.
The all-too-awesome PHPMailer class has been updated and is awaiting your download.
If you use MooTools (or even if you don&#8217;t), Vacuous Virtuoso&#8217;s Fancy Form is totally worth checking out. It&#8217;s a mix of CSS and Javascript that enables you to create custom form checkboxes. [...]]]></description>
			<content:encoded><![CDATA[<p>Yep. I&#8217;m mixing programming references with <a href="http://www.imdb.com/title/tt0032138/quotes">The Wizard of Oz</a>. Shut up.</p>
<p>The all-too-awesome <a href="http://labs.iamkoa.net/2007/11/27/a-simplesecure-email-class-for-phpmailer/">PHPMailer class</a> has been updated and is awaiting your download.</p>
<p>If you use <a href="http://mootools.net/">MooTools</a> (or even if you don&#8217;t), Vacuous Virtuoso&#8217;s <a href="http://lipidity.com/fancy-form/">Fancy Form</a> is totally worth checking out. It&#8217;s a mix of CSS and Javascript that enables you to create custom form checkboxes. There are other script on the net that claim to do the same thing, but none are as cross-browser compatible.</p>
<p>Lastly, to add a splash of color to your ajax load processes, check out Bram Van Damme&#8217;s <a href="http://www.bram.us/projects/js_bramus/jsprogressbarhandler/">Progress Bar Handler</a>. It&#8217;s probably the smoothest, best looking non-flash based progress bar on the net.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2007/12/21/updates-checkboxes-loadbars-oh-my/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CakePHP 1.1 File Upload Plays Rough With PHP 4</title>
		<link>http://labs.iamkoa.net/2007/12/11/cakephp-11-file-upload-plays-rough-with-php-4/</link>
		<comments>http://labs.iamkoa.net/2007/12/11/cakephp-11-file-upload-plays-rough-with-php-4/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 00:23:07 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2007/12/11/cakephp-11-file-upload-plays-rough-with-php-4/</guid>
		<description><![CDATA[Uploading files via CakePHP has been covered a few times on Labs. Based on the feedback, it&#8217;s safe to assume bridging the gap between file uploads and PHP can be tricky. Usually Cake is ready to lend a helpful hand. Not this time.

If you're finding that executing this:
&#60;?php echo $html-&#62;formTag('/' . $params['url']['url'], 'post', array('enctype' =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Uploading files via CakePHP has been covered a <a href="http://labs.iamkoa.net/2007/11/06/multiple-image-uploads-into-single-mysql-table-cakephp/">few</a> <a href="http://labs.iamkoa.net/2007/10/23/image-upload-component-cakephp/">times</a> on Labs. Based on the feedback, it&#8217;s safe to assume bridging the gap between file uploads and PHP can be tricky. Usually Cake is ready to lend a helpful hand. Not this time.</p>
<p><span id="more-52"></span></p>
<pre><code><span class="highlight">If you're finding that executing this:</span>
&lt;?php echo $html-&gt;formTag('/' . $params['url']['url'], 'post', array('enctype' =&gt; 'multipart/form-data')); ?&gt;
	&lt;?php echo $html-&gt;input('Test/title'); ?&gt;
	&lt;?php echo $html-&gt;file('Test/file'); ?&gt;
	&lt;?php echo $html-&gt;submit('Save'); ?&gt;
&lt;/form&gt;

<span class="highlight">... returns something like this:</span>
$this-&gt;data:Array
(
    [Test] =&gt; Array
        (
            [title] =&gt; Foo
            [file] =&gt; 4tmp/phpHGSjDA
        )
)

<span class="highlight">... instead of something like this:</span>
$this-&gt;data:Array
(
    [Test] =&gt; Array
        (
            [title] =&gt; Foo
            [file] =&gt; Array
                (
                    [name] =&gt; aeo.jpg
                    [type] =&gt; image/jpeg
                    [tmp_name] =&gt; /tmp/phppM8tfc
                    [error] =&gt; 0
                    [size] =&gt; 45471
                )
        )
)

... then you must be as annoyed as I am.</code></pre>
<p>The reason why the <code>file</code> form field is returning the tmp name is because CakePHP expects <code>register_globals</code> is OFF.</p>
<h2>Solution One</h2>
<p>Turn off register_globals via .htaccess:</p>
<pre><code>#/app/webroot/.htaccess
php_flag register_globals off</code></pre>
<h2>Solution Two</h2>
<p>Manually write your HTML form fields without using an input array:</p>
<pre><code>-- do this --
&lt;input type="file" name="file" /&gt;
-- not this --
&lt;?php echo $html-&gt;file('Test/file'); ?&gt; // will output: &lt;input type="file" name="data[Test][test]" /&gt;</code></pre>
<p>Solution two is a slight pain in the ass, because now that you&#8217;ve eliminated the array within the form input field, you need to do a little extra work in your CakePHP controller. (If there&#8217;s a demand, I&#8217;ll give some examples.)</p>
<p>Hopefully this&#8217;ll clear up Cake&#8217;s messhole.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2007/12/11/cakephp-11-file-upload-plays-rough-with-php-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Control Suite, High Quality Controls &#038; Widgets for Prototype.js</title>
		<link>http://labs.iamkoa.net/2007/11/28/control-suite-high-quality-controls-widgets-for-prototypejs/</link>
		<comments>http://labs.iamkoa.net/2007/11/28/control-suite-high-quality-controls-widgets-for-prototypejs/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 23:47:10 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2007/11/28/control-suite-high-quality-controls-widgets-for-prototypejs/</guid>
		<description><![CDATA[Ryan Johnson, the founder of LivePipe, created one of the best prototype-based widgets I&#8217;ve ever used.
Control Suite is a collection of six high quality widgets and controls for Web 2.0 applications built using the Prototype JavaScript framework. Each script is well tested, highly extensible, fully documented and degrades gracefully for non JavaScript enabled browsers where [...]]]></description>
			<content:encoded><![CDATA[<p>Ryan Johnson, the founder of <a href="http://livepipe.net/">LivePipe</a>, created one of the best <a href="http://www.prototypejs.org/">prototype</a>-based widgets I&#8217;ve ever used.</p>
<blockquote><p>Control Suite is a collection of six high quality widgets and controls for Web 2.0 applications built using the Prototype JavaScript framework. Each script is well tested, highly extensible, fully documented and degrades gracefully for non JavaScript enabled browsers where possible. All scripts are <a href="http://www.opensource.org/licenses/mit-license.php">MIT licensed</a> and are thus completely free for any purpose in any project.</p></blockquote>
<p>Thus far, the <code>SelectMultiple</code> is finding some serious use in my web applications. Assuming I come up with something not already discussed in Ryan&#8217;s examples, I&#8217;ll post it in <a href="http://labs.iamkoa.net">Labs</a>.</p>
<p><a href="http://livepipe.net/projects/control_suite/">Go to the official Control Suite website.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2007/11/28/control-suite-high-quality-controls-widgets-for-prototypejs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A Simple/Secure Email Class For PHPMailer</title>
		<link>http://labs.iamkoa.net/2007/11/27/a-simplesecure-email-class-for-phpmailer/</link>
		<comments>http://labs.iamkoa.net/2007/11/27/a-simplesecure-email-class-for-phpmailer/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 23:57:38 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2007/11/27/a-simplesecure-email-class-for-phpmailer/</guid>
		<description><![CDATA[If you&#8217;re not careful, sending email via PHP is about as safe as cookies at Fat Camp. BKWLD was recently tagged by a spammer who noticed one such insecurity on one of our websites and ended up using our server to send hundreds of emails. It wasn&#8217;t until MediaTemple informed us of this breach that [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re not careful, sending email via PHP is about as safe as cookies at Fat Camp. <a href="http://bkwld.com">BKWLD</a> was recently tagged by a spammer who noticed one such insecurity on one of our websites and ended up using our server to send hundreds of emails. It wasn&#8217;t until <a href="http://mediatemple.net">MediaTemple</a> informed us of this breach that we realized what had happened.</p>
<p>The method most spammers use is called a &#8220;mail injection&#8221;, in that the spammer manipulats the PHP <code>mail()</code> function via a custom form post, etc. I won&#8217;t go into details, as a quick search on Google came up with over 225,000 pages describing this technique - <a href="http://www.bl0g.co.uk/060214/PHP_mail_Email_Injection_Attack_Allows_Spammers_to_Send_Email/">here</a> <a href="http://www.tonyspencer.com/2005/12/15/email-injection-exploit-through-a-php-contact-form/">are</a> <a href="http://www.securephpwiki.com/index.php/Email_Injection">a</a> <a href="http://www.maravelias.gr/archives/security/28">few</a>.</p>
<p>Getting around these hacks requires detailed validation of your data.Thankfully I&#8217;ve done everything for you using the best PHP email class around, <a href="http://phpmailer.codeworxtech.com/">PHPMailer</a>. My class is called <code>SendMail</code> and it&#8217;s an extension of the PHPMailer class. The result is a powerful script capable of sending email via SMTP or POP3, all without handing over your server to a toothless spammer.</p>
<p><span id="more-48"></span></p>
<blockquote><p>
The SendMail class has been updated. Please view <a href="#updates">the updates</a> before commenting.
</p></blockquote>
<h2>Download The SendMail Class</h2>
<p>Click the link to download the SendMail class and continue reading to learn how to use it.<br />
<a href='http://labs.iamkoa.net/wp-content/uploads/2007/11/sendmail-class-11262007.zip' title='SendMail Class'>Download the SendMail class</a></p>
<h2>Setup</h2>
<p>Setting up the SendMail class is easy-peezie. Simply include the required SendMail variables and call the <code>send()</code> function to send emails:</p>
<pre><code>&lt;?php
require("inc/class.sendmail.php");

if($_POST){
    $mail = new SendMail;

    <span class="highlight">$mail-&gt;authHosts = array("domain.com");</span>

    $mail-&gt;addEmail("name@person.com","Name",);
    $mail-&gt;addEmail("name2@person.com","Name2");

    $mail-&gt;subject($_POST['subject']);
    $mail-&gt;body($_POST['body']);

    $mail-&gt;fromName($_POST['from_name']);
    $mail-&gt;fromEmail($_POST['from_email']);

    $result = $mail-&gt;send();

    if (!$result){
        if(!empty($mail-&gt;errors)) {
            $mail-&gt;displayErrors($mail-&gt;errors,'ol');
        }
    exit();
    }
}

echo "Message was sent successfully";
?&gt;

&lt;form method="post" action="&lt;?=$_SERVER['PHP_SELF']?&gt;"&gt;
    &lt;input type="text" name="from_email" value="people@info.com" /&gt;&lt;br /&gt;
    &lt;input type="text" name="from_name" value="People" /&gt;&lt;br /&gt;
    &lt;input type="text" name="subject" value="This is a subject" /&gt;
    &lt;input type="text" name="body" value="Email body goes here." /&gt;
    &lt;input type="submit" value="Submit" /&gt;
&lt;/form&gt;</code></pre>
<p>For further security, you may implement the <code>authHosts</code> variable as highlighted above. The <code>authHosts</code> array specifies what domains are allowed to send <code>$_POST</code> data. Any domains not listed that attempted to contact the script via <code>$_POST</code> will get a 403 (permission denied) error.</p>
<h2>Further Configuration</h2>
<p>If you need to specify an SMTP host, username, and password, include each variable before calling the <code>send()</code> function. You may also specify the charset and select whether or not HTML should be used in the email by using the respective code below:</p>
<pre><code>...
$mail = new SendMail;

if($_POST) {

    $mail = new SendMail;

    $mail-&gt;authHosts = array("domain.com");

    <span class="highlight">$mail-&gt;host = 'mail.domain.com';
    $mail-&gt;username = 'root';
    $mail-&gt;password = 'pass123';

    $mail-&gt;charset = 'utf-8';
    $mail-&gt;bodyHtml = "HTML goes in here";</span>

    $mail-&gt;addEmail("name@person.com","Name");
    $mail-&gt;addEmail("name2@person.com","Name2");

    $mail-&gt;subject($_POST['subject']);
    $mail-&gt;body($_POST['body']);

    $mail-&gt;fromName($_POST['from_name']);
    $mail-&gt;fromEmail($_POST['from_email']);

    $mail-&gt;Mailer = 'mail';

    $result = $mail-&gt;send();

    if (!$result){
        if(!empty($mail-&gt;errors)) {
            <span class="highlight">$mail-&gt;displayErrors($mail-&gt;errors,'ol');</span>
        }
    exit();
    }
}
...</code></pre>
<p>When displaying errors via the <code>displayErrors()</code> function, you may choose to use <code>&lt;ul&gt;</code> or <code>&lt;ol&gt;</code> HTML. If you&#8217;d rather receive errors as an array, use <code>$mail-&gt;errors</code> only.</p>
<h2>Fini, Cowboy</h2>
<p>If you need further explanation or would like a better understanding of the code, dig into the <code>inc/class.sendmail.php</code> file. The code is well-commented and should guide you nicely. If it doesn&#8217;t, comment and I&#8217;ll help you myself. For further information on PHPMailer, <a href="http://phpmailer.codeworxtech.com/">go to the official website</a>.</p>
<h2>Updates</h2>
<p><a name="updates"></a><strong>Nov 27, 2007</strong>: The entire SendMail class has been rewritten to better perform as OOP should. The domain security is now optional. All files have been updated for downloading.</p>
<p><strong>Dec 21, 2007</strong>: Select between sending with PHP <code>mail()</code>, SMTP, or POP using <code>Mailer</code> as shown above. All files have been updated for downloading. Eat it up.</p>
<p><strong>Jan 15, 2008</strong>: When sending HTML mail, alternative text sends accordingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2007/11/27/a-simplesecure-email-class-for-phpmailer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Custom CakePHP Errors - A Complete Run Down</title>
		<link>http://labs.iamkoa.net/2007/11/20/custom-cakephp-errors-a-complete-run-down/</link>
		<comments>http://labs.iamkoa.net/2007/11/20/custom-cakephp-errors-a-complete-run-down/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 22:50:46 +0000</pubDate>
		<dc:creator>Koa</dc:creator>
		
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://labs.iamkoa.net/2007/11/20/custom-cakephp-errors-a-complete-run-down/</guid>
		<description><![CDATA[Taking advantage of custom error documents usually requires tapping on an .htaccess file, as discussed in my previous custom error article. However CakePHP makes for easy custom error handling thanks to a pre-defined Cake system.
I&#8217;ll walk you through creating custom error pages, both simple and complex.

Basic Errors
Creating typical custom error pages in Cake is super [...]]]></description>
			<content:encoded><![CDATA[<p>Taking advantage of custom error documents usually requires tapping on an <code>.htaccess</code> file, as discussed in <a href="http://labs.iamkoa.net/2007/10/30/custom-404500-errors-via-htaccess/">my previous custom error article</a>. However CakePHP makes for easy custom error handling thanks to a pre-defined Cake system.</p>
<p>I&#8217;ll walk you through creating custom error pages, both simple and complex.</p>
<p><span id="more-47"></span></p>
<h2>Basic Errors</h2>
<p>Creating typical custom error pages in Cake is super easy. Below is a list of files that can be created in the <code>/app/views/errors/</code> folder in order to overwrite the generic error templates located in <code>/cake/libs/view/templates/errors/</code>:</p>
<pre><code><span class="highlight"># not found #</span>
    error404.thtml

<span class="highlight"># missing files #</span>
    missing_action.thtml
    missing_component_class.thtml
    missing_component_file.thtml
    missing_connection.thtml
    missing_controller.thtml
    missing_helper_class.thtml
    missing_helper_file.thtml
    missing_layout.thtml
    missing_model.thtml
    missing_scaffolddb.thtml
    missing_table.thtml
    missing_view.thtml

<span class="highlight"># private &amp; scaffold related errors #</span>
    private_action.thtml
    scaffold_error.thtml</code></pre>
<p>The above errors are all fine and dandy, but what if you want to create a custom error to be displayed when a user is denied access to the super secret area of your website?</p>
<h2>Custom Errors</h2>
<p>Custom errors could be used for anything - to let users know an area is restricted, or perhaps to users know they need to pay you loads of cash in order to use your website. Whatever the reason, Cake can help.</p>
<p><strong>Example:</strong><br />
Let&#8217;s say you want your users to donate before entering your website. For those who haven&#8217;t donated, you want to display an &#8220;error&#8221;.</p>
<p>First create your donation error page as you would any of the errors above, and place it in the typical errors folder:</p>
<pre><code>/app/views/errors/donation_error.thtml</code></pre>
<p>Next, in order to call your custom error, place the following in your controller of choice:</p>
<pre><code>$this-&gt;viewPath = 'errors';
$this-&gt;render('donation_error');</code></pre>
<p>Give yourself a pat on the back. You&#8217;ve done well.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.iamkoa.net/2007/11/20/custom-cakephp-errors-a-complete-run-down/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
