<?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>HalGatewood.com</title>
	<atom:link href="http://www.halgatewood.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.halgatewood.com</link>
	<description>Web Developer in Montreal</description>
	<lastBuildDate>Fri, 19 Mar 2010 05:43:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Free PHP List Files in a Directory Script</title>
		<link>http://www.halgatewood.com/free-php-list-files-in-a-directory-script/</link>
		<comments>http://www.halgatewood.com/free-php-list-files-in-a-directory-script/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 05:33:05 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Free Ideas]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[directory files]]></category>
		<category><![CDATA[directory listing]]></category>
		<category><![CDATA[file list]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[free scripts]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php scripts]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=483</guid>
		<description><![CDATA[After finding a bunch of ugly scripts to display files in a directory, I finally created my own.  It&#8217;s two simple files: index.php and icons.png.  (might switch to .gif soon)  Grab the files at the address below and beautify your file listings.
Get it now at: http://www.halgatewood.com/free/file-directory-list/
I&#8217;ve also added a &#8216;freebies&#8217; section to the [...]]]></description>
			<content:encoded><![CDATA[<p>After finding a bunch of ugly scripts to display files in a directory, I finally created my own.  It&#8217;s two simple files: index.php and icons.png.  (might switch to .gif soon)  Grab the files at the address below and beautify your file listings.</p>
<p>Get it now at: <a href="http://www.halgatewood.com/free/file-directory-list/">http://www.halgatewood.com/free/file-directory-list/</a></p>
<p>I&#8217;ve also added a &#8216;freebies&#8217; section to the lower right of the sidebar &#8212;&#8211;&gt;<br />
Check it out.</p>
<p><span id="more-483"></span></p>
<p style="text-align: center;"><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/php-directory-list-example.jpg"><img class="size-medium  wp-image-493 aligncenter" title="php-directory-list-example" src="http://www.halgatewood.com/wp-content/uploads/2010/03/php-directory-list-example.jpg" alt="" width="450" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/free-php-list-files-in-a-directory-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saturday Night Live Graphs</title>
		<link>http://www.halgatewood.com/saturday-night-live-graphs/</link>
		<comments>http://www.halgatewood.com/saturday-night-live-graphs/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 00:29:24 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=459</guid>
		<description><![CDATA[A few numbers have been crunched and here are the results:








]]></description>
			<content:encoded><![CDATA[<p>A few numbers have been crunched and here are the results:</p>
<table border="0">
<tbody>
<tr>
<td width="250" valign="top" style="padding: 10px"><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/1488-1202179382.gif"><img class="size-medium wp-image-458" title="SNL Bar Graph" src="http://www.halgatewood.com/wp-content/uploads/2010/03/1488-1202179382-288x300.gif" alt="" width="250" /></a></td>
<td width="250" valign="top" style="padding: 10px"><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/1281-1202179415.gif"><img class="size-medium wp-image-457" title="SNL Pie Chart" src="http://www.halgatewood.com/wp-content/uploads/2010/03/1281-1202179415-300x243.gif" alt="" width="250" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/saturday-night-live-graphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable WebShop Tab in eZ Publish 4.3 admin</title>
		<link>http://www.halgatewood.com/enable-webshop-tab-in-ez-publish-4-3-admin/</link>
		<comments>http://www.halgatewood.com/enable-webshop-tab-in-ez-publish-4-3-admin/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 00:18:00 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[ezpublish]]></category>
		<category><![CDATA[ezpublish 4.3]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[how2]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[webshop]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=450</guid>
		<description><![CDATA[A release candidate for eZ Publish 4.3 was posted the other day.  One of the new defaults is less tabs in the top navigation. Here is how you can bring back the tabs.
Navigate to the setup tab across the top:


Click on the ini settings link in the left navigation.  Then choose menu.ini from the top [...]]]></description>
			<content:encoded><![CDATA[<p>A release candidate for eZ Publish 4.3 was <a href="http://ez.no/company/news/ez_publish_4_3_rc_released" target="_blank">posted the other day</a>.  One of the new defaults is less tabs in the top navigation. Here is how you can bring back the tabs.</p>
<p>Navigate to the setup tab across the top:</p>
<p><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/setup-tab-ez43.png"><img class="size-medium  wp-image-456 " title="setup-tab-ez43" src="http://www.halgatewood.com/wp-content/uploads/2010/03/setup-tab-ez43-300x44.png" alt="" width="300" height="44" /></a></p>
<p><span id="more-450"></span></p>
<p>Click on the ini settings link in the left navigation.  Then choose menu.ini from the top dropdown and the siteaccess of your admin.</p>
<p><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/menu-ini-ez43.png"><img class="alignnone size-medium wp-image-455" title="menu-ini-ez43" src="http://www.halgatewood.com/wp-content/uploads/2010/03/menu-ini-ez43-300x112.png" alt="" width="300" height="112" /></a></p>
<p>Scroll down or browser search for the section &#8216;TopAdminMenu&#8217;. Click on the edit icon in the top right of that section.</p>
<p><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/editTopAdminMenu-ez43.png"><img class="alignnone size-medium wp-image-454" title="editTopAdminMenu-ez43" src="http://www.halgatewood.com/wp-content/uploads/2010/03/editTopAdminMenu-ez43-300x100.png" alt="" width="300" height="100" /></a></p>
<p>Scroll down and you should have a default value of something like:</p>
<pre>=dashboard
=content
=media
=users
=setup
</pre>
<p>Update the box to include &#8216;=shop&#8217; in the order you want the tabs to appear <strong>and make sure you add a &#8220;=&#8221; at the top</strong>.  If you don&#8217;t your tabs will get duplicated as it will add to the array instead of starting new.</p>
<p><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/add-show-ez43.png"><img class="alignnone size-full wp-image-453" title="add-show-ez43" src="http://www.halgatewood.com/wp-content/uploads/2010/03/add-show-ez43.png" alt="" width="224" height="162" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/enable-webshop-tab-in-ez-publish-4-3-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I Met Your Mother</title>
		<link>http://www.halgatewood.com/how-i-met-your-mother/</link>
		<comments>http://www.halgatewood.com/how-i-met-your-mother/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 16:23:33 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=448</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.halgatewood.com/wp-content/uploads/2010/03/how-i-met-your-mother.jpg"><img class="aligncenter size-medium wp-image-447" title="how-i-met-your-mother" src="http://www.halgatewood.com/wp-content/uploads/2010/03/how-i-met-your-mother-300x234.jpg" alt="" width="300" height="234" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/how-i-met-your-mother/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Highlight Unicode Text in PHP</title>
		<link>http://www.halgatewood.com/highlight-unicode-text-in-php/</link>
		<comments>http://www.halgatewood.com/highlight-unicode-text-in-php/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 04:24:31 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=434</guid>
		<description><![CDATA[I was trying to get my old highlight function to highlight Russian text from a MySQL database. No Go. It was using eregi_replace which is deprecated according to the php manual. I ended up getting this to work:
function highlight($word, $block)
{
  $pattern = '/('. quotemeta($word) .')/ui';
  return preg_replace($pattern, '&#60;span class="highlight"&#62;$1&#60;/span&#62;' , $block );
}

That&#8217;s it. [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to get my old highlight function to highlight Russian text from a MySQL database. No Go. It was using <em>eregi_replace</em> which is deprecated <a href="http://php.net/manual/en/function.eregi-replace.php" target="_blank">according to the php manual</a>. I ended up getting this to work:</p>
<pre>function highlight($word, $block)
{
  $pattern = '/('. quotemeta($word) .')/ui';
  return preg_replace($pattern, '&lt;span class="highlight"&gt;$1&lt;/span&gt;' , $block );
}
</pre>
<p>That&#8217;s it. I use it to highlight the searched words on <a href="http://khristos.org/" target="_blank">khristos.org</a> like this:</p>
<pre>&lt;?php
$q = $_GET['q'];
foreach($results as $result)
{
  echo highlight($q, $result);
}
?&gt;
</pre>
<p>In the pattern line you will see a &#8216;/ui&#8217; at the end.  The <em><strong>u</strong></em> stands for Unicode and the <em><strong>i</strong></em> stands for case-insensitive.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/highlight-unicode-text-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why 37signals skips Photoshop</title>
		<link>http://www.halgatewood.com/why-37signals-skips-photoshop/</link>
		<comments>http://www.halgatewood.com/why-37signals-skips-photoshop/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 03:46:41 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[37signals]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[prototyping]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=431</guid>
		<description><![CDATA[Just re-read this article on SVN and this line below just jumped out and hit me, because I just did the exact same thing this week.  This company always make me think about my workflow.  Time to acquire a copy of rework.
Photoshop is repeating yourself. Ok, so you’ve spent 3 days on a mockup in [...]]]></description>
			<content:encoded><![CDATA[<p>Just re-read this article on SVN and this line below just jumped out and hit me, because I just did the exact same thing this week.  This company always make me think about my workflow.  Time to acquire a copy of <a href="http://www.amazon.com/gp/product/0307463745?ie=UTF8&amp;tag=halgatewoodco-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0307463745" target="_blank">rework</a>.</p>
<blockquote><p>Photoshop is repeating yourself. Ok, so you’ve spent 3 days on a mockup in Photoshop. Now what? Now I have to make it all over again in HTML/CSS. Wasted time. Just build it in HTML/CSS and spend that extra time iterating, not rebuilding. If you’re not fast enough in HTML/CSS, then spend the time learning how to create in HTML/CSS faster. It’s time well spent.</p></blockquote>
<p>via <a href="http://37signals.com/svn/posts/1061-why-we-skip-photoshop">Why we skip Photoshop &#8211; (37signals)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/why-37signals-skips-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eZPublish &#8211; Get Image File from Object using PHP</title>
		<link>http://www.halgatewood.com/ezpublish-get-image-file-from-object-using-php/</link>
		<comments>http://www.halgatewood.com/ezpublish-get-image-file-from-object-using-php/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 20:56:10 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[attributes]]></category>
		<category><![CDATA[datamap]]></category>
		<category><![CDATA[ez-publish]]></category>
		<category><![CDATA[ezpublish]]></category>
		<category><![CDATA[fetch]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=420</guid>
		<description><![CDATA[Your doing some actually PHP in eZ Publish (in a module, class or whatever) and you need to find the image data for the Image Attribute of an object, here is what to do:
$node = eZContentObjectTreeNode::fetch( $node_id );
$dataMap = $node-&#62;dataMap();

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

$image_url = $image_array['url'];

First get into the DataMap of your object or node.
Change [...]]]></description>
			<content:encoded><![CDATA[<p>Your doing some actually PHP in eZ Publish (in a module, class or whatever) and you need to find the image data for the Image Attribute of an object, here is what to do:</p>
<pre>$node = eZContentObjectTreeNode::fetch( $node_id );
$dataMap = $node-&gt;dataMap();

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

$image_url = $image_array['url'];</pre>
<ol>
<li>First get into the DataMap of your object or node.</li>
<li>Change the &#8216;image&#8217; of <em>$dataMap['<strong>image</strong>']</em> to whatever the attribute_identifier of your image is.</li>
<li>Change the &#8216;original&#8217; of <em>$image_pathobj-&gt;Content()-&gt;attribute(&#8216;<strong>original</strong>&#8216;);</em> to whichever size of image you need to get.  The image array contents all the good information of that image, i.e. height, width, filesize, etc.</li>
<li>Use the &#8216;url&#8217; to get a full path to your image. Slap a &#8220;/&#8221; on the front or use ezurl() to display.</li>
</ol>
<p>If you want to see the available image sizes, you can check them by debugging this value:</p>
<pre>$image_sizes = $image_attribute-&gt;Content()-&gt;attributes();</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/ezpublish-get-image-file-from-object-using-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tallscreen Video</title>
		<link>http://www.halgatewood.com/tallscreen-video/</link>
		<comments>http://www.halgatewood.com/tallscreen-video/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 06:17:02 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[1915studios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone 3Gs video]]></category>
		<category><![CDATA[iphone video]]></category>
		<category><![CDATA[tallscreen]]></category>
		<category><![CDATA[tallscreen video]]></category>
		<category><![CDATA[youtube]]></category>
		<category><![CDATA[youtube tallscreen]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=416</guid>
		<description><![CDATA[I was playing around at lunch the other day and came up with this little site: tallscreen.1915studios.com
It gives you a properly formatted iPhone TallScreen video player.
Upload your tallscreen video to YouTube and then put your YouTube URL in the bar at the top.
Send the link to your friends, rinse and repeat.
Have fun&#8230;
]]></description>
			<content:encoded><![CDATA[<p>I was playing around at lunch the other day and came up with this little site: <a href="http://tallscreen.1915studios.com/">tallscreen.1915studios.com</a></p>
<p>It gives you a properly formatted iPhone TallScreen video player.</p>
<p>Upload your tallscreen video to YouTube and then put your YouTube URL in the bar at the top.</p>
<p>Send the link to your friends, rinse and repeat.</p>
<p>Have fun&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/tallscreen-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>eZ Publish &#8211; Creating a Custom Template Function</title>
		<link>http://www.halgatewood.com/ez-publish-creating-a-custom-template-function/</link>
		<comments>http://www.halgatewood.com/ez-publish-creating-a-custom-template-function/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 02:01:29 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ezpublish]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=385</guid>
		<description><![CDATA[To use this tutorial I am assuming you know how to create an extension.  If you do not please go over to this tutorial or Google ezPublish Extentions.
In this example we will be using an extension called orange.  To start out we are going to create a function we can use in our templates to [...]]]></description>
			<content:encoded><![CDATA[<p>To use this tutorial I am assuming you know how to create an extension.  If you do not please go over to <a href="http://share.ez.no/articles/ez-publish/an-introduction-to-developing-ez-publish-extensions" target="_blank">this tutorial</a> or Google <a href="http://www.google.ca/webhp?q=ezpublish+extension" target="_blank">ezPublish Extentions</a>.</p>
<p>In this example we will be using an extension called <strong>orange</strong>.  To start out we are going to create a function we can use in our templates to mimic the php function <em>str_replace</em>. We will call it <em>ezstr_replace</em>.<span id="more-385"></span></p>
<p>If you don&#8217;t have an autoloads folder in your extension already then create one and add a php file called  eztemplateautoload.php</p>
<pre>extention/orange/autoloads/eztemplateautoload.php</pre>
<p>In this file add the following code.</p>
<pre>&lt;?php
$eZTemplateOperatorArray[] = array( 'script' =&gt; 'extension/orange/autoloads/str_operator.php',
         							'class' =&gt; 'MyStrOperator',
         							'operator_names' =&gt; array('ezstr_replace')
								);
?&gt;
</pre>
<p>The <em>script</em> element points to the file of your class, the <em>class</em> is the Class name you will use and the <em>operator_names</em> are the functions you will be able to use.  You will add more to that array as you build new functions in the future.  <strong>This is the common place I forget to change when adding new functions.</strong></p>
<p>So now let&#8217;s create the php file str_operator.php and put it in the same autoloads folder.  You could put this into a different folder just remember to change the path in the array above. I will give you the whole class and then go through it and inspect certain elements.</p>
<pre>&lt;?php

class MyStrOperator
{
  function MyStrOperator()
  {
    $this-&gt;Operators = array( 'ezstr_replace' );
  }

  function &amp;operatorList() { return $this-&gt;Operators; }
  function namedParameterPerOperator() { return true; }

  function namedParameterList()
  {
    return array (
      'ezstr_replace' =&gt; array(
         'search' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' ),
         'replace' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' ),
         'subject' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' )
      )
    );
  }

  function modify( &amp;$tpl, &amp;$operatorName, &amp;$operatorParameters, &amp;$rootNamespace, &amp;$currentNamespace, &amp;$operatorValue, &amp;$namedParameters )
  {
    switch ( $operatorName )
    {
      case "ezstr_replace":
        $operatorValue = str_replace( $namedParameters['search'], $namedParameters['replace'], $namedParameters['subject']  );
      break;
    }
  }
  var $Operators;
}
?&gt;
</pre>
<p>In the constructor function MyStrOperator we have an array of the functions available.</p>
<p>Leave alone the functions <em>operatorList</em> and <em>ParameterPerOperator</em>.</p>
<p>The <em>namedParameterList</em> is where the action gets started&#8230; it&#8217;s also a mess of an array. The first array has the key with the name of the template function you want to use and it&#8217;s value is another array with the parameters you want to pass to your function. As you can see you set the type of parameter it is, if it&#8217;s required or not and a default value.  If you wanted to add another function it would look like this:</p>
<pre>return array (
  'ezstr_replace' =&gt; array(
    'search' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' ),
    'replace' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' ),
    'subject' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' )
),
  'ezpreg_replace' =&gt; array(
    'search' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' ),
    'replace' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' ),
    'subject' =&gt; array( 'type' =&gt; 'string', 'required' =&gt; true, 'default' =&gt; '' )
  )
);</pre>
<p>In the <em>modify</em> function of this class we do a switch on the $operatorName and set the $operatorValue to whatever actions we want to perform with our template function.  If your actions become too large and you don&#8217;t want to fill up your modify function you could set it up like the example below.</p>
<pre>function modify( &amp;$tpl, &amp;$operatorName, &amp;$operatorParameters, &amp;$rootNamespace, &amp;$currentNamespace, &amp;$operatorValue, &amp;$namedParameters )
{
  switch ( $operatorName )
  {
    case "ezstr_replace":
      $operatorValue = $this-&gt;replace( $namedParameters['search'], $namedParameters['replace'], $namedParameters['subject']  );
    break;
  }
}

function replace($search, $replace, $subject)
{
  return str_replace($search, $replace, $subject);
}</pre>
<p>Here is how you can use the function in your template.</p>
<pre>{def $text = "The King and I are going to get some cookies"}
{def $checkmate = ezstr_replace("King", "Queen", $text)}
{$checkmate}
</pre>
<p>The example above should display &#8220;The Queen and I are going to get some cookies&#8221;</p>
<p>So now you know how to get some template function going. In the upcoming blog posts I&#8217;m going to give some functions that have helped me out quite a bit.  So stay tuned and comment below if you have any questions or problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/ez-publish-creating-a-custom-template-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aviary is going free</title>
		<link>http://www.halgatewood.com/aviary-is-going-free/</link>
		<comments>http://www.halgatewood.com/aviary-is-going-free/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 14:30:55 +0000</pubDate>
		<dc:creator>Hal Gatewood</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[aviary]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[power of free]]></category>

		<guid isPermaLink="false">http://www.halgatewood.com/?p=381</guid>
		<description><![CDATA[Aviary &#8211; Creation on the fly / blog / Setting Aviary Free.
At Aviary, we believe that everyone in the world should have access to  powerful creation tools.  We therefore chose our company mission to be We  make creation accessible to everyone. Our powerful set of tools  helps fulfill this mission by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://aviary.com/blog/posts/free-online-editing">Aviary &#8211; Creation on the fly / blog / Setting Aviary Free</a>.</p>
<blockquote><p>At Aviary, we believe that everyone in the world should have access to  powerful creation tools.  We therefore chose our company mission to be <em>We  make creation accessible to everyone</em>. Our powerful set of tools  helps fulfill this mission by enabling small businesses, students,  artists &amp; creators across different genres.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.halgatewood.com/aviary-is-going-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
