<?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>thephpx - codeigniter junky &#187; codeigniter</title>
	<atom:link href="http://www.thephpx.com/category/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thephpx.com</link>
	<description>codeigniter, jquery, php, mysql</description>
	<lastBuildDate>Mon, 21 Nov 2011 21:17:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Google Oauth2 library for CodeIgniter framework</title>
		<link>http://www.thephpx.com/2011/04/20/google-oauth2-library-for-codeigniter-framework/</link>
		<comments>http://www.thephpx.com/2011/04/20/google-oauth2-library-for-codeigniter-framework/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 08:15:51 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[codeigniter library]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[google codeigniter library]]></category>
		<category><![CDATA[oauth2]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=216</guid>
		<description><![CDATA[Hello everyone, I am back with google oauth2 integration library this time. Before you use the google oauth2 library you must have a google application registered so that you have access to api client id and client key which you will need to use it. Also the redirect url must match your application location. Otherwise &#8230; <a href="http://www.thephpx.com/2011/04/20/google-oauth2-library-for-codeigniter-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hello everyone,</p>
<p>I am back with google oauth2 integration library this time. Before you use the google oauth2 library you must have a google application registered so that you have access to api client id and client key which you will need to use it.</p>
<p>Also the redirect url must match your application location. Otherwise google does not provide access to the api. So, best way to test the code is to test it on a live site.</p>
<p>I am not going to go through the code here as I have commented the code well enough for you to understand <img src='http://www.thephpx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For any extra query feel free to comment.<br />
<a href="http://www.thephpx.com/files/google_oauth.zip"><br />
<h3>DOWNLOAD THE LIBRARY</h3>
<p></a></p>
<p>thanks,</p>
<blockquote>
<h4>faisal ahmed</h4>
<p><em style="padding: 0; margin: 0;">web application developer</em><br />
<strong style="padding: 0; margin: 0;">web: </strong>http://www.faisalbd.com/<br />
<strong style="padding: 0; margin: 0;">email: </strong>thephpx(at)gmail(dot)com</p></blockquote>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2011/04/20/google-oauth2-library-for-codeigniter-framework/"></g:plusone></div><div class="shr-publisher-216"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2011%2F04%2F20%2Fgoogle-oauth2-library-for-codeigniter-framework%2F&amp;title=Google%20Oauth2%20library%20for%20CodeIgniter%20framework" id="wpa2a_2" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2011_2F04_2F20_2Fgoogle-oauth2-library-for-codeigniter-framework_2F_amp_title=Google_20Oauth2_20library_20for_20CodeIgniter_20framework?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2011/04/20/google-oauth2-library-for-codeigniter-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Codeigniter: Helper for template library dynamic view partial loading</title>
		<link>http://www.thephpx.com/2011/02/23/codeigniter-helper-for-template-library-dynamic-view-partial-loading/</link>
		<comments>http://www.thephpx.com/2011/02/23/codeigniter-helper-for-template-library-dynamic-view-partial-loading/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 13:43:51 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[codeigniter library]]></category>
		<category><![CDATA[codeigniter template library]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[template library]]></category>
		<category><![CDATA[template parser helper]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=167</guid>
		<description><![CDATA[Hello everyone, I have recently been in quick-fire blogging mode. After playing with the superb template library developed by Phil Sturgeon. The following template helper is the outcome of tweaking that makes life easier while setting up view partials and calling them inside the layout dynamically. The helper also has an add-on use which gives &#8230; <a href="http://www.thephpx.com/2011/02/23/codeigniter-helper-for-template-library-dynamic-view-partial-loading/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hello everyone,</p>
<p>I have recently been in quick-fire blogging mode. After playing with the superb <a href="http://philsturgeon.co.uk/demos/codeigniter-template/user_guide/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/philsturgeon.co.uk/demos/codeigniter-template/user_guide/?referer=');">template library</a> developed by <a href="http://philsturgeon.co.uk/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/philsturgeon.co.uk/?referer=');">Phil Sturgeon</a>.</p>
<p>The following template helper is the outcome of tweaking that makes life easier while setting up view partials and calling them inside the layout dynamically. The helper also has an add-on use which gives user the option to use region specific partial loading.</p>
<h5>Controller:</h5>
<p> welcome.php<br/></p>
<pre>
$partial_list[]['region'] = 'left';
$partial_list[]['name'] = 'category';
$partial_list[]['view'] = 'partial_category';
$partial_list[]['region'] = 'right';
$partial_list[]['name'] = 'login_box';
$partial_list[]['view'] = 'partial_login';

/* following functionautomatically sets the partials
* based on the above array and also passes $partial_list
* variable to the view.
*/

/*
* make sure the pareser helper is loaded before
* calling this function
*/

setup_partials($partial_list);

$this-&gt;template-&gt;set_layout('home_layout');
$this-&gt;template-&gt;build('home_view');
</pre>
<p><br/></p>
<h5>Layout:</h5>
<p> home_view.php<br/></p>
<pre>
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;&lt;?php echo $template[&#039;title&#039;];?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div class=&quot;left&quot;&gt;
		/* Will show only partials with region set as left */
		&lt;?php show_partials(&#039;list&#039;, &#039;left&#039;, $partial_list, $template); ?&gt;
	&lt;/div&gt;
	&lt;div class=&quot;mid&quot;&gt;&lt;?php echo $template[&#039;body&#039;];?&gt;&lt;/div&gt;
	&lt;div class=&quot;right&quot;&gt;
		/* Will show only partials with region set as right */
		&lt;?php show_partials(&#039;list&#039;, &#039;right&#039;, $partial_list, $template);?&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Detail about the usage can be found in the actual helper file, also feel free to comment here and I will try my best to help out.</p>
<h3>Download Helper:</h3>
<p><a href="http://www.thephpx.com/files/partial_helper.zip">DOWNLOAD PARSER HELPER</a></p>
<p>thanks,</p>
<blockquote>
<h4>faisal ahmed</h4>
<p><i style="padding:0;margin:0;">web application developer</i><br />
<b style="padding:0;margin:0;">web:&nbsp;</b>http://www.faisalbd.com/<br />
<b style="padding:0;margin:0;">email:&nbsp;</b>thephpx(at)gmail(dot)com
</p></blockquote>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2011/02/23/codeigniter-helper-for-template-library-dynamic-view-partial-loading/"></g:plusone></div><div class="shr-publisher-167"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2011%2F02%2F23%2Fcodeigniter-helper-for-template-library-dynamic-view-partial-loading%2F&amp;title=Codeigniter%3A%20Helper%20for%20template%20library%20dynamic%20view%20partial%20loading" id="wpa2a_4" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2011_2F02_2F23_2Fcodeigniter-helper-for-template-library-dynamic-view-partial-loading_2F_amp_title=Codeigniter_3A_20Helper_20for_20template_20library_20dynamic_20view_20partial_20loading?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2011/02/23/codeigniter-helper-for-template-library-dynamic-view-partial-loading/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Google translate helper for codeigniter</title>
		<link>http://www.thephpx.com/2011/02/15/google-translate-helper-for-codeigniter/</link>
		<comments>http://www.thephpx.com/2011/02/15/google-translate-helper-for-codeigniter/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 10:33:27 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[codeigniter google api]]></category>
		<category><![CDATA[codeigniter translate]]></category>
		<category><![CDATA[codeigniter translate helper]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google translate api]]></category>
		<category><![CDATA[translate]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=150</guid>
		<description><![CDATA[Hello everyone, I am back with a tiny contribution. Today I have created a nifty helper for codeigniter which uses the google translate api (v2). In order to use the function you will require a google translation api key which you can get for free the google api console (https://code.google.com/apis/console). After you have your key &#8230; <a href="http://www.thephpx.com/2011/02/15/google-translate-helper-for-codeigniter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hello everyone,</p>
<p>I am back with a tiny contribution. Today I have created a nifty helper for codeigniter which uses the google translate api (v2).</p>
<p>In order to use the function you will require a google translation api key which you can get for free the google api console (<a href="https://code.google.com/apis/console" onclick="pageTracker._trackPageview('/outgoing/code.google.com/apis/console?referer=');">https://code.google.com/apis/console</a>).</p>
<p>After you have your key it has to be passed to the function along-with the text to be translated, the language from which it is being translated from and to the language it is translated to. The function returns the translated text which can be used to do further processing or can be also be echoed.</p>
<p><strong>CODE:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">/* Develeoped by: faisal ahmed &lt;thephpx(at)gmail.com&#8211;&gt; */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> google_translate<span class="br0">&#40;</span><span class="re0">$api_key</span>, <span class="re0">$text</span>, <span class="re0">$from_lang</span>, <span class="re0">$to_lang</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$link</span> = <span class="st0">&#8216;https://www.googleapis.com/language/translate/v2?key=&#8217;</span>.<span class="re0">$api_key</span>.<span class="st0">&#8216;&amp;amp;source=&#8217;</span>.<span class="re0">$from_lang</span>.<span class="st0">&#8216;&amp;amp;target=&#8217;</span>.<span class="re0">$to_lang</span>.<span class="st0">&#8216;&amp;amp;q=&#8217;</span>.<span class="re0">$text</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$response</span> = <a href="http://www.php.net/file_get_contents" onclick="pageTracker._trackPageview('/outgoing/www.php.net/file_get_contents?referer=');"><span class="kw3">file_get_contents</span></a><span class="br0">&#40;</span><span class="re0">$link</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$array</span> = json_decode<span class="br0">&#40;</span><span class="re0">$response</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="re0">$array</span>-&gt;<span class="me1">data</span>-&gt;<span class="me1">translations</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span>-&gt;<span class="me1">translatedText</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">?&gt;</span></div>
</li>
</ol>
</div>
<p>Hope to be back with another snippet soon, till then keep in touch <img src='http://www.thephpx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>thanks,</p>
<blockquote><p>thephpx</p></blockquote>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2011/02/15/google-translate-helper-for-codeigniter/"></g:plusone></div><div class="shr-publisher-150"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2011%2F02%2F15%2Fgoogle-translate-helper-for-codeigniter%2F&amp;title=Google%20translate%20helper%20for%20codeigniter" id="wpa2a_6" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2011_2F02_2F15_2Fgoogle-translate-helper-for-codeigniter_2F_amp_title=Google_20translate_20helper_20for_20codeigniter?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2011/02/15/google-translate-helper-for-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>codeigniter: facebook social plugin &#8211; like button helper</title>
		<link>http://www.thephpx.com/2010/06/20/codeigniter-facebook-social-plugin-like-button-helper/</link>
		<comments>http://www.thephpx.com/2010/06/20/codeigniter-facebook-social-plugin-like-button-helper/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 07:36:15 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook helper]]></category>
		<category><![CDATA[facebook like button]]></category>
		<category><![CDATA[facebook social plugins]]></category>
		<category><![CDATA[like button]]></category>
		<category><![CDATA[social plugins]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=80</guid>
		<description><![CDATA[Hello everybody, I have just created a short helper to create facebook like button dynamically for any content, by just giving-in the URL of the page. Hope this one also helps you like my other helpers Helper function: &#160; if&#40;!function_exists&#40;&#8216;facebook_like&#8217;&#41;&#41;&#123; &#160;function facebook_like&#40;$url&#41;&#123; &#160;$formlink=&#8216;&#60;iframe src=&#34;http://www.facebook.com/plugins/like.php?href=&#8217;; &#160; $formlink .= urlencode&#40;$url&#41;; &#160; $formlink .= &#8216;;layout=button_count&#38;amp;show_faces=true&#38;amp;width=450&#38;amp;action=like&#38;amp;colorscheme=light&#38;amp;height=21&#34; scrolling=&#34;no&#34; frameborder=&#34;0&#34; style=&#34;border:none; &#8230; <a href="http://www.thephpx.com/2010/06/20/codeigniter-facebook-social-plugin-like-button-helper/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hello everybody,</p>
<p>I have just created a short helper to create facebook like button dynamically for any content, by just giving-in the URL of the page. Hope this one also helps you like my other helpers <img src='http://www.thephpx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Helper function:</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/function_exists" onclick="pageTracker._trackPageview('/outgoing/www.php.net/function_exists?referer=');"><span class="kw3">function_exists</span></a><span class="br0">&#40;</span><span class="st0">&#8216;facebook_like&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw2">function</span> facebook_like<span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="re0">$formlink</span>=<span class="st0">&#8216;&lt;iframe src=&quot;http://www.facebook.com/plugins/like.php?href=&#8217;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; <span class="re0">$formlink</span> .= <a href="http://www.php.net/urlencode" onclick="pageTracker._trackPageview('/outgoing/www.php.net/urlencode?referer=');"><span class="kw3">urlencode</span></a><span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="re0">$formlink</span> .= <span class="st0">&#8216;;layout=button_count&amp;amp;show_faces=true&amp;amp;width=450&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;height=21&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;border:none; overflow:hidden; width:450px; height:21px;&quot; allowTransparency=&quot;true&quot;&gt;&lt;/iframe&gt;&#8217;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">return</span> <span class="re0">$formlink</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p><b>Usage:</b></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?php</span> </div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$url</span> = current_url<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');"><span class="kw3">echo</span></a> facebook_like<span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p><b>Note:</b><br />
As you can see the function requires you to use the codeigniter&#8217;s native URI helper.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2010/06/20/codeigniter-facebook-social-plugin-like-button-helper/"></g:plusone></div><div class="shr-publisher-80"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2010%2F06%2F20%2Fcodeigniter-facebook-social-plugin-like-button-helper%2F&amp;title=codeigniter%3A%20facebook%20social%20plugin%20%26%238211%3B%20like%20button%20helper" id="wpa2a_8" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2010_2F06_2F20_2Fcodeigniter-facebook-social-plugin-like-button-helper_2F_amp_title=codeigniter_3A_20facebook_20social_20plugin_20_26_238211_3B_20like_20button_20helper?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2010/06/20/codeigniter-facebook-social-plugin-like-button-helper/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Codeigniter: Helper &#8211; Create breadcrumb from url</title>
		<link>http://www.thephpx.com/2010/05/12/codeigniter-helper-create-breadcrumb-from-url/</link>
		<comments>http://www.thephpx.com/2010/05/12/codeigniter-helper-create-breadcrumb-from-url/#comments</comments>
		<pubDate>Wed, 12 May 2010 03:02:03 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[breadcrumb]]></category>
		<category><![CDATA[navigation breadcrumb]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=59</guid>
		<description><![CDATA[Breadcrumb is a navigational tool that developer often integrate in their application to give easy access to different segment of the application. This is used in applications which has multiple sequence of activities. The following code will go into your helper file and you have to call create_breadcrumb(); function to get the formatted html text; &#8230; <a href="http://www.thephpx.com/2010/05/12/codeigniter-helper-create-breadcrumb-from-url/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Breadcrumb is a navigational tool that developer often integrate in their application to give easy access to different segment of the application. This is used in applications which has multiple sequence of activities.</p>
<p>The following code will go into your helper file and you have to call <em>create_breadcrumb();</em> function to get the formatted html text;</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">if(!function_exists(&#8216;create_breadcrumb&#8217;)){
</div>
</li>
<li class="li1">
<div class="de1">function create_breadcrumb(){
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; $ci = &amp;amp;get_instance();
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; $i=1;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; $uri = $ci-&gt;uri-&gt;segment($i);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; $link = &#8216;&lt;ul&gt;&#8217;;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; while($uri != &#8221;){
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; $prep_link = &#8221;;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; for($j=1; $j&lt;=$i;$j++){
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; $prep_link .= $ci-&gt;uri-&gt;segment($j).&#8217;/';
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; }
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; if($ci-&gt;uri-&gt;segment($i+1) == &#8221;){
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; $link.=&#8217;&lt;li&gt;» &lt;a href=&quot;&#8217;.site_url($prep_link).&#8217;&quot;&gt;&lt;b&gt;&#8217;.$ci-&gt;uri-&gt;segment($i).&#8217;&lt;/b&gt;&lt;/a&gt;&lt;/li&gt; &#8217;;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; }else{
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; $link.=&#8217;&lt;li&gt;» &lt;a href=&quot;&#8217;.site_url($prep_link).&#8217;&quot;&gt;&#8217;.$ci-&gt;uri-&gt;segment($i).&#8217;&lt;/a&gt;&lt;/li&gt; &#8217;;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; }
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; $i++;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; $uri = $ci-&gt;uri-&gt;segment($i);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; }
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; $link .= &#8216;&lt;/ul&gt;&#8217;;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; return $link;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; }
</div>
</li>
<li class="li1">
<div class="de1">}
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>If the current url is <em>http://www.domain.com/user/add</em> then the <em>create_breadcrumb()</em> function will return -</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">» user » ad</div>
</li>
</ol>
</div>
<p>Here <strong><em>user</em></strong> is linked to <em>http://www.domain.com/user/</em> and <strong><em>add</em></strong> is linked to <em>http://www.domain.com/user/add</em></p>
<p>This is generated by calling  in the view file. Try it out and let me know how it went <img src='http://www.thephpx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>thanks,</p>
<blockquote><p>thephpx</p></blockquote>
<p>[ad code=1 align=center]</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2010/05/12/codeigniter-helper-create-breadcrumb-from-url/"></g:plusone></div><div class="shr-publisher-59"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2010%2F05%2F12%2Fcodeigniter-helper-create-breadcrumb-from-url%2F&amp;title=Codeigniter%3A%20Helper%20%26%238211%3B%20Create%20breadcrumb%20from%20url" id="wpa2a_10" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2010_2F05_2F12_2Fcodeigniter-helper-create-breadcrumb-from-url_2F_amp_title=Codeigniter_3A_20Helper_20_26_238211_3B_20Create_20breadcrumb_20from_20url?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2010/05/12/codeigniter-helper-create-breadcrumb-from-url/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Codeigniter: Helper &#8211; absolute path helper</title>
		<link>http://www.thephpx.com/2010/05/12/codeigniter-helper-absolute-path-helper/</link>
		<comments>http://www.thephpx.com/2010/05/12/codeigniter-helper-absolute-path-helper/#comments</comments>
		<pubDate>Wed, 12 May 2010 02:28:45 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[absolute path]]></category>
		<category><![CDATA[base_url()]]></category>
		<category><![CDATA[template path]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=53</guid>
		<description><![CDATA[Recently I decided to give some more time to my blog and write some short but interesting posts. I will be writing some posts about custom helper functions that I have written which helps me in application development. First on the list is a absolute path helper which creates an absolute path, relative to the &#8230; <a href="http://www.thephpx.com/2010/05/12/codeigniter-helper-absolute-path-helper/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Recently I decided to give some more time to my blog and write some short but interesting posts. I will be writing some posts about custom helper functions that I have written which helps me in application development.</p>
<p>First on the list is a absolute path helper which creates an absolute path, relative to the base of the application. I call this function <strong>base_path(&#8216;relative/url&#8217;);</strong></p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/function_exists" onclick="pageTracker._trackPageview('/outgoing/www.php.net/function_exists?referer=');"><span class="kw3">function_exists</span></a><span class="br0">&#40;</span><span class="st0">&#8216;base_path&#8217;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> base_path<span class="br0">&#40;</span><span class="re0">$relative_path_location</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> base_url<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="re0">$relative_path_location</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>The above is the code which will go into your helper file. The function formulates an absolute url from the given relative path based on base path of the application directory. It uses the existing <strong>base_url()</strong> helper function in codeigniter. So, you have make sure the URL helper is already loaded.</p>
<p><strong>Example:</strong></p>
<p>Suppose you want to tag an image which is located at &#8220;<em>application-root/images/picture.jpg</em>&#8221; to give its absolute URL in the img tag you can type as follows in your template/view file.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;img src=&quot;&lt;?php echo base_path(&#8216;images/picture.jpg&#8217;);?&gt;&quot; alt=&quot;picture&quot;/&gt;</div>
</li>
</ol>
</div>
<p>If you application is hosted at <em>domain.com </em>then it will give <em>http://www.domain.com/images/picture.jpg </em>as the returned path where <em>http://www.domain.com/</em> is the base_url();</p>
<p>thanks,</p>
<blockquote><p>thephpx</p></blockquote>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2010/05/12/codeigniter-helper-absolute-path-helper/"></g:plusone></div><div class="shr-publisher-53"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2010%2F05%2F12%2Fcodeigniter-helper-absolute-path-helper%2F&amp;title=Codeigniter%3A%20Helper%20%26%238211%3B%20absolute%20path%20helper" id="wpa2a_12" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2010_2F05_2F12_2Fcodeigniter-helper-absolute-path-helper_2F_amp_title=Codeigniter_3A_20Helper_20_26_238211_3B_20absolute_20path_20helper?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2010/05/12/codeigniter-helper-absolute-path-helper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Simple HTML DOM Parser, Codeigniter Integration</title>
		<link>http://www.thephpx.com/2009/10/25/php-simple-html-dom-parser-codeigniter-integration/</link>
		<comments>http://www.thephpx.com/2009/10/25/php-simple-html-dom-parser-codeigniter-integration/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 10:05:47 +0000</pubDate>
		<dc:creator>thephpx</dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[DOM Parser]]></category>
		<category><![CDATA[PHP simple DOM parser]]></category>

		<guid isPermaLink="false">http://www.thephpx.com/?p=48</guid>
		<description><![CDATA[Hi all, I came across &#8220;Simple HTML DOM Parser&#8221; recently that allows jQuery like DOM selection. This function is quite handy to do some kungfoo DOM manipulation on the fly! I needed to use it on codeIgniter so modified the files and integrated it into a single codeIgniter library. The original files can be accessed &#8230; <a href="http://www.thephpx.com/2009/10/25/php-simple-html-dom-parser-codeigniter-integration/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hi all,</p>
<p>I came across &#8220;Simple HTML DOM Parser&#8221; recently that allows jQuery like DOM selection. This function is quite handy to do some kungfoo DOM manipulation on the fly!</p>
<p>I needed to use it on codeIgniter so modified the files and integrated it into a single codeIgniter library. The original files can be accessed from here its <a title="link to simple html dom parser" href="http://sourceforge.net/project/showfiles.php?group_id=218559" target="_blank" onclick="pageTracker._trackPageview('/outgoing/sourceforge.net/project/showfiles.php?group_id=218559&amp;referer=');">sourceforge</a> project page. For the codeigniter version of the library <a title="codeigniter simple dom parser" href="http://www.thephpx.com/files/ci_simple_dom_parser.zip" target="_blank">click here</a>.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="re0">$this</span>-&gt;<span class="me1">load</span>-&gt;<span class="me1">library</span><span class="br0">&#40;</span><span class="st0">&#8216;domparser&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$html</span> = <span class="re0">$this</span>-&gt;<span class="me1">domparser</span>-&gt;<span class="me1">file_get_html</span><span class="br0">&#40;</span><span class="st0">&#8216;http://www.google.com/&#8217;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="re0">$rank</span> = <span class="re0">$html</span>-&gt;<span class="me1">find</span><span class="br0">&#40;</span><span class="st0">&#8216;b.gb1&#8242;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><a href="http://www.php.net/print_r" onclick="pageTracker._trackPageview('/outgoing/www.php.net/print_r?referer=');"><span class="kw3">print_r</span></a><span class="br0">&#40;</span><span class="re0">$rank</span><span class="br0">&#41;</span>; <span class="co1">// will show all content of tag with class gb1</span></div>
</li>
</ol>
</div>
<p>For further utility functions of the DOM parser visit <a href="http://simplehtmldom.sourceforge.net/manual.htm" onclick="pageTracker._trackPageview('/outgoing/simplehtmldom.sourceforge.net/manual.htm?referer=');">this link</a>.</p>
<p>Feel free to comment or contact me directly for any query.</p>
<p>take care,</p>
<blockquote><p><strong><em>thephpx</em></strong></p></blockquote>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="tall" count="1" href="http://www.thephpx.com/2009/10/25/php-simple-html-dom-parser-codeigniter-integration/"></g:plusone></div><div class="shr-publisher-48"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.thephpx.com%2F2009%2F10%2F25%2Fphp-simple-html-dom-parser-codeigniter-integration%2F&amp;title=PHP%20Simple%20HTML%20DOM%20Parser%2C%20Codeigniter%20Integration" id="wpa2a_14" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save_url=http_3A_2F_2Fwww.thephpx.com_2F2009_2F10_2F25_2Fphp-simple-html-dom-parser-codeigniter-integration_2F_amp_title=PHP_20Simple_20HTML_20DOM_20Parser_2C_20Codeigniter_20Integration?referer=');"><img src="http://www.thephpx.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.thephpx.com/2009/10/25/php-simple-html-dom-parser-codeigniter-integration/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

