<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PathFinder&#039;s Weblog</title>
	<atom:link href="http://sumonbd.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sumonbd.wordpress.com</link>
	<description>Personal weblog for Kazi Abdullah Al Mamun</description>
	<lastBuildDate>Sat, 12 Nov 2011 15:57:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sumonbd.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/8ef4620c6c553379f2c37dc6b0986efd?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>PathFinder&#039;s Weblog</title>
		<link>http://sumonbd.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sumonbd.wordpress.com/osd.xml" title="PathFinder&#039;s Weblog" />
	<atom:link rel='hub' href='http://sumonbd.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Grabbing source data using Xpath and cURL</title>
		<link>http://sumonbd.wordpress.com/2010/04/07/grabbing-data-using-xpath-and-curl/</link>
		<comments>http://sumonbd.wordpress.com/2010/04/07/grabbing-data-using-xpath-and-curl/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 16:05:52 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Technology]]></category>
		<category><![CDATA[Blueliner]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[Data grab]]></category>
		<category><![CDATA[php cURL]]></category>
		<category><![CDATA[php curl example]]></category>
		<category><![CDATA[XML path]]></category>
		<category><![CDATA[xml xpath]]></category>
		<category><![CDATA[xpath]]></category>
		<category><![CDATA[xpath attribute]]></category>
		<category><![CDATA[xpath expression]]></category>
		<category><![CDATA[Xpath+XML]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=347</guid>
		<description><![CDATA[We frequently need to grab data from remote site and there are several processes to do that. I liked process where we can garb using XML Path(xPath). XPath is used to navigate through elements and attributes in an XML document. XPath return a node result set to the calling method or application. A node is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=347&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We frequently need to grab data from remote site and there are several processes to do that. I liked process where we can garb using XML Path(xPath). XPath is used to navigate through elements and attributes in an XML document. XPath return a node result set to the calling method or application. A node is a complete element within an XML document.</p>
<p>Here is a process whether you can grab data from HTML/XHTML source using XPath and cURL.</p>
<p>The Basic Xpath Class:</p>
<p><pre class="brush: php;">
Class xpath{
	public $html;
	public $patten;
	public $childnodes = 0;
	public $attribute = 0;
	public $forbidden = 0;
	public $search = 0;
	public $br2nl = 1;
	public $return = &quot;string&quot;;
	public $charset = &quot;utf8&quot;;
	private $retrund;
	
	function __construct($html, $patten){
		$this-&gt;html = $html; 
		$this-&gt;patten = $patten;
	}
	public function execute(){
		$xpath = new DOMXPath($this-&gt;html); 
		$basenodes = $xpath-&gt;query($this-&gt;patten);
		foreach ($basenodes as $basenode){
			if($this-&gt;childnodes){
				foreach($basenode-&gt;childNodes as $childnode){
					$this-&gt;buffer($childnode);
				}
			}else{
				$this-&gt;buffer($basenode);
			}
		}
	}
	private function buffer($value){
		$preparedvalue = $this-&gt;prepare($value);
		if($preparedvalue){
			if($this-&gt;returnstring()){ 
				$this-&gt;returnd .= $preparedvalue;
			}else{
				$this-&gt;returnd[] = $preparedvalue;
			}
		}
	}
	private function returnstring(){
		if($this-&gt;return == &quot;string&quot;){
			return true;
		}else{
			return false;
		}
	}
	private function returnutf8(){
		if($this-&gt;charset == &quot;utf8&quot;){
			return true;
		}else{
			return false;
		}
	}
	private function prepare($before){
		if($before-&gt;tagName == &quot;br&quot; AND $this-&gt;br2nl){
			$before = &quot;\n&quot;;
		}else{
			if($this-&gt;attribute){
				if($this-&gt;search){
					if(in_array($before-&gt;textContent, $this-&gt;search)){
						$before = $before-&gt;getAttribute($this-&gt;attribute);	
					}else{
						$before = 0;
					}
				}else{
					$before = $before-&gt;getAttribute($this-&gt;attribute);
				}
			}else{
				if($this-&gt;search){
					if(in_array($before-&gt;textContent, $this-&gt;search)){
						$before = trim($before-&gt;textContent);
					}
				}else{
					$before = trim($before-&gt;textContent);
				}
			}
		}
		if(!$this-&gt;returnutf8()){
			$before = utf8_decode($before);
		}
		if($this-&gt;forbidden){
			if(in_array($before, $this-&gt;forbidden)){
				return false;
			}else{
				return $before;
			}
		}else{
			return $before;
		}
	}
	public function get(){
		return $this-&gt;returnd;
	}
}
</pre></p>
<p>We have to create xpath object to grab data using HTML ids/classes as nodes. At first, We need to grab page source using PHP cURL. When you have that source you can easily filter data using attributes/nodes.</p>
<p>Here is the example of fetching data using node and the process of reading HTML attributes.<br />
<pre class="brush: php;">
	$grab_path = trim(&quot;Your URL goes here&quot;);
				
	$grab_path = str_replace(&quot;&amp;amp;&quot;,&quot;&amp;&quot;,$grab_path);
	$url = urlencode($grab_path);
	$html = new DOMDocument(); 
	$html-&gt;loadHtmlFile($url); 
	
    $description = new xpath($html, '//div[@class=&quot;body_container&quot;]'); // div id name
    $description-&gt;return = &quot;string&quot;;
    $description-&gt;childnodes = 1;
    $description-&gt;forbidden = array(&quot;Body&quot;);
    $description-&gt;execute();

    $title = new xpath($html, '//h1'); //Grab h1 data 
    $title-&gt;execute();

    $image = new xpath($html, '//*[@id=&quot;main_image&quot;]'); //Grab Images
    $image-&gt;attribute = &quot;src&quot;;
    $image-&gt;execute();

    $adparams = new xpath($html, '//table[@class=&quot;params UnderlinedLinks&quot;]/tr[1]/td[1]'); //fetch tables
    $adparams-&gt;childnodes = 1;
    $adparams-&gt;return = &quot;array&quot;;
    $adparams-&gt;execute();

   $info[] = array(
		'title_name' =&gt; $title-&gt;get(), 
		'image' =&gt; $image-&gt;get(), 
	);

</pre><br />
Its very effective to retrieve data from HTML source and its easily modifiable according to CSS and HTML changes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=347&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2010/04/07/grabbing-data-using-xpath-and-curl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>23.709921 90.407143</georss:point>
		<geo:lat>23.709921</geo:lat>
		<geo:long>90.407143</geo:long>
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>Swedish Character problem in MySQL</title>
		<link>http://sumonbd.wordpress.com/2010/03/13/swedish-character-problem-in-mysql/</link>
		<comments>http://sumonbd.wordpress.com/2010/03/13/swedish-character-problem-in-mysql/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 09:37:55 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sweden swedish]]></category>
		<category><![CDATA[Swedish character]]></category>
		<category><![CDATA[Swedish character problem]]></category>
		<category><![CDATA[unicode problem in MySQL]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=340</guid>
		<description><![CDATA[Recently I faced a UNICODE encoding problem in MySQL Insert statement using PHP. When I tried to insert Swedish characters in MySQL table,the swedish characters ö, å, Ä were converted to ambiguous symbols because collation character set automatically converted to UTF8, usually I set MySQL collation into &#8220;utf8_general_ci&#8221;. At last I find a solution in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=340&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently I faced a UNICODE encoding problem in MySQL Insert statement using PHP. When I tried to insert Swedish characters in MySQL table,the swedish characters ö, å, Ä were converted to ambiguous symbols because collation character set automatically converted to UTF8, usually I set MySQL collation into &#8220;utf8_general_ci&#8221;.   </p>
<p>At last I find a solution in PHP to solve that problem, by using &#8220;mb_convert_encoding&#8221; we can convert encoding type at the insertion time.<br />
<pre class="brush: php;">
$field = mb_convert_encoding($field,&quot;iso-8859-1&quot;,&quot;utf-8&quot;);
	
@mysql_query(&quot;insert into table (field) values ('$field')&quot;);
</pre></p>
<p>This function will also work for other unicode character like spanish, Frecnch etc. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/340/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/340/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/340/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=340&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2010/03/13/swedish-character-problem-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>23.709921 90.407143</georss:point>
		<geo:lat>23.709921</geo:lat>
		<geo:long>90.407143</geo:long>
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>ভালবাসা এবং valentaine</title>
		<link>http://sumonbd.wordpress.com/2010/02/14/%e0%a6%ad%e0%a6%be%e0%a6%b2%e0%a6%ac%e0%a6%be%e0%a6%b8%e0%a6%be-%e0%a6%8f%e0%a6%ac%e0%a6%82-valentaine/</link>
		<comments>http://sumonbd.wordpress.com/2010/02/14/%e0%a6%ad%e0%a6%be%e0%a6%b2%e0%a6%ac%e0%a6%be%e0%a6%b8%e0%a6%be-%e0%a6%8f%e0%a6%ac%e0%a6%82-valentaine/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 18:11:44 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[happy valentines]]></category>
		<category><![CDATA[Love]]></category>
		<category><![CDATA[valentine]]></category>
		<category><![CDATA[valentine ideas]]></category>
		<category><![CDATA[valentines]]></category>
		<category><![CDATA[valentines day]]></category>
		<category><![CDATA[valentines hearts]]></category>
		<category><![CDATA[valentines ideas]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=333</guid>
		<description><![CDATA[ভালোবাসা শব্দটা মানুষের জীবনের সাথে যত মধুর ভাবে মিশে গেছে তা মনে হয় আর কোনো কিছই পারেনি.আবারও ভালবাসা দিবস চলে এসেছে কিন্তু ভালবাসার মোলায়েম আচর কি সবার জীবনে এসেছে.পৃথিবীর অনেক শব্দই তার জনপ্রিয়তা হারিয়েছে কিন্তু ভালবাসা শব্দটা পৃথিবীর শুরু থেকে শেষ পর্যন্ত যেন একইভাবে টিকে থাকবে. ভালবাসা জিনিসটা আমার জীবনেও এসেছে অনেক বিচিত্র ভাবে, কিন্তু [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=333&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ভালোবাসা শব্দটা মানুষের জীবনের সাথে যত মধুর ভাবে মিশে গেছে তা মনে হয় আর কোনো কিছই পারেনি.আবারও ভালবাসা দিবস চলে এসেছে কিন্তু ভালবাসার মোলায়েম আচর কি সবার জীবনে এসেছে.পৃথিবীর অনেক শব্দই তার জনপ্রিয়তা হারিয়েছে কিন্তু ভালবাসা শব্দটা পৃথিবীর শুরু থেকে শেষ পর্যন্ত যেন একইভাবে টিকে থাকবে.<br />
ভালবাসা জিনিসটা আমার জীবনেও এসেছে অনেক বিচিত্র ভাবে, কিন্তু আমার এবারের ভালবাসার অনুভুতিটা একটু অন্যরকম আমি আমার জীবনে সত্যি যেন ভালবাসা কে অনুভব করছি, ভালবাসা দিয়ে আমার জীবন পরিপূর্ণ মনে করছি. দুরে থেকেও ভালবাসা যেন সব সময়ে আমার পাশে আছে. আমার এই ভালবাসার অনুভুতিটা আজ যেন প্রতিটি যুগল অনুভব করছে. সবার ভালবাসার দিনটা হোক ভালবাসার মতই সুন্দর. ওহ যারা এখন নিজের ভালবাসার মানুষকে খুঁজে পাননি তাদের জন্য বলছি. ভালবাসা নই শুধু  যুগলদের, ভালবাসা তো সবার তাই সবাই কেই তার মাঝে ভালবাসা খুঁজে নিতে হবে. ত়া ছাড়া ভালবাসার নানা আয়োজনতো রয়েছেই<br />
ফেব্র&#8221;য়ারি 14 শুধু যুগলরাই নয়, বিশ্ব ভালবাসা দিবসের আনন্দে সামিল হতে পারে সঙ্গীহীন তরুণ তরুণীরাও।হতাশা ও যন্ত্রণায় ডুবে না থেকে নিঃসঙ্গ মানুষরাও দিনটি উদযাপন করতে পারেন।<br />
ভ্যালেন্টাইন&#8217;স ডে তে একা একা দিন না কাটিয়ে বন্ধুবিহীনরা যেন কোনো রেস্তোরাঁয় জড়ো হয়ে উৎসবে যোগ দিতে পারেন। কিংবা নিজের বাড়িতেও দিতে পারেন আন-ভ্যালেন্টাইন&#8217;স পার্টি।<br />
নিঃসঙ্গদের উদ্দেশ্য করে বলছি ,&#8221;মজা করুন, কিংবা ধরে নেন যে মজাই করছেন। মানুষকে সঙ্গে নিয়ে হলেও একাকীত্বটুকুও উদযাপন করুন।&#8221;<br />
তবে এটা শুধু কপোত কপোতি কিংবা দম্পতিদের জন্য নয়।মা বাবা ভাই বোন থেকে শুরু করে সবারই তো এই দিন.<br />
আমার এই লেখাটা আজ সকল ভালবাসার মানুষদের জন্য যারা ভালবাসতে পছন্দ করে আর যারা ভালবাসা পেতে পছন্দ করে. ভালবাসার জয় হোক , ভালবাসা থাকুক সবার মাঝে.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/333/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=333&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2010/02/14/%e0%a6%ad%e0%a6%be%e0%a6%b2%e0%a6%ac%e0%a6%be%e0%a6%b8%e0%a6%be-%e0%a6%8f%e0%a6%ac%e0%a6%82-valentaine/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<georss:point>23.709921 90.407143</georss:point>
		<geo:lat>23.709921</geo:lat>
		<geo:long>90.407143</geo:long>
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>Bread Crumb Component for CakePHP</title>
		<link>http://sumonbd.wordpress.com/2010/02/12/bread-crumb/</link>
		<comments>http://sumonbd.wordpress.com/2010/02/12/bread-crumb/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 09:34:23 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[Cake PHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[breadcrumb]]></category>
		<category><![CDATA[breadcrumb how to]]></category>
		<category><![CDATA[breadcrumb trail]]></category>
		<category><![CDATA[breadcrumbs]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp component]]></category>
		<category><![CDATA[cakephp components]]></category>
		<category><![CDATA[cakephp helper]]></category>
		<category><![CDATA[PHP frameworks]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/2010/02/12/bread-crumb/</guid>
		<description><![CDATA[Webpage Bread crumbing is common feature in web development. Breadcrumbs usually appear horizontally across the top of a web page, normally just below title bars or headers. BreadCrumb gives users a way to keep track of their locations within programs or documents. For using breadCrumb there must be a common component whether its can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=330&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Webpage Bread crumbing is common feature in web development. Breadcrumbs usually appear horizontally across the top of a web page, normally just below title bars or headers. BreadCrumb gives users a way to keep track of their locations within programs or documents. For using breadCrumb there must be a common component whether its can be effective in all pages through out the Site.<br />
Here I show how to create and use a breadcrumb component in CakePHP.</p>
<p><pre class="brush: php;">
&lt;?php	
class BreadcrumbComponent extends Object
{
  var $controller;
  var $components = array('Session','Acl');

  function startup(&amp;$controller)
  {
    $this-&gt;controller =&amp; $controller; 
  }
    
	function setBreadcrumb($url)
	{
		$crumbs = split('/',$url);
		$link = '/';
		
		if($crumbs[0] != 'admin')
		{
			$breadcrumb[] = array('home', $link);
		}
		
		foreach($crumbs AS $crumb)
		{
			$name = str_replace('_',' ', $crumb);
			$link .= $crumb.'/';
			if($name &amp;&amp; !is_numeric($name))
			{
				$breadcrumb[] = array($name,$link);
			}
			elseif(is_numeric($name))
			{
				$key = count($breadcrumb)-1;
				$breadcrumb[$key][1].= $name;
			}
		}
		
		return $breadcrumb;
	}
	
}
?&gt;
</pre></p>
<p>Load the Component:</p>
<p><pre class="brush: php;">
var $components = array( 'Breadcrumb');
</pre></p>
<p>Call from the controller:</p>
<p><pre class="brush: php;">
function beforeRender()
	{
		$this-&gt;set('breadcrumb', $this-&gt;Breadcrumb-&gt;setBreadcrumb($this-&gt;params['url']['url']));
	}

</pre></p>
<p>This need to be modified according to sitemap</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/330/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=330&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2010/02/12/bread-crumb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>23.709921 90.407143</georss:point>
		<geo:lat>23.709921</geo:lat>
		<geo:long>90.407143</geo:long>
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>File downlaod using CodeIgniter</title>
		<link>http://sumonbd.wordpress.com/2010/02/12/file-downlaod-using-codeigniter/</link>
		<comments>http://sumonbd.wordpress.com/2010/02/12/file-downlaod-using-codeigniter/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 06:53:08 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[blueline]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[codeigniter download]]></category>
		<category><![CDATA[file downlaoder]]></category>
		<category><![CDATA[File Download codeigniter]]></category>
		<category><![CDATA[how to file]]></category>
		<category><![CDATA[php file uploading]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=328</guid>
		<description><![CDATA[CodeIgniter has a nice helper class to download files. Its a nice way to download from server without any hassle just writing one single controller function. In view section, just call the download function thats it. Its the most simple process to download using CodeIgniter<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=328&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>CodeIgniter has a nice helper class to download files. Its a nice way to download from server without any hassle just writing one single controller function.<br />
<pre class="brush: php;">
public function download ($file_path = &quot;&quot;)
	{
			$this-&gt;load-&gt;helper('download'); //load helper
			
			//$file_path = $this-&gt;input-&gt;post(&quot;file_path&quot;,TRUE);
			
			$layout=&quot;no_theme&quot;; //if you have layout
			
			$data['download_path'] = $file_path;		
						
			$this-&gt;load-&gt;view(&quot;view file&quot;,$data);
			redirect(&quot;same url&quot;, &quot;refresh&quot;);						
					
	}
</pre> </p>
<p>In view section, just call the download function thats it.</p>
<p><pre class="brush: php;">
	if( ! empty($download_path))
	{
		$data = file_get_contents(base_url() .&quot;/...path.../&quot;.$download_path); // Read the file's contents
		$name = $download_path;

		force_download($name, $data);

	}
</pre> 	</p>
<p>Its the most simple process to download using CodeIgniter</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/328/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/328/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/328/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=328&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2010/02/12/file-downlaod-using-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>23.709921 90.407143</georss:point>
		<geo:lat>23.709921</geo:lat>
		<geo:long>90.407143</geo:long>
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>URL Shortening using bit.ly</title>
		<link>http://sumonbd.wordpress.com/2010/01/03/url-shortening-using-bit-ly/</link>
		<comments>http://sumonbd.wordpress.com/2010/01/03/url-shortening-using-bit-ly/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 15:15:07 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[bit.ly]]></category>
		<category><![CDATA[bit.ly API]]></category>
		<category><![CDATA[blue line]]></category>
		<category><![CDATA[blueline]]></category>
		<category><![CDATA[blueline forums]]></category>
		<category><![CDATA[URL shortener]]></category>
		<category><![CDATA[URL shortener API]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=316</guid>
		<description><![CDATA[The bit.ly API allows developers to interact in a programmatic way with the bit.ly website. The current API version is 2.0.1. It&#8217;s a very simple way to shorten the URL through bit.ly API. It&#8217;s too simple to call that API.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=316&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The bit.ly API allows developers to interact in a programmatic way with the bit.ly website. The current API version is 2.0.1.<br />
It&#8217;s a very simple way to shorten the URL through bit.ly API.</p>
<p><pre class="brush: php;">
	/**
     * Function: URL_shortener
     *
     * @description : Create a shorten URl from a long URL
     * @param  $ : $url
     * @return : none
     * @author : sumon.
     * @last -modified-by: sumon.
     */

	function URL_shortener($url =&quot;&quot;)
	{
		$api_data = file_get_contents(&quot;http://api.bit.ly/shorten?version=2.0.1&amp;longUrl=&quot;.$url.&quot;&amp;login=bitlyapidemo&amp;apiKey=R_0da49e0a9118ff35f52f629d2d71bf07&quot;);
		$array_data = json_decode($api_data);
		$result = $array_data-&gt;results;
		
		foreach($result as $results)
		{
			$short_url = $results-&gt;shortUrl;
		}
		return $short_url;
	}
	
	
</pre></p>
<p>It&#8217;s too simple to call that API. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=316&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2010/01/03/url-shortening-using-bit-ly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>YouTube video grabbing using Zend Gdata with Codeigniter</title>
		<link>http://sumonbd.wordpress.com/2009/12/31/youtube-video-grabbing-using-zend-gdata-with-codeigniter/</link>
		<comments>http://sumonbd.wordpress.com/2009/12/31/youtube-video-grabbing-using-zend-gdata-with-codeigniter/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 14:43:47 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Farmework]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[Gdata class in Zend framework]]></category>
		<category><![CDATA[Use Gdata with code Igniter]]></category>
		<category><![CDATA[zend framewok with codeigniter]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=310</guid>
		<description><![CDATA[The YouTube Data API allows client applications to retrieve and update YouTube content in the form of Google Data API feeds. The client application can use the YouTube Data API to fetch video feeds, comments, responses, and playlists, as well as modify this information and to upload new video content to the site. There is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=310&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The YouTube Data API allows client applications to retrieve and update YouTube content in the form of Google Data API feeds. The client application can use the YouTube Data API to fetch video feeds, comments, responses, and playlists, as well as modify this information and to upload new video content to the site.</p>
<p>There is a awesome Client Library in PHP distributed by Zend is a part of zend framework which is very effective and powerful class to retrieve that from Google. This can be easily integrated with Codeigniter.<br />
Here I share a Class which is very useful to Grad data from Youtube using Gdata class with Codeigniter.<br />
<pre class="brush: php;">
&lt;?php

class Youtube extends Controller
{
	public $layout=&quot;default&quot;;
	
	function __construct()
	{
		parent::Controller();
		$this-&gt;load-&gt;library(&quot;zend&quot;);
		$this-&gt;zend-&gt;load(&quot;Zend/Gdata/YouTube&quot;);
		
		$youtube = new Zend_Gdata_YouTube();
		$this-&gt;lang-&gt;load(&quot;resource&quot;);
		$this-&gt;load-&gt;helper(&quot;text&quot;);
	}

	function index()
	{
	
		//$youtube = new Zend_Gdata_YouTube();
		
		//Grab Video data
		$videoEntry = $youtube-&gt;getVideoEntry('video_code');
		
		//Grab Channel data
		$this-&gt;getAndPrintUserUploads(&quot;youtube_channel_name&quot;);
		
		$this-&gt;load-&gt;view('youtube_view', $data);
	}
	
	function getAndPrintUserUploads($userName)                    
	{     
		  $youtube = new Zend_Gdata_YouTube();
		  $youtube-&gt;setMajorProtocolVersion(2);
		  $this-&gt;printVideoFeed($youtube-&gt;getuserUploads($userName),$page=1,$page_counter=1);
	}  
		
	function printVideoFeed($videoFeed)
	{
		  $data['no_sidebar'] = true;
		  $count = 1;
		  
		  foreach ($videoFeed as $videoEntry) 
		  {
			
				//$this-&gt;printVideoEntry($videoEntry);
				$video_info[$count]['title'] = $videoEntry-&gt;getVideoTitle();
				$video_info[$count]['id']    = $videoEntry-&gt;getVideoId();
				$video_info[$count]['desc']  = $videoEntry-&gt;getVideoDescription();
				$video_info[$count]['tags']  = implode(&quot;, &quot;, $videoEntry-&gt;getVideoTags());
				$video_info[$count]['updated']  = $videoEntry-&gt;getUpdated();
				$video_info[$count]['category']  = $videoEntry-&gt;getVideoCategory();				
				
				$count++;
		  }
		//pre($video_info);
		
		$data['video_info'] = $video_info;
		$this-&gt;load-&gt;view(&quot;resources/youtube_list_view&quot;,$data);
	}
	
		
	
	function printVideoEntry($videoEntry) 
	{
	  // the videoEntry object contains many helper functions
	  // that access the underlying mediaGroup object
	  echo 'Video: ' . $videoEntry-&gt;getVideoTitle() . &quot;&lt;br&gt;&quot;;
	  echo 'Video ID: ' . $videoEntry-&gt;getVideoId() . &quot;&lt;br&gt;&quot;;
	  echo 'Updated: ' . $videoEntry-&gt;getUpdated() . &quot;&lt;br&gt;&quot;;
	  echo 'Description: ' . $videoEntry-&gt;getVideoDescription() . &quot;&lt;br&gt;&quot;;
	  echo 'Category: ' . $videoEntry-&gt;getVideoCategory() . &quot;&lt;br&gt;&quot;;
	  echo 'Tags: ' . implode(&quot;, &quot;, $videoEntry-&gt;getVideoTags()) . &quot;&lt;br&gt;&quot;;
	  echo 'Watch page: ' . $videoEntry-&gt;getVideoWatchPageUrl() . &quot;&lt;br&gt;&quot;;
	  echo 'Flash Player Url: ' . $videoEntry-&gt;getFlashPlayerUrl() . &quot;&lt;br&gt;&quot;;
	  echo 'Duration: ' . $videoEntry-&gt;getVideoDuration() . &quot;&lt;br&gt;&quot;;
	  echo 'View count: ' . $videoEntry-&gt;getVideoViewCount() . &quot;&lt;br&gt;&quot;;
	  echo 'Rating: ' . $videoEntry-&gt;getVideoRatingInfo() . &quot;&lt;br&gt;&quot;;
	  echo 'Geo Location: ' . $videoEntry-&gt;getVideoGeoLocation() . &quot;&lt;br&gt;&quot;;
	  echo 'Recorded on: ' . $videoEntry-&gt;getVideoRecorded() . &quot;&lt;br&gt;&quot;;
	  
	  // see the paragraph above this function for more information on the 
	  // 'mediaGroup' object. in the following code, we use the mediaGroup
	  // object directly to retrieve its 'Mobile RSTP link' child
	  foreach ($videoEntry-&gt;mediaGroup-&gt;content as $content) {
		if ($content-&gt;type === &quot;video/3gpp&quot;) {
		  echo 'Mobile RTSP link: ' . $content-&gt;url . &quot;&lt;br&gt;&quot;;
		}
	  }
  
  echo &quot;Thumbnails:&lt;br&gt;&quot;;
  $videoThumbnails = $videoEntry-&gt;getVideoThumbnails();

		  foreach($videoThumbnails as $videoThumbnail) {
			echo $videoThumbnail['time'] . ' - ' . $videoThumbnail['url'];
			echo ' height=' . $videoThumbnail['height'];
			echo ' width=' . $videoThumbnail['width'] . &quot;&lt;br&gt;&quot;;
		  }
	}

}

?&gt;
</pre><br />
Zend provides some cool library classes for Youtube.</p>
<p>There is another way to grab youtube data from youtube Channel that is grabbing from API feed.  Which is another easy process.</p>
<p><pre class="brush: php;">

/**
 * Function: youtube data grabber
 *
 * @description :
 * @param  $ : video code, url type (embed/url)
 * @return : data array
 * @author : Mamun.
 * @last -modified-by: Mamun.
 */
if (! function_exists('youtube_data_grabber' ))
{

		function youtube_data_grabber($video_code, $link_type = &quot;embed&quot;)
		{
				if ($video_code != '')
				{
					if ($link_type == &quot;embed&quot;)
					{
						$splited_data = explode(&quot;=&quot;,$video_code);
						$video_unique_code = substr(strrchr($splited_data[4],&quot;/&quot;),1,-strlen(strrchr($splited_data[4],&quot;&amp;&quot;)));

					}
					else if ($link_type == &quot;url&quot;)
					{
						$splited_data = explode(&quot;=&quot;,$video_code);
						$video_unique_code = substr($splited_data[1],0,-strlen(strrchr($splited_data[1],&quot;&amp;&quot;)));
					}
					else
					{
						return;
					}

						// set feed URL
						$feedURL = 'http://gdata.youtube.com/feeds/api/videos/'.$video_unique_code;

						// read feed into SimpleXML object
						$sxml = simplexml_load_file($feedURL);

					return $sxml;
				}

		}
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=310&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2009/12/31/youtube-video-grabbing-using-zend-gdata-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>Thumbnail Grabbing from Youtube Video</title>
		<link>http://sumonbd.wordpress.com/2009/11/17/thumbnail-grabbing-from-youtube-video/</link>
		<comments>http://sumonbd.wordpress.com/2009/11/17/thumbnail-grabbing-from-youtube-video/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 04:15:58 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CI+youtube]]></category>
		<category><![CDATA[Codeigniter+youtube]]></category>
		<category><![CDATA[image grabbing using pHP]]></category>
		<category><![CDATA[youtube image]]></category>
		<category><![CDATA[youtube thumbnail]]></category>
		<category><![CDATA[youtube+php]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=299</guid>
		<description><![CDATA[You Tube provides two types (small/large) of thumbnails for each video. It quite simple task to grab thumbnail from YouTube video. I created this function for grabbing thumbnails form YouTube videos. Its able to grab from both URL and Embedded code and also small and large size. Function Body: Calling Function: Its Cool.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=299&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You Tube provides two types (small/large) of thumbnails for each video. It quite simple task to grab thumbnail from YouTube video. I created this function for grabbing  thumbnails form YouTube videos. Its able to grab from both URL and Embedded code and also small and large size.</p>
<p>Function Body:</p>
<p><pre class="brush: php;">
/**
* Function: youtube thumb grabber
*
* @description :
* @param  $ : video code, url type (embed/url),size (small/Large),thumb link
* @return : thumb path
* @author : Mamun.
* @last -modified-by: Mamun.
*/
if (! function_exists('youtube_thumb_grabber' ))
{

     function youtube_thumb_grabber($video_code, $link_type = &quot;embed&quot;, $size = &quot;small&quot;, $thumb_link = &quot;&quot;)
    {
            if ($video_code != '')
            {
                   if ($link_type == &quot;embed&quot;)
                   {

                                  $splited_data = explode(&quot;=&quot;,$video_code);

                                  $video_unique_code = substr(strrchr($splited_data[4],&quot;/&quot;),1,-strlen(strrchr($splited_data[4],&quot;&amp;&quot;)));

                  }
                  else if ($link_type == &quot;url&quot;)
                  {
                                  $splited_data = explode(&quot;=&quot;,$video_code);
                                  $video_unique_code = substr($splited_data[1],0,-strlen(strrchr($splited_data[1],&quot;&amp;&quot;)));
                  }
                  else
                  {
                                  return;
                  }

                  if($size == &quot;small&quot;)
                  {
                            return &quot;&lt;a href=\&quot;$thumb_link\&quot;&gt;&lt;img src=\&quot;http://img.youtube.com/vi/$video_unique_code/2.jpg\&quot; alt=\&quot;No image\&quot; /&gt;&lt;/a&gt;&quot;;
                  }
                  else if ($size == &quot;large&quot;)
                  {
                            return &quot;&lt;a href=\&quot;$thumb_link\&quot;&gt;&lt;img src=\&quot;http://img.youtube.com/vi/$video_unique_code/0.jpg\&quot; alt=\&quot;No image\&quot; /&gt;&lt;/a&gt;&quot;;
                  }
                  else
                  {
                            return &quot;&lt;a href=\&quot;$thumb_link\&quot;&gt;&lt;img src=\&quot;http://img.youtube.com/vi/$video_unique_code/2.jpg\&quot; alt=\&quot;No image\&quot; /&gt;&lt;/a&gt;&quot;;

                   }

             }

      }
}

</pre></p>
<p>Calling Function:</p>
<p><pre class="brush: php;">
&lt;?php 

echo youtube_thumb_grabber($video[&quot;video_code&quot;],&quot;embed&quot;,&quot;small&quot;,&quot;resources/videos/view/&quot;.$video[&quot;video_title_url&quot;]);

?&gt;

</pre></p>
<p>Its Cool. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/299/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/299/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=299&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2009/11/17/thumbnail-grabbing-from-youtube-video/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>Star Rating using Jquery and CodeIgniter</title>
		<link>http://sumonbd.wordpress.com/2009/10/23/star-rating-using-jquery-and-codeigniter/</link>
		<comments>http://sumonbd.wordpress.com/2009/10/23/star-rating-using-jquery-and-codeigniter/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 18:13:25 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Jquery + codeigniter]]></category>
		<category><![CDATA[Jquery + star rating]]></category>
		<category><![CDATA[JQuery rating]]></category>
		<category><![CDATA[jqyery+codeigniter+rating]]></category>
		<category><![CDATA[star rating]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=274</guid>
		<description><![CDATA[In all Entertainment sites, Star rating is a common phenomena. We need to use star rating for rating different resources like videos, articles, thesis, posts even sometimes persons. JQuery has an excellent Star Rating plugin, which I recently use with PHP CodeIgniter. This is very simple to integrate with controller and show high quality rating options. Jquery Call: Controller [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=274&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In all Entertainment sites, Star rating is a common phenomena. We need to use star rating for rating different resources like videos, articles, thesis, posts even sometimes persons. JQuery has an excellent Star Rating plugin, which I recently use with PHP CodeIgniter. This is very simple to integrate with controller and show high quality rating options.</p>
<p>Jquery Call:</p>
<p><pre class="brush: jscript;">

$(function() {
       $('.auto-submit-star').rating({
            required: true,
            callback: function(value, link) {

            $.ajax({
                     type: &quot;post&quot;,
                     url: site_url + &quot;user/view/star&quot;,
                     dataType: &quot;json&quot;,
                     data: &quot;&amp;video=&quot; + $('#video_url').val() + &quot;&amp;rate_val=&quot; + value,

              success: function(e) {
                   $.jGrowl(e.code + &quot;&lt;br&gt;&quot; + e.msg);
               }
         });
     }
});
</pre></p>
<p>Controller Method:</p>
<p><pre class="brush: php;">
public function star()
    {
        $rate = $this-&gt;input-&gt;post(&quot;rate_val&quot;, true);
        $video_url = $this-&gt;input-&gt;post(&quot;video&quot;, true);
        $this-&gt;load-&gt;model(&quot;Model Name&quot;);
        $video_id = $this-&gt;model_name-&gt;get_video_id($video_url);
        unset($this-&gt;layout); //Block template Layout
        if (get_user_id())   //get_user_id() return login user id
        {
            if (!$this-&gt;model_name-&gt;is_video_rated(get_user_id(), $video_id))
            {
                $data = array(&quot;video_id&quot; =&gt; $video_id,
                    &quot;user_id&quot; =&gt; get_user_id(),
                    &quot;videos_rating_value&quot; =&gt; $rate,
                    &quot;videos_rating_date&quot; =&gt; &quot;&quot; . date(&quot;Y-m-d H:i:s&quot;) . &quot;&quot;
                    );
                if ($this-&gt;model_name-&gt;insert_rating($data, $video_id, $rate))
                {
                    echo json_encode(array(&quot;code&quot; =&gt; &quot;Success&quot;, &quot;msg&quot; =&gt; &quot;Your Video Rating has been posted&quot;));
                }
                else
                {
                    echo json_encode(array(&quot;code&quot; =&gt; &quot;Error&quot;, &quot;msg&quot; =&gt; &quot;There was a problem rating your video&quot;));
                }
            }
            else
            {
                echo json_encode(array(&quot;code&quot; =&gt; &quot;Error&quot;, &quot;msg&quot; =&gt; &quot;You have already rated this video&quot;));
            }
        }
        else
        {
            echo json_encode(array(&quot;code&quot; =&gt; &quot;Error&quot;, &quot;msg&quot; =&gt; &quot;You have to login to rate the video&quot;));
        }
        exit(0);
    }
</pre></p>
<p>Presentation View:</p>
<p><pre class="brush: php;">
    if (!get_user_id()) //Check if user logged in
    {
        $radio_level = &quot;disabled&quot;;
    }
    else
    {
        $radio_level = &quot; &quot;;
    }

    for($i = 1;$i &lt;= 5;$i++)
    {
        if ($i == round($row[&quot;total_rate&quot;]))
        {
       ?&gt;
       &lt;input class=&quot;auto-submit-star&quot; type=&quot;radio&quot; name=&quot;rating&quot; &lt;?php echo &quot;$radio_level&quot;;

            ?&gt; value=&quot;&lt;?php echo $i;

            ?&gt;&quot; checked=&quot;checked&quot;/&gt;
	&lt;?php
        }
        else
        {
         ?&gt;
	&lt;input class=&quot;auto-submit-star&quot; type=&quot;radio&quot; name=&quot;rating&quot; &lt;?php echo &quot;$radio_level&quot;;

            ?&gt; value=&quot;&lt;?php echo $i;

            ?&gt;&quot;/&gt;
   &lt;?php
        }
    } //end of for
?&gt;
    </pre></p>
<p>Its a very cool <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  rating JQuery plugins.<br />
For demo <a href="http://www.fyneworks.com/jquery/star-rating/#tab-Testing" target="_blank">click</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/274/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/274/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=274&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2009/10/23/star-rating-using-jquery-and-codeigniter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
		<item>
		<title>Import CSV to MySQL</title>
		<link>http://sumonbd.wordpress.com/2009/10/22/import-csv-to-mysql/</link>
		<comments>http://sumonbd.wordpress.com/2009/10/22/import-csv-to-mysql/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 14:50:03 +0000</pubDate>
		<dc:creator>kazi abdullah al Mamun (sumon)</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[CSV import]]></category>
		<category><![CDATA[CSV to MYSQL]]></category>
		<category><![CDATA[data import to mysql]]></category>
		<category><![CDATA[Import MySQL]]></category>

		<guid isPermaLink="false">http://sumonbd.wordpress.com/?p=269</guid>
		<description><![CDATA[Import from CSV to MySQL is pretty simple and just a matter of single line command. This post might be helpful for those are newbie in PHP/MySQL. The command: Be careful about the &#8220;\\\&#8221; after drive letter and the data type for MySQL table fields. data type should be set according to CSV data format.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=269&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Import from CSV to MySQL is pretty simple and just a matter of single line command. This post might be helpful for those are newbie in PHP/MySQL.</p>
<p>The command:</p>
<p><pre class="brush: php;">

LOAD DATA LOCAL INFILE 'Drive Letter:\\\file_name.csv'
into TABLE table_name
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(field1,field2,field3)

</pre></p>
<p>Be careful about the <strong>&#8220;\\\&#8221;</strong> after drive letter and the data type for MySQL table fields. data type should be set according<br />
to CSV data format.<br />
<!--Session data--></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sumonbd.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sumonbd.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sumonbd.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sumonbd.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sumonbd.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sumonbd.wordpress.com/269/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sumonbd.wordpress.com/269/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sumonbd.wordpress.com/269/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sumonbd.wordpress.com&amp;blog=3086285&amp;post=269&amp;subd=sumonbd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sumonbd.wordpress.com/2009/10/22/import-csv-to-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d1760789025e0a28e722f7c93bb7d08d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sumonbd</media:title>
		</media:content>
	</item>
	</channel>
</rss>
