<?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>Peeled Carrots &#187; Code</title>
	<atom:link href="http://www.peeledcarrots.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peeledcarrots.com</link>
	<description>....cause life&#039;s too short to peel carrots. Enough said!!</description>
	<lastBuildDate>Tue, 03 Nov 2009 14:42:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ensuring the hand cursor is displayed in Flex components</title>
		<link>http://www.peeledcarrots.com/ensuring-the-hand-cursor-is-displayed-in-flex-components/</link>
		<comments>http://www.peeledcarrots.com/ensuring-the-hand-cursor-is-displayed-in-flex-components/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 19:53:42 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.peeledcarrots.com/?p=206</guid>
		<description><![CDATA[I&#8217;m not sure if it&#8217;s a bug in the Flex code framework, but I have found it difficult to get the handcursor working when hovering over components like Labels/Text which arn&#8217;t used as links by default. After bashing my head against my desk for a few hours and doing some research on the web, I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if it&#8217;s a bug in the <a href="http://www.adobe.com/products/flex/">Flex </a>code framework, but I have found it difficult to get the handcursor working when hovering over components like Labels/Text which arn&#8217;t used as links by default. After bashing my head against my desk for a few hours and doing some research on the web, I finally came across a soution which which works in most cases.  To get the hand cursor working you need use the following 3 properties:</p>
<p><strong>buttonMode=&#8221;true&#8221; mouseChildren=&#8221;false&#8221; useHandCursor=&#8221;true&#8221;</strong></p>
<p>Here&#8217;s an example of a Label which is used as a link:</p>
<p><code>< mx:Label text="Log out" buttonMode="true" mouseChildren="false" useHandCursor="true" click="logout()" /></code></p>
<p>It seems like it&#8217;s a pretty common problem and these two articles showed me the light of day, thanks dudes!</p>
<ul>
<li><a href="http://frankieloscavio.blogspot.com/2007/08/mousechildren-and-buttonmode.html">http://frankieloscavio.blogspot.com/2007/08/mousechildren-and-buttonmode.html</a></li>
<li><a href="http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&#038;productId=2&#038;postId=1687">http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&#038;productId=2&#038;postId=1687</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/ensuring-the-hand-cursor-is-displayed-in-flex-components/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Styling and controlling a Flex Tree control using a custom ItemRenderer</title>
		<link>http://www.peeledcarrots.com/styling-and-controlling-a-flex-tree-control-using-a-custom-itemrenderer/</link>
		<comments>http://www.peeledcarrots.com/styling-and-controlling-a-flex-tree-control-using-a-custom-itemrenderer/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 09:34:50 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.peeledcarrots.com/?p=201</guid>
		<description><![CDATA[I am still pretty new to Flex and the last two weeks have been a massive learning curve. However, through trial and error, lots of research and plenty of tea (thanks Drew!), I am finally coming to grips with Flex, but more importantly Actionscript.
One of the things I have been working on is a FAQ [...]]]></description>
			<content:encoded><![CDATA[<p>I am still pretty new to Flex and the last two weeks have been a massive learning curve. However, through trial and error, lots of research and plenty of tea (thanks Drew!), I am finally coming to grips with Flex, but more importantly Actionscript.</p>
<p>One of the things I have been working on is a FAQ section for a web portol. To implement this I have used the following components and controls:</p>
<ol>
<li>A basepage</li>
<li>A standard mxml Tree contol (<mx :Tree />)</li>
<li><strong>A custom ItemRenderer</strong></li>
<li>A custom DataDescriptor</li>
<li>A function which is executed upon creation (creationComplete=&#8221;initTree()&#8221;)</li>
</ol>
<p>The focus of this tutorial is however on Item 3, <strong>a custom ItemRenderer</strong>. So here goes&#8230;</p>
<p>Firstly the data structure that I am using is a standard xml file which has categories, an answer and a question, I have included an exmaple below:<br />
<code><br />
< ? xml version="1.0" encoding="UTF-8"?><br />
< faq xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><br />
	< category><br />
		< nameGuidance</ name><br />
		< item><br />
			< question>What is the meaning of life, the universe and everything?<br />
			< answer>42<br />
		< /item></p>
<p></code><br />
Secondly, the Tree control has a number of paramaters which need to be included to get the desired result:<br />
<code><br />
< mx:Tree id="myTree"<br />
		  styleName="faqList"<br />
	             wordWrap="true"<br />
	             itemClick="tree_itemClick(event);"<br />
	             width="100%" height="100%"<br />
	             top="20"<br />
	             dataDescriptor="{new TreeDataDescriptor()}"<br />
	             itemRenderer="renderers.TreeRenderer"<br />
	             creationComplete="initTree()"<br />
	             /><br />
</code><br />
I will try to cover the dataDescriptor, itemClick and creationComplete in other posts, but for the time being, the ItemRenderer works something like this:</p>
<ul>
<li>It is important to include the if (super.data) logic otherwise the application will through errors because it&#8217;s referring to an object with a null value.</li>
<li>In the data method, I have set all parents (depth == 1) to have a bold style otherwise the nodes should just have normal font weight.</li>
<li>In the updateDisplayList:
<ol>
<li>I firstly remove the disclosure icons from all nodes</li>
<li>Add some default text styling to nodes, which sets the selected node back to its original styling after it was selected</li>
<li>Then if a 2nd level node is either highlighted (isItemHighligthed) or selected (isItemSelected) I change styling, display the disclosure icon and adjust the position of the disclosure icon<br />
(super.disclosureIcon.x = super.width &#8211; 50;).
</li>
</ol>
</li>
<li>Note: The moving the position of the icon is relatively simple, but I had difficulty finding information on the web about how to do this, so I&#8217;m hoping this will help someone out ther. This particular example moves the disclsure icon 50px inside the right hand border of the Tree control</li>
</ul>
<p><code>package com.g3global.ipp.view.components.renderers<br />
{<br />
    import mx.collections.*;<br />
    import mx.controls.treeClasses.*;<br />
    import mx.controls.listClasses.ListBase;</p>
<p>	/*<br />
	*	Custom Item Renderer for TreeControl<br />
	*<br />
	*	@package	Renderers<br />
	*	@author		Stephen Blake<br />
	*/<br />
    public class TreeRenderer extends TreeItemRenderer<br />
    {</p>
<p>        /*<br />
        * Define the constructor.<br />
        */<br />
        public function TreeRenderer()<br />
        {<br />
            super();<br />
        }</p>
<p>        /* Override method for the data property to set the font color and style of each node.<br />
        *<br />
        * @param value Object<br />
        */<br />
        override public function set data(value:Object):void<br />
        {<br />
            super.data = value;</p>
<p>            if (super.data)<br />
            {<br />
	            if (TreeListData(listData).depth == 1)<br />
	            {<br />
	                 setStyle("fontWeight", 'bold');<br />
	            }<br />
	            else<br />
	            {<br />
	                setStyle("fontWeight", 'normal');<br />
	            }<br />
            }<br />
        }</p>
<p>        /* Override method to set the text for each tree node.<br />
        *<br />
        * @param unscaledWidth Number<br />
        * @param unscaledHeight Number<br />
        */<br />
        override protected function updateDisplayList(unscaledWidth:Number,<br />
            unscaledHeight:Number):void {</p>
<p>       		// Call the method in the super class<br />
       		super.updateDisplayList(unscaledWidth, unscaledHeight);</p>
<p>            if(super.data)<br />
            {<br />
          		// Set the disclosure icon to false - overrides styles<br />
          		super.disclosureIcon.visible = false;</p>
<p>          		if (TreeListData(listData).depth > 1)<br />
	            {<br />
	                 setStyle("fontWeight", 'normal');<br />
	            }</p>
<p>          		// Specific styling for children nodes that are selected or highlighted<br />
        	   	if(ListBase(owner).isItemSelected(data) || ListBase(owner).isItemHighlighted(data) &#038;&#038; TreeListData(listData).depth == 2)<br />
    	        {<br />
            		super.disclosureIcon.visible = true;<br />
		super.disclosureIcon.x = super.width - 50;<br />
                	setStyle('fontWeight', 'bold');<br />
	           }</p>
<p>			}<br />
        }<br />
    }<br />
}</code></p>
<p>So that&#8217;s about it. Unfortunately I can&#8217;t link to a working demo of this feature because it is part of a much bigger application which is being built for a client. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/styling-and-controlling-a-flex-tree-control-using-a-custom-itemrenderer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kindo releases a private beta</title>
		<link>http://www.peeledcarrots.com/kindo-releases-a-private-beta/</link>
		<comments>http://www.peeledcarrots.com/kindo-releases-a-private-beta/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 14:16:17 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/09/18/kindo-releases-a-private-beta/</guid>
		<description><![CDATA[The team at Technovated has been working very diligently for the past few months to get a new application off the ground. Its called Kindo and we have finally released a private beta which is open to invitees only. If you would like to get onto the beta testers list, then submit your email address [...]]]></description>
			<content:encoded><![CDATA[<p>The team at Technovated has been working very diligently for the past few months to get a new application off the ground. Its called <a href="http://www.kindo.com">Kindo</a> and we have finally released a private beta which is open to invitees only. If you would like to get onto the beta testers list, then submit your email address via the form on <a href="http://www.kindo.com">www.kindo.com</a>.</p>
<p>We have also released a new blog on <a href="http://blog.kindo.com">blog.kindo.com</a>, so if you would like to keep up to date with our latest news, then please visit it. Comments are more than welcome <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Here are some snippets from two interesting posts on the Kindo blog</p>
<blockquote><p><a href="http://blog.kindo.com/2007/08/02/some-technical-details/en/">http://blog.kindo.com/2007/08/02/some-technical-details/en/</a></p>
<p>Weâ€™re having fun building the Kindo application and used a number of frameworks and components to achieve the finished result.</p>
<p>For the web framework weâ€™re using Seagull which offers excellent integration with Flash through the AMF PHP request handling and easy integration with Ajax and Graphviz. For the Ajax interactions we use jquery exclusively, for Graphviz a heavily extended version of the PEAR lib of the same name. Working with the dot language has been interesting and a good opportunity to experiment with the subtleties of a genealogy graph.</p>
<p><a href="http://blog.kindo.com/2007/09/04/welcome-to-the-beta-release/en/">http://blog.kindo.com/2007/09/04/welcome-to-the-beta-release/en/</a></p>
<p>A little while ago we released an Alpha to a small group of people, to gather valuable user feedback. Thanks to those great people, weâ€™ve had our heads down improving Kindo, and as a result weâ€™re releasing the Beta, and at the same time opening it up to a wider audience for more feedback.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/kindo-releases-a-private-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling rss feeds on a vanilla forum that doesn&#8217;t allow public browsing</title>
		<link>http://www.peeledcarrots.com/enabling-rss-feeds-on-a-vanilla-forum-that-does-not-allow-public-browsing/</link>
		<comments>http://www.peeledcarrots.com/enabling-rss-feeds-on-a-vanilla-forum-that-does-not-allow-public-browsing/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 08:42:07 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/08/03/enabling-rss-feeds-on-a-vanilla-forum-that-doesn%e2%80%99t-allow-public-browsing/</guid>
		<description><![CDATA[Situation
I recently installed the Vanilla forum and set it up so that it would not allow public browsing, because the discussions there are top secret  
I then installed the Feedpublisher extension to allow for RSS2 and ATOM feeds.
Problem
I encountered a major problem though, the rss feeds were not accessible because the forum did not [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Situation</strong></p>
<p>I recently installed the <a href="http://getvanilla.com/">Vanilla</a> forum and set it up so that it would not allow public browsing, because the discussions there are top secret <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I then installed the <a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&amp;AddOnID=304">Feedpublisher</a> extension to allow for RSS2 and ATOM feeds.</p>
<p><strong>Problem</strong></p>
<p>I encountered a major problem though, the rss feeds were not accessible because the forum did not allow public browsing. I also saw that on the <a href="http://lussumo.com/community/discussion/2951/">vanilla community forum</a>, this problem had been rasied, but no-one had offered a solution.<br />
Also, when trying to access the feed through the browser, one gets an authentication pop up box requested a username and password. When one enters the username and password into the respective text fields the following error message is displayed:</p>
<p><code>A fatal, non-recoverable error has occurred<br />
Technical information (for support personel):</p>
<p>Error Message<br />
An error occurred while validating user credentials.<br />
Affected Elements<br />
Feed.ValidateCredentials();</p>
<p>The error occurred on or near: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(u.Password = md5('foobar') or u.Password = 'foobar' )' at line 1<br />
</code></p>
<p><strong>Solution</strong></p>
<p>After quite a bit of playing around and testing, I found a relatively easy solution to the problem â€“ typical a five minute fix for an error that keeps you busy for 2 hours!!!</p>
<p><strong>Step 1</strong></p>
<p><code><br />
So firstly go to /extensions/Feedpublisher/default.php and make sure that the following section of code looks like this (line 60-73 )</p>
<p>if ( $Context-&gt;Session-&gt;UserID == 0 &amp;&amp; ! $Configuration[ "PUBLIC_BROWSING" ] )<br />
{</p>
<p>// Temporarily make the PUBLIC_BROWSING enabled,<br />
// but make sure to validate this user<br />
$Configuration[ "PUBLIC_BROWSING" ] = 1;<br />
$Context-&gt;Configuration[ 'AUTHENTICATE_USER_FOR_FEED_PUBLISHER' ] = 0;</p>
<p>}<br />
else<br />
{</p>
<p>$Context-&gt;Configuration[ 'AUTHENTICATE_USER_FOR_FEED_PUBLISHER' ] = 0;</p>
<p>}<br />
</code></p>
<p><strong>Step 2</strong></p>
<p>Then login to the admin section of the forum go to settings &gt; categories &gt; $category edit</p>
<p>Then you need to check the â€œunauthenticatedï¿½? option in the â€œRolesï¿½? and hot save. Do this for each and every category, unless you donâ€™t want a specific category to be displayed on the feed.</p>
<p>This method fixed my problem, so I would be interested to find out if anyone else has a better solution. Also let me know id it doesnâ€™t work for you â€“ I hope thatâ€™s not the case though.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/enabling-rss-feeds-on-a-vanilla-forum-that-does-not-allow-public-browsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reviewing a CMS solution developed on Mediatemple with the Seagull PHP Framework, including Paypal integration</title>
		<link>http://www.peeledcarrots.com/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/</link>
		<comments>http://www.peeledcarrots.com/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 11:29:02 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Seagull]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/07/25/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/</guid>
		<description><![CDATA[On Friday 20th July I finally deployed a site which we as a team have been working on for a number of months. Working on the project has been a huge learning curve and has taken way longer than ever expected.

The site which I am talking about is http://bd4d.com, which stands for By Designers 4 [...]]]></description>
			<content:encoded><![CDATA[<p>On Friday 20th July I finally deployed a site which we as a team have been working on for a number of months. Working on the project has been a huge learning curve and has taken way longer than ever expected.</p>
<p><a href="http://www.bd4d.com"><img src="http://www.technovated.com/wp-content/bd4d-home.jpg" width="550"  alt="BD4D"/></a></p>
<p>The site which I am talking about is <a href="http://www.bd4d.com">http://bd4d.com</a>, which stands for By Designers 4 Designers is built using the <a href="http://seagull.phpkitchen.com/">seagull php framework</a> with the new <a href="http://trac.seagullproject.org/wiki/Modules/Cms">cms</a> module</p>
<h3>General comments</h3>
<p>
<h4>Media Temple Installation</h4>
<p>During the live installation I encountered a few problems, most of which related to permissions of files on the server:</p>
<p>The main one however were the permissions of the /var/lib/php/session/ folder â€“ it has to be writable</p>
<p>
<h4>Plugins that I found really useful during development</h4>
<p>There were two firefox plug-ins that I found very useful during development of the site:</p>
<p><a href="http://www.iosart.com/firefox/colorzilla/">Colorzilla</a> â€“ gives you # codes for colours on any webpage<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/1419">IE tab </a>â€“ allows you to open up ie7 tabs within firefox, which is great for cross browser compliant xhtml/css</p>
<p>Thanks to the developers of these two add-ons <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>
<h4>Paypal</h4>
<p>The site has a payment gateway for listing jobs and events which has transaction processing done by <a href="https://www.paypal.com/">Paypal</a>.</p>
<p>In terms of project mistakes, this was one of the biggest we made. The support that <a href="http://www.floydtech.co.uk">James</a> received from  <a href="https://www.paypal.com/">Paypal</a> was extremely poor and the general documentation which they supply is often out of date and incorrect. I am amazed that they have become such a successful company, when it is so difficult to integrate their transaction processing into oneâ€™s site.</p>
<p>However after a lot of waiting for accounts to go live, numerous queries, emails, phone calls and a lot of frustration, we did eventually get the transactions working. It is working fine now, but it was definitely not worth all of that hassle.</p>
<p>I would be interested to here about other experiences from developers using  <a href="https://www.paypal.com/">Paypal</a> â€“ hopefully you had a better one than we did.</p>
<h3>Site Features</h3>
<p>
<h4>Showcase</h4>
<p>The section of the site that I am most proud of is the <a href="http://www.bd4d.com/index.php/default/showcase/action/list/">Showcase</a> section, which has flash and movies of some really cool clips which the <a href="http://www.bd4d.com">bd4d</a> guys have done. The section allows comments to be made on each of the movies and I think it looks pretty slick â€“ even if I say so myself <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>To get the section functioning, I used the following:</p>
<p>A comment manager which Dmitri initially developed and then  I adapted that code to be used for the site.</p>
<p>To prevent spam on the site I used <a href="http://pear.php.net/package/Text_CAPTCHA">captcha package</a> from the <a href="http://pear.php.net/">php pear library</a></p>
<p>And I used the following code in the template to hold the movies/flash files:</p>
<p><code>< object width="550" height="400" ><br />
< param name="movie" value="{webRoot}/themes/bd4d/showcasemovies/<br />
{oItem.media}" ><br />
< param name="quality" value="high" ><br />
< embed src="{webRoot}/themes/bd4d/showcasemovies/<br />
{oItem.media}" quality="high" width="{oItem.width}" height="{oItem.height}" autostart="true">< / embed ><br />
< / object >	</code></p>
<p>
<h4>Events</h4>
<p>The <a href="http://www.bd4d.com/index.php/event/calendar/action/viewMonth/y/2007/m/07/regionId/0/">Events calendar</a> uses the default seagull events module as a basis, but there where a few enhancements made to fit the requirements of the site. The majority of the development of this section was done by James and I think that he did a pretty good job of it.</p>
<p>The calendar looks pretty slick and works really well, also the backend of the seagull events module provides a lot of flexibility for administrators wanting to manage events.</p>
<p>
<h4>Job board</h4>
<p>The <a href="http://www.bd4d.com/index.php/default/jobboard/action/list/">Job board</a> uses custom managers in the default module and as I have mentioned in my section about paypal, it allows members of the site to post jobs for a fee. The transaction processing handles straight paypal payments as well as credit card payments which are verified by paypal.</p>
<p>
<h3>Conclusion</h3>
<p>As I mentioned in the introduction this site took way longer than expected and there were a number of hard lessons which the whole team learnt. But at the end of the day, the site looks pretty good and works as expected, so in some way it can be seen as a success.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/reviewing-a-cms-solution-developed-on-mediatemple-with-the-seagull-php-framework-including-paypal-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ensuring that favicons are displayed on your site</title>
		<link>http://www.peeledcarrots.com/ensuring-that-favicons-are-displayed-on-your-site/</link>
		<comments>http://www.peeledcarrots.com/ensuring-that-favicons-are-displayed-on-your-site/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 15:58:17 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/06/21/ensuring-that-favicons-are-displayed-on-your-site/</guid>
		<description><![CDATA[Favicons have become quite the norm on websites nowadays and I have encountered a few problems with them in the past, since browsers usually cache them and it takes quite awhile for browsers to update when a favicon is changed.
I used to just leave the .ico file in the document root and hoped that the [...]]]></description>
			<content:encoded><![CDATA[<p>Favicons have become quite the norm on websites nowadays and I have encountered a few problems with them in the past, since browsers usually cache them and it takes quite awhile for browsers to update when a favicon is changed.</p>
<p>I used to just leave the .ico file in the document root and hoped that the browser would pick it up, but I have recently been told a much better way of ensuring that the correct image is displayed in the URL text field.</p>
<p>Place the file in the images folder and then refer to it in your the head of you html template by using the following code: < link rel="Shortcut Icon" type="image/x-icon" href="../images/favicon.ico" / > (remove spaces in code)</p>
<p>So, one definitely does learn something new everyday. Hat tip to Ali <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/ensuring-that-favicons-are-displayed-on-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing a CMS solution on Mediatemple with the Seagull PHP Framework, including Google Maps</title>
		<link>http://www.peeledcarrots.com/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/</link>
		<comments>http://www.peeledcarrots.com/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/#comments</comments>
		<pubDate>Fri, 20 Apr 2007 09:03:53 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Seagull]]></category>

		<guid isPermaLink="false">http://www.technovated.com/2007/04/20/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/</guid>
		<description><![CDATA[Having just completed the Atalink site, I would like to highlight some of my experiences, frustrations and lessons which I have learnt over the past few months. 
Background
I developed the site using the Seagull php framework, using the publisher module (which has recently been superseded by the CMS module). 
The publisher module requires a bit [...]]]></description>
			<content:encoded><![CDATA[<p>Having just completed the Atalink site, I would like to highlight some of my experiences, frustrations and lessons which I have learnt over the past few months. </p>
<p><strong>Background</strong></p>
<p>I developed the site using the Seagull php framework, using the <a href="http://trac.seagullproject.org/wiki/Modules/Publisher">publisher module </a>(which has recently been superseded by the <a href="http://trac.seagullproject.org/wiki/Modules/Cms">CMS module</a>). </p>
<p>The <a href="http://trac.seagullproject.org/wiki/Modules/Publisher">publisher module</a> requires a bit of hacking to make it run effectively, especially if the site requires content pages which have different layouts. But, overall the site works well and looks pretty good, even if I say so myself <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . </p>
<p>I have still had a number of difficulties, so for those of you who are planning on building a similar site, here are some of the things which I have learnt:</p>
<p>This is especially relevant if you are going to be using some of the following:</p>
<ul>
<li><a href="http://seagullproject.org/">Seagull php Framework</a></li>
<li>Installing a site on a <a href="http://mediatemple.net/">Media Temple</a> Server</li>
<li>Including a dynamic <a href="http://www.google.com/apis/maps/">Google Map</a> in a page using the api</li>
</ul>
<p><strong>Lessons learned</strong></p>
<p>Tips for using the <a href="http://seagullproject.org/">Seagull</a> publisher module:</p>
<p>If you have various site sections which need to have different layouts, the best way of handling this is to create different content types for each different layout which is required.</p>
<p>Then create a different publisher template for that content type and specify the styling which you want for that particular section.</p>
<p>If you have any exceptions, then use a handler like this:</p>
<p><code>    {if:isEqual(29,articleID)}<br />
            <flexy:include src="about_flow.html" /><br />
   {end:}<br />
    {if:isEqual(30,articleID)}<br />
              <flexy:include src="about_approach.html" /><br />
    {end:}<br />
    {if:isEqual(34,articleID)}<br />
           <flexy:include src="products.html" /><br />
    {end:}</code></p>
<p>I will endeavour to write a more in depth tutorial for this and put it on the Seagull wiki. Once I have done so, I will update this post.</p>
<p><strong>Server Issues</strong></p>
<p>The first issue which I encountered was trying to do an installation on a staging sub-domain on a <a href="http://mediatemple.net/webhosting/dv/"> Media Temple Dedicated Virtual Server</a>, where php safe mode was turned on. I have written a <a href="http://www.technovated.com/2007/04/03/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/">post </a>which is a guide on how to successfully remove these restrictions.</p>
<p><strong>Browser Issues</strong></p>
<p>As always, I encountered problems with cross browser compatibility. I discovered huge differences between IE6, IE7 and Firefox. The site looks best in Firefox, Safari and in IE6, but there are a few small differences on IE7.</p>
<p>I used this basic conditional block to include an IE hacks file for when a user views the site using IE.</p>
<p><code>< !--[if IE] >< style type="text/css" >@import "http://www.atalink.com/ themes/atalink/css/hacks/ie.css";< /style >< ![endif]-- ></code> (Remove spaces)</p>
<p><strong>Google Maps</strong></p>
<p>Although this is not that difficult to implement, I found quite a useful site called:</p>
<p><a href="http://www.gorissen.info/Pierre/maps/googleMapLocationv3.php">Google Maps latitude, longitude Popup </a>, which gives you the latitudes and longitude values for a specific location, which you use in the <a href="http://www.google.co.uk">Google </a>supplied javascript</p>
<p><strong>Design</strong></p>
<p>Although a designer may do a really good job and a client signs off a design, one has to be flexible enough to deal with client requests for changing of the layouts. Often the changes requested are quite valid and one should consider each request before just disagreeing.</p>
<p><strong>Content</strong></p>
<p>Again, I have been reminded about how important it is to have content ready and signed off, before beginning with development. It is amazing how much time can be wasted when you are waiting for pieces of content. Details about content should be agreed upon during initial agreements and no matter how difficult it may be, these agreements should be adhered to.</p>
<p><strong>Conclusion</strong></p>
<p>I have enjoyed working on this site and I have learnt a lot, in terms of development and in terms of communicating with clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/developing-a-cms-solution-on-mediatemple-with-the-seagull-php-framework-including-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to turn off PHP safe mode and remove open_basedir restrictions to install the Seagull PHP framework on a Media Temple sub domain</title>
		<link>http://www.peeledcarrots.com/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/</link>
		<comments>http://www.peeledcarrots.com/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 09:37:42 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://soapbox.technovated.com/2007/04/03/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/</guid>
		<description><![CDATA[Problem
I wanted to run an installation script on a sub-domain of a Dedicated-Virtual server hosted by Media Temple with a Plesk 7.5.4, but received the following php error message when I ran the script:
Warning: file_exists(): open_basedir restriction in effect.
Reason why the error occurs
The reason for this error is because, php safe mode is turned on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong></p>
<p>I wanted to run an installation script on a sub-domain of a Dedicated-Virtual server hosted by Media Temple with a Plesk 7.5.4, but received the following php error message when I ran the script:</p>
<p><strong>Warning:</strong> file_exists(): open_basedir restriction in effect.</p>
<p><strong>Reason why the error occurs</strong></p>
<p>The reason for this error is because, php safe mode is turned on and because the open_basedir is set for each sub-domain. After quite a lot of searching on the web, I eventually tried a few tutorials, but none of them were comprehensive enough to describe exactly how to solve the actual problem.</p>
<p><strong>Solution</strong></p>
<p>Follow these steps and you should solve the problem:</p>
<ol>
<li>SSH into your server using the root login information </li>
<p></p>
<li>Once you have logged in, edit the php.ini file located  /etc/ folder with a text editor. The line you are looking for is:<br />
a. Change this line safe_mode = on to safe_mode = off<br />
b. Or you can cut and paste this one-liner: <br /> perl -p -i -e &#8217;s/^safe_mode\s*=\s*on/safe_mode = off/i;&#8217; /etc/php.ini
</li>
<p></p>
<li>Make sure that the open_basedir in the php.ini file looks like this:
<p><code>; open_basedir, if set, limits all file operations to the defined<br />
directory<br />
; and below. This directive makes most sense if used in a per-<br />
directory<br />
; or per-virtualhost web server configuration file. This directive is<br />
; *NOT* affected by whether Safe Mode is turned On or Off.<br />
open_basedir = none</code></p>
</li>
<p></p>
<li>Then you need to edit the virtual hosts for the domain and for each sub-domain in the http.inc file, which is located in the /var/www/vhosts/$domain/conf folder.<br />
Add the following section of code to the domain Virtual Host, as well as to each sub-domain Virtual Host</p>
<p><code><br />
< IfModule sapi_apache2.c ><br />
	php_admin_flag engine on<br />
	php_admin_flag safe_mode off<br />
	php_admin_value open_basedir none<br />
< /IfModule ></p>
<p>< IfModule mod_php5.c ><br />
	php_admin_flag engine on<br />
	php_admin_flag safe_mode off<br />
	php_admin_value open_basedir none<br />
< /IfModule ><br />
</code>
 </li>
<p></p>
<li>To complete the process, one needs to type the following two commands:</li>
<p>a. /etc/init.d/httpd stop<br />
b. /etc/init.d/httpd start</p>
<p>Hit â€œEnterâ€? after each command and you should be given an [ OK ] status in the command line.</p>
<p><strong>Conclusion</strong></p>
<p>This should solve your problem and if you have any comments, suggestions or improvements, please submit them. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/successfully-turning-off-php-safe-mode-removing-open_basedir-restrictions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Getting to grips with PEAR Quickform and Smarty</title>
		<link>http://www.peeledcarrots.com/getting-to-grips-with-pear-quickform-and-smarty/</link>
		<comments>http://www.peeledcarrots.com/getting-to-grips-with-pear-quickform-and-smarty/#comments</comments>
		<pubDate>Thu, 26 Oct 2006 09:41:36 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://soapbox.technovated.com/2006/10/26/getting-to-grips-with-pear-quickform-and-smarty/</guid>
		<description><![CDATA[Over the past few months, we have done a number of projects using the php Smarty package. Smarty is a fantastic templating engine which is quite easy to use and is extremely powerful. It also enforces the distinction between presentation logic and application logic and provides a great deal of flexibility when developing.
On our most [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few months, we have done a number of projects using the <a href="http://www.php.net/">php </a><a href="http://smarty.php.net/">Smarty</a> package. Smarty is a fantastic <a href="http://en.wikipedia.org/wiki/Templating_engine">templating engine</a> which is quite easy to use and is extremely powerful. It also enforces the distinction between presentation logic and application logic and provides a great deal of flexibility when developing.</p>
<p>On our most recent project we decided to try and use the php <a href="http://pear.php.net/">PEAR</a> <a href="http://pear.php.net/package/html_quickform/redirected">Quickform</a> module. This has also proved to be a easy to use, yet powerful form generator and processor.One thing which I think needs improving is that when forms are generated, the <a href="http://en.wikipedia.org/wiki/HTML">HTML</a> templates are table based. I am sure that the developers of this package are trying to implement this feature on later realeases, but the package we are using doesn&#8217;t generate semantically correct HTML forms.</p>
<p>However, to overcome this sticking point, we combined the smarty and quickform packages to produce semantically correct HTML templates, which have validation and processing ability.</p>
<p>The form generation, validation form processing are extremely quick and provide an awesome amount of felxibility when it comes to both presentation and application logic.</p>
<p>It is truly awesome what can be acheived using open source code.<br />
Go php!!! <img src='http://www.peeledcarrots.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>For those of you who are intrested in learning about quickform and smarty-check these links out:</p>
<ul>
<li><a href="http://www.devarticles.com/c/a/Web-Design-Usability/Using-HTML-QuickForm-To-Manage-Web-Forms-Part-1/">Devarticle</a></li>
<li><a href="http://davidmintz.org/presentations/show.php/QuickForm_and_Smarty/">David Mintz</a></li>
<li><a href="http://www.midnighthax.com/quickform.php">Midnighthax</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/getting-to-grips-with-pear-quickform-and-smarty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The value of semantically correct XHTML, without using tables</title>
		<link>http://www.peeledcarrots.com/the-value-of-semantically-correct-xhtml-without-using-tables/</link>
		<comments>http://www.peeledcarrots.com/the-value-of-semantically-correct-xhtml-without-using-tables/#comments</comments>
		<pubDate>Wed, 11 Oct 2006 10:25:57 +0000</pubDate>
		<dc:creator>Stephen Blake</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://soapbox.technovated.com/2006/10/11/the-value-of-semantically-correct-xhtml-without-using-tables/</guid>
		<description><![CDATA[Ok, so I am going to use my revamping of the dating site as another topic for this post. As I identified in the previous post, we have inherited the code from a previous developer and are making improvements to the site.
The previous site was almost completely table based &#8211; yuck!! Dan Cederholm  has [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so I am going to use my revamping of the <a href="http://soapbox.technovated.com/2006/10/09/the-importance-of-good-commenting/">dating site</a> as another topic for this post. As I identified in the <a href="http://soapbox.technovated.com/2006/10/09/the-importance-of-good-commenting/">previous post</a>, we have inherited the code from a previous developer and are making improvements to the site.</p>
<p>The previous site was almost completely table based &#8211; yuck!! <a href="http://www.friendsofed.com/designer.html?isbn=1590593812#231">Dan Cederholm</a>  has a chapter in his book <a href="http://www.friendsofed.com/book.html?isbn=1590593812">Web Standards Solutions</a>,  which is titled &#8220;Tables are evil?&#8221;. Now of course tables should be used when one is displaying tabular data, but in this case there is no tabular data on the site, maybe just some on the administrators CMS.</p>
<p>The &#8220;old&#8221; way of using tables for layouts is just so blotted and messy. Having tables within rows and doing styling within the code and not in the <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS</a>, makes the site soooo difficult to manage and I am already seeing the benefits which the <a href="http://www.w3.org/">W3C</a> have brought to website development.</p>
<p>So, some of the immediate benefits of not using tables, which I have been reminded of are the following:</p>
<ul>
<li>Much less code &#8211; which means smaller files &#8211; which in turn means less space on your web server</li>
<li>Less code means less bandwidth and if you have a site with thousands of hits a day, this will have a huge impact on overall performance.</li>
<li>The ability to access the site with portable devices-mobile phones, PDAs etc.</li>
<li>It&#8217;s much easier to update layouts and styling via the <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS</a> </li>
</ul>
<p>I know that there are still loads of sites out there that are table based and which work perfectly. So I am not saying that it&#8217;s completely wrong to use them. It&#8217;s just that it&#8217;s so much easier not to use tables and there are lots of additional benefits which have become apparent in recent years.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peeledcarrots.com/the-value-of-semantically-correct-xhtml-without-using-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
