<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AM05.com</title>
	<atom:link href="http://www.am05.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.am05.com</link>
	<description>The Internet and Me</description>
	<lastBuildDate>Tue, 12 Apr 2011 21:05:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Loading CakePHP Helpers, Components and Behaviors on the fly</title>
		<link>http://www.am05.com/2011/04/08/loading-cakephp-helpers-components-and-behaviors-on-the-fly/</link>
		<comments>http://www.am05.com/2011/04/08/loading-cakephp-helpers-components-and-behaviors-on-the-fly/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 19:12:31 +0000</pubDate>
		<dc:creator>Amos Chan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://www.am05.com/?p=265</guid>
		<description><![CDATA[Disclaimer: All credit goes to Jose Diaz-Gonzalez, whose post Adding a Helper/Behavior/Component on the fly, contains the 99% of the code I needed to create this component. He&#8217;s the one who came up with this idea, I just put it all into a component and added a few tweaks here and there. Thanks, Jose. FlyLoader [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>All credit goes to Jose Diaz-Gonzalez, whose post <a href="http://josediazgonzalez.com/2009/08/14/adding-a-helper-behavior-component-on-the-fly/">Adding a Helper/Behavior/Component on the fly</a>, contains the 99% of the code I needed to create this component. He&#8217;s the one who came up with this idea, I just put it all into a component and added a few tweaks here and there. Thanks, Jose.</em></p>
<p><b>FlyLoader @ GitHub</b>: <a href="https://github.com/achan/montreal-cac.org/blob/master/www/app/controllers/components/fly_loader.php">Source</a> (temporary location)</p>
<p>The FlyLoaderComponent will import and load Helpers, Components and Behaviors on the fly. Cases in which this may because useful is if the Helper/Component/Behavior is only needed in certain cases/actions.<span id="more-265"></span></p>
<h2>The FlyLoader Component</h2>
<p>The FlyLoaderComponent consists of the following functions:</p>
<p><code><strong>load($type, $name)</strong></code><br />
The <code>load()</code> function will import and initialize your Helper/Component/Behavior accordingly.</p>
<p><code>$type</code> is the type of object you wish to load, as expected by the <code>$type</code> value in <a href="http://book.cakephp.org/#!/view/934/Using-App-import">App::import()</a>. The values currently supported are &#8220;Component&#8221;, &#8220;Helper&#8221; and &#8220;Behavior&#8221;.</p>
<p><code>$name</code> is the name of the Component/Helper/Behavior you wish to load. $name can be String value or a key/value array where the key is the key is the Component/Helper/Behavior name and the value is a key/value array of options/settings passed to the Component/Helper/Behavior.</p>
<p>For example, if you wanted to load my <a href="http://www.am05.com/2011/03/06/alpha-retrieve-bible-passages-with-the-bible-plugin-for-cakephp-esv/">BibleComponent/BibleHelper</a> on the fly (shameless plug), it would look like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> PassageController <span style="color: #000000; font-weight: bold;">extends</span> AppController <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> passages<span style="color: #009900;">&#40;</span><span style="color: #000088;">$passage</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//load BibleComponent</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">FlyLoader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Component&quot;</span><span style="color: #339933;">,</span> 
                <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Bible.Bible&quot;</span> <span style="color: #339933;">=&gt;</span> 
                        <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Esv&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;key&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;&lt;your key&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//load BibleHelper</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">FlyLoader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Helper&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Bible.Bible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$passages</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Bible</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_passage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$passage</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;passages&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$passages</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><code><strong>unload($type, $name)</strong></code><br />
The <code>unload()</code> function will unload your Helper/Component/Behavior accordingly. Currently, it will only unload Behaviors&#8230; Any other <code>$type</code> will simply do nothing. But the placeholders are there in the event that we find reasoning to unload a Helper/Component.</p>
<p><code>$type</code> is the type of object you wish to unload. The values supported are &#8220;Component&#8221;, &#8220;Helper&#8221; and &#8220;Behavior&#8221;.</p>
<p><code>$name</code> is the name of the Component/Helper/Behavior you wish to unload. <code>$name</code> is expected to be a <code>String</code> value.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.am05.com/2011/04/08/loading-cakephp-helpers-components-and-behaviors-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ALPHA] Retrieve Bible passages with the Bible plugin for CakePHP (ESV)</title>
		<link>http://www.am05.com/2011/03/06/alpha-retrieve-bible-passages-with-the-bible-plugin-for-cakephp-esv/</link>
		<comments>http://www.am05.com/2011/03/06/alpha-retrieve-bible-passages-with-the-bible-plugin-for-cakephp-esv/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 22:18:32 +0000</pubDate>
		<dc:creator>Amos Chan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bible]]></category>
		<category><![CDATA[CakePHP]]></category>

		<guid isPermaLink="false">http://www.am05.com/?p=205</guid>
		<description><![CDATA[Bible @ GitHub: Repository &#124; Download I&#8217;m happy to announce the release of the alpha version of my Bible plugin for CakePHP! It&#8217;s alpha because, well, it&#8217;s really limited right now&#8230; but if all you want is to retrieve passages from the Bible, this does the job. The Bible plugin was created with the intentions [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Bible @ GitHub:</strong> <a title="Repository" href="https://github.com/achan/bible">Repository</a> | <a title="Download" href="https://github.com/achan/bible/archives/master">Download</a></p>
<p>I&#8217;m happy to announce the release of the alpha version of my Bible plugin for CakePHP! It&#8217;s alpha because, well, it&#8217;s really limited right now&#8230; but if all you want is to retrieve passages from the Bible, this does the job.</p>
<p>The Bible plugin was created with the intentions of expanding support for various translations of the Bible. However, as it stands, it currently only supports the <a href="http://www.gnpcb.org/esv">English Standard Version</a> (ESV).<span id="more-205"></span></p>
<h2>What&#8217;s in the Bible plugin?</h2>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">App<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Component&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Bible.Bible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
App<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Helper&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Bible.Bible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">class</span> SermonsController <span style="color: #000000; font-weight: bold;">extends</span> AppController <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$components</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Bible&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            <span style="color: #0000ff;">&quot;Esv&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;key&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;&lt;your key&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$helpers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Bible&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #339933;">...</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> passages<span style="color: #009900;">&#40;</span><span style="color: #000088;">$passage</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">layout</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ajax&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$passages</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Bible</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_passage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$passage</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;passages&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$passages</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>The Bible component</h3>
<p>The <code>Bible</code> component is a dispatching component which will provide your controller with the functionality to lookup passages in the bible.</p>
<p>The <code>Bible</code> component&#8217;s <code>$settings</code> array is a key/value array where the key is the name of the translation-specific component and the value is said component&#8217;s <code>$settings</code> array. The purpose of this is to allow for us to easily add new translations in the future.</p>
<p>The &#8220;Esv&#8221; key refers to the <code>EsvBibleComponent</code> that the <code>BibleComponent</code> will dispatch its calls to when specified. Adding suport for &#8220;Niv&#8221;, &#8220;Nlt&#8221;, &#8220;Kjv&#8221; and so on would be as simple as creating <code>NivBibleComponent</code>, <code>NltBibleComponent</code>, <code>KjvBibleComponent</code> and implementing the functions dispatched by <code>BibleComponent</code>.</p>
<p>Currently, the only translation implemented is ESV. The component is basically a wrapper for the <a href="http://esvapi.org">ESV Bible Web Service</a> (ESVBWS), so make sure to follow all of its <a href="http://www.esvapi.org/#conditions">conditions</a> before using this plugin.</p>
<p>One of the conditions placed by the ESVBWS is that you can make no more than 5000 queries per day. The way they determine how many queries you&#8217;ve made is by your server&#8217;s IP or <a href="http://www.esvapi.org/signup">by requesting an API Key with them</a>. As you can see from the example above, the <code>EsvBibleComponent</code> takes a &#8220;key&#8221; parameter in its <code>$settings</code> array as well. The key field is optional and it will default to &#8220;IP&#8221; (meaning that the ESVBWS will log your query count by the querying server&#8217;s IP). They say that this is typically sufficient, but if you&#8217;re on a shared server and share your IP with many other sites (who also happen to use the ESVBWS or the mighty Bible plugin) then all your request counts will be summed up together. So, you can request an API key to make sure you get your 5000 queries a day (or an <a href="http://www.esvapi.org/#expanded">annual price of $100</a> for more than 5000 queries a day).</p>
<h3>The Bible helper</h3>
<p>Currently, all the <code>Bible</code> helper contains is a method to encode passages to be sent back to the controller&#8217;s actions.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Html</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;[ESV]&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;/sermons/passages/&quot;</span> <span style="color: #339933;">.</span> 
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Bible</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">encode_passage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;John 3:16&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Due to CakePHP&#8217;s <a href="http://book.cakephp.org/view/947/Named-parameters">named parameters</a>, passing passages with colons is not possible (it will think you&#8217;re trying to pass a named parameter). As a result, you can use the <code>Bible</code> helper&#8217;s <code>encode_passage($passage)</code> function in order to encode the passage to be passed to your controller. Essentially, all this does is replace any occurrence of &#8220;:&#8221; with &#8220;|&#8221;.</p>
<p>To see a working example, unpack this plugin in your <code>plugins</code> directory and go to /bible/examples in your browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.am05.com/2011/03/06/alpha-retrieve-bible-passages-with-the-bible-plugin-for-cakephp-esv/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cuploadify: The CakePHP plugin for Uploadify</title>
		<link>http://www.am05.com/2011/01/06/using-uploadify-in-cakephp/</link>
		<comments>http://www.am05.com/2011/01/06/using-uploadify-in-cakephp/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 22:48:00 +0000</pubDate>
		<dc:creator>Amos Chan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Cuploadify]]></category>

		<guid isPermaLink="false">http://www.am05.com/?p=53</guid>
		<description><![CDATA[UPDATE #2: 2011/01/29 &#8211; Documentation for overloading include_scripts paths. UPDATE #1: 2011/01/17 &#8211; Split article to separate element and view information. Cuploadify @ GitHub: Repository &#124; Download To install this plugin, simply unzip the latest stable build into your /app/plugins/cuploadify directory. In my attempt to decouple all of my CakePHP projects into separate, reusable plugins, [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #993300;">UPDATE #2: 2011/01/29 &#8211; Documentation for overloading <code>include_scripts</code> paths.</span></strong><br />
<strong><span style="color: #993300;">UPDATE #1: 2011/01/17 &#8211; Split article to separate element and view information.</span></strong></p>
<p><strong>Cuploadify @ GitHub:</strong> <a title="Repository" href="https://github.com/achan/cuploadify">Repository</a> | <a title="Download" href="https://github.com/achan/cuploadify/archives/1.0">Download</a></p>
<p><a href="http://www.am05.com/wp-content/uploads/2011/01/uploadify.gif"><img class="aligncenter size-medium wp-image-183" title="Uploadify" src="http://www.am05.com/wp-content/uploads/2011/01/uploadify-300x212.gif" alt="Uploadify example" width="300" height="212" /></a></p>
<p>To install this plugin, simply unzip the latest stable build into your <code>/app/plugins/cuploadify</code> directory.</p>
<p>In my attempt to decouple all of my CakePHP projects into separate, reusable plugins, I&#8217;ve created a CakePHP plugin for <a href="http://www.uploadify.com/demos">Uploadify</a>. For those of you who aren&#8217;t familiar with Uploadify, they describe themselves as <em>&#8220;a powerful and highly-customizable file upload script.&#8221;</em><span id="more-53"></span></p>
<h2>The Uploadify Element</h2>
<p>At the heart of Cuploadify is the uploadify element which can be used in your views to quickly create a real-time file upload input box.</p>
<p>An Uploadify file input box can be inserted into your view like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">element</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;uploadify&quot;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">&quot;plugin&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;cuploadify&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">&quot;dom_id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;file_upload&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">&quot;session_id&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">&quot;include_scripts&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #339933;">...</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">&quot;options&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;script&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;/users/upload_profile_pic&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$mixed</span><span style="color: #339933;">...</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>Options for the Uploadify element</h3>
<p><code><strong>plugin</strong></code><span style="color: #ff0000;">*</span><br />
The value here must be specified as <code>"cuploadify"</code> in order to let CakePHP know that the element resides in the <code>cuploadify</code> plugin.</p>
<p><code><strong>dom_id</strong></code><span style="color: #ff0000;">*</span><br />
The DOM id of the Uploadify file uploader element.</p>
<p><code><strong>session_id</strong></code><br />
As described in Uploadify&#8217;s <a title="How do I send the session id to the back-end script?" href="http://www.uploadify.com/faqs/how-do-i-send-the-session-id-to-the-back-end-script">FAQ</a>, &#8220;Since the Flash file is what is communicating with your back-end script, the session information is not sent when a file is being uploaded.&#8221; If you want to give the back-end script the current session, you can either pass the <code>"session_id"</code> key through the <code>scriptData</code> option, or by specifying the session id through this parameter.</p>
<p>If you&#8217;re using the <code>cuploadify</code> component in your controller, the switching of the sessions will be taken care of for you. Otherwise, you will need to manually switch the session before it has been started (ie. in your controller&#8217;s beforeFilter() method) like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// this is not necessary if you're using the cuploadify component</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;session_id&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$session_id</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;session_id&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$session_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><code><strong>include_scripts</strong></code><br />
In order to avoid including the same scripts multiple times &#8212; in the event that you have multiple uploadify inputs within the same page or are already including jquery/swfobject scripts &#8212; you can use this array to specify which scripts you wish to include when printing this element.<br />
Possible values: <code>"jquery"</code>, <code>"swfobject"</code>, <code>"uploadify"</code>, <code>"uploadify_css"</code>.<br />
<em>As of v0.1.6, all of these values can be overloaded as keys, whose value will specify a custom path to its corresponding script.</em><br />
Default values: No scripts will be included by default.</p>
<p>Example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jquery&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;/path/to/jquery&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;swfobject&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;uploadify&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><code><strong>options</strong></code><br />
This associative array allows you to specify all the jquery options expected by Uploadify.<br />
Possible values: View the <a href="http://www.uploadify.com/documentation/#options">Uploadify documentation</a> to see all the possible keys and their expected values.<br />
Mandatory option(s): <code>script</code><br />
Default option(s): The <code>cancelImg</code> and <code>uploader</code> options will use the files provided by Uploadify. No other options will be included.</p>
<p>To my knowledge, all paths/urls can use the CakePHP routing URLs.</p>
<p><em><span style="color: #ff0000;">*</span> denotes mandatory options.</em></p>
<h2>The Cuploadify Component</h2>
<p>The <code>cuploadify</code> component contains helper methods to facilitate the back-end functionality likely to be used by an Uploadify input box. It is not required when using the <code>uploadify</code> element, but it&#8217;s purpose is to implement some of the basic actions generally used with Uploadify input boxes.</p>
<p>To use this plugin with your <code>uploadify</code> element, you will need to call the this component in the <code>action</code> specified by the <code>script</code> key of your element&#8217;s <code>options</code> parameter.  In our current example, it would be like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// don't forget to import the Cuploadify component!</span>
App<span style="color: #339933;">::</span><span style="color: #004000;">import</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Component&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Cuploadify.Cuploadify&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">class</span> UsersController <span style="color: #000000; font-weight: bold;">extends</span> AppController <span style="color: #009900;">&#123;</span>
    <span style="color: #339933;">...</span>
    <span style="color: #000000; font-weight: bold;">function</span> upload_profile_pic<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cuploadify</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">upload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>The Cuploadify component methods</h3>
<p><code><strong>upload($options = array($key=>$value,...))</strong></code><br />
This method can be used to upload the files specified by the Uploadify input box (to the destination specified by the input box).<br />
Options: The only option currently available is <code>"root"</code>, which allows the developer to specify a root directory to prepend to the upload directory specified by the <code>"folder"</code> key of the corresponding Uploadify input box. This gives a sort of sandbox effect to avoid certain XSS exploits.</p>
<p>And that&#8217;s it!</p>
<p>If there are any features missing or not working properly, <a href="https://github.com/achan/cuploadify/issues">feel free to let me know</a>. Or &#8211; better yet &#8211; send me a patch with the fix <img src='http://www.am05.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.am05.com/2011/01/06/using-uploadify-in-cakephp/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>What&#8217;s Next for Montreal-CAC.org?</title>
		<link>http://www.am05.com/2010/10/27/whats-next-for-montreal-cac-org/</link>
		<comments>http://www.am05.com/2010/10/27/whats-next-for-montreal-cac-org/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 22:21:33 +0000</pubDate>
		<dc:creator>Amos Chan</dc:creator>
				<category><![CDATA[Misc.]]></category>
		<category><![CDATA[churchie]]></category>
		<category><![CDATA[montreal-cac.org]]></category>

		<guid isPermaLink="false">http://www.am05.com/?p=19</guid>
		<description><![CDATA[MCAC is getting a new site&#8230; now what? I&#8217;ve decided to split V2 of Montreal-CAC.org into multiple phases, otherwise it would just take too long to get something out there. BETA As soon as I have some semblance of a site, I will put it up @ beta.montreal-cac.org. There, potential users/fellowship staffs can start getting [...]]]></description>
			<content:encoded><![CDATA[<p>MCAC is getting a new site&#8230; now what?</p>
<p>I&#8217;ve decided to split V2 of Montreal-CAC.org into multiple phases, otherwise it would just take too long to get something out there.</p>
<p><strong>BETA</strong><br />
As soon as I have some semblance of a site, I will put it up @ <a href="http://beta.montreal-cac.org">beta.montreal-cac.org</a>. There, potential users/fellowship staffs can start getting acquainted to using the site.</p>
<p><strong>PHASE 1</strong><br />
The goal of Phase 1 is 1) to migrate all the old content (that we intend to keep) to the new structure, 2) to have the site updated more often, 3) to bring the information to the user, not relying on them to look for it and 4) Churchie.org integration.<span id="more-19"></span></p>
<p style="padding-left: 30px;"><strong>WHAT DO WE KEEP?<br />
</strong>Even though most of our site has been untouched for years, there are certain sections that are still up to date. For instance, we have 5 years worth of sermons from the English Congregation. Moving forward, we&#8217;ll need to decide what to keep and what needs to be revamped.</p>
<p style="padding-left: 30px;"><strong>AVOIDING AN ABANDONED SITE<br />
</strong>It&#8217;s going to be crucial for us to find a way to keep the new site up-to-date. The #1 factor (no research made lol) in retaining visitors is giving the users the information that they came for. If a visitor gets the impression that our site is no longer being used, they&#8217;re not coming back. We can&#8217;t still have posts about Christmas service when Easter is coming up.</p>
<p style="padding-left: 30px;">Of course, the information generated on the site will not depend on me&#8230; I&#8217;ll need the cooperation of the MCAC community in order to keep it up-to-date. What I need to do, as the web developer, is make it easy for our community to update the site.</p>
<p style="padding-left: 30px;">The people expected to drive this site&#8217;s content will be the Fellowship PRs. Typically, they will send out a weekly emails to advise the fellowship&#8217;s members what&#8217;s going on this week. However, the staff needs to be convinced that weekly emails are <em>NOT </em>the approach to take. Why? Because after a couple months, you end up with an email list of about 50 people even though only 20 of them actually want to stay on the mailing list. There is no way to unsubscribe.</p>
<p style="padding-left: 30px;">This is where the new site comes in hand. We&#8217;ll be implementing newsletters per small group/fellowship so that people can subscribe/unsubscribe to whichever newsletters they wish. The beauty of using these newsletters is that it will simultaneously be posted on the church site! That way, even people not registered to the mailing lists can see what&#8217;s going on around the church&#8230; and, if successful, will keep the site updated regularly without requiring anyone to do more work than they did before.</p>
<p style="padding-left: 30px;"><strong>BRINGING THE CHURCH TO THEM<br />
</strong>Let&#8217;s face it&#8230; people are NOT going to go to Montreal-CAC.org regularly. We&#8217;re going to need to bring Montreal-CAC.org to <em>them</em>. How? It all works around the new newsletter feature. For each newsletter written, there will be options to post to twitter and post to Facebook so that, as long as you&#8217;re following MCAC on twitter or are a fan of MCAC (or whichever small group/fellowship) on Facebook, you&#8217;ll receive a short blurb along with a link to the full details located on our site. This way, users can keep up-to-date with the ongoings of MCAC without ever visiting the site!</p>
<p style="padding-left: 30px;"><strong>SHARING THE WEALTH<br />
</strong>As a developer, I want everything I create to be re-usable. As a Christian, I want to help as many churches &#8220;get online&#8221; as I can. A lot of the features on Montreal-CAC.org are not specific to MCAC &#8212; most churches have sermons and fellowships &#8212; and if it&#8217;s good enough for MCAC to use, I&#8217;m sure many other churches would find it useful as well. That&#8217;s why everything developed for this site will be written generically, to be re-implemented on Churchie.org where churches will be able to register for free and take advantage of those features.</p>
<p><strong>PHASE 2<br />
</strong>Phase 2 will consist of more church management tools like viewing your tithing records online and reserving rooms in the church.</p>
<p>Hope you guys are as excited as I am!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.am05.com/2010/10/27/whats-next-for-montreal-cac-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting a Church Site</title>
		<link>http://www.am05.com/2010/10/27/starting-a-church-site/</link>
		<comments>http://www.am05.com/2010/10/27/starting-a-church-site/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 15:20:31 +0000</pubDate>
		<dc:creator>Amos Chan</dc:creator>
				<category><![CDATA[Misc.]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[montreal-cac.org]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.am05.com/?p=9</guid>
		<description><![CDATA[In early 2010, I decided that Montreal-CAC.org was more than due for a refresh. It&#8217;s been more than 5 years since the current version was pushed out, which means that it&#8217;s pretty much irrelevant at this point. Well, between switching jobs, moving out and getting married, we&#8217;re closing in on the end of the year, [...]]]></description>
			<content:encoded><![CDATA[<p>In early 2010, I decided that Montreal-CAC.org was more than due for a refresh. It&#8217;s been more than 5 years since the current version was pushed out, which means that it&#8217;s pretty much irrelevant at this point.</p>
<p>Well, between switching jobs, moving out and getting married, we&#8217;re closing in on the end of the year, and there&#8217;s been little progress.</p>
<p>What I <em>have </em>done is scrapped two different designs for the new site. I&#8217;ve also created a third layout, which looks great now, but will probably face a similar fate as the previous two before it&#8217;s release date.</p>
<p>One of the tougher decisions I&#8217;ve made was to <em>not</em> use Drupal or WordPress. Don&#8217;t get me wrong, I absolutely feel that those are good tools for creating church sites&#8230; and if one were thinking of creating a church site, I would definitely recommend checking out those two solutions first before deciding to build your own. If you can fit your site within those frameworks, their community&#8217;s plugins will help you tremendously. Unfortunately, I just didn&#8217;t see the features I wanted to implement for the new site as being easily integrated into Drupal or WordPress.</p>
<p>In the end, I felt most comfortable with building this site using the CakePHP framework. I&#8217;m aware of Drake, the CakePHP module for Drupal, but at this point, it just seems to bloated for what I&#8217;m trying to do.</p>
<p>In an attempt to reuse as much code as possible, I&#8217;m going to try and make as many generic CakePHP plugins as possible. For example, the management of Users, Groups and Roles will be part of it&#8217;s own separate project called the URG plugin. Ideally this plugin will be able to be reused in my future CakePHP projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.am05.com/2010/10/27/starting-a-church-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

