<?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>Codelab Blog &#187; Open Source</title>
	<atom:link href="http://blog.codelab.co.nz/category/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codelab.co.nz</link>
	<description>Technical Articles and News from Codelab Ltd</description>
	<lastBuildDate>Tue, 17 Jan 2012 13:10:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A way around page refreshes/back button problems with a simple concept</title>
		<link>http://blog.codelab.co.nz/2010/05/17/a-way-around-page-refreshesback-button-problems-with-a-simple-concept/</link>
		<comments>http://blog.codelab.co.nz/2010/05/17/a-way-around-page-refreshesback-button-problems-with-a-simple-concept/#comments</comments>
		<pubDate>Mon, 17 May 2010 09:58:24 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Coding Practices]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=231</guid>
		<description><![CDATA[The problem: You have a form in which the user fills out and clicks a &#8220;submit&#8221; button that validates their input, does some processing and output&#8217;s some results. The problem being the application needs to cater for page refreshes, back buttons and the case of the page being submitted more than once (latency/slow internet connection). [...]]]></description>
			<content:encoded><![CDATA[<p><em>The problem:</em></p>
<p>You have a form in which the user fills out and clicks a &#8220;submit&#8221; button that validates their input, does some processing and output&#8217;s some results. The problem being the application needs to cater for page refreshes, back buttons and the case of the page being submitted more than once (latency/slow internet connection).</p>
<p><em>The Solution:</em></p>
<p>Possible solutions can be (<em>this assumes not using Ajax as a solution</em>), once the user clicks the submit button the server validates the user&#8217;s input and has processed the information. Store a unique id in session and redirect to a &#8220;complete&#8221; page. If the user clicks the back button and resubmits the page, you can build logic to check if a unique id exists in session and if it does, redirect to the complete page without having to re-process the information.</p>
<p>If the user is on the complete page and refreshes the page, because its on a page which has used a GET, there is no processing done and hence no duplication of data.</p>
<p><strong><em>References:</em></strong></p>
<p><a href="http://en.wikipedia.org/wiki/Post/Redirect/Get">http://en.wikipedia.org/wiki/Post/Redirect/Get</a></p>
<p><a href="http://stackoverflow.com/questions/665399/how-do-i-stop-the-back-and-refresh-buttons-from-resubmitting-my-form">http://stackoverflow.com/questions/665399/how-do-i-stop-the-back-and-refresh-buttons-from-resubmitting-my-form</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/05/17/a-way-around-page-refreshesback-button-problems-with-a-simple-concept/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing Test orders from Magento</title>
		<link>http://blog.codelab.co.nz/2010/03/28/removing-test-orders-from-magento/</link>
		<comments>http://blog.codelab.co.nz/2010/03/28/removing-test-orders-from-magento/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 10:05:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=208</guid>
		<description><![CDATA[If you want to do this manually and not pay (via a extension) then use the following script on your database.   Please make sure you back up your database first, I take no responsibility for the overall result, this script worked for me on version 1.4.0.1: SET FOREIGN_KEY_CHECKS=0; TRUNCATE `sales_order`; TRUNCATE `sales_order_tax`; TRUNCATE `sales_order_datetime`; TRUNCATE [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to do this manually and not pay (via a extension) then use the following script on your database.   Please make sure you back up your database first, I take no responsibility for the overall result, this script worked for me on version 1.4.0.1:</p>
<pre>SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_order`;
TRUNCATE `sales_order_tax`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE `sales_order_entity_varchar`;
TRUNCATE `sales_order_int`;
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_tax` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
TRUNCATE `log_customer`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;
ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
TRUNCATE `eav_entity_store`;
ALTER TABLE  `eav_entity_store` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/03/28/removing-test-orders-from-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>var _gaq undefined &#8211; Magento</title>
		<link>http://blog.codelab.co.nz/2010/03/01/var-_gaq-undefined-magento/</link>
		<comments>http://blog.codelab.co.nz/2010/03/01/var-_gaq-undefined-magento/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 08:21:15 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=197</guid>
		<description><![CDATA[I came across this javascript error when updating a instance of Magento to version 1.4 and Google Analytics &#8220;var _gaq is undefined&#8221; In the ga.php file located under /app/code/core/Mage/GoogleAnalytics/Block add the following line of code before _gaq.push javascript &#8220;var _gaq = _gaq &#124;&#124; [];&#8221; &#8211; about line 179 This will remove the error.   I still [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this javascript error when updating a instance of Magento to version 1.4 and Google Analytics</p>
<p>&#8220;var _gaq is undefined&#8221;</p>
<p>In the ga.php file located under /app/code/core/Mage/GoogleAnalytics/Block add the following line of code before _gaq.push javascript</p>
<blockquote><p>&#8220;var _gaq = _gaq || [];&#8221; &#8211; about line 179</p></blockquote>
<p>This will remove the error.   I still need to test to see if visitor site numbers have been affected.</p>
<p><em><strong>References:</strong></em></p>
<p><a href="http://www.magentocommerce.com/boards/viewthread/68885/">http://www.magentocommerce.com/boards/viewthread/68885/</a></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">http://www.magentocommerce.com/boards/viewthread/68885/&#8221;</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/03/01/var-_gaq-undefined-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>toolbar.phtml -&gt; Magento 1.4 error</title>
		<link>http://blog.codelab.co.nz/2010/02/21/toolbar-phtml-magento-1-4-error/</link>
		<comments>http://blog.codelab.co.nz/2010/02/21/toolbar-phtml-magento-1-4-error/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 09:36:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=191</guid>
		<description><![CDATA[Came across this error in toolbar.phtml for Magento 1.4: Warning: Invalid argument suppplied for foreach() line 51. Fix is available from here (this is only a fix, it doesn&#8217;t solve the problem &#8211; The paging is removed). References: http://www.sonassi.com/knowledge-base/magento-1-4-install-errors/]]></description>
			<content:encoded><![CDATA[<p>Came across this error in toolbar.phtml for Magento 1.4:</p>
<p>Warning: Invalid argument suppplied for foreach() line 51.</p>
<p>Fix is available from <a href="http://www.sonassi.com/knowledge-base/magento-1-4-install-errors/">here </a>(this is only a fix, it doesn&#8217;t solve the problem &#8211; The paging is removed).</p>
<p><em><strong>References:</strong></em></p>
<p><a href="http://www.sonassi.com/knowledge-base/magento-1-4-install-errors/">http://www.sonassi.com/knowledge-base/magento-1-4-install-errors/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/02/21/toolbar-phtml-magento-1-4-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Sales Order Notification in Magento</title>
		<link>http://blog.codelab.co.nz/2010/02/08/enabling-sales-order-notification-in-magento/</link>
		<comments>http://blog.codelab.co.nz/2010/02/08/enabling-sales-order-notification-in-magento/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 20:17:53 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=185</guid>
		<description><![CDATA[Very helpful post there that enables sales order notifications to the shop admin email address.  Dont&#8217;s use the Bcc option System Configuration -&#62; Sales menu, you have to send a copy of the email to another email address. References: http://nik.chankov.net/2009/10/28/adding-notification-when-new-order-arrives-magento/]]></description>
			<content:encoded><![CDATA[<p>Very helpful post there that enables sales order notifications to the shop admin email address.  Dont&#8217;s use the Bcc option System Configuration -&gt; Sales menu, you have to send a copy of the email to another email address.</p>
<p><em><strong>References:</strong></em></p>
<p><a href="http://nik.chankov.net/2009/10/28/adding-notification-when-new-order-arrives-magento/">http://nik.chankov.net/2009/10/28/adding-notification-when-new-order-arrives-magento/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/02/08/enabling-sales-order-notification-in-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluehost wont allow gmail SMTP connections</title>
		<link>http://blog.codelab.co.nz/2010/01/12/bluehost-wont-allow-gmail-smtp-connections/</link>
		<comments>http://blog.codelab.co.nz/2010/01/12/bluehost-wont-allow-gmail-smtp-connections/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 11:24:44 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=166</guid>
		<description><![CDATA[According to bluehost, you cannot send emails through SMTP connections from web applications hosted on bluehost.   They only allow sending through their own SMTP servers. The problem I had was trying to send emails in Magento using GMAIL (Google Apps) using the code from this forum: http://www.magentocommerce.com/boards/viewthread/1073/ The work around is that I setup a [...]]]></description>
			<content:encoded><![CDATA[<p>According to bluehost, you cannot send emails through SMTP connections from web applications hosted on bluehost.   They only allow sending through their own SMTP servers.</p>
<p>The problem I had was trying to send emails in Magento using GMAIL (Google Apps) using the code from this forum:</p>
<p><a href="http://www.magentocommerce.com/boards/viewthread/1073/">http://www.magentocommerce.com/boards/viewthread/1073/</a></p>
<p>The work around is that I setup a email account in Bluehost the same as the email I use in Google Apps.  I then modified the code in Magento to send out using bluehost&#8217;s SMTP servers:</p>
<p>For example:</p>
<p><strong>Outgoing Mail Server: </strong> (SSL) boxnumber.bluehost.com<em> (server requires authentication)</em><br />
<strong>Supported Incoming Mail Protocols:</strong></p>
<ul>
<li>POP3: port 110</li>
<li>POP3S (SSL/TLS): port 995</li>
<li>IMAP: port 143</li>
<li>IMAPS (SSL/TLS): port 993</li>
</ul>
<p><strong>Supported Outgoing Mail Protocols:</strong></p>
<ul>
<li>SMTP: port 26</li>
<li>SMTPS (SSL/TLS): port 465</li>
</ul>
<p>And it works, it sends the email out to the customers with the right email address sent from bluehost&#8217;s local SMTP servers, so when customers reply to the email address it will arrive in my google apps mail box.</p>
<p><em><strong>References:</strong></em></p>
<p><a href="http://drupal.org/node/458044">http://drupal.org/node/458044</a></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
var gaJsHost = ((&#8220;https:&#8221; == document.location.protocol) ? &#8220;https://ssl.&#8221; : &#8220;http://www.&#8221;);<br />
document.write(unescape(&#8220;%3Cscript src=&#8217;&#8221; + gaJsHost + &#8220;google-analytics.com/ga.js&#8217; type=&#8217;text/javascript&#8217;%3E%3C/script%3E&#8221;));<br />
&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
try {<br />
var pageTracker = _gat._getTracker(&#8220;UA-4995672-4&#8243;);<br />
pageTracker._trackPageview();<br />
} catch(err) {}&lt;/script&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/01/12/bluehost-wont-allow-gmail-smtp-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JFactory::getDate() doesn&#8217;t automatically add offset</title>
		<link>http://blog.codelab.co.nz/2009/12/07/jfactorygetdate-doesnt-automatically-add-offset/</link>
		<comments>http://blog.codelab.co.nz/2009/12/07/jfactorygetdate-doesnt-automatically-add-offset/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 09:43:50 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=156</guid>
		<description><![CDATA[By default, calling JFactory::getDate() doesn&#8217;t automatically apply the timezone offset.   The default date/time is GMT. By using the following code, you can set the offset from the global joomla configuration file &#60;?php $thisJApp = &#38;JFactory::getApplication(); $thisJDate = JFactory::getDate(); $thisJDate -&#62;setOffset($thisJApp -&#62;getCfg(&#8216;offset&#8217;)); echo $thisJDate-&#62;toFormat(&#8220;%A %d %b %Y&#8221;); ?&#62; If you want to set the date from [...]]]></description>
			<content:encoded><![CDATA[<p>By default, calling JFactory::getDate() doesn&#8217;t automatically apply the timezone offset.   The default date/time is GMT.</p>
<p>By using the following code, you can set the offset from the global joomla configuration file</p>
<p>&lt;?php<br />
$thisJApp = &amp;JFactory::getApplication();<br />
$thisJDate = JFactory::getDate();<br />
$thisJDate -&gt;setOffset($thisJApp -&gt;getCfg(&#8216;offset&#8217;));<br />
echo $thisJDate-&gt;toFormat(&#8220;%A %d %b %Y&#8221;);<br />
?&gt;</p>
<p>If you want to set the date from a logged in user you can try:</p>
<p>&lt;%</p>
<p>$JUser =&amp; JFactory::getUser();<br />
$JDate = JFactory::getDate();<br />
echo $JDate-&gt;toFormat().&#8217;&lt;br&gt;&#8217;;<br />
echo &#8216;offset=&#8217; . $JDate-&gt;getOffset() . &#8216;&lt;br&gt;&#8217;;<br />
$JDate-&gt;setOffset($JUser-&gt;getParam(&#8216;timezone&#8217;));</p>
<p>%&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2009/12/07/jfactorygetdate-doesnt-automatically-add-offset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocking IP Addresses on Linux Server</title>
		<link>http://blog.codelab.co.nz/2009/11/04/blocking-ip-addresses-on-linux-server/</link>
		<comments>http://blog.codelab.co.nz/2009/11/04/blocking-ip-addresses-on-linux-server/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 07:57:17 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=144</guid>
		<description><![CDATA[Had some suspect IP addresses trying to attempt to login via the admin user in Moodle. Best thing to do is block the IP address to the server or even better the IP range (after doing a IP lookup to see where the IP address came from). References: http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/]]></description>
			<content:encoded><![CDATA[<p>Had some suspect IP addresses trying to attempt to login via the admin user in Moodle.   Best thing to do is block the IP address to the server or even better the IP range (after doing a IP lookup to see where the IP address came from).</p>
<p><strong><em>References: </em></strong></p>
<p><a href="http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/">http://www.cyberciti.biz/faq/how-do-i-block-an-ip-on-my-linux-server/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2009/11/04/blocking-ip-addresses-on-linux-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SimplePie Joomla Proxy Issue</title>
		<link>http://blog.codelab.co.nz/2009/06/19/simplepie-joomla-proxy-issue/</link>
		<comments>http://blog.codelab.co.nz/2009/06/19/simplepie-joomla-proxy-issue/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 00:43:50 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Joomla]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=133</guid>
		<description><![CDATA[The issue I had with a particular joomla site is that I could not load external RSS feeds.   The error was &#8220;Could not connect to {server}&#8221;.   RSS Feed load failed.   This was caused in the SimplePie.php class around line 6601. Steps to resolve: I enabled the cUrl extension in php.ini (running on a IIS platform) [...]]]></description>
			<content:encoded><![CDATA[<p>The issue I had with a particular joomla site is that I could not load external RSS feeds.   The error was &#8220;Could not connect to {server}&#8221;.   RSS Feed load failed.   This was caused in the SimplePie.php class around line 6601.</p>
<p>Steps to resolve:</p>
<p>I enabled the cUrl extension in php.ini (running on a IIS platform)</p>
<p>Changed the code around line 6536:</p>
<p>curl_setopt($fp, CURLOPT_PROXY, $ip);<br />
curl_setopt($fp, CURLOPT_PROXYPORT, $port);<br />
curl_setopt($fp, CURLOPT_PROXYUSERPWD, $login . &#8216;:&#8217; . $passwd);</p>
<p>where $ip is the proxy IP Address, $port is the port and $login:$password is the proxy authentication.</p>
<p>After this, I can load in external RSS feeds! YAY</p>
<p><em><strong>References:</strong></em></p>
<p><a href="http://www.phpdig.net/ref/rn11re189.html">http://www.phpdig.net/ref/rn11re189.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2009/06/19/simplepie-joomla-proxy-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limiting the number of text in textarea using JQuery</title>
		<link>http://blog.codelab.co.nz/2009/05/20/limiting-the-number-of-text-in-textarea-using-jquery/</link>
		<comments>http://blog.codelab.co.nz/2009/05/20/limiting-the-number-of-text-in-textarea-using-jquery/#comments</comments>
		<pubDate>Wed, 20 May 2009 01:51:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[JQuery]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=131</guid>
		<description><![CDATA[example: &#60;textarea id=&#8221;id&#8221; maxlength=&#8221;255&#8243;&#62;&#60;/textarea&#62; jQuery(&#8216;textarea[maxlength]&#8216;).keyup(function() { var max = parseInt(jQuery(this).attr(&#8216;maxlength&#8217;)); if (jQuery(this).val().length &#62; max) { jQuery(this).val(jQuery(this).val().substr(0, jQuery(this).attr(&#8216;maxlength&#8217;))); } if (jQuery(this).parent().find(&#8216;.charsRemaining&#8217;).length &#62; 0) jQuery(this).parent().find(&#8216;.charsRemaining&#8217;).html(&#8216;You have &#8216; + (max &#8211; jQuery(this).val().length) + &#8216; characters remaining&#8217;); else jQuery(this).parent().append(&#8216;&#60;div class=&#8221;charsRemaining&#8221;&#62;You have &#8216; + (max &#8211; jQuery(this).val().length) + &#8216; characters remaining&#60;/div&#62;&#8217;); });]]></description>
			<content:encoded><![CDATA[<p>example: &lt;textarea id=&#8221;id&#8221; maxlength=&#8221;255&#8243;&gt;&lt;/textarea&gt;</p>
<p>jQuery(&#8216;textarea[maxlength]&#8216;).keyup(function() {<br />
var max = parseInt(jQuery(this).attr(&#8216;maxlength&#8217;));<br />
if (jQuery(this).val().length &gt; max) {<br />
jQuery(this).val(jQuery(this).val().substr(0, jQuery(this).attr(&#8216;maxlength&#8217;)));<br />
}<br />
if (jQuery(this).parent().find(&#8216;.charsRemaining&#8217;).length &gt; 0) jQuery(this).parent().find(&#8216;.charsRemaining&#8217;).html(&#8216;You have &#8216; + (max &#8211; jQuery(this).val().length) + &#8216; characters remaining&#8217;);<br />
else jQuery(this).parent().append(&#8216;&lt;div class=&#8221;charsRemaining&#8221;&gt;You have &#8216; + (max &#8211; jQuery(this).val().length) + &#8216; characters remaining&lt;/div&gt;&#8217;);</p>
<p>});</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2009/05/20/limiting-the-number-of-text-in-textarea-using-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

