<?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>frankly at a glance. &#187; Development</title>
	<atom:link href="http://frankleng.me/category/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://frankleng.me</link>
	<description>the world according to Frank...</description>
	<lastBuildDate>Thu, 17 May 2012 21:07:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Drupal Tip: Lightbox pop-up on page load</title>
		<link>http://frankleng.me/2010/07/21/drupal-tip-lightbox-pop-up-on-page-load/</link>
		<comments>http://frankleng.me/2010/07/21/drupal-tip-lightbox-pop-up-on-page-load/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 21:22:58 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Me]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://frankleng.me/?p=345</guid>
		<description><![CDATA[Just like I was, a lot people have been seeking around the web for an easy way of invoking a lightbox as a page loads. Examples including http://www.bram.us/demo/projects/autofirelightbox/ uses javascript to trigger the lightbox. However, scripts like this one does not work with Drupal&#8217;s Lightbox 2 module. Here is what I used to accomplish this [...]]]></description>
			<content:encoded><![CDATA[<p>Just like I was, a lot people have been seeking around the web for an easy way of invoking a lightbox as a page loads.</p>
<p>Examples including <a href="http://www.bram.us/demo/projects/_autofirelightbox/" target="_blank">http://www.bram.us/demo/projects/autofirelightbox/</a> uses javascript to trigger the lightbox. However, scripts like this one does not work with Drupal&#8217;s Lightbox 2 module.</p>
<p>Here is what I used to accomplish this in Drupal, by using  JQuery&#8217;s triggerHandler function to invoke the click. Hope this will help others who need an auto lightbox pop-up.</p>
<p><span id="more-345"></span></p>
<pre>&lt;a rel="<strong>lightframe</strong>" href="" id="<strong>link</strong>"&gt;&lt;/a&gt;</pre>
<pre>&lt;script type="text/javascript"&gt;
   $(document).ready(function () {
     $('<strong>#link</strong>').triggerHandler("click");
   });
&lt;/script&gt;</pre>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2010%2F07%2F21%2Fdrupal-tip-lightbox-pop-up-on-page-load%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2010/07/21/drupal-tip-lightbox-pop-up-on-page-load/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2010/07/21/drupal-tip-lightbox-pop-up-on-page-load/"  data-text="Drupal Tip: Lightbox pop-up on page load" data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2010/07/21/drupal-tip-lightbox-pop-up-on-page-load/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=345&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2010/07/21/drupal-tip-lightbox-pop-up-on-page-load/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Drupal and its serious e-commerce muscle</title>
		<link>http://frankleng.me/2010/06/16/drupal-and-its-serious-e-commerce-muscle/</link>
		<comments>http://frankleng.me/2010/06/16/drupal-and-its-serious-e-commerce-muscle/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 23:19:19 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://frankleng.me/?p=330</guid>
		<description><![CDATA[It has been about a month since my last post, but the site is getting some real nice traffic since the posts about my &#8220;Drobo Alternative&#8220;. So thank you all for the support. I&#8217;ve been working my rear off these days&#8230; apart from my day job I am working on two other sites. Both are [...]]]></description>
			<content:encoded><![CDATA[<p>It has been about a month since my last post, but the site is getting some real nice traffic since the posts about my &#8220;<a href="http://frankleng.me/2010/05/01/zfs-powered-nas-the-ultimate-alternative-to-drobo-droboshare-the-complete-guide/">Drobo Alternative</a>&#8220;. So thank you all for the support.</p>
<p>I&#8217;ve been working my rear off these days&#8230; apart from my day job I am working on two other sites. Both are e-commerce oriented sites based on Drupal.<br />
While Drupal may not be particularly popular among e-commerce ventures, I am here to tell you that it has some serious e-com muscle and potential.</p>
<p>The particular module is called <a href="http://drupal.org/project/ubercart">Ubercart</a>. It is a full featured e-commerce Drupal module that handles the <img class="alignright" title="Ubercart" src="http://drupal.org/files/images/logo.png" alt="" width="208" height="124" />frontend store, as well as inventory and payment processing. What is even more important is that since this is a Drupal module, it can take advantage of the various existing Drupal modules to function. Thus, allowing the developers to make Ubercart great at what it does.</p>
<p>The folks over at <a href="http://www.topnotchthemes.com/">TopNotchThemes </a>developed an amazing sample theme that supports Ubercart out of the box. This is the <a href="http://drupal.org/project/acquia_prosper">Acquia Prosper</a>. I use as a foundation for all of my Drupal e-commerce projects. It is built on the Fusion themeing framework and highly customizable.</p>
<p>All you need to do is download and install these on your box&#8230; hook it up with a PayPal account and you are good to go.</p>
<p>Coming from OScommerce, developing on Drupal is much more organized as long as you stay within the scope of the Drupal API. The API is comprehensive but it is quite the beast to master. It is nothing like writing your normal PHP app, and it makes you feel like you are developing in another language.</p>
<p>Having said that, Drupal + Ubercart is years ahead of OScommerce in every way. I love the modular design that makes Drupal what it is, and the enormous dev support i has behind it.</p>
<p>I&#8217;m going to try and write my magazine subscription app as a Ubercart add-on this summer.</p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2010%2F06%2F16%2Fdrupal-and-its-serious-e-commerce-muscle%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2010/06/16/drupal-and-its-serious-e-commerce-muscle/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2010/06/16/drupal-and-its-serious-e-commerce-muscle/"  data-text="Drupal and its serious e-commerce muscle" data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2010/06/16/drupal-and-its-serious-e-commerce-muscle/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=330&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2010/06/16/drupal-and-its-serious-e-commerce-muscle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress asks for connection info during upgrade.</title>
		<link>http://frankleng.me/2010/02/21/wordpress-asks-for-connection-info-during-upgrade/</link>
		<comments>http://frankleng.me/2010/02/21/wordpress-asks-for-connection-info-during-upgrade/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 20:35:18 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://frankleng.me/?p=167</guid>
		<description><![CDATA[After migrating all of my sites to the VPS, I noticed WP auto upgrade asks me for FTP login every time I upgrade a plugin. I was a bit puzzled at first because I have never seen that before, and the upgrade process is dramatically slower this way. After googling, I realized that all the [...]]]></description>
			<content:encoded><![CDATA[<p>After migrating all of my sites to the VPS, I noticed WP auto upgrade asks me for FTP login every time I upgrade a plugin.</p>
<p>I was a bit puzzled at first because I have never seen that before, and the upgrade process is dramatically slower this way.</p>
<p>After googling, I realized that all the WP files are now owned by my webroot account and apache no longer has exclusive access to them.</p>
<p>the simple fix was to give apache ownership of the WordPress directory.</p>
<h2><strong>#: chown -R   apache-user: wordpressRoot</strong></h2>
<p><strong><span id="more-167"></span></strong></p>
<p><strong><em>This does pose a potential security risk. However, this already exists on every WP site that has auto upgrade working. Most shared hosts will run the apache instance under your username so you don&#8217;t see this problem.</em></strong></p>
<p><strong><em>If you are concerned about security, I would suggest you leave the permissions as they are&#8230; or use <a href="http://drupal.org">Drupal</a>. =p</em></strong></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2010%2F02%2F21%2Fwordpress-asks-for-connection-info-during-upgrade%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2010/02/21/wordpress-asks-for-connection-info-during-upgrade/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2010/02/21/wordpress-asks-for-connection-info-during-upgrade/"  data-text="WordPress asks for connection info during upgrade." data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2010/02/21/wordpress-asks-for-connection-info-during-upgrade/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=167&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2010/02/21/wordpress-asks-for-connection-info-during-upgrade/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>finding the perfect Virtual Private Server (VPS)</title>
		<link>http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/</link>
		<comments>http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 05:45:08 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/</guid>
		<description><![CDATA[I&#8217;ve been searching for a cheap VPS for some of the projects I&#8217;m working on. I needed an affordable plan&#8230; (by that I mean CHEAP! &#60;$20) with great stability and reasonable support. This sounds almost impossible to pull off&#8230; even in today&#8217;s world. Most popular shared plans cost more than $20&#8230; But wait, introducing Unmanaged [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been searching for a cheap VPS for some of the projects I&#8217;m working on. I needed an affordable plan&#8230; (by that I mean CHEAP! &lt;$20)  with great stability and reasonable support.</p>
<p>This sounds almost impossible to pull off&#8230; even in today&#8217;s world. Most popular shared plans cost more than $20&#8230;</p>
<p>But wait, introducing <strong>Unmanaged VPS service.</strong></p>
<p>An unmanaged VPS is basically an empty VPS space with a metred uplink. The hosting companies will not install ANY software for you&#8230; no Apache, no MySQL&#8230; no PHP. You must do all the work yourself. Their job is keeping the physical servers and their uplinks online. (Previously I worked remotely for a web hosting firm&#8230; so I know a fair bit about keeping things running.)</p>
<p>Before choosing a hosting company, you must understand some of the terminologies used to value VPS packages.</p>
<p><strong>CPU Speed/Limit:</strong> some hosts will give you an estimate of CPU in megahertz; obviously the higher number the faster. However, as a user you do not really have any practical way of measuring performance by looking these numbers&#8230; so I wouldn&#8217;t worry too much about it. Other hosts will specify if multiple CPU instances are allowed on the VPS to create a virtual multi-core space. These options are probably very expensive. Choose wisely according to your budget.</p>
<p><strong>RAM:</strong> like the RAM in your computer, RAM on your VPS will be a great limiting factor of performance. The OS, Apache, MySQL, PHP instances all require quite a bit of RAM to run. I would say that 128MB is the absolute minimum you should have. I would recommend getting at least 256MB&#8230; because after I installed everything on my VPS&#8230; it was eating up more than 200mb while idling. I seriously would not recommend running production sites on a 128MB VPS.</p>
<p><strong>Burst RAM: </strong>since resources on the physical server are still shared among multiple users, each VPS instance will have a guaranteed RAM size and a <em>burst </em>or <em>peak</em> size. The <em>burst</em> RAM specifies the maximum amount of RAM the VPS is allowed to allocate should the resources be available. You will see companies advertise their plans as 512MB RAM/1024MB Burst. This indicates that your VPS will get 512MB in any situation, and it is allowed to go up to 1024MB or 1GB when it is under load and the other VPS spaces on your server can spare you a few MB of RAM.</p>
<p><span id="more-98"></span></p>
<p><strong>Bandwidth: </strong>no explanation needed here. definitely more the better. Most hosts will offer you quite a bit of bandwidth. A few hundred GBs will do for small to medium sites.</p>
<p><strong>IP: </strong>each VPS should be accompanied by its own IP address. usually this is included in the initial process of setting up your account. You may also ask for more IPs at your expense.</p>
<p><strong>Control Panels:</strong> Unmanaged VPSs do not include goodies like cPanel, which is slightly annoying at times. However, I&#8217;m a guy that grew up on Webmin &#8211; an open source, generic remote management application. I will be posting a guide on how to set up Webmin as your control panel and perform some of the tasks you do in cPanel. No big deal! However, if you really need cPanel, you can licensing it at about $10/month extra.</p>
<p><strong>Virtual Machine:</strong> I do not know a lot about virtualization to create VPS spaces&#8230; However I can tell you that most people favour Xen machines because it is impossible for the host to oversell the server. When you have Xen, what you see is really what you get. OpenVZ and HyperVM are usually geared toward low-end VPS spaces where servers are packed with clients, and they offer very limited admin interfaces. So go with Xen if the price is within your budget, otherwise try to look for OpenVZ&#8230; HyperVM is the worst as reported by other users.</p>
<p>After reading some reviews and getting some recommendations from friends. I nailed my choices to:</p>
<p><a href="http://linode.com">linode.com</a> &#8211; Genuine Xen powered VPS spaces, not oversold, awesome admin features, quad-core CPU instances.<br />
<a href="http://intovps.com">intovps.com</a> &#8211; OpenVZ powered, very cheap.<br />
<a href="http://fsckvps.com ">fsckvps.com </a>- both OpenVZ and Xen spaces. fairly cheap.</p>
<p>However, after reading encouraging reviews and seeing some very pretty benchmarks on <a href="http://webhostingtalk.com">webhostingtalk.com</a>&#8230;<br />
I was introduced to this particular host &#8211; <strong><a href="http://ramhost.us">ramhost.us</a></strong><br />
They are a new and small company, but the feedback on the forums are surprisingly positive and their prices are VERY competitive!</p>
<p>I went with their 40GB, 512MB RAM + 1GB Burst with 500GB uplink package for $11.99/mo. The server is SUPER fast! low latency! and their support is simply amazing! Someone will respond to your request in minutes, and the support person goes out of his way to help customers.</p>
<p>Right now I&#8217;m in the process of transferring my sites from this shared server to my shiny new VPS.<br />
At this price, I will certainly choose VPS over shared hosting from now on!</p>
<p>I will be posting guides soon on this blog to teach everyone how to setup a CentOS 5 powered VPS from scratch!</p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2009%2F10%2F07%2Ffinding-the-perfect-virtual-private-server-vps%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/"  data-text="finding the perfect Virtual Private Server (VPS)" data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=98&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2009/10/07/finding-the-perfect-virtual-private-server-vps/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>installing APC &amp; uploadprogress on CentOS 5 [updated]</title>
		<link>http://frankleng.me/2009/08/25/installing-apc-on-centos-5/</link>
		<comments>http://frankleng.me/2009/08/25/installing-apc-on-centos-5/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 08:35:04 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://frankleng.me/2009/08/25/installing-apc-on-centos-5/</guid>
		<description><![CDATA[First, we need the pecl command so we can download and install APC from the repositories. I use the &#8220;remi&#8221; repo to give me the latest packages, so use &#8220;&#8211;enablerepo=remi&#8221; if you have it installed. yum install php-pear But, this will not run on its own, we need the following package for the phpize command: [...]]]></description>
			<content:encoded><![CDATA[<p>First, we need the pecl command so we can download and install APC from the repositories. I use the &#8220;remi&#8221; repo to give me the latest packages, so use &#8220;&#8211;enablerepo=remi&#8221; if you have it installed.</p>
<p><strong>yum install php-pear</strong><br />
But, this will not run on its own, we need the following package for the phpize command:</p>
<p><strong>yum install php-devel</strong><br />
We also need the apxs command, which is installed via the following package:</p>
<p><strong>yum install httpd-devel</strong><br />
Now we have all the software we need, so we install apc via the pecl command:</p>
<p><strong>pecl install apc</strong></p>
<p>I also recommend installing <strong>uploadprogress</strong>, because Drupal 6 will ask you to do so.</p>
<p><strong>pecl install uploadprogress</strong></p>
<p>Now we have to enable <strong>apc </strong>and <strong>uploadprogress </strong>in php.ini.</p>
<p>Add the following lines to /etc/php.ini or wherever your php config file is located.</p>
<p><strong>extension=apc.so</strong></p>
<p><strong>extension=uploadprogress.so<br />
</strong></p>
<p>Then we restart Apache:</p>
<p><strong>/etc/init.d/httpd start</strong><br />
And we are all done. Watch for less execution time per page, and decreased memory usage per Apache process compared to what you had<br />
before.</p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2009%2F08%2F25%2Finstalling-apc-on-centos-5%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2009/08/25/installing-apc-on-centos-5/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2009/08/25/installing-apc-on-centos-5/"  data-text="installing APC &#038; uploadprogress on CentOS 5 [updated]" data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2009/08/25/installing-apc-on-centos-5/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=79&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2009/08/25/installing-apc-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>include PHP inside custom Drupal modules</title>
		<link>http://frankleng.me/2009/08/08/include-php-inside-custom-drupal-modules/</link>
		<comments>http://frankleng.me/2009/08/08/include-php-inside-custom-drupal-modules/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 07:38:34 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://frankleng.me/?p=51</guid>
		<description><![CDATA[In an attempt to make my sites more dynamic and easier to manage, I use PHP includes quite extensively. I like the idea of make a change in a single file and have it propagated to other sections of the site that call upon it. However, when you want to have multiple custom modules in [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-53 alignleft" title="Drupal" src="http://frankleng.me/wp-content/uploads/2009/08/druplicon.large-262x300.png?9d7bd4" alt="Drupal" width="157" height="180" /></p>
<p>In an attempt to make my sites more dynamic and easier to manage, I use PHP includes quite extensively. I like the idea of make a change in a single file and have it propagated to other sections of the site that call upon it.</p>
<p>However, when you want to have multiple custom modules in Drupal to include PHP&#8230; it gets tricky. Depending on how your modules are written, <strong>it is usually not within the same scope as the Drupal core&#8230; therefore your variables should be global if you want to call them throughout the site.</strong></p>
<p>Secondly,</p>
<p><strong>include_once() </strong>and  <strong>require_once()</strong> do not work so well in these situations.</p>
<p>I&#8217;ll give you an example. I have written a very large and complex custom theme for a client with ecommerce needs. I&#8217;m including a file called <em>sales_price.inc.php</em> that defines a bunch of variables for my ecommerce module. This file has been included in numerous modules with <strong>include_once()</strong>.</p>
<p>I&#8217;m also using a module called <strong><a href="http://drupal.org/project/node_content_themehook">node_content themehook</a><strong> </strong></strong>to theme only on a node level.</p>
<p>When I try to include in my <em>node_content</em> templates using the *_once() functions&#8230; Drupal thinks the file has been included once even when it has not. This problem is not specific to the node_content module. When you have multiple modules calling the same file&#8230; using <strong>*_once() </strong>is not reliable at all.</p>
<p>The solution&#8230;? simple as hell.  Use <strong>include() </strong>and  <strong>require().</strong></p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2009%2F08%2F08%2Finclude-php-inside-custom-drupal-modules%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2009/08/08/include-php-inside-custom-drupal-modules/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2009/08/08/include-php-inside-custom-drupal-modules/"  data-text="include PHP inside custom Drupal modules" data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2009/08/08/include-php-inside-custom-drupal-modules/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=51&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2009/08/08/include-php-inside-custom-drupal-modules/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New projects&#8230;</title>
		<link>http://frankleng.me/2009/08/01/new-projects/</link>
		<comments>http://frankleng.me/2009/08/01/new-projects/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 23:20:55 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[ubercart]]></category>
		<category><![CDATA[zinio]]></category>

		<guid isPermaLink="false">http://frankleng.me/?p=39</guid>
		<description><![CDATA[busy busy busy&#8230; Got another Drupal project booked&#8230; this time I&#8217;ll be using UberCart instead of OsCommerce. UberCart is a native Drupal module that offers comprehensive e-commerce features to the platform. UberCart does require some effort to configure and it really doesn&#8217;t work straight out of the box (unlike OsCommerce) but it takes full advantage [...]]]></description>
			<content:encoded><![CDATA[<p>busy busy busy&#8230;</p>
<p>Got another Drupal project booked&#8230; this time I&#8217;ll be using <a href="http://www.ubercart.org/" target="_blank">UberCart </a>instead of OsCommerce. UberCart is a native Drupal module that offers comprehensive e-commerce features to the platform. UberCart does require some effort to configure and it really doesn&#8217;t work straight out of the box (unlike OsCommerce) but it takes full advantage of all the common Drupal goodies &#8211; CCK, View, taxonomy&#8230; Check back for more updates, and I&#8217;ll be posting my codes as the project moves on.</p>
<p>Previous employer (<a href="http://alternativesjournal.ca">Alternatives Journal</a>) is teaming up with Magazine Canada and Zinio.com to offer digital magazines. This will probably make my custom OsCommerce platform obsolete&#8230; but it&#8217;ll be interesting to learn how Zinio operates. Zinio is giving these magazines a very sweet deal and I was surprised to learn that most of their services are free (for the duration of the contract &#8211; 2 years).</p>
<p>I got the feel that they are trying to suck in as many clients as possible by offering free incentives to publishers and customers. However, a glance at their UI left me with much to desire. I didn&#8217;t see any innovative features at all&#8230; at the end it just felt like another Flashpaper viewer with embedded PDFs. When compared to more polished services like  <a href="http://issuu.com">issuu.com</a>,  Zinio has some work to do.</p>
<p>I still haven&#8217;t seen any paperwork from Zinio, but the challenge will be to mesh our existing e-commerce effort with their system. Customer databases need to be synced&#8230; financial reports need to be combined and analyzed&#8230;. all the fun stuff.  Expect more updates.</p>
<p>Take a look at the site I built for Alternatives Journal &#8211; <a href="http://alternativesjournal.ca">http://www.alternativesjournal.ca</a> (Drupal site)</p>
<div class="bottomcontainerBox" style="">
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffrankleng.me%2F2009%2F08%2F01%2Fnew-projects%2F&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:21px;"></iframe></div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://frankleng.me/2009/08/01/new-projects/"></g:plusone>
			</div>
			<div style="float:left; width:100px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://frankleng.me/2009/08/01/new-projects/"  data-text="New projects&#8230;" data-count="horizontal" data-via="frankleng"></a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://frankleng.me/2009/08/01/new-projects/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><img src="http://frankleng.me/?ak_action=api_record_view&id=39&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://frankleng.me/2009/08/01/new-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced
Database Caching 58/63 queries in 0.101 seconds using disk: basic
Object Caching 1220/1334 objects using apc

Served from: frankleng.me @ 2012-05-19 01:42:46 -->
