<?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>&#60;? Life in Code ?&#62;</title>
	<atom:link href="http://blog.erwinsetiawan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.erwinsetiawan.com</link>
	<description></description>
	<lastBuildDate>Sat, 01 May 2010 16:03:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create Simple Captcha on Code Igniter</title>
		<link>http://blog.erwinsetiawan.com/2010/05/01/create-simple-captcha-on-code-igniter/</link>
		<comments>http://blog.erwinsetiawan.com/2010/05/01/create-simple-captcha-on-code-igniter/#comments</comments>
		<pubDate>Sat, 01 May 2010 16:03:07 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Code Igniter]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=197</guid>
		<description><![CDATA[
			
				
			
		
Hello, there.. In this post, I would like to explain how to create simple captcha in Code Igniter. Basic on this captcha is generate random code, save it to session, and check post code with session. If the post code is match then return TRUE and vice versa.
First create validation function on your form controller.
 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F05%2F01%2Fcreate-simple-captcha-on-code-igniter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F05%2F01%2Fcreate-simple-captcha-on-code-igniter%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello, there.. In this post, I would like to explain how to create simple captcha in Code Igniter. Basic on this captcha is generate random code, save it to session, and check post code with session. If the post code is match then return TRUE and vice versa.</p>
<p>First create validation function on your form controller.</p>
<p><span style="white-space: pre;"> </span>function captcha_check($str)</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>//check captcha</p>
<p><span style="white-space: pre;"> </span>$get_false=FALSE;</p>
<p><span style="white-space: pre;"> </span>if (strtolower(trim($this-&gt;session-&gt;userdata(&#8220;captcha&#8221;)))!=strtolower(trim($str)))</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>$get_false = TRUE;</p>
<p><span style="white-space: pre;"> </span>$this-&gt;form_validation-&gt;set_message(&#8216;captcha_check&#8217;, &#8216;Wrong code, please type again!&#8217;.$this-&gt;session-&gt;userdata(&#8220;captcha&#8221;));</p>
<p><span style="white-space: pre;"> </span>return FALSE;</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>if ($get_false==FALSE)</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>return TRUE;</p>
<p><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>}</p>
<div>Then set you form captcha validation and put callback_captcha_check on validation rules.</div>
<div id="_mcePaste">//form validation</div>
<div>$config = array(</div>
<div id="_mcePaste">array(</div>
<div id="_mcePaste">&#8216;field&#8217;		=&gt; &#8216;captcha&#8217;,</div>
<div id="_mcePaste">&#8216;label&#8217;		=&gt; &#8216;Captcha&#8217;,</div>
<div id="_mcePaste">&#8216;rules&#8217;		=&gt; &#8216;trim|required|callback_captcha_check&#8217;</div>
<div id="_mcePaste">)</div>
<div id="_mcePaste">);</div>
<div id="_mcePaste">$this-&gt;form_validation-&gt;set_rules($config);</div>
<div></div>
<div>Next create random string on your view and save it into session.</div>
<div></div>
<div>
<div>&lt;?php   $listAlpha = &#8216;abcdefghijklmnopqrstuvwxyz0123456789&#8242;;</div>
<div><span style="white-space: pre;"> </span>$numAlpha=6;</div>
<div><span style="white-space: pre;"> </span>$captcha=substr(str_shuffle($listAlpha),0,$numAlpha);</div>
<div><span style="white-space: pre;"> </span>$code_captcha = array(</div>
<div><span style="white-space: pre;"> </span>&#8216;captcha&#8217;<span style="white-space: pre;"> </span>=&gt; $captcha,</div>
<div><span style="white-space: pre;"> </span>);</div>
<div><span style="white-space: pre;"> </span>$this-&gt;session-&gt;set_userdata($code_captcha);</div>
<div>?&gt;</div>
</div>
<div></div>
<div>The show the random string into your form and let user type the code on input form.</div>
<div></div>
<div></div>
<div></div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/05/01/create-simple-captcha-on-code-igniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>moURL Wordpress Plugin on Wordpress Repository</title>
		<link>http://blog.erwinsetiawan.com/2010/03/11/mourl-wordpress-plugin-on-wordpress-repository/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/11/mourl-wordpress-plugin-on-wordpress-repository/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 08:50:36 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=188</guid>
		<description><![CDATA[
			
				
			
		
I have Wordpress plugin for moURL my shorten application and submitted by Wordpress on view days ago. But now I don&#8217;t know how to add my plugin to Wordpress Plugin repository. I really don&#8217;t know about svn and repository on opensource project. This is my first time and I&#8217;ll try it. I read some tutorial [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F11%2Fmourl-wordpress-plugin-on-wordpress-repository%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F11%2Fmourl-wordpress-plugin-on-wordpress-repository%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I have Wordpress plugin for moURL my shorten application and submitted by Wordpress on view days ago. But now I don&#8217;t know how to add my plugin to Wordpress Plugin repository. I really don&#8217;t know about svn and repository on opensource project. This is my first time and I&#8217;ll try it. I read some tutorial on Wordpress.org but didn&#8217;t found yet the solution. Then I get some tutorial from <a title="Diggin Into Wordpress" href="http://digwp.com/2010/03/add-plugin-to-wordpress-plugin-repository/" target="_blank">Diggin Into Wordpress</a> and wow it&#8217;s working.</p>
<p><img class="alignnone" title="Wordpress plugin" src="http://img709.imageshack.us/img709/7074/screenshot20100311at349.png" alt="" width="512" height="219" /><span id="more-188"></span></p>
<p><img class="alignnone" title="Newest" src="http://img203.imageshack.us/img203/2538/screenshot20100311at353.png" alt="" width="512" height="233" /></p>
<p>Now you can get my moURL Wordpress plugin from <a title="moURL plugin" href="http://wordpress.org/extend/plugins/mourl/" target="_blank">http://wordpress.org/extend/plugins/mourl/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/11/mourl-wordpress-plugin-on-wordpress-repository/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Huawei e160 on Mac OS Snow Leopard</title>
		<link>http://blog.erwinsetiawan.com/2010/03/08/huawei-e160-on-mac-os-snow-leopard/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/08/huawei-e160-on-mac-os-snow-leopard/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 15:53:00 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=184</guid>
		<description><![CDATA[
			
				
			
		
On this post, I want to share how to connect internet trough Huawei Modem installed on your Mac Os. First, I bought Huawei Modem and I can&#8217;t get Mac OS driver on package. So I must search driver trough internet. Download this driver on http://www.ziddu.com/download/8877516/HuaweiDataCardDriver.zip.html. Instal the driver till finish.
Then put your Huawei e160 modem [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F08%2Fhuawei-e160-on-mac-os-snow-leopard%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F08%2Fhuawei-e160-on-mac-os-snow-leopard%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>On this post, I want to share how to connect internet trough Huawei Modem installed on your Mac Os. First, I bought Huawei Modem and I can&#8217;t get Mac OS driver on package. So I must search driver trough internet. Download this driver on <a href="http://www.ziddu.com/download/8877516/HuaweiDataCardDriver.zip.html" target="_blank">http://www.ziddu.com/download/8877516/HuaweiDataCardDriver.zip.html</a>. Instal the driver till finish.</p>
<p>Then put your Huawei e160 modem to USB port. Go to the System Preference&gt;&gt;Network Preference and create new connection.<span id="more-184"></span></p>
<p><img class="alignnone" title="Choose Huawei" src="http://img704.imageshack.us/img704/1286/screenshot20100308at103.png" alt="" width="512" height="445" /></p>
<p>Choose on Huawei Mobile interface. Then type your service name. It&#8217;s up to you.</p>
<p><img class="alignnone" title="Choose Huawei" src="http://img408.imageshack.us/img408/1286/screenshot20100308at103.png" alt="" width="474" height="471" /></p>
<p>I used my local operator XLUnlimited to powered my internet connection. So I must set setting for XL operator. Then some setting on advance.</p>
<p><img class="alignnone" title="Advance Setting" src="http://img696.imageshack.us/img696/5184/screenshot20100308at104.png" alt="" width="512" height="438" /></p>
<p>Oke. Then try to connect it.</p>
<p><img class="alignnone" title="Success" src="http://img532.imageshack.us/img532/2668/screenshot20100308at105.png" alt="" width="512" height="445" /></p>
<p>If you see like the picture above. It&#8217;s mean your internet connection is successfully.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/08/huawei-e160-on-mac-os-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallel Dekstop Ubuntu 9.10 on Mac OS 10.6.2</title>
		<link>http://blog.erwinsetiawan.com/2010/03/04/parallel-dekstop-ubuntu-9-10-on-mac-os-10-6-2/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/04/parallel-dekstop-ubuntu-9-10-on-mac-os-10-6-2/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 18:31:28 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Mac OS]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=180</guid>
		<description><![CDATA[
			
				
			
		
Today, I try to install parallel dekstop Ubuntu on Mac OS. First time you must have VMWare Fusion 3 installed on your Mac OS. You can get it on https://www.vmware.com/tryvmware/?p=vmware-fusion&#38;lp=1 (this is trial version, you must registered to download this application).  Then you must have Ubuntu 9.10 installation CD or image. You can download on [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F04%2Fparallel-dekstop-ubuntu-9-10-on-mac-os-10-6-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F04%2Fparallel-dekstop-ubuntu-9-10-on-mac-os-10-6-2%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Today, I try to install parallel dekstop Ubuntu on Mac OS. First time you must have VMWare Fusion 3 installed on your Mac OS. You can get it on <a title="VMWare" href="https://www.vmware.com/tryvmware/?p=vmware-fusion&amp;lp=1" target="_blank">https://www.vmware.com/tryvmware/?p=vmware-fusion&amp;lp=1</a> (this is trial version, you must registered to download this application).  Then you must have Ubuntu 9.10 installation CD or image. You can download on this site <a title="Ubuntu" href="http://ubuntu.com" target="_blank">http://ubuntu.com</a>. Choose the server on your country and download Ubuntu image (*.iso). After get the iso file, you can burn it to CD or keep iso file saved in your hard disk. On this case I keep iso file on my hard disk.</p>
<p>After You get VMWare installed on your PC, Open your VMWare Application and you&#8217;ll get this.<span id="more-180"></span></p>
<p><img class="alignnone" title="VMWARE" src="http://img532.imageshack.us/img532/7720/screenshot20100304at646.png" alt="" width="512" height="328" /></p>
<p>VMWare allow you to create parallel dekstop with 3 ways. First you can create parallel dekstop from your existing Boot Camp partition, second you can install operating system from CD or Image files, and the last you can create parallel desktop from your existing operating system on other PC trough intranet.</p>
<p><img class="alignnone" title="Chose CD" src="http://img294.imageshack.us/img294/7720/screenshot20100304at646.png" alt="" width="512" height="372" /></p>
<p>I won&#8217;t use CD to install this Ubuntu. So I click on &#8220;Continue without disc&#8221;.</p>
<p><img class="alignnone" title="Choose File" src="http://img14.imageshack.us/img14/4563/screenshot20100304at647.png" alt="" width="512" height="372" /></p>
<p>Choose on &#8220;Use operating system installation disc image file:&#8221;, then select your Ubuntu iso file on finder.</p>
<p><img class="alignnone" title="Finder" src="http://img52.imageshack.us/img52/4563/screenshot20100304at647.png" alt="" width="433" height="304" /></p>
<p>Continue to the next step.</p>
<p><img class="alignnone" title="Next Step" src="http://img443.imageshack.us/img443/5137/screenshot20100304at648.png" alt="" width="512" height="372" /></p>
<p>VMWare will automatically detect your Ubuntu iso file. Then click &#8220;continue&#8221;.</p>
<p><img class="alignnone" title="Username Password" src="http://img202.imageshack.us/img202/5137/screenshot20100304at648.png" alt="" width="512" height="370" /></p>
<p>On this step, VMWare will ask for Display Name, Account Name, and Password to your Ubuntu User account. You can allow Ubuntu to read and write Mac home folder or just keep Ubuntu to read only. Then click on continue.</p>
<p><img class="alignnone" title="VMWare Tools Download" src="http://img176.imageshack.us/img176/9379/screenshot20100304at654.png" alt="" width="512" height="373" /></p>
<p>VMWare tools download is needed on Ubuntu. This application must be installed to enable drag and drop feature with your Mac desktop and make fullscreen resolution fit on your monitor resolution (by default not using VMWare tools is 600 x 400). Download it till finish to make it install automatically on you Ubuntu. If you don&#8217;t do this step you can install it latter.</p>
<p><img class="alignnone" title="Ubuntu Installation Detail" src="http://img692.imageshack.us/img692/425/screenshot20100304at714.png" alt="" width="512" height="372" /></p>
<p>Finish, just keep default setting then click on finish. After click on finish VMWare will start Ubuntu Installation.</p>
<p><img class="alignnone" title="Ubuntu started" src="http://img20.imageshack.us/img20/4950/screenshot20100304at715.png" alt="" width="512" height="462" /></p>
<p><img class="alignnone" title="Ubuntu started" src="http://img704.imageshack.us/img704/3269/screenshot20100305at121.png" alt="" width="512" height="443" /></p>
<p>The screen will prompted to install VMWare tools on Ubuntu. Enter your Ubuntu Username and Password to install VMWare tools on Ubuntu.</p>
<p>Then Ubuntu installation begin.</p>
<p><img class="alignnone" title="Ubuntu Installation" src="http://img19.imageshack.us/img19/7704/screenshot20100304at716.png" alt="" width="512" height="446" /></p>
<p><img class="alignnone" title="Ubuntu Installation" src="http://img11.imageshack.us/img11/4229/screenshot20100304at717.png" alt="" width="512" height="447" /></p>
<p>Wait till installation complete to 100% and Ubuntul will be restarted. Login with your username and password.</p>
<p><img class="alignnone" title="Login" src="http://img442.imageshack.us/img442/2354/screenshot20100304at745.png" alt="" width="512" height="446" /></p>
<p><img class="alignnone" title="Ubuntu on VMWare" src="http://img412.imageshack.us/img412/2354/screenshot20100304at745.png" alt="" width="512" height="447" /></p>
<p>If VMWare tools on Ubuntu failed to install or VMWare Tools is not installed, You&#8217;ll see this message on status bar &#8220;VMWare Tools is not installed. Choose the Virtual Machine &gt; Install VMWare Tools menu.&#8221;</p>
<p>Remember that if VMWare Tools is not installed, You can&#8217;t drag Mac file to Ubuntu and the highest resolution fullscreen on Ubuntu only 600&#215;400px. Please install it manually by following the instruction on <a title="Install VMWare Tools" href="http://www.ubuntugeek.com/howto-install-vmware-tools-in-ubuntu.html" target="_blank">this blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/04/parallel-dekstop-ubuntu-9-10-on-mac-os-10-6-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deprecated Functions List on PHP 5.3.x</title>
		<link>http://blog.erwinsetiawan.com/2010/03/03/deprecated-functions-list-on-php-5-3-x/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/03/deprecated-functions-list-on-php-5-3-x/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 09:22:57 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=176</guid>
		<description><![CDATA[
			
				
			
		
I try to install my old application on new the version of XAMPP, but my application didn&#8217;t working correctly with the new version of PHP, it caused by deprecated function on the new version of PHP 5.3.x.
In my application just shown PHP error message.
“SPLIT() function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F03%2Fdeprecated-functions-list-on-php-5-3-x%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F03%2Fdeprecated-functions-list-on-php-5-3-x%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I try to install my old application on new the version of XAMPP, but my application didn&#8217;t working correctly with the new version of PHP, it caused by deprecated function on the new version of PHP 5.3.x.</p>
<p>In my application just shown PHP error message.</p>
<blockquote><p>“SPLIT() function has been <em>DEPRECATED</em> as of PHP 5.3.0 and <em>REMOVED</em> as of PHP 6.0.0. Relying on this feature is highly discouraged.”</p></blockquote>
<p>Then, I must change SPLIT() using EXPLODE() function.<span id="more-176"></span></p>
<p>[php]</p>
<p>&lt;?php</p>
<p>//to get categories and tags<br />
$comma=”,”;//separate by commas<br />
$categories=explode($comma, $row-&gt;caName);<br />
$tags=explode($comma, $row-&gt;taName);?&gt;</p>
<p>[/php]</p>
<p>PHP 5.3.0 introduces two new error levels: <strong><tt>E_DEPRECATED</tt></strong> and <strong><tt>E_USER_DEPRECATED</tt></strong>. The <strong><tt>E_DEPRECATED</tt></strong> error level is used to indicate that a function or feature has been deprecated. The <strong><tt>E_USER_DEPRECATED</tt></strong> level is intended for indicating deprecated features in user code, similarly to the <strong><tt>E_USER_ERROR</tt></strong> and <strong><tt>E_USER_WARNING</tt></strong>levels.</p>
<p>The following is a list of deprecated INI directives. Use of any of these INI directives will cause an <strong><tt>E_DEPRECATED</tt></strong> error to be thrown at startup.</p>
<ul>
<li><a href="http://php.net/manual/en/network.configuration.php#ini.define-syslog-variables">define_syslog_variables</a></li>
<li><a href="http://php.net/manual/en/ini.core.php#ini.register-globals">register_globals</a></li>
<li><a href="http://php.net/manual/en/ini.core.php#ini.register-long-arrays">register_long_arrays</a></li>
<li><a href="http://php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode">safe_mode</a></li>
<li><a href="http://php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc">magic_quotes_gpc</a></li>
<li><a href="http://php.net/manual/en/info.configuration.php#ini.magic-quotes-runtime">magic_quotes_runtime</a></li>
<li><a href="http://php.net/manual/en/sybase.configuration.php#ini.magic-quotes-sybase">magic_quotes_sybase</a></li>
<li>Comments starting with &#8216;#&#8217; are now deprecated in .INI files.</li>
</ul>
<p>Deprecated functions:</p>
<ul>
<li><a href="http://php.net/manual/en/function.call-user-method.php">call_user_method()</a> (use <a href="http://php.net/manual/en/function.call-user-func.php">call_user_func()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.call-user-method-array.php">call_user_method_array()</a> (use <a href="http://php.net/manual/en/function.call-user-func-array.php">call_user_func_array()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.define-syslog-variables.php">define_syslog_variables()</a></li>
<li><a href="http://php.net/manual/en/function.dl.php">dl()</a></li>
<li><a href="http://php.net/manual/en/function.ereg.php">ereg()</a> (use <a href="http://php.net/manual/en/function.preg-match.php">preg_match()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.ereg-replace.php">ereg_replace()</a> (use <a href="http://php.net/manual/en/function.preg-replace.php">preg_replace()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.eregi.php">eregi()</a> (use <a href="http://php.net/manual/en/function.preg-match.php">preg_match()</a> with the <em>&#8216;i&#8217;</em> modifier instead)</li>
<li><a href="http://php.net/manual/en/function.eregi-replace.php">eregi_replace()</a> (use <a href="http://php.net/manual/en/function.preg-replace.php">preg_replace()</a> with the <em>&#8216;i&#8217;</em> modifier instead)</li>
<li><a href="http://php.net/manual/en/function.set-magic-quotes-runtime.php">set_magic_quotes_runtime()</a> and its alias, <a href="http://php.net/manual/en/function.magic-quotes-runtime.php">magic_quotes_runtime()</a></li>
<li><a href="http://php.net/manual/en/function.session-register.php">session_register()</a> (use the <var><a href="http://php.net/manual/en/reserved.variables.session.php">$_SESSION</a></var> superglobal instead)</li>
<li><a href="http://php.net/manual/en/function.session-unregister.php">session_unregister()</a> (use the <var><a href="http://php.net/manual/en/reserved.variables.session.php">$_SESSION</a></var> superglobal instead)</li>
<li><a href="http://php.net/manual/en/function.session-is-registered.php">session_is_registered()</a> (use the <var><a href="http://php.net/manual/en/reserved.variables.session.php">$_SESSION</a></var> superglobal instead)</li>
<li><a href="http://php.net/manual/en/function.set-socket-blocking.php">set_socket_blocking()</a> (use <a href="http://php.net/manual/en/function.stream-set-blocking.php">stream_set_blocking()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.split.php">split()</a> (use <a href="http://php.net/manual/en/function.preg-split.php">preg_split()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.spliti.php">spliti()</a> (use <a href="http://php.net/manual/en/function.preg-split.php">preg_split()</a> with the <em>&#8216;i&#8217;</em> modifier instead)</li>
<li><a href="http://php.net/manual/en/function.sql-regcase.php">sql_regcase()</a></li>
<li><a href="http://php.net/manual/en/function.mysql-db-query.php">mysql_db_query()</a> (use <a href="http://php.net/manual/en/function.mysql-select-db.php">mysql_select_db()</a> and <a href="http://php.net/manual/en/function.mysql-query.php">mysql_query()</a> instead)</li>
<li><a href="http://php.net/manual/en/function.mysql-escape-string.php">mysql_escape_string()</a> (use <a href="http://php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a> instead)</li>
<li>Passing locale category names as strings is now deprecated. Use the LC_* family of constants instead.</li>
<li>The <em><tt>is_dst</tt></em> parameter to <a href="http://php.net/manual/en/function.mktime.php">mktime()</a>. Use the new timezone handling functions instead.</li>
</ul>
<p>Deprecated features:</p>
<ul>
<li>Assigning the return value of <a href="http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.new">new</a> by reference is now deprecated.</li>
<li>Call-time pass-by-reference is now deprecated.</li>
<li>The use of <em>{}</em> to access string offsets is deprecated. Use <em>[]</em> instead.</li>
</ul>
<p>Impact:</p>
<ul>
<li>Code Igniter 1.7.1 cannot working because of this deprecated function. Please update to Code Igniter 1.7.2</li>
<li>Some Wordpress function deprecated. Please see this <a title="WP function reference" href="http://codex.wordpress.org/Function_Reference/wp_list_cats" target="_blank">function reference</a>.</li>
</ul>
<p>See more about PHP 5.3.x migration on <a title="PHP Manual" href="http://www.php.net/manual/en/migration53.php" target="_blank">PHP Manual</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/03/deprecated-functions-list-on-php-5-3-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrated Tag Cloud Into Code Igniter</title>
		<link>http://blog.erwinsetiawan.com/2010/03/02/integrated-tag-cloud-into-code-igniter/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/02/integrated-tag-cloud-into-code-igniter/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 16:27:37 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Code Igniter]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=172</guid>
		<description><![CDATA[
			
				
			
		
This post talk about Tag Cloud on my previous post, but in this post I’ll show you how to integrate it into Code Igniter >> my favorite framework..
First you must create it to your own library.
this is my script:

[php]
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fintegrated-tag-cloud-into-code-igniter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fintegrated-tag-cloud-into-code-igniter%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>This post talk about Tag Cloud on my previous post, but in this post I’ll show you how to integrate it into Code Igniter >> my favorite framework..</p>
<p>First you must create it to your own library.</p>
<p>this is my script:<br />
<span id="more-172"></span><br />
[php]<br />
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');<br />
//tag_cloud.php<br />
class Tag_cloud{<br />
	private $arrTags;<br />
	private $sort;<br />
	private $fMaks;<br />
	private $fMin;<br />
/**<br />
* konstruktor<br />
* @param $arrTags tag array<br />
* @param $sort Boolean sort by aphabet<br />
* @param $fMaks Int maximum size of font<br />
* @param $fMin Int minimum size of font<br />
*/<br />
	function __construct($arrTags, $sort = true, $fMaks = 36, $fMin = 12){<br />
	if(!is_array($arrTags)){<br />
		exit('First Argument must array!');<br />
	}<br />
	$this->arrTags = $arrTags;<br />
	$this->sort = $sort;<br />
	$this->fMaks = $fMaks;<br />
	$this->fMin = $fMin;<br />
}<br />
/**<br />
*Create and print tag cloud<br />
*<br />
*/<br />
	function show(){<br />
	$arrTags = $this->arrTags;<br />
	if ($this->sort){<br />
		//sort by aphabet<br />
		ksort($arrTags);<br />
	}<br />
	//maximum item<br />
	$jmlMaks = max(array_values($arrTags));<br />
	//minimum item<br />
	$jmlMin = min(array_values($arrTags));<br />
	//Range total max and min<br />
	$range = $jmlMaks &#8211; $jmlMin;<br />
	//avoid divide by zero<br />
	if ($range == 0){<br />
		$range = 1;<br />
	}<br />
	//for increment font tag size<br />
	$step = ($this->fMaks &#8211; $this->fMin)/$range;<br />
	$size = 0;<br />
	$arr_item=array();<br />
	$arr_jml=array();<br />
	$arr_size=array();<br />
	$out=array();<br />
	$n=0;<br />
	while (list($item, $jml)=each($arrTags)){<br />
		//increment font size<br />
		$size =round($this->fMin+(($jml-$jmlMin)*$step));<br />
		$arr_item[$n]=$item;<br />
		$arr_jml[$n]=$jml;<br />
		$arr_size[$n]=$size;<br />
		$n++;<br />
	/*echo &#8216;<a href="tag/'.$item.'" style="font-size:'.$size.'px" tittle="'.$jml.' item on tag'.$item.'"><br />
	&#8216;.$item.&#8217; </a>&#8216;;*/<br />
	}<br />
	$arr1 = array_values($arr_item);<br />
	$arr2 = array_values($arr_jml);<br />
	$arr3 = array_values($arr_size);<br />
	foreach($arr1 as $key1 => $value1) {<br />
	$out[(string)$value1][0] = $arr2[$key1];<br />
	$out[(string)$value1][1] = $arr3[$key1];<br />
	}<br />
	//print_r($out); // this will print out the contents of your new array<br />
	return $out;<br />
	}</p>
<p>}</p>
<p>?><br />
[/php]</p>
<p>This script will return 3 dimentional array.<br />
Then create tags_model.php to call database tags..<br />
for this example i have tags table with contain tag_id and tag_name where tag_id as primary key and tag_name as unique key.<br />
This is tags_model.php</p>
<p>[php]<br />
<?php<br />
class Tags_model extends Model{<br />
	function __construct()<br />
	{<br />
		parent::Model();<br />
	}<br />
	function get_all()<br />
	{<br />
		$query=$this->db->get(&#8216;tags&#8217;);<br />
		return $query->result();<br />
	}<br />
}<br />
?><br />
[/php]</p>
<p>Create active record on your Post model to count how many tags on colum tags.<br />
For colum tags i have sparate each tag by commas. Example: code, igniter, php.<br />
So to count how many post that contain each tag you must add this function:</p>
<p>[php]<br />
function count_by_tag($tag)<br />
	{<br />
		$this->db->select(&#8216;count(*) AS MyCount&#8217;);<br />
		$this->db->from(&#8216;posts&#8217;);<br />
		$this->db->like(&#8216;tag&#8217;, $tag, &#8216;both&#8217;);<br />
		$count=$this->db->count_all_results();<br />
		return $count;<br />
	}<br />
[/php]</p>
<p>Don’t forget to add each model to controller:</p>
<p>[php]<br />
$this->load->model(&#8216;posts_model&#8217;);<br />
$this->load->model(&#8216;tags_model&#8217;);<br />
[/php]</p>
<p>Then this is script to get data tags from database and load your own tags library.</p>
<p>[php]<br />
//tags<br />
		$query=$this->tags_model->get_all();<br />
		$tags=array();<br />
		foreach ($query as $row):<br />
				$count=$this->news_model->count_by_tag($row->tag_name);<br />
				$tags[$row->tag_name]=$count;<br />
		endforeach;<br />
		$this->load->library(&#8216;tag_cloud&#8217;, $tags);<br />
[/php]</p>
<p>This tag cloud library will return 3d array.. so you must parsing each array on your view. Then create it to tag cloud using component.<br />
this is my view:</p>
<p>[php]<br />
<?php<br />
		$arr_tags=$this->tag_cloud->show();<br />
		//print_r($this->tag_cloud->show()); // this will print out the contents of your new array<br />
		foreach($arr_tags as $item => $value):<br />
			foreach ($value as $row => $val):<br />
				$jml=$value[0];<br />
				$size=$value[1];<br />
			endforeach;<br />
		echo &#8216;<a href="'.$base.'news/tag/'.$item.'" style="font-size:'.$size.'px" title="'.$jml.' items on tag '.$item.'"><br />
	&#8216;.$item.&#8217; </a>&#8216;;<br />
		endforeach;<br />
		?><br />
[/php]</p>
<p>Finish.. It’s pretty simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/02/integrated-tag-cloud-into-code-igniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tag Cloud With PHP</title>
		<link>http://blog.erwinsetiawan.com/2010/03/02/tag-cloud-with-php/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/02/tag-cloud-with-php/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 16:15:52 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=168</guid>
		<description><![CDATA[
			
				
			
		
I think Wordpress blogger familiar with Tag Cloud. Last time, I want to know how to make it. Looking for some tutorial and found it. In this tutorial, I must learn about OOP in PHP. With my little knowledge about OOP programing in JAVA, I tried to explore it in PHP.
To make simple tag cloud [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Ftag-cloud-with-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Ftag-cloud-with-php%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I think Wordpress blogger familiar with Tag Cloud. Last time, I want to know how to make it. Looking for some tutorial and found it. In this tutorial, I must learn about OOP in PHP. With my little knowledge about OOP programing in JAVA, I tried to explore it in PHP.</p>
<p>To make simple tag cloud with PHP you’ll need 2 PHP file. With OOP background you must create Tag Cloud Class first then you can use it to create new Tag Cloud object.<br />
<span id="more-168"></span></p>
<p>[php]<br />
<?php<br />
//tagcloud.php<br />
class TagCloud{<br />
	private $arrTags;<br />
	private $sort;<br />
	private $fMaks;<br />
	private $fMin;</p>
<p>/**<br />
* konstruktor<br />
* @param $arrTags tag array<br />
* @param $sort Boolean sort by aphabet<br />
* @param $fMaks Int maximum size of font<br />
* @param $fMin Int minimum size of font<br />
*/<br />
public function __construct($arrTags, $sort = true, $fMaks = 36, $fMin = 12){<br />
	if(!is_array($arrTags)){<br />
		exit('First Argument must array!');<br />
	}<br />
	$this->arrTags = $arrTags;<br />
	$this->sort = $sort;<br />
	$this->fMaks = $fMaks;<br />
	$this->fMin = $fMin;<br />
}</p>
<p>/**<br />
*Create and print tag cloud<br />
*<br />
*/</p>
<p>public function show(){<br />
	$arrTags = $this->arrTags;<br />
	if ($this->sort){<br />
		//sort by aphabet<br />
		ksort($arrTags);<br />
	}<br />
	//maximum item<br />
	$jmlMaks = max(array_values($arrTags));<br />
	//minimum item<br />
	$jmlMin = min(array_values($arrTags));</p>
<p>	//Range total max and min<br />
	$range = $jmlMaks &#8211; $jmlMin;<br />
	//avoid divide by zero<br />
	if ($range == 0){<br />
		$range = 1;<br />
	}</p>
<p>	//for increment font tag size<br />
	$step = ($this->fMaks &#8211; $this->fMin)/$range;</p>
<p>	$size = 0;<br />
	while (list($item, $jml)=each($arrTags)){<br />
		//increment font size<br />
		$size =round($this->fMin+(($jml-$jmlMin)*$step));<br />
	?><br />
	<a href="?tag=<?php echo $item;?>&#8221; style=&#8221;font-size:<?php echo $size;?>px&#8221; tittle=&#8221;<?php echo $jml?> item di tag<?php echo $item;?>&#8220;><br />
	<?php echo $item;?></a><br />
	<?php<br />
	}<br />
}</p>
<p>}<br />
?><br />
[/php]</p>
<p>Save it to TagCloud.php, then create tag simulation to preview Tag Cloud Class. In this script you can use database to get your real data.</p>
<p>[php]<br />
<?<br />
require './TagCloud.php';</p>
<p>//Array, simulation item and value<br />
$tags = array(<br />
	'Java' => 73,<br />
	&#8216;ASP&#8217; => 21,<br />
	&#8216;JavaScript&#8217; => 55,<br />
	&#8216;Python&#8217; => 31,<br />
	&#8216;PHP&#8217; => 99,<br />
	&#8216;Visual Basic&#8217; => 11,<br />
	&#8216;C++&#8217; => 77,<br />
	&#8216;Perl&#8217; => 35,<br />
	&#8216;CSharp&#8217; => 57,<br />
	&#8216;AJAX&#8217; => 49);<br />
$tc = new tagCloud($tags);<br />
?></p>
<table border=1 width=200>
<tr>
<td><?php $tc->show();?></td>
</tr>
</table>
<p>[/php]</p>
<p>Save it to Sample_TagCloud.php, then call Sample_TagCloud.php from your localhost server and view the result. Nice right.<br />
<img src="http://img79.imageshack.us/img79/8221/tagcloudtd3.jpg" alt="" /></p>
<p>Just take Tag Cloud Class and added to your application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/02/tag-cloud-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create User Log</title>
		<link>http://blog.erwinsetiawan.com/2010/03/02/create-user-log/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/02/create-user-log/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:54:44 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=162</guid>
		<description><![CDATA[
			
				
			
		
User log is used to save information about visitor, like IP address and web browser. User log saved in html file. So you don’t need databases like MySQL. In this user log script, we need date() function (to set time) and variable like $REMOTE_ADDR to get IP address from user and $HTTP_USER_AGENT to know web [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fcreate-user-log%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fcreate-user-log%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>User log is used to save information about visitor, like IP address and web browser. User log saved in html file. So you don’t need databases like MySQL. In this user log script, we need date() function (to set time) and variable like $REMOTE_ADDR to get IP address from user and $HTTP_USER_AGENT to know web browser in user. Usually this script must be place in index of web site (index.php). Then you need to created log.html file to save user log.<span id="more-162"></span></p>
<p>[php]<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></p>
<p></head><br />
<body><br />
<?php<br />
//to get time and save in $time variable<br />
$time = date("F jS Y, h:iA");</p>
<p>//to get IP Address and save in $ip variable<br />
$ip = $_SERVER['REMOTE_ADDR'];</p>
<p>//to get hostname and save in $hostname<br />
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])</p>
<p>//to get web browser and save in $browser variable<br />
$browser = $_SERVER['HTTP_USER_AGENT'];</p>
<p>//open log.html<br />
$fp = fopen("log.html", "a");<br />
//then input log on it<br />
fputs($fp, "<strong>Time : </strong> $time <br />
<strong>IP Address :</strong>$ip <br />
<strong>Hostname (if any):</strong> $hostname <br />
<strong>Browser : </strong> $browser</p>
<p>&#8220;);<br />
//close log.html<br />
fclose($fp);<br />
?><br />
<a href="log.html">See User Log</a></p>
<p></body><br />
</html><br />
[/php]</p>
<p>Save it to index.php. Try to open it from your localhost, for example http://localhost/your_root_website/index.php.<br />
<img src="http://img365.imageshack.us/img365/1403/userloglinkau8.jpg" alt="" /><br />
Then click on “See User Log” link and get your IP logged on it.</p>
<p><img src="http://img221.imageshack.us/img221/7357/userlogeb3.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/02/create-user-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamically Dropdown Value On Code Igniter</title>
		<link>http://blog.erwinsetiawan.com/2010/03/02/dynamically-dropdown-value-on-code-igniter/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/02/dynamically-dropdown-value-on-code-igniter/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:48:05 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Code Igniter]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=159</guid>
		<description><![CDATA[
			
				
			
		
One day, I got problem with dynamically dropdown value on Code Igniter. First think i hope I can generate dropdown with values from mySql database. I want to use form helper that provided by Code Igniter to generate form.
Basically to make dropdown input on controller are:
[php]
&#8230;
$data['input_category'] = array(
&#8220;1&#8243; =&#62; &#8220;Mobile&#8221;,
&#8220;2&#8243; =&#62; &#8220;Web&#8221;
);
&#8230;
[/php]
Then in views:
[php]
&#8230;
&#8230;
[/php]
It&#8217;s pretty [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fdynamically-dropdown-value-on-code-igniter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fdynamically-dropdown-value-on-code-igniter%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>One day, I got problem with dynamically dropdown value on Code Igniter. First think i hope I can generate dropdown with values from mySql database. I want to use form helper that provided by Code Igniter to generate form.</p>
<p>Basically to make dropdown input on controller are:<br />
[php]<br />
&#8230;<br />
$data['input_category'] = array(<br />
&#8220;1&#8243; =&gt; &#8220;Mobile&#8221;,<br />
&#8220;2&#8243; =&gt; &#8220;Web&#8221;<br />
);<br />
&#8230;<br />
[/php]</p>
<p>Then in views:<span id="more-159"></span></p>
<p>[php]<br />
&#8230;</p>
<p>&#8230;<br />
[/php]</p>
<p>It&#8217;s pretty simple.</p>
<p><strong>How to make it values generate dynamically?</strong></p>
<p>I’ll created each array to string and then explode it into an array. It’s working, but I got “‘1′ =&gt; ‘Mobile’” on my dropdown input and array started to 0. So “1″ =&gt; “Mobile”’s select name became 0 not id of mobile.</p>
<p>So I must create array_combine() function to make fix this problem.<br />
This is my clear code.</p>
<p>[php]<br />
$cat_id=&#8221;";<br />
$category=&#8221;";<br />
$query=$this-&gt;dn_categories_model-&gt;get_all();<br />
foreach($query as $row):<br />
$cat_id .= &#8220;$row-&gt;cat_id&#8221;;<br />
$cat_id .= &#8220;,&#8221;;<br />
$category .= &#8220;$row-&gt;category&#8221;;<br />
$category .= &#8220;,&#8221;;<br />
endforeach;<br />
$comma=&#8221;,&#8221;;//separate by commas<br />
$arr_cat_id=explode($comma,$cat_id);<br />
$arr_category=explode($comma,$category);<br />
$options=array_combine($arr_cat_id,$arr_category);</p>
<p>$data['input_category'] = $options;<br />
[/php]</p>
<p>I wrote it to on <a title="CI Forum" href="http://codeigniter.com/forums/viewthread/94277/" target="_blank">Code Igniter forum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/02/dynamically-dropdown-value-on-code-igniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Up Ubuntu Grub Menu After Upgrade Kernel</title>
		<link>http://blog.erwinsetiawan.com/2010/03/02/clean-up-ubuntu-grub-menu-after-upgrade-kernel/</link>
		<comments>http://blog.erwinsetiawan.com/2010/03/02/clean-up-ubuntu-grub-menu-after-upgrade-kernel/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 15:35:50 +0000</pubDate>
		<dc:creator>erwin</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.erwinsetiawan.com/?p=157</guid>
		<description><![CDATA[
			
				
			
		
When you upgrade kernel on ubuntu, you will add grub menu with new kernel version.
Ubuntu doesn’t remove the old entries. It’s very dirty. Why Ubuntu do this? How to remove it.. Hmm.. after several time browsing to find the solution…I found the best solution for me.
This is my Grub menu after upgrade kernel:

The best way [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fclean-up-ubuntu-grub-menu-after-upgrade-kernel%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.erwinsetiawan.com%2F2010%2F03%2F02%2Fclean-up-ubuntu-grub-menu-after-upgrade-kernel%2F&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>When you upgrade kernel on ubuntu, you will add grub menu with new kernel version.</p>
<p>Ubuntu doesn’t remove the old entries. It’s very dirty. Why Ubuntu do this? How to remove it.. Hmm.. after several time browsing to find the solution…I found the best solution for me.</p>
<p>This is my Grub menu after upgrade kernel:</p>
<p><img title="Grub Menu" src="http://www.howtogeek.com/wp-content/uploads/2007/09/image55.png" alt="" width="573" height="246" /></p>
<p>The best way to remove the older menu, you’ll need to edit the file /boot/grub/menu.lst. You can do this by using Alt+F2 and then typing in the following command:</p>
<p><code>gksu gedit /boot/grub/menu.lst</code></p>
<p><span id="more-157"></span></p>
<p><img title="Alt+F2" src="http://www.howtogeek.com/wp-content/uploads/2007/09/image56.png" alt="" width="432" height="190" /></p>
<p>Click on run and you’ll get the file open. find “#howmany=all” and change it to “#howmany=1″.</p>
<p><img title="menu.lst" src="http://img340.imageshack.us/img340/7857/screenshotoc3.png" alt="" width="462" height="268" /></p>
<p>Then run “sudo update-grub” to update changes. Next time, only newest kernel lines will be shown.</p>
<p>If you have more than one OS in your PC (example: Ubuntu and Windows), the tip that I mentioned above is the best way to update GRUB automatically. You dont need to delete any lines (and change the “default” value also) after every time your Ubuntu box is updated <img src="http://www.howtogeek.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.erwinsetiawan.com/2010/03/02/clean-up-ubuntu-grub-menu-after-upgrade-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

