<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0MFSHYzfyp7ImA9WhVTEEg.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471</id><updated>2012-02-23T19:50:19.887-08:00</updated><category term="yahoo" /><category term="technology" /><category term="jquery tips" /><category term="javascript" /><category term="magento-extension" /><category term="admin" /><category term="web" /><category term="how to" /><category term="api" /><category term="linkedin" /><category term="chrome" /><category term="effects" /><category term="module" /><category term="css" /><category term="OOPS" /><category term="web 2.0" /><category term="animation" /><category term="wordpress plugins" /><category term="tips n tricks" /><category term="performance" /><category term="payment-gateway" /><category term="JSON" /><category term="facebook" /><category term="debug" /><category term="mootools" /><category term="twitter api" /><category term="orkut" /><category term="mysql" /><category term="google maps" /><category term="maoneybookers" /><category term="php" /><category term="ajax" /><category term="jquery-plugin" /><category term="security" /><category term="facebook api" /><category term="css3" /><category term="webdesign" /><category term="wordpress" /><category term="pdf" /><category term="webservice" /><category term="jquery" /><category term="paypal" /><category term="twitter" /><category term="optimization" /><category term="design" /><category term="regular expressions" /><category term="magento" /><category term="tweaks" /><category term="gmail" /><category term="google" /><title>Web Speaks</title><subtitle type="html">'WebSpeaks.in provides excellent tutorials on Jquery, JavaScript, PHP, CSS, Magento, Wordpress, Facebook API, Twitter API, PHP security tips.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.webspeaks.in/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.webspeaks.in/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>107</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WebSpeaks" /><feedburner:info uri="webspeaks" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by/2.0/" /><logo>http://creativecommons.org/images/public/somerights20.gif</logo><feedburner:emailServiceId>WebSpeaks</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/WebSpeaks" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FWebSpeaks" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><entry gd:etag="W/&quot;C08FSHw8cSp7ImA9WhRaGUQ.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-6029333755885953956</id><published>2012-02-23T02:05:00.000-08:00</published><updated>2012-02-23T02:10:19.279-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-23T02:10:19.279-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web 2.0" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook api" /><title>Create Album and Upload Photo to Facebook Fan Page using PHP</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this series of Facebook API tutorials, today we will continue with creating albums on Facebook Fan Page. The main meat of this tutorial is getting the right access token for your fan page. To get the right access token, follow these steps:&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;Go to https://developers.facebook.com/tools/explorer?method=GET&amp;amp;path=me%2Faccounts&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Enter https://graph.facebook.com/me/accounts in the second text box&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Click on submit&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Json data will be returned&amp;nbsp;&lt;/li&gt;
&lt;li&gt;From that select the access token of your Fan page.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Other Facebook Tutorials:&lt;br /&gt;
&lt;a href="http://www.webspeaks.in/2011/12/upload-photos-to-facebook-fan-page.html"&gt;How to upload photos to you Facebook Fan Page&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.webspeaks.in/2011/09/access-faceook-photo-albums-using-php.html"&gt;Access Facebook Photo Albums using PHP - v1.0&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.webspeaks.in/2011/08/upload-photos-on-facebook-using-php.html"&gt;Upload photos on Facebook using PHP&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://draft.blogger.com/demos.frnzzz.com/fbAlbum/create_n_upload_to_fanpage.php" target="_blank"&gt;See it working&lt;/a&gt;&lt;br /&gt;

&lt;a name='more'&gt;&lt;/a&gt;&lt;a class="demo" href="http://demos.frnzzz.com/fbAlbum/create_n_upload_to_fanpage.php" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://www.box.com/s/90bqt30bcd0p6uku5l73" target="_blank"&gt;Download Script&lt;/a&gt;

&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
require_once 'library/facebook.php';
$facebook = new Facebook(array(
 'appId'  =&amp;gt; '&amp;lt;app_id&amp;gt;',
 'secret' =&amp;gt; '&amp;lt;app_sercret&amp;gt;',
 'fileUpload' =&amp;gt; true
));
?&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;WebSpeaks.in | Create album and upload photos to Facebook Fan Page&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
//It can be found at https://developers.facebook.com/tools/access_token/
$access_token = '&amp;lt;you_access_token&amp;gt;';

$params = array('access_token' =&amp;gt; $access_token);

//The id of the fanpage
$fanpage = '&amp;lt;your_fan_page_id&amp;gt;';

/*
 * Go to https://developers.facebook.com/tools/explorer?method=GET&amp;amp;path=me%2Faccounts
 * Enter https://graph.facebook.com/me/accounts in the second text box
 * Click on submit
 * Json data will be returned
 * From that select the access token of your Fan page
*/
$page_access_token = '&amp;lt;your_page_access_token&amp;gt;';
$facebook-&amp;gt;setAccessToken($page_access_token);

$facebook-&amp;gt;setFileUploadSupport(true);

//Create an album
$album_details = array(
        'message'=&amp;gt; 'Test album',
        'name'=&amp;gt; 'Album name'.date('Y-m-d H:i:s') //should be unique each time
);
$album = $facebook-&amp;gt;api('/'.$fanpage.'/albums', 'post', $album_details);

//The id of the album
$album_id =$album['id'];

//Replace arvind07 with your Facebook ID
$accounts = $facebook-&amp;gt;api('/arvind07/accounts', 'GET', $params);

foreach($accounts['data'] as $account) {
 if( $account['id'] == $fanpage || $account['name'] == $fanpage ){
  $fanpage_token = $account['access_token'];
 }
}

$valid_files = array('image/jpeg', 'image/png', 'image/gif');

if(isset($_FILES) &amp;amp;&amp;amp; !empty($_FILES)){
 if( !in_array($_FILES['pic']['type'], $valid_files ) ){
  echo 'Only jpg, png and gif image types are supported!';
 }else{
  #Upload photo here
  $img = realpath($_FILES["pic"]["tmp_name"]);

  $args = array(
   'message' =&amp;gt; 'This photo was uploaded via WebSpeaks.in',
   'image' =&amp;gt; '@' . $img,
   'aid' =&amp;gt; $album_id,
   'no_story' =&amp;gt; 0,
   'access_token' =&amp;gt; $fanpage_token
  );

  $photo = $facebook-&amp;gt;api($album_id . '/photos', 'post', $args);
  if( is_array( $photo ) &amp;amp;&amp;amp; !empty( $photo['id'] ) ){
   echo '&amp;lt;p&amp;gt;&amp;lt;a target="_blank" href="http://www.facebook.com/photo.php?fbid='.$photo['id'].'"&amp;gt;Click here to watch this photo on Facebook.&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';
  }
 }
}

?&amp;gt;
 &amp;lt;!-- Form for uploading the photo --&amp;gt;
 &amp;lt;div class="main"&amp;gt;
  &amp;lt;p&amp;gt;Select a photo to upload on Facebook Fan Page&amp;lt;/p&amp;gt;
  &amp;lt;form method="post" action="&amp;lt;?php echo $_SERVER['PHP_SELF']; ?&amp;gt;" enctype="multipart/form-data"&amp;gt;
  &amp;lt;p&amp;gt;Select the image: &amp;lt;input type="file" name="pic" /&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;&amp;lt;input class="post_but" type="submit" value="Create album and Upload" /&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;/form&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-6029333755885953956?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yb9R2zDU4I5dR2m0oPdhX8EnoIM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yb9R2zDU4I5dR2m0oPdhX8EnoIM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yb9R2zDU4I5dR2m0oPdhX8EnoIM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yb9R2zDU4I5dR2m0oPdhX8EnoIM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=xeG1SxAdrpU:G1Q1iSxWV3E:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=xeG1SxAdrpU:G1Q1iSxWV3E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=xeG1SxAdrpU:G1Q1iSxWV3E:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=xeG1SxAdrpU:G1Q1iSxWV3E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=xeG1SxAdrpU:G1Q1iSxWV3E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=xeG1SxAdrpU:G1Q1iSxWV3E:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=xeG1SxAdrpU:G1Q1iSxWV3E:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/xeG1SxAdrpU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/6029333755885953956/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2012/02/create-album-and-upload-photo-to.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6029333755885953956?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6029333755885953956?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/xeG1SxAdrpU/create-album-and-upload-photo-to.html" title="Create Album and Upload Photo to Facebook Fan Page using PHP" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.webspeaks.in/2012/02/create-album-and-upload-photo-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQDQ384fyp7ImA9WhRbE0o.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-250109024048005507</id><published>2012-02-04T09:10:00.000-08:00</published><updated>2012-02-04T09:26:12.137-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-04T09:26:12.137-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tips n tricks" /><category scheme="http://www.blogger.com/atom/ns#" term="magento" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Programmatically Add Grouped Product to Cart in Magento</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Adding simple products to cart through custom PHP code is pretty straight forward. You just need to call the '&lt;span style="background-color: orange; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;$cart-&amp;gt;addProduct()&lt;/span&gt;' function with the product_id and quantity as parameters. But if you want to add grouped products to cart through your code, you will need to perform few additional steps. The process is very easy - create an '$super_group' array of the associated products with the specified quantities. Then you need to pass the array to the 'addProduct()' function. See the actual code below that makes it work:

&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
//Array for holding the associated products
$super_group = array();

//Id of the grouped product
$parentId = &amp;lt;grouped_product_id&amp;gt;;

//Create an array of associated products
$children = array('&amp;lt;child_id_1&amp;gt;','&amp;lt;child_id_2&amp;gt;','&amp;lt;child_id_3&amp;gt;');

//Quantity of each child product to be addede to cart
$child_qty = 2;

//Add all child products to $super_group with product_id as key and quantity as value
foreach($children as $child){
 if(intval($child)){
   $super_group[$child] = $child_qty;
  }
 }
}

//Add Grouped product to cart
try {
 //Get object of main grouped product
 $product = Mage::getModel('catalog/product')-&amp;gt;load($parentId);
 
 //Check product availability
 if (!$product) {
  echo "Error in product!";
  return;
 }

 //Get cart object
 $cart = Mage::getModel('checkout/cart');

 //Create params for grouped product
 $params = array('super_group' =&amp;gt; $super_group);

 //Add product to cart with specified parameters and save the cart object
 $cart-&amp;gt;addProduct($product, $params)-&amp;gt;save();

 Mage::getSingleton('checkout/session')-&amp;gt;setCartWasUpdated(true);
  
 echo $this-&amp;gt;__('%s was added to your shopping cart.', Mage::helper('core')-&amp;gt;htmlEscape($product-&amp;gt;getName()));

}
catch (Mage_Core_Exception $e){
 if (Mage::getSingleton('checkout/session')-&amp;gt;getUseNotice(true)){
  echo $this-&amp;gt;__($e-&amp;gt;getMessage());
 }
 else{
  $messages = array_unique(explode("\n", $e-&amp;gt;getMessage()));
  foreach ($messages as $message) {
   echo "&amp;lt;br /&amp;gt;".$message;
  }
 }
}
catch (Exception $e){
 echo $this-&amp;gt;__('Cannot add the item to shopping cart.');
}
?&amp;gt; 
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-250109024048005507?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AuZ-v2Dg_nOexqO1_hodReySZsE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AuZ-v2Dg_nOexqO1_hodReySZsE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AuZ-v2Dg_nOexqO1_hodReySZsE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AuZ-v2Dg_nOexqO1_hodReySZsE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=s9c2YSQ2BRc:CqFyf0gplB0:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=s9c2YSQ2BRc:CqFyf0gplB0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=s9c2YSQ2BRc:CqFyf0gplB0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=s9c2YSQ2BRc:CqFyf0gplB0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=s9c2YSQ2BRc:CqFyf0gplB0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=s9c2YSQ2BRc:CqFyf0gplB0:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=s9c2YSQ2BRc:CqFyf0gplB0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/s9c2YSQ2BRc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/250109024048005507/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2012/02/programmatically-add-grouped-product-to.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/250109024048005507?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/250109024048005507?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/s9c2YSQ2BRc/programmatically-add-grouped-product-to.html" title="Programmatically Add Grouped Product to Cart in Magento" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2012/02/programmatically-add-grouped-product-to.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQBSX85fyp7ImA9WhRUGUQ.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-91683950650927270</id><published>2012-01-30T22:58:00.000-08:00</published><updated>2012-01-30T23:02:38.127-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-30T23:02:38.127-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="web 2.0" /><category scheme="http://www.blogger.com/atom/ns#" term="webservice" /><category scheme="http://www.blogger.com/atom/ns#" term="api" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><category scheme="http://www.blogger.com/atom/ns#" term="google maps" /><title>Google Maps Part 2: Implementing Driving Directions &amp; Roadmaps</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this series of Google Maps tutorials we will implement the driving directions and roadmaps on Google maps. If you do not know how to implement Google Maps, read &lt;a href="http://www.webspeaks.in/2012/01/implementing-google-maps-with-jquery.html"&gt;this tutorial&lt;/a&gt;. In this tutorials I have covered all the options of Google driving directions like 'Directions Panel', 'Waypoints' and 'Draggable directions'. &lt;a href="http://demos.frnzzz.com/gMaps/index5.php"&gt;See the demo here&lt;/a&gt;.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-7FzjQ0sQan8/TyeQmk0S_sI/AAAAAAAAAM0/xUIN3qAj1HQ/s1600/gmaps.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-7FzjQ0sQan8/TyeQmk0S_sI/AAAAAAAAAM0/xUIN3qAj1HQ/s1600/gmaps.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="download" href="http://www.box.com/s/ky4l57l3df0p5kqoibj6" target="_blank"&gt;Download Script&lt;/a&gt;&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/gMaps/index2.php" target="_blank"&gt;Simple Demo&lt;/a&gt;&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/gMaps/index3.php" target="_blank"&gt;Google Map with Directions Panel&lt;/a&gt;&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/gMaps/index4.php" target="_blank"&gt;Google Map with Waypoints&lt;/a&gt;&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/gMaps/index5.php" target="_blank"&gt;Google Map with Draggable Directions&lt;/a&gt;&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;h2&gt;

Implementing Driving Directions in Google Maps&lt;/h2&gt;
Following function creates the driving directions on Google maps. This function takes three arguments: starting location, end locations and the driving mode. Driving mode can take any value out of the following options:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;
DRIVING&amp;nbsp;&lt;/li&gt;
&lt;li&gt;WALKING&amp;nbsp;&lt;/li&gt;
&lt;li&gt;BICYCLING
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="brush:javascript"&gt;var directionsDisplay = new google.maps.DirectionsRenderer();
var directionsService = new google.maps.DirectionsService();

function calcRoute(start, end, mode) {
 var request = {
  origin:start,
  destination:end,
  travelMode: google.maps.TravelMode[mode]
 };
 directionsService.route(request, function(result, status) {
  if (status == google.maps.DirectionsStatus.OK) {
   directionsDisplay.setDirections(result);
  }
 });
 /*Set the directions on the map*/
 directionsDisplay.setMap(map);
}
&lt;/pre&gt;
&lt;h2&gt;



Implementing Directions Panel in Google Maps&lt;/h2&gt;
To show the directions panel you need to add following line in the end of the above function:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;directionsDisplay.setPanel(document.getElementById("directions"));
&lt;/pre&gt;
So our function now looks like:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function calcRoute(start, end, mode) {
 var request = {
  origin:start,
  destination:end,
  travelMode: google.maps.TravelMode[mode]
 };
 directionsService.route(request, function(result, status) {
  if (status == google.maps.DirectionsStatus.OK) {
   directionsDisplay.setDirections(result);
  }
 }); 
 directionsDisplay.setMap(map);

 /*Show directions panel*/
 directionsDisplay.setPanel(document.getElementById("directions"));
}
&lt;/pre&gt;
&lt;h2&gt;



Implementing Directions Way Points in Google Maps&lt;/h2&gt;
If you want to show the way points in the driving directions, just add the waypoint locations in the directionsService onject. See the following function:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function calcRoute(start, end, mode) {
 var request = {
  origin:start,
  destination:end,
  waypoints:[{location: "bhopal"}, {location: "indore"}],/*Show the waypoints*/
  travelMode: google.maps.TravelMode[mode]
 };
 directionsService.route(request, function(result, status) {
  if (status == google.maps.DirectionsStatus.OK) {
   directionsDisplay.setDirections(result);
  }
 });
 
 directionsDisplay.setMap(map);
 directionsDisplay.setPanel(document.getElementById("directions"));
}
&lt;/pre&gt;
&lt;h2&gt;



Implementing Draggable Directions in Google Maps&lt;/h2&gt;
To make the directions draggable, we need to set the 'draggable' property of our DirectionsRenderer to true. See how its done:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;var rendererOptions = {
 draggable: true
};
var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);
&lt;/pre&gt;
&lt;h2&gt;



Complete Implementation&lt;/h2&gt;
&lt;pre class="brush:html"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;script type="text/javascript" src="jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"&amp;gt;&amp;lt;/script&amp;gt;
 &amp;lt;script type="text/javascript"&amp;gt;
  var map;

  /*Options for making draggable direction*/
  var rendererOptions = {
   draggable: true
  };
  var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions);
  var directionsService = new google.maps.DirectionsService();
  
  jQuery(document).ready(function(){
   function initialize() {
    var delhi = new google.maps.LatLng(28.635308, 77.22496);

    var myOptions = {
     zoom:10,
     mapTypeId: google.maps.MapTypeId.ROADMAP,
     center: delhi
    }

    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
   }

   /*Function for creating the roadmap*/
   function calcRoute(start, end, mode) {
    var request = {
     origin:start,
     destination:end,
     waypoints:[{location: "bhopal"}, {location: "indore"}],
     travelMode: google.maps.TravelMode[mode]
    };
    directionsService.route(request, function(result, status) {
     if (status == google.maps.DirectionsStatus.OK) {
      directionsDisplay.setDirections(result);
     }
    });
    
    directionsDisplay.setMap(map);
    directionsDisplay.setPanel(document.getElementById("directions"));
   }

   initialize();
   calcRoute('New Delhi', 'Mumbai', 'DRIVING');
   
   jQuery('#driveit').click(function(){
    var srcAddr = jQuery('#from').val();
    var destAddr = jQuery('#to').val();
    var mode = jQuery('#mode').val();
    calcRoute(srcAddr, destAddr, mode);
   });
  });
 &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
 &amp;lt;h2&amp;gt;Google Map with Draggable directions&amp;lt;/h2&amp;gt;
 &amp;lt;div class="googlemap"&amp;gt;
  &amp;lt;div id="map_area"&amp;gt;
   &amp;lt;div id="map_canvas"&amp;gt;&amp;lt;/div&amp;gt;
   &amp;lt;div class="text"&amp;gt;
    &amp;lt;br /&amp;gt;
    From &amp;lt;input type="text" id="from" value="New Delhi" /&amp;gt;
    To &amp;lt;input type="text" id="to" value="Mumbai" /&amp;gt;
    Travel Mode 
    &amp;lt;select id="mode"&amp;gt;
     &amp;lt;option value="DRIVING"&amp;gt;Driving&amp;lt;/option&amp;gt;
     &amp;lt;option value="WALKING"&amp;gt;Walking &amp;lt;/option&amp;gt;
     &amp;lt;option value="BICYCLING"&amp;gt;Bicycling  &amp;lt;/option&amp;gt;
    &amp;lt;/select&amp;gt;
    &amp;lt;input type="button" value="Show Route" id="driveit" /&amp;gt;
   &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div id="directions"&amp;gt;&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;?php

?&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;



A bit of CSS&lt;/h2&gt;
&lt;pre class="brush:css"&gt; body{
  font-family:Sans-serif;
  font-size:12px;
 }
 h2{border-bottom: 1px dotted;}
 .googlemap{
  margin: auto;
  padding: 0;
  width: 100%;
 }
 #map_area{
  float:left;
  width:70%;
  height:80%;
 }
 #directions{
  float:right;
  width:30%;
  height:80%;
 }
 #map_canvas{
  margin: auto;
  width: 750px;
  height: 550px;
  border:2px double #ececec;
  padding:10px;
 }
 div.text{
  margin: auto;
  text-align:center;
 }
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-91683950650927270?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EMDsggjbJqVzKAFSSMxhQm_UWS4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMDsggjbJqVzKAFSSMxhQm_UWS4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EMDsggjbJqVzKAFSSMxhQm_UWS4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMDsggjbJqVzKAFSSMxhQm_UWS4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=1L0eP0XnBTw:bF5wcXCl-Uw:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=1L0eP0XnBTw:bF5wcXCl-Uw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=1L0eP0XnBTw:bF5wcXCl-Uw:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=1L0eP0XnBTw:bF5wcXCl-Uw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=1L0eP0XnBTw:bF5wcXCl-Uw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=1L0eP0XnBTw:bF5wcXCl-Uw:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=1L0eP0XnBTw:bF5wcXCl-Uw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/1L0eP0XnBTw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/91683950650927270/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2012/01/google-maps-part-2-implementing-driving.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/91683950650927270?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/91683950650927270?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/1L0eP0XnBTw/google-maps-part-2-implementing-driving.html" title="Google Maps Part 2: Implementing Driving Directions &amp; Roadmaps" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-7FzjQ0sQan8/TyeQmk0S_sI/AAAAAAAAAM0/xUIN3qAj1HQ/s72-c/gmaps.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2012/01/google-maps-part-2-implementing-driving.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkACSXs-fip7ImA9WhRVGUk.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-3646925489264676122</id><published>2012-01-18T03:12:00.000-08:00</published><updated>2012-01-18T20:52:48.556-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-18T20:52:48.556-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jquery-plugin" /><category scheme="http://www.blogger.com/atom/ns#" term="twitter api" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="twitter" /><category scheme="http://www.blogger.com/atom/ns#" term="webdesign" /><title>twito: jQuery Twitter Plugin</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
twito is a simple yet configurable jQuery Twitter plugin that displays the latest tweets on your webpages without acquiring any space. twito creates a floating box on the page that can be set to be displayed on any four corners of the webpage. You can configure twito to show the Twitter updates from multiple Twitter accounts. The plugin uses only jQuery and CSS without any server side coding. In this version two types of animations have been provided - fade and bubble. &lt;a href="http://demos.frnzzz.com/twito/" target="_blank"&gt;See the live demo here.&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-VD8z7EpngE8/Txehj_GDi5I/AAAAAAAAAMs/B4XmFcLX8dU/s1600/oie_1954617E75MWVcn.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="166" src="http://1.bp.blogspot.com/-VD8z7EpngE8/Txehj_GDi5I/AAAAAAAAAMs/B4XmFcLX8dU/s400/oie_1954617E75MWVcn.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="download" href="http://www.box.com/s/p7hhhy0f17hs4d7emzgm" target="_blank"&gt;Download Plugin&lt;/a&gt;&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;/div&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/twito/" target="_blank"&gt;Demo 1&lt;/a&gt;&amp;nbsp;
&lt;a class="demo" href="http://demos.frnzzz.com/twito/index2.php" target="_blank"&gt;Demo 2&lt;/a&gt;&amp;nbsp;
&lt;a class="demo" href="http://demos.frnzzz.com/twito/index3.php" target="_blank"&gt;Demo 3&lt;/a&gt;&amp;nbsp;
&lt;a class="demo" href="http://demos.frnzzz.com/twito/index4.php" target="_blank"&gt;Demo 4&lt;/a&gt;&amp;nbsp;
&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;/div&gt;
&lt;h2&gt;



twito Plugin Options&lt;/h2&gt;
&lt;pre class="brush:html"&gt;&lt;b&gt;users:&lt;/b&gt; [Array] It is the array of Twitter accounts whose tweets need to be displayed. e.g. ['web_speaks','smashingmag']

&lt;b&gt;position:&lt;/b&gt; [string] It is the position of the twito div on the page. It can be any four corners of the web page. The possible options are:
 'br' - Bottom Right
 'bl' - Bottom Left
 'tl' - Top Left
 'tr' - Top Right

&lt;b&gt;width:&lt;/b&gt; [string] It is the width of the twito div. Default is '300px'.

&lt;b&gt;height:&lt;/b&gt; [string] It is the width of the twito div. Default is 'auto'.

&lt;b&gt;margin:&lt;/b&gt; [string] It is the margin of the twito div from the browser boundaries. Default is '10px'.

&lt;b&gt;padding:&lt;/b&gt; [string] It is the padding of the twito div. Default is '10px'.

&lt;b&gt;animation:&lt;/b&gt; [string] The type of animation. Default is 'fade'. Two animations are supported right now - fade, bubble.

&lt;b&gt;speed:&lt;/b&gt; [int] It is the speed of the animation. Default is 5000.

&lt;b&gt;showAvatar:&lt;/b&gt; [bool] Whether or not to show the user's Twitter profile image. Default is true.

&lt;b&gt;avatarSize:&lt;/b&gt; [string] Height and width of the user's profile image. e.g. '36px',

&lt;b&gt;bgColor:&lt;/b&gt; [string] Background color of the twito div. Default is '#ffffff'.
&lt;/pre&gt;
&lt;h2&gt;




twito Plugin Code&lt;/h2&gt;
&lt;pre class="brush:javascript"&gt;(function($){
 $.fn.twito = function(options){

  var defaults = {
   users: ['web_speaks'],
   position: 'br',
   width: '300px',
   height: 'auto',
   margin: '10px',
   padding: '10px',
   animation: 'fade',
   speed: 5000,
   showAvatar: true,
   avatarSize: '36px',
   bgColor : '#ffffff'
  }

  var o = $.extend(defaults, options);
  $('body').append('&amp;lt;div id="twitPane"&amp;gt;&amp;lt;/div&amp;gt;');

  var $this = $('div#twitPane');
  $this.css({'width' : o.width});

  var buildString = '';
  for(var i=0;i&amp;lt;o.users.length;i++){
   if(i!=0) buildString+='+OR+';
   buildString+='from:'+o.users[i];
  }

  setPosition(o.position);
  function setPosition(pos){
   switch(pos){
    case 'tl':
     $this.css({'top' : o.margin, 'left' : o.margin});
     break;
    case 'tr':
     $this.css({'top' : o.margin, 'right' : o.margin});
     break;
    case 'bl':
     $this.css({'bottom' : o.margin, 'left' : o.margin});
     break;
    case 'br':
    default:
     $this.css({'bottom' : o.margin, 'right' : o.margin});
   }
  }

  $.getJSON("http://search.twitter.com/search.json?q="+buildString+"&amp;amp;rpp=50&amp;amp;callback=?", function(data){
   tweet(data);
  });
  
  function tweet(d){
   switch(o.animation){
    case 'fade':fade(d);break;
    case 'bubble':bubble(d);break;
    default:fade(d);
   }
  }

  function fade(d){
   var c = 0;
   var interval = setInterval(
     function() {
      $this.find('div.tweet').fadeOut('slow');
      var str = createTweetDiv(d.results[c]);
      $this.html(str).hide().fadeIn('slow');
      c++; 
      if( c &amp;gt;= d.results.length) c=0;
     } , o.speed);
  }

  function bubble(d){
   var c = 0;
   var tt = $this.css('top');
   var tl = $this.css('left');
   var tb = $this.css('bottom');
   var tr = $this.css('right');

   var interval = setInterval(
     function() {
      var str = createTweetDiv(d.results[c]);
      $this.html(str).fadeTo('fast', 1);
      switch(o.position){
       case 'bl':
        $this.animate({opacity: 0,bottom: '150px'}, parseInt(o.speed*80/100), function() {
          $this.css({'bottom' : tb, 'left' : tl});
        });
        break;
       case 'tl':
        $this.animate({opacity: 0,top: '150px'}, parseInt(o.speed*80/100), function() {
          $this.css({'top' : tt, 'right' : tl});
        });
        break;
       case 'tr':
        $this.animate({opacity: 0,top: '150px'}, parseInt(o.speed*80/100), function() {
          $this.css({'top' : tt, 'right' : tr});
        });
        break;
       case 'br':
       default:
        $this.animate({opacity: 0,bottom: '150px'}, parseInt(o.speed*80/100), function() {
          $this.css({'bottom' : tb, 'right' : tr});
        });
      }
      c++; 
      if( c &amp;gt;= d.results.length) c=0;
     } , o.speed);

  }

  function createTweetDiv(data){
   var htm = '&amp;lt;div class="tweet" style="background-color:'+o.bgColor+';padding:'+o.padding+';height:'+o.height+'"&amp;gt;';
   if(o.showAvatar){
    htm += '&amp;lt;div class="avatar"&amp;gt;&amp;lt;a href="http://twitter.com/'+data.from_user+'" target="_blank"&amp;gt;&amp;lt;img style="height:'+o.avatarSize+';width:'+o.avatarSize+';" src="'+data.profile_image_url+'" alt="'+data.from_user+'" /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;';
   }
   htm += '&amp;lt;div class="user"&amp;gt;&amp;lt;a href="http://twitter.com/'+data.from_user+'" target="_blank"&amp;gt;'+data.from_user+'&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;\
     &amp;lt;div class="time"&amp;gt;'+relativeTime(data.created_at)+'&amp;lt;/div&amp;gt;\
     &amp;lt;div class="txt"&amp;gt;'+formatTwitString(data.text)+'&amp;lt;/div&amp;gt;\
     &amp;lt;/div&amp;gt;';
   return htm;
  }

  function formatTwitString(str){
   str=' '+str;
   str = str.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'&amp;lt;a href="$1" target="_blank"&amp;gt;$1&amp;lt;/a&amp;gt;');
   str = str.replace(/([^\w])\@([\w\-]+)/gm,'$1@&amp;lt;a href="http://twitter.com/$2" target="_blank"&amp;gt;$2&amp;lt;/a&amp;gt;');
   str = str.replace(/([^\w])\#([\w\-]+)/gm,'$1&amp;lt;a href="http://twitter.com/search?q=%23$2" target="_blank"&amp;gt;#$2&amp;lt;/a&amp;gt;');
   return str;
  }

  function relativeTime(pastTime){ 
   var origStamp = Date.parse(pastTime);
   var curDate = new Date();
   var currentStamp = curDate.getTime();
   
   var difference = parseInt((currentStamp - origStamp)/1000);

   if(difference &amp;lt; 0) return false;

   if(difference &amp;lt;= 5)    return "Just now";
   if(difference &amp;lt;= 20)   return "Seconds ago";
   if(difference &amp;lt;= 60)   return "A minute ago";
   if(difference &amp;lt; 3600)   return parseInt(difference/60)+" minutes ago";
   if(difference &amp;lt;= 1.5*3600)   return "One hour ago";
   if(difference &amp;lt; 23.5*3600)  return Math.round(difference/3600)+" hours ago";
   if(difference &amp;lt; 1.5*24*3600) return "One day ago";
   
   var dateArr = pastTime.split(' ');
   return dateArr[4].replace(/\:\d+$/,'')+' '+dateArr[2]+' '+dateArr[1]+(dateArr[3]!=curDate.getFullYear()?' '+dateArr[3]:'');
  }
 };
 
})(jQuery);
&lt;/pre&gt;
Note: createTweetDiv, formatTwitString, relativeTime javascript functions in the plugin and the CSS has been borrowed from &lt;a href="http://tutorialzine.com/" target="_blank"&gt;Tutorialzine&lt;/a&gt; in &lt;a href="http://tutorialzine.com/2009/10/jquery-twitter-ticker" target="_blank"&gt;A jQuery Twitter Ticker&lt;/a&gt; article.

&lt;br /&gt;
&lt;h2&gt;




twito Plugin Usage&lt;/h2&gt;
&lt;pre class="brush:html"&gt;&amp;lt;script type="text/javascript"&amp;gt;
$(function(){
 $("body").twito();
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;




twito Plugin Usage With Options&lt;/h2&gt;
&lt;pre class="brush:html"&gt;&amp;lt;script type="text/javascript"&amp;gt;
$(function(){
 $("body").twito({
  users: ['web_speaks','smashingmag','real_CSS_Tricks','jeresig'],
  position: 'tr',
  width: '300px',
  height: '80px',
  margin: '10px',
  animation: 'bubble',
  speed: 3000,
  padding: '10px',
  bgColor: "#000",
  showAvatar: true,
  avatarSize: '24px'
 });
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;




twito Full Page Example&lt;/h2&gt;
&lt;pre class="brush:html"&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;
&amp;lt;title&amp;gt;twito : jQuery Twitter Plugin | WebSpeaks.in&amp;lt;/title&amp;gt;
&amp;lt;link rel="stylesheet" type="text/css" href="style.css" /&amp;gt;
&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="twito.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$(function(){
 $("body").twito();
});
&amp;lt;/script&amp;gt;
&amp;lt;!--[if lt IE 7]&amp;gt;
&amp;lt;style type="text/css"&amp;gt;
div.tweet {
 background:none;
    border:none;
}
&amp;lt;/style&amp;gt;
&amp;lt;![endif]--&amp;gt;
&amp;lt;style&amp;gt;
div#main{
 height:2000px;
}
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;div id="main"&amp;gt;
  &amp;lt;h1&amp;gt;twito : jQuery Twitter Plugin&amp;lt;/h1&amp;gt;
  &amp;lt;p&amp;gt;Show tweets from multiple accounts&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;Pure jQuery &amp;amp; CSS&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;Multiple animations&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;Options for easy configuration&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-3646925489264676122?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S_RKMtrKecYwH11xCILDwo3u9jA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S_RKMtrKecYwH11xCILDwo3u9jA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S_RKMtrKecYwH11xCILDwo3u9jA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S_RKMtrKecYwH11xCILDwo3u9jA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=GR0w_olfcZA:9VI5OIJPwug:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=GR0w_olfcZA:9VI5OIJPwug:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=GR0w_olfcZA:9VI5OIJPwug:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=GR0w_olfcZA:9VI5OIJPwug:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=GR0w_olfcZA:9VI5OIJPwug:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=GR0w_olfcZA:9VI5OIJPwug:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=GR0w_olfcZA:9VI5OIJPwug:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/GR0w_olfcZA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/3646925489264676122/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2012/01/twito-jquery-twitter-plugin.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3646925489264676122?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3646925489264676122?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/GR0w_olfcZA/twito-jquery-twitter-plugin.html" title="twito: jQuery Twitter Plugin" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-VD8z7EpngE8/Txehj_GDi5I/AAAAAAAAAMs/B4XmFcLX8dU/s72-c/oie_1954617E75MWVcn.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2012/01/twito-jquery-twitter-plugin.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQGQHk4eCp7ImA9WhRVE0g.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-8299446574662791118</id><published>2012-01-11T23:24:00.000-08:00</published><updated>2012-01-11T23:28:41.730-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-11T23:28:41.730-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><category scheme="http://www.blogger.com/atom/ns#" term="webdesign" /><category scheme="http://www.blogger.com/atom/ns#" term="google maps" /><title>Implementing Google Maps with jQuery</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Google maps are the most popular service for displaying locations over the web. Today we will learn how to implement Google maps in you web pages. We will create custom markers for pointing the locations on the map. We will also create infoWindows for showing the information text for the locations. &lt;a href="http://demos.frnzzz.com/gMaps" target="_blank"&gt;See the demo here&lt;/a&gt;.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-BqxLhbp_aOs/Tw6J-rqSqcI/AAAAAAAAAMc/ERa1t1EEQaU/s1600/Google+maps.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="353" src="http://2.bp.blogspot.com/-BqxLhbp_aOs/Tw6J-rqSqcI/AAAAAAAAAMc/ERa1t1EEQaU/s640/Google+maps.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/gMaps" target="_blank"&gt;Live demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://www.box.com/s/ky4l57l3df0p5kqoibj6" target="_blank"&gt;Download Script&lt;/a&gt;

&lt;br /&gt;
&lt;h2&gt;


&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;




Including Google Maps Javascript&lt;/h2&gt;
You need to create a Google Maps key for your domain at &lt;a href="http://code.google.com/apis/maps/signup.html" target="_blank"&gt;code.google.com/apis/maps/signup.html&lt;/a&gt;. Then include the following JS in your web page:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;script type="text/javascript"
  src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;amp;sensor=true"&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;




Initializing Google Maps&lt;/h2&gt;
For initializing Google Maps on your web page, we have created a function called &lt;span style="background-color: #f6b26b; color: black; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;'initialize()'&lt;/span&gt;. Here is the body of the function:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function initialize() {

 //Create a location object with latitude and longitudes
 var delhi = new google.maps.LatLng(28.635308, 77.22496);

 //Create options for the map object
 var myOptions = {
  zoom:10,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  center: delhi
 }

 //Create our map
 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
&lt;/pre&gt;
&lt;h2&gt;




Creating Custom markers on Google Maps&lt;/h2&gt;
For creating markers with our own icons, we have created a function called &lt;span style="background-color: #f6b26b; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;'createMarker()'&lt;/span&gt;. This function accept two parameters:&lt;br /&gt;
1. &lt;b&gt;map&lt;/b&gt;: map object on which marker is to be placed.&lt;br /&gt;
2. &lt;b&gt;centerLoc&lt;/b&gt;: the location object where marker is to be located
Here is the body of the function:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;/*Function for creating the custom marker*/
function createMarker(map, centerLoc){
 var image = new google.maps.MarkerImage(
  'http://www.webspeaks.in/favicon.ico',
  new google.maps.Size(40,35),
  new google.maps.Point(0,0),
  new google.maps.Point(0,35)
 );
 marker = new google.maps.Marker({
  position: centerLoc,
  map: map,
  icon: image,
  title:"Click here for more info."
 });
}
&lt;/pre&gt;
&lt;h2&gt;




Creating Custom infoWindow on Google Maps&lt;/h2&gt;
For creating infoWindow on Google Maps, we have created a function called &lt;span style="background-color: #f6b26b; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;'createInfoWindow()'&lt;/span&gt;. This function accept three parameters:&lt;br /&gt;
1. &lt;b&gt;map&lt;/b&gt;: map object on which marker is to be placed.&lt;br /&gt;
2. &lt;b&gt;marker:&lt;/b&gt; The marker object on click of which infoWindow needs to be opened&lt;br /&gt;
3. &lt;b&gt;customText:&lt;/b&gt; The text to be written in infoWindow
Here is the body of the function:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;/*Function for creating the custom infoWindow*/
function createInfoWindow(map, marker, customText){
 infowindow = new google.maps.InfoWindow({
  content: customText
 });

 /*Open infoWindow on clicking the marker*/
 google.maps.event.addListener(marker, 'click', function() {
   infowindow.open(map,marker);
 });
}
&lt;/pre&gt;
&lt;h2&gt;




Complete implementation of Google Maps&lt;/h2&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;script type="text/javascript" src="jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script type="text/javascript"
      src="http://maps.googleapis.com/maps/api/js?key=ABQIAAAA637Mus9i198xaCP6kyeT0RQx_VuEwDbQw2tT4lOIPXcH-8yh-RShip_gsIHcjuA8B3qb__racWinFg&amp;amp;sensor=true"&amp;gt;
    &amp;lt;/script&amp;gt;
 &amp;lt;script type="text/javascript"&amp;gt;
  //Variable for holding map object
  var map;

  //Variable for holding marker object
  var marker;

  //Variable for infowindow map object
  var infowindow;
  
  jQuery(document).ready(function(){
   /*Map initialization*/
   function initialize() {

    //Create a location object with latitude and longitudes
    var delhi = new google.maps.LatLng(28.635308, 77.22496);

    //Create options for the map object
    var myOptions = {
     zoom:10,
     mapTypeId: google.maps.MapTypeId.ROADMAP,
     center: delhi
    }

    //Create our map
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    
    createMarker(map, delhi);//Call function for creating our marker
    customText = '&amp;lt;div id="infoWindow"&amp;gt;Welcome to &amp;lt;b&amp;gt;New Delhi&amp;lt;/b&amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;a href="http://webspeaks.in/" target="_blank"&amp;gt;Webspeaks.in&amp;lt;/a&amp;gt; provides excellent tutorials on Jquery, JavaScript, PHP, CSS, Magento, Wordpress, Facebook API, Twitter API, PHP security tips.&amp;lt;/div&amp;gt;';
    createInfoWindow(map, marker, customText);//Call function for creating our infowindow
   }

   /*Function for creating the custom marker*/
   function createMarker(map, centerLoc){
    var image = new google.maps.MarkerImage(
     'http://www.webspeaks.in/favicon.ico',
     new google.maps.Size(40,35),
     new google.maps.Point(0,0),
     new google.maps.Point(0,35)
    );
    marker = new google.maps.Marker({
     position: centerLoc,
     map: map,
     icon: image,
     title:"Click here for more info."
    });
   }
   
   /*Function for creating the custom infoWindow*/
   function createInfoWindow(map, marker, customText){
    infowindow = new google.maps.InfoWindow({
     content: customText
    });

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.open(map,marker);
    });
   }

   jQuery('#mumbai').click(function(){
    var Mumbai = new google.maps.LatLng(19.0759837, 72.8776559);
    map.setCenter(Mumbai);
    createMarker(map, Mumbai);
    customText = '&amp;lt;div id="infoWindow"&amp;gt;&amp;lt;b&amp;gt;Welcome to Mumbai&amp;lt;/b&amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;a href="http://webspeaks.in/" target="_blank"&amp;gt;Webspeaks.in&amp;lt;/a&amp;gt; provides excellent tutorials on Jquery, JavaScript, PHP, CSS, Magento, Wordpress, Facebook API, Twitter API, PHP security tips.&amp;lt;/div&amp;gt;';
    createInfoWindow(map, marker, customText);
   });

   jQuery('#new-york').click(function(){
    var newyork = new google.maps.LatLng(40.77, 73.90);
    map.setCenter(newyork);
    createMarker(map, newyork);
    customText = '&amp;lt;div id="infoWindow"&amp;gt;&amp;lt;b&amp;gt;Welcome to New York&amp;lt;/b&amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;a href="http://webspeaks.in/" target="_blank"&amp;gt;Webspeaks.in&amp;lt;/a&amp;gt; provides excellent tutorials on Jquery, JavaScript, PHP, CSS, Magento, Wordpress, Facebook API, Twitter API, PHP security tips.&amp;lt;/div&amp;gt;';
    createInfoWindow(map, marker, customText);
   });

   initialize();
  });
 &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
 &amp;lt;div class="googlemap"&amp;gt;
  &amp;lt;div id="map_canvas"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div class="text"&amp;gt;
   &amp;lt;a id="mumbai" href="javascript:;"&amp;gt;Go to Mumbai&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;
   &amp;lt;a id="new-york" href="javascript:;"&amp;gt;Go to New York&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;
  &amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;




A bit of CSS&lt;/h2&gt;
&lt;pre class="brush:css"&gt;body{
 font-family:Sans-serif;
 font-size:12px;
}
.googlemap{
 margin: auto;
 padding: 0;
 width: 960px;
}
#map_canvas{
 margin: auto;
 width: 650px;
 height: 350px;
 border:2px double #ececec;
 padding:10px;
}
#infoWindow {
 color: #3E56E5;
 height: 100px;
 width: 200px;
 overflow:hidden;
}
div.text{
 margin: auto;
 text-align:center;
}
div.text a{
 color: #888888;
 font-weight: bold;
 text-align: center;
 font-size: 18px;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-8299446574662791118?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OfvAJfHqlO_sguSYCytF33wcdIk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OfvAJfHqlO_sguSYCytF33wcdIk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OfvAJfHqlO_sguSYCytF33wcdIk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OfvAJfHqlO_sguSYCytF33wcdIk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=XMny-cWVpTA:iLBSikOUn_Y:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=XMny-cWVpTA:iLBSikOUn_Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=XMny-cWVpTA:iLBSikOUn_Y:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=XMny-cWVpTA:iLBSikOUn_Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=XMny-cWVpTA:iLBSikOUn_Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=XMny-cWVpTA:iLBSikOUn_Y:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=XMny-cWVpTA:iLBSikOUn_Y:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/XMny-cWVpTA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/8299446574662791118/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2012/01/implementing-google-maps-with-jquery.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/8299446574662791118?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/8299446574662791118?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/XMny-cWVpTA/implementing-google-maps-with-jquery.html" title="Implementing Google Maps with jQuery" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-BqxLhbp_aOs/Tw6J-rqSqcI/AAAAAAAAAMc/ERa1t1EEQaU/s72-c/Google+maps.PNG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.webspeaks.in/2012/01/implementing-google-maps-with-jquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcGQHk_fyp7ImA9WhRWE04.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-6736044764181804608</id><published>2011-12-30T11:20:00.000-08:00</published><updated>2011-12-31T04:03:41.747-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-31T04:03:41.747-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="api" /><category scheme="http://www.blogger.com/atom/ns#" term="paypal" /><category scheme="http://www.blogger.com/atom/ns#" term="payment-gateway" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Integrating PayPal Payment Gateway with PHP</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
If you want to allow users on your website to make payments then PayPal is the best and the simplest option. Today we will see how to integrate PayPal payment gateway with your PHP online store. We will use the IPN(Instant Payment Notification) service of PayPal for processing the payments. PayPal sends responses for all payment actions(make payment, accept payment, refund payment, cancel payment) to the IPN URL set in your PayPal account settings. So lets go step by step and see how the whole process is done.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-TLDe2HUhINA/Tv4XyaK0ElI/AAAAAAAAAMU/IeFkCu-QcDc/s1600/paypal-logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-TLDe2HUhINA/Tv4XyaK0ElI/AAAAAAAAAMU/IeFkCu-QcDc/s1600/paypal-logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/paypal/store/" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://www.box.com/s/5ux6qsffo1rlaqeyxt2t" target="_blank"&gt;Download Script&lt;/a&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;Step 1:&lt;/b&gt;
Create a PayPal Sandbox account at https://developer.paypal.com/.&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;Step 2:&lt;/b&gt;
Create two test accounts under this Sandbox account. One account will be for buyer and other for seller. You should select the 'Preconfigured test accounts' for simplicity.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-U8BUJI0kIHQ/Tv4MENhwLLI/AAAAAAAAAK4/weFsUkGSpfg/s1600/Test+Accounts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="195" src="http://2.bp.blogspot.com/-U8BUJI0kIHQ/Tv4MENhwLLI/AAAAAAAAAK4/weFsUkGSpfg/s400/Test+Accounts.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: #660000;"&gt;
&lt;b style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;Step 3: Enabling IPN&lt;/b&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;To enable IPN, go to the 'Test site' of the seller account(see below screenshot).&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-nLgk76DV-74/Tv4Np59k6rI/AAAAAAAAAL8/HF4SBIOpyxw/s1600/Enter+Test+site.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="177" src="http://4.bp.blogspot.com/-nLgk76DV-74/Tv4Np59k6rI/AAAAAAAAAL8/HF4SBIOpyxw/s400/Enter+Test+site.png" width="400" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;

Now click on the 'Profile' menu link and then click on 'Instant Payment Notification Preferences'(see below screenshot).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-B8sH19454ik/Tv4M8GLgh-I/AAAAAAAAALk/NDTbmnzvxlc/s1600/IPN+Profile.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://1.bp.blogspot.com/-B8sH19454ik/Tv4M8GLgh-I/AAAAAAAAALk/NDTbmnzvxlc/s400/IPN+Profile.png" width="400" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
Edit the IPN settings, add your IPN URL in the URL textbox and click on Save(see below screenshot). &lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-uBHB3L3buiw/Tv4N2TX2kXI/AAAAAAAAAMI/-5rWV6gJBC8/s1600/IPN-edit.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="117" src="http://2.bp.blogspot.com/-uBHB3L3buiw/Tv4N2TX2kXI/AAAAAAAAAMI/-5rWV6gJBC8/s400/IPN-edit.png" width="400" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Step 4: payments table
&lt;/b&gt;&lt;/div&gt;
&lt;pre class="brush:sql"&gt;CREATE TABLE `payments`
(
`payment_id` int(11) AUTO_INCREMENT PRIMARY KEY,
`item_id` int(11),
`invoice_id` int(11),
`amount` float(10,2),
`amount_refunded` float(10,2),
`amount_refunded` float(10,2),
`transaction_id` varchar(125),
`status` varchar(10)
)
&lt;/pre&gt;
&lt;div style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Step 5:
The Products page&lt;/b&gt;&lt;/div&gt;
Our product page will contain a separate form for each product. The details in the forms will be product specific.
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /&amp;gt;
&amp;lt;title&amp;gt;WebSpeaks.in | Paypal Integration with PHP&amp;lt;/title&amp;gt;
&amp;lt;link rel="stylesheet" type="text/css" href="style.css" /&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
$paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$paypal_id = 'bhardw_1325263769_biz@yahoo.co.in';//This is your seller id

$cancel_url = 'http://demos.frnzzz.com/paypal/store/index.php?action=cancel';
$return_url = 'http://demos.frnzzz.com/paypal/store/';

$products = array();
$products[] = array('id'=&amp;gt;156,'name'=&amp;gt;'Motorola 156 MX-VL','price'=&amp;gt;15, 'special_price'=&amp;gt;7, 'image'=&amp;gt;'laptop.gif'); 
$products[] = array('id'=&amp;gt;157,'name'=&amp;gt;'Iphone Apple','price'=&amp;gt;12, 'special_price'=&amp;gt;10, 'image'=&amp;gt;'p4.gif'); 
$products[] = array('id'=&amp;gt;158,'name'=&amp;gt;'Samsung Webcam','price'=&amp;gt;10, 'special_price'=&amp;gt;5, 'image'=&amp;gt;'p5.gif'); 
?&amp;gt;
&amp;lt;div id="main_container"&amp;gt;
 &amp;lt;div id="header"&amp;gt;
        
        &amp;lt;div id="logo"&amp;gt;
            &amp;lt;a href="index.html"&amp;gt;&amp;lt;img src="images/webspeaks.gif" alt="" title="" border="0" width="260" height="140" /&amp;gt;&amp;lt;/a&amp;gt;
     &amp;lt;/div&amp;gt;
        
    &amp;lt;/div&amp;gt;
    
   &amp;lt;div id="main_content"&amp;gt; 
    
 &amp;lt;div class="center_content"&amp;gt;
  &amp;lt;div class="center_title_bar"&amp;gt;Latest Products&amp;lt;/div&amp;gt;

  &amp;lt;?php
  foreach($products as $product){
  ?&amp;gt;
   &amp;lt;div class="prod_box"&amp;gt;
    &amp;lt;div class="top_prod_box"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="center_prod_box"&amp;gt;            
      &amp;lt;div class="product_title"&amp;gt;&amp;lt;a href="#"&amp;gt;&amp;lt;?php echo $product['name'] ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div class="product_img"&amp;gt;&amp;lt;a href="#"&amp;gt;&amp;lt;img src="images/&amp;lt;?php echo $product['image'] ?&amp;gt;" alt="" title="" border="0" /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
      &amp;lt;div class="prod_price"&amp;gt;&amp;lt;span class="reduce"&amp;gt;&amp;lt;?php echo $product['price'] ?&amp;gt;$&amp;lt;/span&amp;gt; &amp;lt;span class="price"&amp;gt;&amp;lt;?php echo $product['special_price'] ?&amp;gt;$&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;                        
    &amp;lt;/div&amp;gt;
    &amp;lt;div class="bottom_prod_box"&amp;gt;&amp;lt;/div&amp;gt;             
    &amp;lt;div class="prod_details_tab"&amp;gt;
     &amp;lt;form id='payment_form' action='&amp;lt;?php echo $paypal_url ?&amp;gt;' method='post' name='payform' /&amp;gt;
      &amp;lt;input type='hidden' name='business' value='&amp;lt;?php echo $paypal_id ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='hidden' name='cmd' value='_xclick' /&amp;gt;
      &amp;lt;input type='hidden' name='amount' value='&amp;lt;?php echo $product['special_price'] ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='hidden' name='no_shipping' value='0' /&amp;gt;
      &amp;lt;input type='hidden' name='item_name' value='&amp;lt;?php echo $product['name'] ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='hidden' name='item_number' value='&amp;lt;?php echo $product['id'] ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='hidden' name='invoice' value='WS-&amp;lt;?php echo $product['id'] ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='hidden' name='currency_code' value='USD' /&amp;gt;
      &amp;lt;input type='hidden' name='cancel_return' value='&amp;lt;?php echo $cancel_url ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='hidden' name='return' value='&amp;lt;?php echo $return_url ?&amp;gt;' /&amp;gt;
      &amp;lt;input type='image' src='https://www.sandbox.paypal.com/en_US/i/btn/btn_buynow_SM.gif' name='submit' style='display:{$display_button}' /&amp;gt;
     &amp;lt;/form&amp;gt;   
    &amp;lt;/div&amp;gt;                     
   &amp;lt;/div&amp;gt;
  &amp;lt;?php
  }
  ?&amp;gt;

 &amp;lt;/div&amp;gt;
   &amp;lt;/div&amp;gt;

&amp;lt;/div&amp;gt;
&amp;lt;!-- end of main_container --&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;div style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Step 6:
The payment process page&lt;/b&gt;&lt;/div&gt;
process_payment.php
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
$paypal_response = $_REQUEST;

//Check if it is the response from PayPal
if ( isset( $paypal_response ) ) {

 $tx = $paypal_response['tx'];//Transaction code
 $st = strtolower($paypal_response['payment_status']);//Payment status
 $amount = $paypal_response['mc_gross'];//Amount
 $cc = $paypal_response['mc_currency'];//Currency code
 $item_number = $paypal_response['item_number'];//Item number
 $invoice_id = $paypal_response['invoice'];

 $user_email = 'bhardwajsonheight@gmail.com';

 $site_name = 'WebSpeaks.in Test Store';
 $eol = "\r\n";
 $headers  = 'MIME-Version: 1.0' . $eol;
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . $eol;
 $headers .= 'From:' . $site_name . ' &amp;lt;store@webspeaks.in&amp;gt;'. $eol;
 $headers .= 'Reply-To:' . $site_name . ' &amp;lt;store@webspeaks.in&amp;gt;' . $eol;
 $headers .= 'Return-Path:' . $site_name . ' &amp;lt;store@webspeaks.in&amp;gt;' . $eol;

 $eol = "\r\n&amp;lt;br /&amp;gt;";
 $thanks_text = $eol.$eol.'Thanks!'. $eol;

 if($st == 'completed'){//Payment has been completed successfully

  //Update payment in DB
  mysql_query("UPDATE payments SET `status`='complete', `amount`='".$amount."' WHERE `invoice_id`='".$invoice_id." AND `item_id`='".$item_id."')");

  //Send succes email to user
  $email_tpl = 'Hello Buyer,' . $eol;
  $email_tpl .= "We have received your payment of $amount $cc." . $eol;
  $email_tpl .= "Thanks for the purchase." . $eol;
  $email_tpl .= $eol . $thanks_text;

  mail ($user_email, 'Payment Received', $email_tpl, $headers);

 }elseif($st == 'pending'){//Payment is pending for approval

  //Enter payment in DB
  mysql_query("INSERT INTO payments (`item_id`, `invoice_id`, `amount`, `transaction_id`, `status`) VALUES ('".$item_number."', '".$invoice_id."', '".$amount."',  '".$tx."', 'pending')");

  $email_tpl = 'Hello Buyer,' . $eol;
  $email_tpl .= "Your payment of $amount $cc is pending for approval. We will process it soon." . $eol;
  $email_tpl .= $eol . $thanks_text;

  mail ($user_email, 'Payment Pending', $email_tpl, $headers);

 }elseif($st == 'refunded'){//Payment is refunded after approval

  //Update payment in DB
  mysql_query("UPDATE payments SET `status`='refunded', `amount_refunded`='".$amount."' WHERE `invoice_id`='".$invoice_id." AND `item_id`='".$item_id."')");

  $email_tpl = 'Hello Buyer,' . $eol;
  $email_tpl .= "Your payment of $amount $cc has been refunded." . $eol;
  $email_tpl .= $eol . $thanks_text;

  mail ($user_email, 'Payment Pending', $email_tpl, $headers);

 }elseif($st == 'reversed'){//Payment is refunded before approval or it has been cancelled

  $reason = strtolower($paypal_response['reason_code']);//Reason for payment reversal

  if($reason == 'refund'){//Payment is refunded before approval
   //Update payment in DB
   mysql_query("UPDATE payments SET `status`='refunded', `amount_refunded`='".$amount."' WHERE `invoice_id`='".$invoice_id." AND `item_id`='".$item_id."')");

   $email_tpl = 'Hello Buyer,' . $eol;
   $email_tpl .= "Your payment of $amount $cc has been refunded." . $eol;
   $email_tpl .= $eol . $thanks_text;

   mail ($user_email, 'Payment Refunded', $email_tpl, $headers);

  }elseif($reason == 'other'){//Payment has been cancelled
   //Update payment in DB
   mysql_query("UPDATE payments SET `status`='cancelled' WHERE `invoice_id`='".$invoice_id." AND `item_id`='".$item_id."')");

   $email_tpl = 'Hello Buyer,' . $eol;
   $email_tpl .= "Your payment of $amount $cc has been refunded." . $eol;
   $email_tpl .= $eol . $thanks_text;

   mail ($user_email, 'Payment Cancelled', $email_tpl, $headers);

  }

 }
}
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-6736044764181804608?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7IXtKUxwJ8A5skLE5Z53jo4A_iU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7IXtKUxwJ8A5skLE5Z53jo4A_iU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7IXtKUxwJ8A5skLE5Z53jo4A_iU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7IXtKUxwJ8A5skLE5Z53jo4A_iU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=VuXMlCh7ZJg:UB8bQ6J5aJk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=VuXMlCh7ZJg:UB8bQ6J5aJk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=VuXMlCh7ZJg:UB8bQ6J5aJk:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=VuXMlCh7ZJg:UB8bQ6J5aJk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=VuXMlCh7ZJg:UB8bQ6J5aJk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=VuXMlCh7ZJg:UB8bQ6J5aJk:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=VuXMlCh7ZJg:UB8bQ6J5aJk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/VuXMlCh7ZJg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/6736044764181804608/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/12/integrating-paypal-payment-gateway-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6736044764181804608?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6736044764181804608?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/VuXMlCh7ZJg/integrating-paypal-payment-gateway-with.html" title="Integrating PayPal Payment Gateway with PHP" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-TLDe2HUhINA/Tv4XyaK0ElI/AAAAAAAAAMU/IeFkCu-QcDc/s72-c/paypal-logo.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/12/integrating-paypal-payment-gateway-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEACQH87cCp7ImA9WhRXEUU.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-2531745666625123199</id><published>2011-12-17T09:22:00.000-08:00</published><updated>2011-12-17T20:32:41.108-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-17T20:32:41.108-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="how to" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook api" /><title>Upload photos to Facebook Fan Page using PHP</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
After writing the article on &lt;a href="http://www.webspeaks.in/2011/08/upload-photos-on-facebook-using-php.html" target="_blank"&gt;Uploading photos to Facebook albums&lt;/a&gt;, I though it would be a good idea to tell my readers how to upload photos to your Facebook fan page. Uploading photos to the fan page is a bit different from uploading photos to your album. Here we need the access token of your Fan page. If you know the id of your Fan page, it can be found on runtime though. So here is the script to upload the pics.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-kw2_ci0LR4w/TnOdAI-zXJI/AAAAAAAAAJ8/9FNH6og2mDo/s1600/facebook_logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="120" src="http://2.bp.blogspot.com/-kw2_ci0LR4w/TnOdAI-zXJI/AAAAAAAAAJ8/9FNH6og2mDo/s320/facebook_logo.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/fbAlbum/uploadtopage.php" target="_blank"&gt;Live Demo&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;PHP Code:&lt;/b&gt;
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;WebSpeaks.in | Upload images to Facebook&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;?php
require_once 'library/facebook.php';
$facebook = new Facebook(array(
 'appId'  =&amp;gt; $app_id,,
 'secret' =&amp;gt; $app_secret,
 'fileUpload' =&amp;gt; true
));


//It can be found at https://developers.facebook.com/tools/access_token/
$access_token = '&amp;lt;Your access token&amp;gt;';

$params = array('access_token' =&amp;gt; $access_token);

//The id of the fanpage
$fanpage = '330299184793';

//The id of the album
$album_id ='10150418901414794';

//Replace arvind07 with your Facebook ID
$accounts = $facebook-&amp;gt;api('/arvind07/accounts', 'GET', $params);

foreach($accounts['data'] as $account) {
 if( $account['id'] == $fanpage || $account['name'] == $fanpage ){
  $fanpage_token = $account['access_token'];
 }
}


$valid_files = array('image/jpeg', 'image/png', 'image/gif');

if(isset($_FILES) &amp;amp;&amp;amp; !empty($_FILES)){
 if( !in_array($_FILES['pic']['type'], $valid_files ) ){
  echo 'Only jpg, png and gif image types are supported!';
 }else{
  #Upload photo here
  $img = realpath($_FILES["pic"]["tmp_name"]);

  $args = array(
   'message' =&amp;gt; 'This photo was uploaded via WebSpeaks.in',
   'image' =&amp;gt; '@' . $img,
   'aid' =&amp;gt; $album_id,
   'no_story' =&amp;gt; 1,
   'access_token' =&amp;gt; $fanpage_token
  );

  $photo = $facebook-&amp;gt;api($album_id . '/photos', 'post', $args);
  if( is_array( $photo ) &amp;amp;&amp;amp; !empty( $photo['id'] ) ){
   echo '&amp;lt;p&amp;gt;&amp;lt;a target="_blank" href="http://www.facebook.com/photo.php?fbid='.$photo['id'].'"&amp;gt;Click here to watch this photo on Facebook.&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';
  }
 }
}

?&amp;gt;
 &amp;lt;!-- Form for uploading the photo --&amp;gt;
 &amp;lt;div class="main"&amp;gt;
  &amp;lt;p&amp;gt;Select a photo to upload on Facebook Fan Page&amp;lt;/p&amp;gt;
  &amp;lt;form method="post" action="&amp;lt;?php echo $_SERVER['PHP_SELF']; ?&amp;gt;" enctype="multipart/form-data"&amp;gt;
  &amp;lt;p&amp;gt;Select the image: &amp;lt;input type="file" name="pic" /&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;p&amp;gt;&amp;lt;input class="post_but" type="submit" value="Upload to my album" /&amp;gt;&amp;lt;/p&amp;gt;
  &amp;lt;/form&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #660000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;A bit of CSS:
&lt;/b&gt;&lt;/div&gt;
&lt;pre class="brush:css"&gt;html{
 font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
}
.main{
 width:400px;
 margin:auto;
 border:2px solid #0066CC;
 color:#3B5998;
 padding:20px;
 font-size: 11px;
    -moz-border-radius: 4px 4px 4px 4px;
    border-radius: 4px 4px 4px 4px;
    -moz-box-shadow: 1px 1px 0 #d5d5d5;
 background: none repeat scroll 0 0 #F2F2F2;
}
.text{
 color: #777777;
 border: 1px solid #BDC7D8;
 font-size: 11px;
 height: 15px;
}
.post_but {
    background: none repeat scroll 0 0 #EEEEEE;
    border-color: #999999 #999999 #888888;
    border-style: solid;
    border-width: 1px;
    color: #333333;
    cursor: pointer;
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    text-align: center;
    text-decoration: none;
}
a{
 color:#3B5998;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-2531745666625123199?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eZEIrBk2G0iD_LmTEYszvRdnYKY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eZEIrBk2G0iD_LmTEYszvRdnYKY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eZEIrBk2G0iD_LmTEYszvRdnYKY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eZEIrBk2G0iD_LmTEYszvRdnYKY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=v8APVjgNkjU:ggMuSlKqt_s:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=v8APVjgNkjU:ggMuSlKqt_s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=v8APVjgNkjU:ggMuSlKqt_s:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=v8APVjgNkjU:ggMuSlKqt_s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=v8APVjgNkjU:ggMuSlKqt_s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=v8APVjgNkjU:ggMuSlKqt_s:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=v8APVjgNkjU:ggMuSlKqt_s:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/v8APVjgNkjU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/2531745666625123199/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/12/upload-photos-to-facebook-fan-page.html#comment-form" title="25 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/2531745666625123199?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/2531745666625123199?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/v8APVjgNkjU/upload-photos-to-facebook-fan-page.html" title="Upload photos to Facebook Fan Page using PHP" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-kw2_ci0LR4w/TnOdAI-zXJI/AAAAAAAAAJ8/9FNH6og2mDo/s72-c/facebook_logo.jpg" height="72" width="72" /><thr:total>25</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/12/upload-photos-to-facebook-fan-page.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIARXg-eCp7ImA9WhRQGEU.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-3296358785445985358</id><published>2011-12-14T09:22:00.000-08:00</published><updated>2011-12-14T09:25:44.650-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-14T09:25:44.650-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="magento-extension" /><category scheme="http://www.blogger.com/atom/ns#" term="magento" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Magento Live Customer Chat Extension released</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Magento Customer Chat extension allows the customers on your store to communicate with each other in real time. The logged in customers on your store can see other logged in customers and chat with each other. The chat boxes are opened in Gmail style and new chat notifications are also shown over the browser window title bar.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: #660000; font-size: large;"&gt;&lt;b&gt;Extension Price: $49.00&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
Here are the features available in the extension:&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;
See all online users&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Chat with any online user&lt;/li&gt;
&lt;li&gt;
New chat notification&lt;/li&gt;
&lt;li&gt;
Option to configure the chat timing and the chatbox colors&lt;/li&gt;
&lt;/ul&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
Here are the screenshots to see how the extension works:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-VUx_5hyI354/TujZ_2qBxjI/AAAAAAAAAKk/0TCVkvkzntg/s1600/mockup.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="433" src="http://2.bp.blogspot.com/-VUx_5hyI354/TujZ_2qBxjI/AAAAAAAAAKk/0TCVkvkzntg/s640/mockup.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
Live chatboxes&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-DF-Bgj1Ew1s/TujanmPjyMI/AAAAAAAAAKs/y9b1FpHHYW4/s1600/Configuration+-+System+-+Magento+Admin+2011-12-14+22-41-23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://1.bp.blogspot.com/-DF-Bgj1Ew1s/TujanmPjyMI/AAAAAAAAAKs/y9b1FpHHYW4/s640/Configuration+-+System+-+Magento+Admin+2011-12-14+22-41-23.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
Chat configurations&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Purchase this extension:&lt;br /&gt;
&lt;iframe frameborder="0" height="715" marginheight="0" marginwidth="0" src="https://docs.google.com/spreadsheet/embeddedform?formkey=dEFzbXVVV0RpdkxPcE5Sc3p4eWZqbnc6MQ" width="760"&gt;&amp;amp;amp;lt;p&amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;p&amp;amp;amp;amp;amp;amp;amp;gt;Loading...&amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;lt;/p&amp;amp;amp;gt;&lt;/iframe&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-3296358785445985358?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7ZUURLNZHZcZN2Yj1kGCuX3enHs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7ZUURLNZHZcZN2Yj1kGCuX3enHs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7ZUURLNZHZcZN2Yj1kGCuX3enHs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7ZUURLNZHZcZN2Yj1kGCuX3enHs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=dVboxt8REb0:IZO0Kmnfkyc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=dVboxt8REb0:IZO0Kmnfkyc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=dVboxt8REb0:IZO0Kmnfkyc:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=dVboxt8REb0:IZO0Kmnfkyc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=dVboxt8REb0:IZO0Kmnfkyc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=dVboxt8REb0:IZO0Kmnfkyc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=dVboxt8REb0:IZO0Kmnfkyc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/dVboxt8REb0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/3296358785445985358/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/12/magento-live-customer-chat-extension.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3296358785445985358?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3296358785445985358?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/dVboxt8REb0/magento-live-customer-chat-extension.html" title="Magento Live Customer Chat Extension released" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-VUx_5hyI354/TujZ_2qBxjI/AAAAAAAAAKk/0TCVkvkzntg/s72-c/mockup.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/12/magento-live-customer-chat-extension.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8CSXk-eSp7ImA9WhRQFE0.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-6659933689030733181</id><published>2011-12-08T09:16:00.001-08:00</published><updated>2011-12-08T20:11:08.751-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-08T20:11:08.751-08:00</app:edited><title>Create custom plugin with button in CKEditor</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Recently I needed to customize the famous CKEditor for one of my projects. The requirement was to add custom text in the source code with the help of a new button added in the CKEditor. Then I searched the net and found some good tutorials. Here I am presenting a collaborative outcome of all the research in term of a simple plugin for adding current time to the source on click of a the button. Here is the &lt;a href="http://demos.frnzzz.com/ckeditor/samples_data/index.php" target="_blank"&gt;working demo...&lt;/a&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-LiXu72QVY9A/TuDzODYoOoI/AAAAAAAAAKc/qEz84hoogl4/s1600/Create+new+plugin+in+CKEDITOR+-+WebSpeaks.in+2011-12-08+22-44-31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://4.bp.blogspot.com/-LiXu72QVY9A/TuDzODYoOoI/AAAAAAAAAKc/qEz84hoogl4/s400/Create+new+plugin+in+CKEDITOR+-+WebSpeaks.in+2011-12-08+22-44-31.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span id="goog_1149580771"&gt;&lt;/span&gt;&lt;span id="goog_1149580772"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/ckeditor/samples_data/index.php" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://demos.frnzzz.com/d/?f=ckeditor/ckeditor.zip" target="_blank"&gt;Download Script&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #783f04; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Creating new Plugin&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;In the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ckeditor/plugins&lt;/span&gt; directory create a new directory with the name of your plugin. We are creating '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ckeditor/plugins/showtime&lt;/span&gt;'.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;In this directory add '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;plugin.js&lt;/span&gt;' file which is the main file for our plugin.&lt;/li&gt;
&lt;/ul&gt;
Here is the code for our showtime plugin:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;CKEDITOR.plugins.add('showtime',   //name of our plugin
{    
    requires: ['dialog'], //requires a dialog window
    init:function(a) {
  var b="showtime";
  var c=a.addCommand(b,new CKEDITOR.dialogCommand(b));
  c.modes={wysiwyg:1,source:1}; //Enable our plugin in both modes
  c.canUndo=true;

  //add new button to the editor
  a.ui.addButton("showtime",
  {
   label:'Show current time',
   command:b,
   icon:this.path+"showtime.png"
  });
  CKEDITOR.dialog.add(b,this.path+"dialogs/ab.js") //path of our dialog file
 }
});&lt;/pre&gt;
&lt;pre class="brush:javascript"&gt;&lt;/pre&gt;
Create the dialog box
For creating the dialog box, follow these steps:
Inside '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ckeditor/plugins/showtime&lt;/span&gt;' directory add new directory named '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;dialogs&lt;/span&gt;'.
In this directory create a new javascript file with any name. We are naming it as '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ab.js&lt;/span&gt;'.
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;CKEDITOR.dialog.add("showtime",function(e){

 var date=new Date();
 var months = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

 var h=date.getHours();
 var nh=h;
 var m=date.getMinutes();
 var s=date.getSeconds();
 var a;
 if(h&amp;gt;12){a="PM"; nh=h-12;}
 if(h&amp;lt;=12){a="AM"; nh=h;}
 
 //Create different time formats
 var t1 = months[parseInt(date.getMonth())]+' '+date.getDate()+" @ " + nh +  ":" + m + " " + a;
 var t2 = date.getFullYear()+'-'+parseInt(date.getMonth()+1) +'-'+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();
 var t3 = date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();

 return {
  title:'Show Time',
  resizable : CKEDITOR.DIALOG_RESIZE_BOTH,
  minWidth:300,
  minHeight:100,
  onShow:function(){ 
  },
  onLoad:function(){ 
    dialog = this; 
    this.setupContent();
  },
  onOk:function(){
  },
  contents:[
  {  id:"info",
    name:'info',
    label:'Tab',
    elements:[

     {
      id : 'format',
      type : 'select',
      label : 'Format',
      accessKey : 'T',
      items :
      [
       [ t1 ],
       [ t2 ],
       [ t3 ]
      ]
     },
     {  
      type:'html',
      html:'&amp;lt;span style=""&amp;gt;'+'Select the date format'+'&amp;lt;/span&amp;gt;'
     }
    ]
  }
  ],
  buttons:[{
   type:'button',
   id:'okBtn',
   label: 'Set',
   onClick: function(){
      addCode(); //function for adding time to the source
   }
  }, CKEDITOR.dialog.cancelButton],
};

 //function for adding time to the source
 function addCode(){

  //get the value of 'format' field in the 'info' tab of the dialog box
  var t = dialog.getValueOf('info', 'format');
  if(t.length == 0){
   alert('Please select date format.')
   return false;
  }

  var myEditor = CKEDITOR.instances.editor1;

  //insert the time into the HTML source code
  myEditor.insertHtml(t);

  return false;

 };

});&lt;/pre&gt;
&lt;pre class="brush:javascript"&gt;&lt;/pre&gt;
Adding the new button in our CKEditor
For adding the new plugin button in the CKEditor, we need to modify the '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;config.js&lt;/span&gt;' in the root directory of CKEditor. Our '&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;config.js&lt;/span&gt;' looks like:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;CKEDITOR.editorConfig = function( config )
{
 config.uiColor = '#AADC6E';

 //Add new button to the editor
 config.toolbar = 'Full';
 config.toolbar_Full =
 [
  { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Source'] },

  { name: 'bibliography', items : [ 'showtime' ] }
 ];
};&lt;/pre&gt;
&lt;pre class="brush:javascript"&gt;&lt;/pre&gt;
Calling our custom plugin in CKEditor:
To add our custom plugin in CKEditor, we need to declare this while adding the CKEditor in our HTML page. See the following code:
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;form action="sample_posteddata.php" method="post"&amp;gt;
  &amp;lt;textarea cols="80" id="editor1" name="editor1" rows="10"&amp;gt;Create new plugin with custom button. &amp;lt;/textarea&amp;gt;
  &amp;lt;script type="text/javascript"&amp;gt;
  //&amp;lt;![CDATA[

   CKEDITOR.replace( 'editor1',
    {
     fullPage : true,
     extraPlugins : 'showtime' //add our plugin to CKEditor
    });

  //]]&amp;gt;
  &amp;lt;/script&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-6659933689030733181?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/j3oY8B5MKsm1-aynIrY8lbXRz80/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j3oY8B5MKsm1-aynIrY8lbXRz80/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/j3oY8B5MKsm1-aynIrY8lbXRz80/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/j3oY8B5MKsm1-aynIrY8lbXRz80/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=PG4jBJmWJVg:Mn02ukBVHb0:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=PG4jBJmWJVg:Mn02ukBVHb0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=PG4jBJmWJVg:Mn02ukBVHb0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=PG4jBJmWJVg:Mn02ukBVHb0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=PG4jBJmWJVg:Mn02ukBVHb0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=PG4jBJmWJVg:Mn02ukBVHb0:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=PG4jBJmWJVg:Mn02ukBVHb0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/PG4jBJmWJVg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/6659933689030733181/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/12/create-custom-plugin-with-button-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6659933689030733181?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6659933689030733181?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/PG4jBJmWJVg/create-custom-plugin-with-button-in.html" title="Create custom plugin with button in CKEditor" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-LiXu72QVY9A/TuDzODYoOoI/AAAAAAAAAKc/qEz84hoogl4/s72-c/Create+new+plugin+in+CKEDITOR+-+WebSpeaks.in+2011-12-08+22-44-31.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/12/create-custom-plugin-with-button-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MNSX0zfyp7ImA9WhdaGE8.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-662609402508534437</id><published>2011-10-28T11:47:00.000-07:00</published><updated>2011-10-28T12:18:18.387-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-28T12:18:18.387-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JSON" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="ajax" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook api" /><title>Facebook Album Script: version 2.0</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
After the first version of &lt;a href="http://www.webspeaks.in/2011/09/access-faceook-photo-albums-using-php.html" target="_blank"&gt;Facebook Album Script&lt;/a&gt;, I am here with its second and extended version. This album script allows you to embed user's Facebook albums in your site in an easy and elegant manner. Here are the prime features of the script:&lt;br /&gt;
1. All albums listing&lt;br /&gt;
2. Show photos in fancy popup (no separate page to view photos)&lt;br /&gt;
3. Next-Previous Pagination&lt;br /&gt;
4. AJAX enabled&lt;br /&gt;
5. Show comments for each photo&lt;br /&gt;
6. Show likes for user comments&lt;br /&gt;
7. Fast performance for smooth user experience&lt;br /&gt;
&lt;br /&gt;
Don't wait. &lt;a href="http://demos.frnzzz.com/fbAlbum/fbAlbum_v2.0/" target="_blank"&gt;Try it here.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-MGcMKjCB4ic/Tqr3zRMHTRI/AAAAAAAAAKI/KDegQ6avfow/s1600/WebSpeaks.in+-+Access+facebook+Albums+on+your+site+using+PHP+2011-10-29+00-13-08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="276" src="http://4.bp.blogspot.com/-MGcMKjCB4ic/Tqr3zRMHTRI/AAAAAAAAAKI/KDegQ6avfow/s320/WebSpeaks.in+-+Access+facebook+Albums+on+your+site+using+PHP+2011-10-29+00-13-08.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/fbAlbum/fbAlbum_v2.0/" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://demos.frnzzz.com/d/?f=fbAlbum/fbAlbum_v2.0/fbAlbum_v2.0.zip" target="_blank"&gt;Download Script&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step by step code explained:&lt;br /&gt;
1. Create config file for basic Facebook configuration.
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
error_reporting(E_ERROR);
ini_set('display_errors', '1');
ini_set('max_execution_time','100');

require_once 'library/facebook.php';
try{
 $app_id = "your_app_id";
 $app_secret = "your_app_secret";
 $facebook = new Facebook(array(
   'appId' =&amp;gt; $app_id,
   'secret' =&amp;gt; $app_secret,
   'cookie' =&amp;gt; true
 ));
 if(is_null($facebook-&amp;gt;getUser()))
 {
  header("Location:{$facebook-&amp;gt;getLoginUrl(array('req_perms' =&amp;gt; 'user_status,publish_stream,user_photos,user_likes,user_location,offline_access,user_photo_video_tags'))}");
  exit;
 }
 $me = $facebook-&amp;gt;api('/me');

}catch(Exception $e){
 echo $e-&amp;gt;getMessage();
 echo '&amp;lt;p&amp;gt;Please try clearing your browser cookies or &amp;lt;a href="http://demos.frnzzz.com/fbAlbum/fbAlbum_v2.0/index.php.php"&amp;gt;click here&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;';
 die;
}
?&amp;gt;
&lt;/pre&gt;
2. Main markup file
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
require_once 'config.php';
?&amp;gt;

&amp;lt;html&amp;gt;
 &amp;lt;head&amp;gt;
  &amp;lt;link type="text/css" rel="stylesheet" href="style.css" /&amp;gt;
  &amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;script type="text/javascript" src="comments.js"&amp;gt;&amp;lt;/script&amp;gt;
  &amp;lt;title&amp;gt;WebSpeaks.in | Access facebook Albums on your site using PHP&amp;lt;/title&amp;gt;
  
  &amp;lt;script type="text/javascript"&amp;gt;
  jQuery(document).ready(function(){

  });
  &amp;lt;/script&amp;gt;
 &amp;lt;/head&amp;gt;
 &amp;lt;body&amp;gt;

 &amp;lt;div id="main"&amp;gt;

&amp;lt;?php

 echo '&amp;lt;p class="hd"&amp;gt;My Albums&amp;lt;/p&amp;gt;';


try {
 $albums = $facebook-&amp;gt;api('/me/albums');

 if(!empty($albums['data'])) {
  foreach($albums['data'] as $album) {
  
   $cover = "https://graph.facebook.com/{$album['id']}/picture?type=album&amp;amp;access_token={$facebook-&amp;gt;getAccessToken()}";

   echo '&amp;lt;div class="alb_cover" id="',$album['id'],'" title="',$album['name'],'"&amp;gt;';
   
    echo '&amp;lt;a href="javascript:;"&amp;gt;&amp;lt;div class="cover_photo"&amp;gt;&amp;lt;img src="',$cover,'" /&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/a&amp;gt;';

    echo '&amp;lt;a href="javascript:;"&amp;gt;'.'&amp;lt;div class="alb_title"&amp;gt;',$album['name'],'&amp;lt;/div&amp;gt;&amp;lt;/a&amp;gt;';
   
   echo '&amp;lt;/div&amp;gt;';

  }
 }
} catch (FacebookApiException $e) {
 error_log($e);
 var_dump($e);
}


?&amp;gt;
 &amp;lt;/div&amp;gt;

  &amp;lt;div id="backgroundPopup"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div id="popupContact"&amp;gt;
   
   &amp;lt;table align="center"&amp;gt;
    &amp;lt;tr id="popup_head"&amp;gt;
     &amp;lt;td colspan="3"&amp;gt;&amp;lt;a id="popupContactClose"&amp;gt;Close&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    &amp;lt;tr&amp;gt;
     &amp;lt;td&amp;gt;&amp;lt;div id="prev" class="nextPrev"&amp;gt;&amp;lt;a href="javascript:void(0)"&amp;gt;«&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;
    
     &amp;lt;td&amp;gt;&amp;lt;div id="picHolder"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;
    
     &amp;lt;td&amp;gt;&amp;lt;div id="next" class="nextPrev"&amp;gt;&amp;lt;a href="javascript:void(0)"&amp;gt;»&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
    
    &amp;lt;tr&amp;gt;
     &amp;lt;td colspan="3" class="commentsTd"&amp;gt;
      &amp;lt;div id="commentsHolder"&amp;gt;
       &amp;lt;table align="center" class="new_comment_table"&amp;gt;
       &amp;lt;/table&amp;gt;  
      &amp;lt;/div&amp;gt;
     &amp;lt;/td&amp;gt;
    &amp;lt;/tr&amp;gt;
   &amp;lt;/table&amp;gt;
   
  &amp;lt;/div&amp;gt;
  
 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/pre&gt;
3. jQuery file that performs some magic
&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;jQuery(document).ready(function()
{
 
 var loaded = [];
 var albums = [];
 var album_id;
 var cur_pic = 0;
 var alb_name = '';

 jQuery('div.alb_cover a').click(function(){

  album_id = jQuery(this).parent().attr('id');
  var cover_photo = jQuery(this).parent().find('div.cover_photo');
  var cover = cover_photo.html();
  var cover_height = cover_photo.css('height');
  var cover_width = cover_photo.css('width');
  alb_name = jQuery(this).parent().attr('title');

  if ( !loaded[album_id] ) {
  
   albums[album_id] = [];

   jQuery.ajax({
      'url':'ajax.php',
      'dataType': 'json',
      'data':'album_id=' + album_id,
      'type':'POST',
      'async':false,
      'beforeSend': function(){
     cover_photo.html('&amp;lt;img src="http://static.ak.connect.facebook.com/images/loaders/indicator_white_large.gif" /&amp;gt;');
     cover_photo.css({"height": cover_height,"width": cover_width});
      },
      'success':function(data){

      loaded[album_id] = true;

      albums[album_id] = data;
      
      cover_photo.html(cover);
      
      loadNextImage(album_id, 0);

    }
   });

  }
  
  centerPopup();
  loadPopup();
 });
 
 function loadNextImage(album_id, step){

  jQuery('div.alb_count').empty();
  
  var next_pic = 0;

  if(step == 0){
  
   next_pic = 0;
   
  }else if(step == 'next'){
  
   next_pic = parseInt(cur_pic, 10)+1;

   if(next_pic &amp;gt;= albums[album_id].length){
    next_pic = 0;
   }
   
  }else{
  
   next_pic = parseInt(cur_pic, 10)-1;

   if(next_pic &amp;lt; 0){
    next_pic = albums[album_id].length - 1;
   }
  
  }

  cur_pic = next_pic;

  jQuery('#picHolder').html('&amp;lt;img src="'+albums[album_id][next_pic]['source']+'" /&amp;gt;');

  loadComments(album_id);

 }
 
 function loadComments(album_id){

  var comment_table = jQuery('#commentsHolder').find('table.new_comment_table');

  comment_table.empty();
  
  var ntr = '&amp;lt;div class="alb_count"&amp;gt;Album:' + alb_name + ' ' + parseInt(cur_pic+1) +' of '+albums[album_id].length+'&amp;lt;/div&amp;gt;';
 
  if(albums[album_id][cur_pic]['name'] != ''){

   ntr = albums[album_id][cur_pic]['name'] + ntr;
  }

  comment_table.append('&amp;lt;tr&amp;gt;&amp;lt;td class="pic_name"&amp;gt;' + ntr + '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;');
  
  var comments = albums[album_id][cur_pic]['comments'];

  if ( comments.length &amp;gt; 0 ){
  
   for (var x in comments){

    var from_id = comments[x]['from']['id'];
    var from_name = comments[x]['from']['name'];
    var msg = comments[x]['message'];
    var time = comments[x]['created_time'].substring(0,10) + ' ' + comments[x]['created_time'].substring(11,19);
    var likes = parseInt(comments[x]['likes'], 10);
    
    if(likes &amp;gt; 0){
     if(likes &amp;gt; 1){
      var person = 'persons';
     }else{
      var person = 'person';
     }
     var likeHtm = '&amp;lt;img src="facebook_like_icon.png" /&amp;gt;' + '&amp;lt;div class="count"&amp;gt;' + likes + ' ' + person +'&amp;lt;/div&amp;gt;';
    }else{
     var likeHtm = '';
    }

    var ctr = '&amp;lt;tr class="new_comment_row"&amp;gt;';
    ctr += '&amp;lt;td class="new_comment_text"&amp;gt;&amp;lt;a class="prof_name" target="_blank" href="http://facebook.com/profile.php?id='+from_id+'"&amp;gt;'+from_name+':&amp;lt;/a&amp;gt; &amp;lt;span class="msg"&amp;gt;'+msg+'&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;div class="comment_time"&amp;gt;'+time+'&amp;lt;/div&amp;gt;&amp;lt;div class="comment_likes"&amp;gt;'+likeHtm+'&amp;lt;/div&amp;gt;';
    ctr += '&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;';

    comment_table.append(ctr);

   }

  }
  
 }

 jQuery("#next").click(function(){

  loadNextImage(album_id, 'next');

 });

 jQuery("#prev").click(function(){

  loadNextImage(album_id, 'prev');

 });
 
 

 jQuery("#popupContactClose, .c_btn").click(function()
 {
  disablePopup();
 });
 
 jQuery(document).keypress(function(e){
  if(e.keyCode==27)//Disable popup on pressing `ESC`
  {
   disablePopup();
  }
 });


 function loadPopup(){
  jQuery("#backgroundPopup").css({"opacity": "0.7"});
  jQuery("#backgroundPopup").fadeIn("fast");
  jQuery("#popupContact").fadeIn("slow");
 }
 function disablePopup(){
  jQuery("#backgroundPopup").fadeOut("slow");
  jQuery("#popupContact").fadeOut("slow");
 }
 function centerPopup(){
  var windowWidth = document.documentElement.clientWidth;
  var windowHeight = document.documentElement.clientHeight;
  var popupHeight = jQuery("#popupContact").height();
  var popupWidth = jQuery("#popupContact").width();
  jQuery("#popupContact").css({"left": windowWidth/2-popupWidth/2});
  jQuery("#popupContact").css({"position": "absolute",/*"top": windowHeight/2-popupHeight/2,*/"left": windowWidth/2-popupWidth/2});
  jQuery("#backgroundPopup").css({"height": windowHeight});
 }
 
 function ifExists(str){
  if(str=='undefined' || typeof(str)=='undefined' || str==''){
   return false;
  }else{
   return true;
  }
 }

});
&lt;/pre&gt;
4. AJAX file
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
if( !isset($_REQUEST['album_id']) )
 die("No direct access allowed!");

ini_set('max_execution_time','100');

$album_id = $_REQUEST['album_id'];

require_once '../library/facebook.php';

try{
 $app_id = "your_app_id";
 $app_secret = "your_app_secret";
 $facebook = new Facebook(array(
   'appId' =&amp;gt; $app_id,
   'secret' =&amp;gt; $app_secret,
   'cookie' =&amp;gt; true
 ));
 if(is_null($facebook-&amp;gt;getUser()))
 {
  // header("Location:{$facebook-&amp;gt;getLoginUrl(array('req_perms' =&amp;gt; 'user_status,publish_stream,user_photos,user_likes,user_location,user_photo_video_tags'))}");
  // exit;
 }
 $me = $facebook-&amp;gt;api('/me');

}catch(Exception $e){
 echo $e-&amp;gt;getMessage();
 die;
}


if($me){
 try {
  $params['fields'] = 'name,source,comments';
  $params = http_build_query($params, null, '&amp;amp;');
  $photos = $facebook-&amp;gt;api("/$album_id/photos?$params");

  $i = 0;
  $album = array();
  foreach( $photos['data'] as $photo ){

   $album[$i] = array();
   
   $album[$i]['photo_id'] = $photo['id'];
   
   if(isset($photo['name'])){
    $album[$i]['name'] = $photo['name'];
   }else{
    $album[$i]['name'] = '';
   }
    
   $album[$i]['source'] = $photo['source'];
   
   if(isset($photo['from'])){
    $album[$i]['from'] = $photo['from'];
   }else{
    $album[$i]['from'] = '';
   }
    
   $album[$i]['created_time'] = $photo['created_time'];
   
   if(isset($photo['comments'])){
    $album[$i]['comments'] = $photo['comments']['data'];
   }else{
    $album[$i]['comments'] = '';
   }

   if(isset($photo['likes'])){
    $album[$i]['likes'] = $photo['likes'];
   }else{
    $album[$i]['likes'] = '';
   }

   $i++;
  }
  echo json_encode($album);

 } catch (FacebookApiException $e) {
  echo '&amp;lt;pre&amp;gt;';print_r($e);echo '&amp;lt;/pre&amp;gt;';
  $user = null;
 }
} else {
 echo 'User not found';
}
?&amp;gt;
&lt;/pre&gt;
5. CSS file for styling the application
&lt;br /&gt;
&lt;pre class="brush:css"&gt;body{font-family: "lucida grande",tahoma,verdana,arial,sans-serif;color:#3B5998;font-size:11px;}
a{
 text-decoration:none;
}
div.alb_cover{
    float: left;
 margin:20px;
 padding:5px;
}
div.cover_photo{
 min-width:80px;
 min-height:100px;
 padding:7px;
 text-align:center;
    border: 1px solid #ECECEC;
}
div.cover_photo:hover{
 border:1px solid #3B5998;
}
div.alb_title{
 padding: 3px 0 0 0;
 color:#3B5998!important;
}

#popupContact *{
 border:0pt none;
 margin:0pt;
 padding:0pt;
 text-align:left;
}

#popupContact body{
 background:#fff none repeat scroll 0%;
 line-height:1;
 font-size: 12px;
 margin:0pt;
 height:100%;
}
#popupContact a{
 cursor: pointer;
 text-decoration:none;
 font-size:10px;
}
#backgroundPopup{
 display:none;
 position:fixed;
 _position:absolute; /* hack for internet explorer 6*/
 height:100%;
 width:100%;
 top:0;
 left:0;
 background:#FFFFFF; 
 z-index:1;
}
#popupContact{
 background-color:#F9F9F9;
 display:none;
 position:fixed;
 _position:absolute; /* hack for internet explorer 6*/
 min-height:402px;
 max-width: 960px;
 min-width: 787px;
 padding: 12px;
 border:10px solid #FFFFFF;
 z-index:2;
 top: 10px;
 overflow:hidden;
 box-shadow: 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 5px 3px rgba(0, 0, 0, 0.05), 0 5px 4px -3px rgba(0, 0, 0, 0.06);
}
#popupContactClose{
 line-height:14px;
 right:6px;
 top:4px;
 position:absolute;
 display:block;
 color:#000000;
}


#picHolder{
 text-align:center;
 max-width: 960px;
 min-width: 740px;
}


#popup_head{
 color:#333333!important;
 text-align:center!important;
}
div.nextPrev a{
 font-size: 24px!important;
    font-weight: bold;
 text-align:center;
 color:#333333!important;
}
#commentsHolder{
    overflow-y: auto;
 margin-left:18px;
}
.new_comment_table{
 clear:left;
 overflow:hidden;
 padding:5px 0 4px 5px;
 font-size:11px;
 margin:1px 0 0 25px;
}
.new_comment_table div.alb_count{
 color:#333333;
 float:right;
}
.new_comment_table td.pic_name{
 padding:5px 0 5px 5px!important;
 width:380px;
}
td.commentsTd{
 border-top: 1px groove #333333;
 padding: 10px 0 5px 0;
}
.new_comment_row{
 background-color:#ECEFF5;
 line-height: 16px;
 padding:3px;
}
.new_comment_text{
 width:300px;
 margin-top:2px;
 vertical-align:top;
 border-bottom: 1px solid #D2D9E7;
 padding: 5px 5px 4px!important;
}
.new_comment_text a.prof_name{
 color:#3B5998;
    font-weight: bold;
}
.new_comment_text span.msg{
 color:#333333;
}
.comment_time{
 color:#808080;
 font-size:9px;
 float:left;
}
.comment_likes{
 color:#808080;
 font-size:9px;
 float:right;
}
.comment_likes img{
 padding: 0 5px 0 0;
 vertical-align:middle;
}
.comment_likes div.count{
 padding: 0 5px 0 0!important;
 float:right;
}
&lt;/pre&gt;
Thats all to make our application running on your site. Will be back with version 3 of this script. Till then enjoy it:)
&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-662609402508534437?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ONU0lM41b1m-bpHb1OHldBmZW8g/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ONU0lM41b1m-bpHb1OHldBmZW8g/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ONU0lM41b1m-bpHb1OHldBmZW8g/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ONU0lM41b1m-bpHb1OHldBmZW8g/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Lr5EY5FFdec:zRDx_5RyNMQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Lr5EY5FFdec:zRDx_5RyNMQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Lr5EY5FFdec:zRDx_5RyNMQ:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Lr5EY5FFdec:zRDx_5RyNMQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Lr5EY5FFdec:zRDx_5RyNMQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Lr5EY5FFdec:zRDx_5RyNMQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Lr5EY5FFdec:zRDx_5RyNMQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/Lr5EY5FFdec" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/662609402508534437/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/10/facebook-album-script-version-20.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/662609402508534437?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/662609402508534437?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/Lr5EY5FFdec/facebook-album-script-version-20.html" title="Facebook Album Script: version 2.0" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-MGcMKjCB4ic/Tqr3zRMHTRI/AAAAAAAAAKI/KDegQ6avfow/s72-c/WebSpeaks.in+-+Access+facebook+Albums+on+your+site+using+PHP+2011-10-29+00-13-08.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/10/facebook-album-script-version-20.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YHSHg4eSp7ImA9WhdUGEk.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-2976039997249553630</id><published>2011-10-05T11:47:00.000-07:00</published><updated>2011-10-05T11:58:59.631-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-05T11:58:59.631-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="tips n tricks" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Quick tips for improving PHP Performance</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Recently I was studying about improving the performance of our PHP code. While surfing through the web I came out with some interesting tips about improving the performance of your PHP code. All the tips have been verified by renowned authors(including Google) and there is nearly no doubt regarding their authenticity. I want to share these tips with my readers. So here we go...&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-91A4rU1HY20/ToyoRgxA5NI/AAAAAAAAAKE/V3oZdqbu1n4/s1600/performance.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-91A4rU1HY20/ToyoRgxA5NI/AAAAAAAAAKE/V3oZdqbu1n4/s320/performance.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.dalecarnegiewaynl.com/wp-content/uploads/2011/04/performance.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
1. 'echo' is much faster than print. So always try echo something rather than printing it.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*This is faster*/
	echo 'This is echoed text';

	/*This is slower*/
	print 'This is printed text';
	&lt;/pre&gt;
2. Always use the stacked form of echo instead of using concatenation. e.g
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*Faster form of echo*/
	echo 'This is stacked form of ', $variable;

	/*Slower form of echo*/
	echo 'This is regular form of ' . $variable;
	&lt;/pre&gt;
3. Use of single quotes rather than double quotes with echo can improve the performance of your code because compiler will not search for the variables inside the single quotes but in double quotes it will perform a search for possible variables.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*Faster form of echo*/
	echo 'This is single quoted string.';

	/*Slower form of echo*/
	echo "This is double quoted $string.";
	&lt;/pre&gt;
4. Use pre-increments where possible instead of post-increments. Pre-incrementing is faster than post-increments.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*Slower form of iteration*/
	for ( $i=0; $i &amp;lt; 1000; $i++ ) {
		echo 'Loop ',$i;
	}

	/*Faster form of iteration*/
	for ( $i=0; $i &amp;lt; 1000; ++$i ) {
		echo 'Loop ',$i;
	}
	&lt;/pre&gt;
5. Never use calculations as counters in an iteration.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*Slower form of iteration*/
	for ( $i=0; $i &amp;lt; count($arr); $i++ ) {
		echo 'Loop ',$i;
	}

	/*Faster form of iteration*/
	$counter = count($arr);
	
	for ( $i=0; $i &amp;lt; $counter; $i++ ) {
		echo 'Loop ',$i;
	}
	&lt;/pre&gt;
6. Always unset the variable after using those. It may save some of your resources on the server.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	$counter = count($arr);
	
	for ( $i=0; $i &amp;lt; $counter; $i++ ) {
		$value = $arr[$i];
		
		foo( $value );//call any function
		
		unset($value);//unset the variable after using it.
	}
	&lt;/pre&gt;
7. Always initialize your variables before using those. It can sometimes prove beneficial in terms of performance.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	$counter = count($arr);
	
	$value = '';//initialize the variable before using it
	
	for ( $i=0; $i &amp;lt; $counter; $i++ ) {
		$value = $arr[$i];
		
		foo( $value );//call any function
		
		unset($value);//unset the variable after using it.
	}
	&lt;/pre&gt;
8. Always close the database connections after you are done with the queries.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	mysql_connect('localhost', 'root', 'secret123');
	
	mysql_select_db('test_db');
	
	//write database queries here
	
	mysql_close();//close the connection at the end
	&lt;/pre&gt;
9. Avoid strlen() to check the length of a string. Checking the desired index in the string can also work.	
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*Slower form*/
	if ( strlen($str) &amp;gt; 100 ) {
		echo 'You have crossed the limits';
	}

	/*Faster form*/
	if ( $str[100] ) {
		echo 'You have crossed the limits';
	}
	&lt;/pre&gt;
10. Use include() and require() instead of include_once() and require_once(). There's a lot of work involved in checking to see if a file has already been included. Sometimes it's necessary, but you should default to include() and require() in most situations.&lt;br /&gt;
&lt;br /&gt;


11. Use full file paths on include/require statements. Normalizing a relative file path can be expensive; giving PHP the absolute path (or even "./file.inc") avoids the extra step.&lt;br /&gt;
&lt;br /&gt;


12. Don't copy variables for no reason. Sometimes PHP novices attempt to make their code "cleaner" by copying predefined variables to variables with shorter names before working with them. What this actually results in is doubled memory consumption (when the variable is altered), and therefore, slow scripts. In the following example, if a user had inserted 512KB worth of characters into a textarea field. This implementation would result in nearly 1MB of memory being used.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	/*Slower form*/
	$description = strip_tags($_POST['description']);
	echo $description;

	/*Faster form*/
	echo strip_tags($_POST['description']);
	&lt;/pre&gt;
13. Avoid doing SQL queries within a loop. A common mistake is placing a SQL query inside of a loop. This results in multiple round trips to the database, and significantly slower scripts. In the example below, you can change the loop to build a single SQL query and insert all of your users at once.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	foreach ($userList as $user) {
		$query = 'INSERT INTO users (first_name,last_name) VALUES("' . $user['first_name'] . '", "' . $user['last_name'] . '")';
		mysql_query($query);
	}
	&lt;/pre&gt;
Produces:
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	INSERT INTO users (first_name,last_name) VALUES("John", "Doe")
	&lt;/pre&gt;
Instead of using a loop, you can combine the data into a single database query.
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	$userData = array();
	foreach ($userList as $user) {
		$userData[] = '("' . $user['first_name'] . '", "' . $user['last_name'] . '")';
	 }
	$query = 'INSERT INTO users (first_name,last_name) VALUES' . implode(',', $userData);
	mysql_query($query);
	&lt;/pre&gt;
Produces:
	&lt;br /&gt;
&lt;pre class="brush:php"&gt;	INSERT INTO users (first_name,last_name) VALUES("John", "Doe"),("Jane", "Doe")...
	&lt;/pre&gt;
14. Avoid OOP whenever you can. You should use OOP concepts only when these are really required. Study the situation you are working in. If you can do the things without OOP concepts, do it without hesitation. Using OOP for smaller tasks will always increase overhead rather than improving the performance. So the core concepts can help in most of the situations.'&lt;br /&gt;
&lt;br /&gt;
15. Always strive for caching. Each time your request is processed by the server, the server has to reproduce the similar content repetitively. This wastes a lot of server resources just for nothing useful. So try to implement templating systems like 'Smarty'. It will always fasten your web application.&lt;br /&gt;
&lt;br /&gt;
16. Using in built functions of PHP is many times faster than using custom build functions. So search the PHP manual thoroughly before writing your own function. Nearly every type of function is available in PHP.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-2976039997249553630?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KtJ6_qRdGDtB39R2kTsyB53rCrM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KtJ6_qRdGDtB39R2kTsyB53rCrM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KtJ6_qRdGDtB39R2kTsyB53rCrM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KtJ6_qRdGDtB39R2kTsyB53rCrM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=8I8CTGHiPNA:A-bOr9vNfmM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=8I8CTGHiPNA:A-bOr9vNfmM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=8I8CTGHiPNA:A-bOr9vNfmM:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=8I8CTGHiPNA:A-bOr9vNfmM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=8I8CTGHiPNA:A-bOr9vNfmM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=8I8CTGHiPNA:A-bOr9vNfmM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=8I8CTGHiPNA:A-bOr9vNfmM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/8I8CTGHiPNA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/2976039997249553630/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/10/quick-tips-for-improving-php.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/2976039997249553630?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/2976039997249553630?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/8I8CTGHiPNA/quick-tips-for-improving-php.html" title="Quick tips for improving PHP Performance" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-91A4rU1HY20/ToyoRgxA5NI/AAAAAAAAAKE/V3oZdqbu1n4/s72-c/performance.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/10/quick-tips-for-improving-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIBRH06eip7ImA9WhdVF0o.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-1466863950337890498</id><published>2011-09-23T03:19:00.000-07:00</published><updated>2011-09-23T03:25:55.312-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-23T03:25:55.312-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="wordpress" /><category scheme="http://www.blogger.com/atom/ns#" term="wordpress plugins" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Adding custom columns to the WordPress Posts/Pages listing</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
While developing your custom plugins you might may have desired to add extra columns to the pages/posts listing in WordPress admin section. At first glance you may think that it may requires editing some template file (I guessed same though ;)). But thanks to WordPress action api that allows you to manipulate nearly every action in WordPress. Adding custom column is also achieved through WordPress actions. Lets see how it is done.&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/-iyLGpIRAQY4/TnxcrczAyCI/AAAAAAAAAKA/wKlR1Y_vtI0/s1600/wordpress.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="121" src="http://3.bp.blogspot.com/-iyLGpIRAQY4/TnxcrczAyCI/AAAAAAAAAKA/wKlR1Y_vtI0/s640/wordpress.PNG" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In your theme's &lt;span style="color: orange; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;function.php&lt;/span&gt; or your plugin file, write the following code:
&lt;br /&gt;
&lt;pre class="brush:php"&gt;add_filter('manage_posts_columns', 'my_column');

function my_column($defaults){

	$defaults['my_column'] = __('Custom Column');	/*Add our column to the list of default columns*/

	return $defaults;

}
&lt;/pre&gt;
The '&lt;span style="color: orange; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;manage_posts_columns&lt;/span&gt;' filter will add the custom column to the list of default columns. So the column heading now appears in the listing. But it has no data till now. To add data under this column, write following code:
&lt;br /&gt;
&lt;pre class="brush:php"&gt;add_action('manage_posts_custom_column', 'custom_column_data', 10, 2);

function custom_column_data($column_name, $id) {
    if( $column_name == 'my_column' ) {

		/*Fetch custom information saved in meta data for this post*/
		$meta = get_post_meta($id, 'custom_info');

		/*If metadata is not empty, show it in the column*/
		if(!empty($meta)){

			$reviewed_by = $meta['reviewed_by'];
			
			$user = get_userdata($reviewed_by);
			
			echo '&amp;lt;a href="'.site_url()."/wp-admin/edit.php?post_type=post&amp;amp;author=".$user-&amp;gt;ID.'"&amp;gt;'.$user-&amp;gt;user_nicename.'&amp;lt;/a&amp;gt;';

		}

	}
}
&lt;/pre&gt;
The action '&lt;span style="color: orange; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;manage_posts_custom_column&lt;/span&gt;' takes two arguments, one is the column name and other is the post ID. Based on these, any type of information can be shown in the column.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Managing Pages&lt;/b&gt;&lt;br /&gt;
To add the column to the pages listing, use following actions and filters:
&lt;br /&gt;
&lt;pre class="brush:php"&gt;add_filter('manage_pages_columns', 'my_column');

add_action('manage_pages_custom_column', 'custom_column_data', 10, 2);
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-1466863950337890498?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EFyVoeqhZ6TvkVymcvcLGbDzvv4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EFyVoeqhZ6TvkVymcvcLGbDzvv4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EFyVoeqhZ6TvkVymcvcLGbDzvv4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EFyVoeqhZ6TvkVymcvcLGbDzvv4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=tUm__S7-t6c:XzusHoERc-g:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=tUm__S7-t6c:XzusHoERc-g:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=tUm__S7-t6c:XzusHoERc-g:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=tUm__S7-t6c:XzusHoERc-g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=tUm__S7-t6c:XzusHoERc-g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=tUm__S7-t6c:XzusHoERc-g:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=tUm__S7-t6c:XzusHoERc-g:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/tUm__S7-t6c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/1466863950337890498/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/09/adding-custom-columns-to-wordpress.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/1466863950337890498?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/1466863950337890498?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/tUm__S7-t6c/adding-custom-columns-to-wordpress.html" title="Adding custom columns to the WordPress Posts/Pages listing" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-iyLGpIRAQY4/TnxcrczAyCI/AAAAAAAAAKA/wKlR1Y_vtI0/s72-c/wordpress.PNG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/09/adding-custom-columns-to-wordpress.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIASXgzeyp7ImA9WhdVEk0.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-4694005382538733881</id><published>2011-09-16T12:04:00.000-07:00</published><updated>2011-09-16T12:15:48.683-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-16T12:15:48.683-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook api" /><category scheme="http://www.blogger.com/atom/ns#" term="webdesign" /><title>Access Facebook Photo Albums using PHP - v1.0</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I think it will be great if you can access your Facebook photo albums on your website. I have created an easy way to access your Facebook albums and photos on your site. Like the previous tutorial on &lt;a href="http://www.webspeaks.in/2011/08/upload-photos-on-facebook-using-php.html" target="_blank"&gt;'How to upload photos on Facebook using PHP'&lt;/a&gt;, this tutorial also requires the appId and secret code of your Facebook application. I will release updates of this post in near future The new version will include the comments posting on the photos.&lt;br /&gt;
&lt;a href="http://demos.frnzzz.com/fbAlbum/photos.php"&gt;Lets see it working...&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-kw2_ci0LR4w/TnOdAI-zXJI/AAAAAAAAAJ8/9FNH6og2mDo/s1600/facebook_logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://2.bp.blogspot.com/-kw2_ci0LR4w/TnOdAI-zXJI/AAAAAAAAAJ8/9FNH6og2mDo/s400/facebook_logo.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/fbAlbum/photos.php" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://demos.frnzzz.com/d/?f=fbAlbum/photos.zip" target="_blank"&gt;Download Script&lt;/a&gt;
&lt;br /&gt;
&lt;div class="clear"&gt;
&lt;/div&gt;
&lt;b style="color: #990000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;PHP Code:&lt;/b&gt;
&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
	require_once 'library/facebook.php';
	try{
		$facebook = new Facebook(array(
				'appId' =&amp;gt; $app_id,
				'secret' =&amp;gt; $app_secret,
				'cookie' =&amp;gt; true
		));
		if(is_null($facebook-&amp;gt;getUser()))
		{
				header("Location:{$facebook-&amp;gt;getLoginUrl(array('req_perms' =&amp;gt; 'user_status,publish_stream,user_photos'))}");
				exit;
		}
		$me = $facebook-&amp;gt;api('/me');
	}catch(Exception $e){
		echo $e-&amp;gt;getMessage();
		echo '&amp;lt;p&amp;gt;Please try clearing your browser cookies or &amp;lt;a href="http://demos.frnzzz.com/fbAlbum/photos.php"&amp;gt;click here&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;';
		die;
	}
?&amp;gt;
&amp;lt;html&amp;gt;
	&amp;lt;head&amp;gt;
		&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt; 
		&amp;lt;script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"&amp;gt;&amp;lt;/script&amp;gt; 
		&amp;lt;script type="text/javascript"&amp;gt; 
		$(document).ready(function() {
			$('.slideshow').cycle({
				fx: 'fade'
			});
		});
		&amp;lt;/script&amp;gt; 
		&amp;lt;title&amp;gt;WebSPeaks.in | Access facebook Albums on your site using PHP&amp;lt;/title&amp;gt;
	&amp;lt;/head&amp;gt;
	&amp;lt;body&amp;gt;
&amp;lt;?php
	$albums = $facebook-&amp;gt;api('/me/albums');

	$action = $_REQUEST['action'];

	$album_id = '';
	if(isset($action) &amp;amp;&amp;amp; $action=='viewalbum'){ 
		$album_id = $_REQUEST['album_id'];
		$photos = $facebook-&amp;gt;api("/{$album_id}/photos");
		?&amp;gt;
		&amp;lt;div class="slideshow"&amp;gt; 
		&amp;lt;?php
		foreach($photos['data'] as $photo)
		{
			echo "&amp;lt;img src='{$photo['source']}' /&amp;gt;";
		}
		?&amp;gt;
		&amp;lt;/div&amp;gt;
		&amp;lt;?php
	}

	$pageURL .= 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
	echo '&amp;lt;div class="alb"&amp;gt;';
	if(strstr($pageURL,'.php?')){
		$and = '&amp;amp;';
	}else{
		$and = '?';
	}

	echo '&amp;lt;p class="hd"&amp;gt;My Albums&amp;lt;/p&amp;gt;';
	foreach($albums['data'] as $album)
	{
		if($album_id == $album['id']){
			$name = '&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;'.$album['name'].'&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;';
		}else{
			$name = $album['name'];
		}
		echo '&amp;lt;p&amp;gt;'."&amp;lt;a href=".$pageURL.$and."action=viewalbum&amp;amp;album_id=".$album['id']."&amp;gt;".$name.'&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';
	}
	echo '&amp;lt;/div&amp;gt;';
	?&amp;gt;
	&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;div style="color: #990000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;CSS Code:
&lt;/b&gt;&lt;/div&gt;
&lt;pre class="brush:css"&gt;body{
	font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
}
.alb {
	margin: auto;
	width:200px;
	float:right;
	padding:20px;
}
.alb p{
	background-color: #EDEFF4;
}
.alb p.hd{
	background-color: #EDEFF4;
	color: #1C2A47;
	font-size: 16px;
	font-weight:bold;
	padding:5px;
}
.alb p a{
	color: #3B5998;
	cursor: pointer;
	text-decoration: none;
	font-size: 11px;
	padding:10px;
	line-height: 25px;
}
.slideshow{
	margin: auto;
	float:left;
	padding:20px;
}
.slideshow img {
	padding: 15px;
	border: 1px solid #ccc;
	background-color: #eee;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-4694005382538733881?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3D9ZpNw95PQGfNpHzGr-1LN92Dg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3D9ZpNw95PQGfNpHzGr-1LN92Dg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3D9ZpNw95PQGfNpHzGr-1LN92Dg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3D9ZpNw95PQGfNpHzGr-1LN92Dg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=FeMKB5s_KwQ:0jHDvEjw84c:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=FeMKB5s_KwQ:0jHDvEjw84c:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=FeMKB5s_KwQ:0jHDvEjw84c:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=FeMKB5s_KwQ:0jHDvEjw84c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=FeMKB5s_KwQ:0jHDvEjw84c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=FeMKB5s_KwQ:0jHDvEjw84c:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=FeMKB5s_KwQ:0jHDvEjw84c:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/FeMKB5s_KwQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/4694005382538733881/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/09/access-faceook-photo-albums-using-php.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/4694005382538733881?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/4694005382538733881?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/FeMKB5s_KwQ/access-faceook-photo-albums-using-php.html" title="Access Facebook Photo Albums using PHP - v1.0" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-kw2_ci0LR4w/TnOdAI-zXJI/AAAAAAAAAJ8/9FNH6og2mDo/s72-c/facebook_logo.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/09/access-faceook-photo-albums-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEANRXk5fSp7ImA9WhdXF04.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-7440441213186969821</id><published>2011-08-30T12:30:00.000-07:00</published><updated>2011-08-30T12:33:14.725-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-30T12:33:14.725-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook api" /><title>Upload photos on Facebook using PHP</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;a href="http://4.bp.blogspot.com/-xhj_iGtluq0/Tl05NOkAd3I/AAAAAAAAAJ4/7iD1lUSfCQE/s1600/fb.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="204" src="http://4.bp.blogspot.com/-xhj_iGtluq0/Tl05NOkAd3I/AAAAAAAAAJ4/7iD1lUSfCQE/s320/fb.PNG" width="320" /&gt;&lt;/a&gt;If you have strived for the uploading photos on Facebook via your site, then you are at right place. On demand of my readers I have written this article to show how to upload images on Facebook via PHP.
First of all you need to create a &lt;a href="https://developers.facebook.com/" target="_blank"&gt;Facebook app&lt;/a&gt;. I will not tell you how to do that. Get the appId and secret code of your application from facebook. This appId and secret code is necessary to connect you site to the application on Facebook. This code uses the Facebook.php class that can be downloaded from &lt;a href="http://github.com/facebook/php-sdk/" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/fbAlbum" target="_blank"&gt;Live Demo&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #990000; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;PHP Code:
&lt;/b&gt;&lt;/div&gt;
&lt;pre class="brush:php"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;WebSpeaks.in | Upload images to Facebook&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&amp;gt;
&amp;lt;style&amp;gt;
html{
	font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
}
.main{
	width:400px;
	margin:auto;
	border:2px solid #0066CC;
	color:#3B5998;
	padding:20px;
	font-size: 11px;
    -moz-border-radius: 4px 4px 4px 4px;
    border-radius: 4px 4px 4px 4px;
    -moz-box-shadow: 1px 1px 0 #d5d5d5;
	background: none repeat scroll 0 0 #F2F2F2;
}
.post_but {
    background: none repeat scroll 0 0 #EEEEEE;
    border-color: #999999 #999999 #888888;
    border-style: solid;
    border-width: 1px;
    color: #333333;
    cursor: pointer;
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    text-align: center;
    text-decoration: none;
}
a{
	color:#3B5998;
}
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;?php
/******************Configuration options***********************/

require_once 'library/facebook.php';
$facebook = new Facebook(array(
  'appId'  =&amp;gt; $appId,	//your facebook application id
  'secret' =&amp;gt; $secret,	//your facebook secret code
  'cookie' =&amp;gt; true
));
	
$user = $facebook-&amp;gt;getUser();

if(is_null($facebook-&amp;gt;getUser()))
{
	header("Location:{$facebook-&amp;gt;getLoginUrl(array('req_perms' =&amp;gt; 'user_status,publish_stream,user_photos'))}");
	exit;
}
/******************Configuration options***********************/

if($_SERVER['REQUEST_METHOD'] =='POST'){
	$img = realpath($_FILES["pic"]["tmp_name"]);
	// allow uploads
	$facebook-&amp;gt;setFileUploadSupport("http://" . $_SERVER['SERVER_NAME']);
	// add a status message
	$photo = $facebook-&amp;gt;api('/me/photos', 'POST', 
		array(
			'source' =&amp;gt; '@' . $img,
			'message' =&amp;gt; 'This photo was uploaded via www.WebSpeaks.in'
		)
	);

	echo '&amp;lt;p&amp;gt;&amp;lt;a target="_blank" href="http://www.facebook.com/photo.php?fbid='.$photo['id'].'"&amp;gt;Click here to watch this photo on Facebook.&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';
}
?&amp;gt;
&amp;lt;div class="main"&amp;gt;
	&amp;lt;p&amp;gt;Select a photo to upload on Facebook.&amp;lt;/p&amp;gt;
	&amp;lt;form method="post" action="&amp;lt;?php echo $_SERVER['PHP_SELF']; ?&amp;gt;" enctype="multipart/form-data"&amp;gt;
	&amp;lt;p&amp;gt;Select the image: &amp;lt;input type="file" name="pic" /&amp;gt;&amp;lt;/p&amp;gt;
	&amp;lt;p&amp;gt;&amp;lt;input class="post_but" type="submit" value="Upload to my album" /&amp;gt;&amp;lt;/p&amp;gt;
	&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-7440441213186969821?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/4JhCXqRWSY1-hhLAgeGXAM75Rn4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4JhCXqRWSY1-hhLAgeGXAM75Rn4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/4JhCXqRWSY1-hhLAgeGXAM75Rn4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/4JhCXqRWSY1-hhLAgeGXAM75Rn4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=OM2A0NKTUj8:SgRoTgmnabA:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=OM2A0NKTUj8:SgRoTgmnabA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=OM2A0NKTUj8:SgRoTgmnabA:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=OM2A0NKTUj8:SgRoTgmnabA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=OM2A0NKTUj8:SgRoTgmnabA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=OM2A0NKTUj8:SgRoTgmnabA:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=OM2A0NKTUj8:SgRoTgmnabA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/OM2A0NKTUj8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/7440441213186969821/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/08/upload-photos-on-facebook-using-php.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/7440441213186969821?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/7440441213186969821?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/OM2A0NKTUj8/upload-photos-on-facebook-using-php.html" title="Upload photos on Facebook using PHP" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-xhj_iGtluq0/Tl05NOkAd3I/AAAAAAAAAJ4/7iD1lUSfCQE/s72-c/fb.PNG" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/08/upload-photos-on-facebook-using-php.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMBQXs5eCp7ImA9WhdSFU8.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-3698448565432739694</id><published>2011-07-24T09:04:00.000-07:00</published><updated>2011-07-24T09:54:10.520-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-24T09:54:10.520-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jquery-plugin" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="gmail" /><category scheme="http://www.blogger.com/atom/ns#" term="design" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><category scheme="http://www.blogger.com/atom/ns#" term="css" /><title>New Gmail like Floating Toolbar jQuery Plugin: v. 1.0</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This time Google has invested some resources in designing their sites. Like Gmail has been made much better. The new theme is simple and sober. I liked the floating toolbar of new Gmail. When I looked at it I thought why shouldn't I create something like that for my readers. After that I created a jQuery plugin that floats any element on your webpage just like the Gmail's toolbar. The plugin is really simple to use with few lines of code. &lt;a href="http://demos.frnzzz.com/gmailToolbar/" target="_blank"&gt;Lets have a look at it.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-uftG-EEm-xU/TixCLXvhptI/AAAAAAAAAJ0/cc0fBeYdEzY/s1600/gmail.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="126" src="http://3.bp.blogspot.com/-uftG-EEm-xU/TixCLXvhptI/AAAAAAAAAJ0/cc0fBeYdEzY/s640/gmail.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/gmailToolbar/" target="_blank"&gt;Live Demo 1&lt;/a&gt;&amp;nbsp;&lt;a class="demo" href="http://demos.frnzzz.com/gmailToolbar/test2.php" target="_blank"&gt;Live Demo 2&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://demos.frnzzz.com/d?f=gmailToolbar/gmailToolbar.zip" target="_blank"&gt;Download Script&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #783f04; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;jQuery Plugin:&lt;/b&gt;&lt;/div&gt;
Here is the jQuery plugin that I wrote to make the thing happen.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;(function($){
	$.fn.fixFloat = function(options){	/**We have named our plugin 'fixFloat'**/
	
		var defaults = {
			enabled: true
		};
		var options = $.extend(defaults, options);

		var offsetTop;		/**Distance of the element from the top of window**/
		var s;				/**Scrolled distance from the top of window through which we have moved**/
		var fixMe = true;
		var repositionMe = true;

		var tbh = $(this);
		var originalOffset = tbh.css('top');	/**Get the actual distance of the element from the top**/

		tbh.css({'position':'absolute'});

		if(options.enabled){
			$(window).scroll(function(){
				var offsetTop = tbh.offset().top;	/**Get the current distance of the element from the top**/
				var s = parseInt($(window).scrollTop(), 10);	/**Get distance from the top of window through which we have scrolled**/
				var fixMe = true;
				if(s &amp;gt; offsetTop){
					fixMe = true;
				}else{
					fixMe = false;
				}

				if(s &amp;lt; parseInt(originalOffset, 10)){
					repositionMe = true;
				}else{
					repositionMe = false;
				}

				if(fixMe){
					var cssObj = {
						'position' : 'fixed',
						'top' : '0px'
					}
					tbh.css(cssObj);
				}
				if(repositionMe){
					var cssObj = {
						'position' : 'absolute',
						'top' : originalOffset
					}
					tbh.css(cssObj);
				}
			});
		}
	};
})(jQuery);
&lt;/pre&gt;
&lt;div style="color: #783f04; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;HTML Markup: &lt;/b&gt;&lt;/div&gt;
&lt;pre class="brush:php"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;WebSpeaks.in | Gmail like Floating Toolbar&amp;lt;/title&amp;gt;
&amp;lt;script type="text/javascript" src="../jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="fixFloat.jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$(function(){
	$('div#toolbar_holder').fixFloat();	/**Call our plugin**/
});
&amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;div class="main"&amp;gt;
	&amp;lt;div id="toolbar_holder"&amp;gt;
		&amp;lt;div class="tb"&amp;gt;
			&amp;lt;ul&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;input type="checkbox" &amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Archive&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Spam&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Delete&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Move to&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Labels&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
				&amp;lt;li&amp;gt;&amp;lt;a&amp;gt;Refresh&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
			&amp;lt;/ul&amp;gt;
		&amp;lt;/div&amp;gt;
	&amp;lt;/div&amp;gt;
	&amp;lt;div class="spacer"&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;div style="color: #783f04; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;CSS Code: &lt;/b&gt;&lt;/div&gt;
&lt;pre class="brush:css"&gt;html {
	height:100%; /* fix height to 100% for IE */
	max-height:100%; /* fix height for other browsers */
	padding:0; /*remove padding */
	margin:0; /* remove margins */
	border:0; /* remove borders */
	background:#fff; /*color background - only works in IE */
	/* hide overflow:hidden from IE5/Mac */
	/* \*/
	/*overflow:hidden; /*get rid of scroll bars in IE */
	/* */
	font: 75% arial,sans-serif;
}
#toolbar_holder{
	position:absolute;
	top:80px;
	margin:0;
	padding:0;
	border:1px solid #e1e1e1;
	background-color:#f9f9f9;
	height:50px;
	width:100%;
	width:800px;
	margin-left:207px;
    -moz-border-radius: 4px 4px 4px 4px;
    border-radius: 4px 4px 4px 4px;
    -moz-box-shadow: 1px 1px 0 #d5d5d5;
}
.tb ul{
	margin:0;
	padding:0;
	background:transparent;
	height:100%;
	margin-left:60px;
	padding-left:60px;
	padding-top:10px;
    line-height: 31px;
}
.tb ul li {  display:inline;}
.tb ul li a {
	cursor:pointer;
	font-weight:bold;
	padding:6px;
	color:#666666;
	text-decoration:none;
	border:1px solid #D3D3D3;
    -moz-border-radius: 4px 4px 4px 4px;
    border-radius: 4px 4px 4px 4px;
	background-color: #F1F1F1;
}
.tb ul li:first-child {
	padding-right:30px;
}
.tb ul li:last-child {
	padding-left:30px;
}
.tb ul li a:hover {
	border:1px solid #666666;
}
.spacer{
	height:1000px;
	width:100%;
	background-color:#F1F1F1;
	width:1007px;
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-3698448565432739694?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7_jxpK_rIVbCrKmrIU5GM1b8xe8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7_jxpK_rIVbCrKmrIU5GM1b8xe8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7_jxpK_rIVbCrKmrIU5GM1b8xe8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7_jxpK_rIVbCrKmrIU5GM1b8xe8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Sl0GRw5Xtvg:MdiE_NJAdUU:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Sl0GRw5Xtvg:MdiE_NJAdUU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Sl0GRw5Xtvg:MdiE_NJAdUU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Sl0GRw5Xtvg:MdiE_NJAdUU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Sl0GRw5Xtvg:MdiE_NJAdUU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Sl0GRw5Xtvg:MdiE_NJAdUU:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Sl0GRw5Xtvg:MdiE_NJAdUU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/Sl0GRw5Xtvg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/3698448565432739694/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/07/new-gmail-like-floating-toolbar-jquery.html#comment-form" title="24 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3698448565432739694?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3698448565432739694?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/Sl0GRw5Xtvg/new-gmail-like-floating-toolbar-jquery.html" title="New Gmail like Floating Toolbar jQuery Plugin: v. 1.0" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-uftG-EEm-xU/TixCLXvhptI/AAAAAAAAAJ0/cc0fBeYdEzY/s72-c/gmail.PNG" height="72" width="72" /><thr:total>24</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/07/new-gmail-like-floating-toolbar-jquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EMRnc6eip7ImA9WhZaF0o.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-7851757033606070178</id><published>2011-07-04T02:51:00.000-07:00</published><updated>2011-07-04T04:41:27.912-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-04T04:41:27.912-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="css3" /><category scheme="http://www.blogger.com/atom/ns#" term="design" /><category scheme="http://www.blogger.com/atom/ns#" term="webdesign" /><category scheme="http://www.blogger.com/atom/ns#" term="effects" /><category scheme="http://www.blogger.com/atom/ns#" term="css" /><title>10 handy CSS3 tricks for web developers</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This time I have collected some useful CSS3 techniques for my readers. These are handy and ready to use techniques that can help you during your website development. I have selected the best tricks out of various excellent articles written by renowned authors. Here is the collection:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s1600/css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s320/css3.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s1600/css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s1600/css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s1600/css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s1600/css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s1600/css3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;1. Multiple background images&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #073763;"&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
CSS3 allows you to have multiple background images in your containers. Now you need not to implement nested containers with clumsy CSS to create the layered effects.&lt;br /&gt;
&lt;pre class="brush:css"&gt;#multipleBGDiv{
 border: 5px solid #cccccc;
 background:url(bg1.jpeg) top left no-repeat, url(bg2.jpeg) bottom left no-repeat, url(bg3.jpeg) bottom right no-repeat, url(bg4.jpeg) top right no-repeat;
 padding: 15px 25px;
 height: 400px;
 width: 500px;
}
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kCu72L9ypGo/ThGL0mAp63I/AAAAAAAAAJk/VGVG-YrqHxs/s1600/multipleBg.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="http://3.bp.blogspot.com/-kCu72L9ypGo/ThGL0mAp63I/AAAAAAAAAJk/VGVG-YrqHxs/s320/multipleBg.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;2. Multiple border colors (FireFox only):&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Using CSS3 you can also implement multiple colors in the borders of you containers. Take a look at this.&lt;br /&gt;
&lt;pre class="brush:css"&gt;.borderColor{
 border: 8px solid #000;
 -moz-border-bottom-colors: #033 #039 #777 #888 #999 #aaa #bbb #ccc;
 -moz-border-top-colors:    #033 #039 #777 #888 #999 #aaa #bbb #ccc;
 -moz-border-left-colors:   #033 #039 #777 #888 #999 #aaa #bbb #ccc;
 -moz-border-right-colors:  #033 #039 #777 #888 #999 #aaa #bbb #ccc;
 width:400px;
}
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/--jWjlGRFuAI/ThGLx_e3iJI/AAAAAAAAAJQ/pyWbF0AyvKE/s1600/borderColor.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="30" src="http://1.bp.blogspot.com/--jWjlGRFuAI/ThGLx_e3iJI/AAAAAAAAAJQ/pyWbF0AyvKE/s320/borderColor.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;3. Rainbow Effect:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:css"&gt;.rainbow  {
 /* fallback */
 background-color:#063053;
 /* chrome 2+, safari 4+; multiple color stops */
 background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0.20,red),color-stop(0.40,green), color-stop(0.6,blue), color-stop(0.8,purple), color-stop(1,orange));
 /* chrome 10+, safari 5.1+ */
 background-image:-webkit-linear-gradient(,green,blue,purple,orange);
 /* firefox; multiple color stops */
 background-image:-moz-linear-gradient(top,red,green,blue,purple,orange);
 /* ie10 */
 background-image: -ms-linear-gradient(red,green,blue,purple,orange);
 /* opera 11.1 */
 background-image: -o-linear-gradient(red,green,blue,purple,orange);
 /* The "standard" */
 background-image: linear-gradient(red,green,blue,purple,orange);
}
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-JHGz_G1zOjs/ThGL1xOhHuI/AAAAAAAAAJo/PkdfxqG-Vgs/s1600/rainbow.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-JHGz_G1zOjs/ThGL1xOhHuI/AAAAAAAAAJo/PkdfxqG-Vgs/s1600/rainbow.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;4. Drop Shadows:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Creating text shadows is now few words far. CSS3 provides direct implementation for text shadows.&lt;br /&gt;
&lt;pre class="brush:css"&gt;.shadow{
 text-shadow: 2px 2px 2px #000;
}
&lt;/pre&gt;The first two numbers control the offset, which is 2px down and 2px right. The last number sets the shadow spread. If you want shadows above the text, just use negative numbers. &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-BM3o6vX3wMQ/ThGLxbiZvNI/AAAAAAAAAJM/2XRmH9oWPOo/s1600/textShadow.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="24" src="http://1.bp.blogspot.com/-BM3o6vX3wMQ/ThGLxbiZvNI/AAAAAAAAAJM/2XRmH9oWPOo/s320/textShadow.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;5. Rotation:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Now rotate your containers around the axes using CSS3.&lt;br /&gt;
&lt;pre class="brush:css"&gt;.rotate30deg{
 transform:rotate(30deg);
 -ms-transform:rotate(30deg); /* IE 9 */
 -moz-transform:rotate(30deg); /* Firefox */
 -webkit-transform:rotate(30deg); /* Safari and Chrome */
 -o-transform:rotate(30deg); /* Opera */
 background-color:#063053;
 border:2px solid #e9e9e9;
 height:300px;
 width:300px;
 border-radius:15px;
 margin:50px;
}
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-9ML5tt24iYk/ThGL2f_7JGI/AAAAAAAAAJs/Klj-lpMxbQQ/s1600/rotate.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-9ML5tt24iYk/ThGL2f_7JGI/AAAAAAAAAJs/Klj-lpMxbQQ/s320/rotate.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;6. Box Shadow:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Giving a shadow to your box provides it an elevated effect.&lt;br /&gt;
&lt;pre class="brush:css"&gt;.boxShadow
{
 box-shadow: 10px 10px 5px #888888;
 -webkit-box-shadow: 10px 10px 5px #888888; /* Safari */
}
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-PQsaIsAZ5-M/ThGLyOl-NbI/AAAAAAAAAJU/mh3nKfF9jnc/s1600/boxShadow.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-PQsaIsAZ5-M/ThGLyOl-NbI/AAAAAAAAAJU/mh3nKfF9jnc/s1600/boxShadow.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;7. Stylish image less buttons:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Courtesy:&lt;a href="http://inspectelement.com/articles/create-a-slick-css3-button-with-box-shadow-and-rgba/"&gt;http://inspectelement.com/&lt;/a&gt;&lt;br /&gt;
&lt;pre class="brush:css"&gt;.button {
    -webkit-box-shadow: inset 0px -3px 1px rgba(0, 0, 0, 0.45), 0px 2px 2px rgba(0, 0, 0, 0.25);
    -moz-box-shadow: inset 0px -3px 1px rgba(0, 0, 0, 0.45), 0px 2px 2px rgba(0, 0, 0, 0.25);
    box-shadow: inset 0px -3px 1px rgba(0, 0, 0, 0.45), 0px 2px 2px rgba(0, 0, 0, 0.25);
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5);
 background: #67b600;
    padding: 10px;
    text-decoration: none;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
 color:#fff;
}
.button.gradient {
 background-image: -webkit-gradient(
  linear,
  left bottom,
  left top,
  color-stop(0.1, rgba(0,0,0,0.3)),
  color-stop(1, rgba(255,255,255,0.2))
 );
 background-image: -moz-linear-gradient(
  center bottom,
  rgba(0,0,0,0.3) 1%,
  rgba(255,255,255,0.2) 100%
 );
 background-image: gradient(
  center bottom,
  rgba(0,0,0,0.3) 1%,
  rgba(255,255,255,0.2) 100%
 );
}
 
.button.gradient:hover {
 background-image: -webkit-gradient(
  linear,
  left bottom,
  left top,
  color-stop(0.1, rgba(0,0,0,0.45)),
  color-stop(1, rgba(255,255,255,0.3))
 );
 background-image: -moz-linear-gradient(
  center bottom,
  rgba(0,0,0,0.45) 1%,
  rgba(255,255,255,0.3) 100%
 );
 background-image: gradient(
  center bottom,
  rgba(0,0,0,0.45) 1%,
  rgba(255,255,255,0.3) 100%
 );
}
.button:active { position: relative; top: 3px;
    -webkit-box-shadow: inset 0px -3px 1px rgba(255, 255, 255, 1), inset 0 0px 3px rgba(0, 0, 0, 0.9);
    -moz-box-shadow: inset 0px -3px 1px rgba(255, 255, 255, 1), inset 0 0px 3px rgba(0, 0, 0, 0.9);
    box-shadow: inset 0px -3px 1px rgba(255, 255, 255, 1), inset 0 0px 3px rgba(0, 0, 0, 0.9);
}
.button:active:after { content: ""; width: 100%; height: 3px; background: #fff; position: absolute; bottom: -1px; left: 0; }
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-0NgGRgLmIaU/ThGLyXxEasI/AAAAAAAAAJY/R-SaOdlGcgE/s1600/button.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-0NgGRgLmIaU/ThGLyXxEasI/AAAAAAAAAJY/R-SaOdlGcgE/s1600/button.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;8. CSS3 Columns:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Now arrange your content in multiple columns without those tricky CSS tricks.&lt;br /&gt;
&lt;pre class="brush:css"&gt;.3column{
 text-align: justify;
 -moz-column-count: 3;
 -moz-column-gap: 1.5em;
 -moz-column-rule: 1px solid #c4c8cc;
 -webkit-column-count: 3;
 -webkit-column-gap: 1.5em;
 -webkit-column-rule: 1px solid #c4c8cc;
}
&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-rLUAxvy7b_4/ThGLut9pQDI/AAAAAAAAAJI/orI3I1Et57E/s1600/3column.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="65" src="http://3.bp.blogspot.com/-rLUAxvy7b_4/ThGLut9pQDI/AAAAAAAAAJI/orI3I1Et57E/s640/3column.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;9 CSS3 Opacity:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Creating opacity simplified with CSS3.&lt;br /&gt;
&lt;pre class="brush:css"&gt;.opac{
 opacity:.30;/*Backward compatibility*/
 filter: alpha(opacity=value);/*IE*/
 -moz-opacity:.30;/*Mozilla*/
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;10. Gradient Background:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:css"&gt;.linearBg2 {
  /* fallback */
  background-color: #1a82f7;
  background: url(bg1.jpeg);
  background-repeat: repeat-x;
  
  /* Firefox 3.6+ */
  background: -moz-linear-gradient(100% 100% 90deg, #2F2727, #1a82f7);
  
  /* Safari 4-5, Chrome 1-9 */
  /* -webkit-gradient(&lt;type&gt;, &lt;point&gt; [, &lt;radius&gt;]?, &lt;point&gt; [, &lt;radius&gt;]? [, &lt;stop&gt;]*) */
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#1a82f7), to(#2F2727));
  
  /* Safari 5.1+, Chrome 10+ */
  background: -webkit-linear-gradient(#2F2727, #1a82f7);
  
  /* Opera 11.10+ */
  background: -o-linear-gradient(#2F2727, #1a82f7);
}
&lt;/stop&gt;&lt;/radius&gt;&lt;/point&gt;&lt;/radius&gt;&lt;/point&gt;&lt;/type&gt;&lt;/pre&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-7xL6_2duUyg/ThGLyxvI19I/AAAAAAAAAJc/lOH6PuCD8l0/s1600/gradientBG.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-7xL6_2duUyg/ThGLyxvI19I/AAAAAAAAAJc/lOH6PuCD8l0/s1600/gradientBG.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-7851757033606070178?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AAVgykgKNvGlrEZs6cwYuJUpGe0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AAVgykgKNvGlrEZs6cwYuJUpGe0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AAVgykgKNvGlrEZs6cwYuJUpGe0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AAVgykgKNvGlrEZs6cwYuJUpGe0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Gc-2drcLv1I:88VZ1YHyYBk:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Gc-2drcLv1I:88VZ1YHyYBk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Gc-2drcLv1I:88VZ1YHyYBk:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Gc-2drcLv1I:88VZ1YHyYBk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Gc-2drcLv1I:88VZ1YHyYBk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=Gc-2drcLv1I:88VZ1YHyYBk:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=Gc-2drcLv1I:88VZ1YHyYBk:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/Gc-2drcLv1I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/7851757033606070178/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/07/10-handy-css3-tricks-for-web-developers.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/7851757033606070178?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/7851757033606070178?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/Gc-2drcLv1I/10-handy-css3-tricks-for-web-developers.html" title="10 handy CSS3 tricks for web developers" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-hxRctqFKpCg/ThGNC9PJqgI/AAAAAAAAAJw/ySzbGCIwCic/s72-c/css3.jpg" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/07/10-handy-css3-tricks-for-web-developers.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkEMQH89fip7ImA9WhZaFUw.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-8732525302678874794</id><published>2011-07-01T00:26:00.000-07:00</published><updated>2011-07-01T01:58:01.166-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-01T01:58:01.166-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="tips n tricks" /><category scheme="http://www.blogger.com/atom/ns#" term="technology" /><category scheme="http://www.blogger.com/atom/ns#" term="OOPS" /><title>Learn Object Oriented Programming Concepts in JavaScript</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;If you are a JavaScript lover then you must have always missed the Object Oriented programming concepts in JavaScript. You must have dreamt of classes, properties, objects in JavaScript. But let me tell you that your dreams will come true after reading this article. Object Oriented programming is possible in JavaScript and this is done&amp;nbsp;with&amp;nbsp;help of 'prototype'. Now lets come to point and see how it is done.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s1600/oopsinJS.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s320/oopsinJS.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s1600/oopsinJS.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s1600/oopsinJS.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s1600/oopsinJS.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s1600/oopsinJS.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Creating the Class&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
In JavaScript, a class is nothing else than a simple function. It has same definition and declaration style as that of a function. Look at the following example:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function myClass(){  //myClass is the name of the JS class
 //Extra code lies here...
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Now let us create some properties for our class&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function myClass(){
 this.a = 20;
 this.b = 'webspeaks';
 this.c = new Array();
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Adding variables from outside the class:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;myClass.prototype.newVariable = 'Wow! It works...';
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Now let us add some methods to our class&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;.&lt;br /&gt;
Adding methods to our class is very interesting. You need to create new methods through 'prototype' keyword along with the class name. All the properties of the class are available in this function through the use of 'this' keyword.&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;myClass.prototype.myMethod = function (){
 document.writeln('Following are the properties of myClass:');
 document.writeln(this.a+', '+this.b); //'this' points to myClass
 this.c['first'] = 'Red';    //Assign values to properties of the class
 this.c['second'] = 'Blue';
 document.writeln(this.c['first']+', '+this.c['second']);
 document.writeln(this.newVariable);     //Access the class variable created outside the class
}
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Call the method from the class&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function myClass(params){
 this.myMethod(); //Call the method using 'this'
}
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Creating object of the class&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;
Now you may want to know how do I access the class through the code. Don't worry, here is the solution:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;//Creating Object 
var obj = new myClass();

//Call the methods and properties of the class through the newly created object
document.writeln(obj.a + ' = a');
document.writeln(obj.c['first'] + ' = c[first]');
obj.myMethod();     //Call the method of class through object
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Parametrized Classes:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
We can also create classes in JS that accept parameters. Just take a look at following example:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;function myParamClass(params){ //We pass an array to the class as parameter
 this.p = params     //Hold the parameters in a class variable for access throughout the class methods.
 this.x = this.p['name'];  //Same as this.x = params['name'];
 this.y = this.p['age'];   //Same as this.x = params['age'];
}

//Passing parameters to our class
var values = new Array();
values['name'] = 'Arvind';
values['age'] = '23';
//Creating Parameterized Object 
var obj = new myParamClass(values);

//Access the class variables
document.writeln(obj.x + ' = name'); //Prints 'Arvind'
document.writeln(obj.y + ' = age');  //Prints '23'
&lt;/pre&gt;&lt;br /&gt;
And that's all for now. I hope you enjoyed the article. Please share the article if you find it interesting:)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-8732525302678874794?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bdqDAOye_UrmtRwRMShoPBGYVME/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bdqDAOye_UrmtRwRMShoPBGYVME/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bdqDAOye_UrmtRwRMShoPBGYVME/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bdqDAOye_UrmtRwRMShoPBGYVME/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=L47lo7lDgK0:fUDTqq5uo18:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=L47lo7lDgK0:fUDTqq5uo18:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=L47lo7lDgK0:fUDTqq5uo18:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=L47lo7lDgK0:fUDTqq5uo18:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=L47lo7lDgK0:fUDTqq5uo18:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=L47lo7lDgK0:fUDTqq5uo18:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=L47lo7lDgK0:fUDTqq5uo18:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/L47lo7lDgK0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/8732525302678874794/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/07/learn-object-oriented-programming.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/8732525302678874794?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/8732525302678874794?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/L47lo7lDgK0/learn-object-oriented-programming.html" title="Learn Object Oriented Programming Concepts in JavaScript" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-TPAFazJQkAE/Tg12X87ubRI/AAAAAAAAAJE/_J_aZUmNtDI/s72-c/oopsinJS.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/07/learn-object-oriented-programming.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMAR34_cCp7ImA9WhZaEkU.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-384601055768547250</id><published>2011-06-28T09:34:00.000-07:00</published><updated>2011-06-28T10:00:46.048-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-28T10:00:46.048-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="how to" /><category scheme="http://www.blogger.com/atom/ns#" term="chrome" /><category scheme="http://www.blogger.com/atom/ns#" term="twitter" /><category scheme="http://www.blogger.com/atom/ns#" term="google" /><title>How to Create Your First Google Chrome Extension</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This time I have created my first Google Chrome Extension - 'TwitFinder'. TwitFinder is a simple extension that allows you to retrieve the twitter profile information and all tweets posted by your friends just by typing in their username. So you need not open twitter.com each time you want to check out the new tweets of your friends. The main objective is to learn basics of How to create your first Chrome extension. And believe me, its really easy. Now I will tell you step by step how to create your first Google Chrome extension.&lt;br /&gt;
Extensions in Google Chrome are basically webpages. You have JavaScript files, stylesheets and images. You can even use JavaScript libraries like  jQuery.&lt;br /&gt;
&lt;a class="download" href="http://demos.frnzzz.com/d/?f=gChrome/arv_tweet.zip" target="_blank"&gt;Download zip file&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://demos.frnzzz.com//d/?f=gChrome/arv_tweet.crx" target="_blank"&gt;Download Extension&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-C2JLlfnAWpY/TgnEjP6BcyI/AAAAAAAAAI8/LVqn6za-Bz0/s1600/twitFinder.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="332" src="http://1.bp.blogspot.com/-C2JLlfnAWpY/TgnEjP6BcyI/AAAAAAAAAI8/LVqn6za-Bz0/s400/twitFinder.PNG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
The extensions are, however, treated a bit differently than your regular webpage, which is displayed in the browser. You can have access to all the opened tabs, to the user’s browsing history, you can manipulate all the pages that are opened, send AJAX requests to any website and much more.&lt;br /&gt;
You also have the benefit (or the limitation) that your extension runs only on one browser. You can forget all compatibility issues and embrace Google Chrome’s hot new HTML5 features.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: orange; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;Developing extensions&lt;/b&gt;&lt;/div&gt;Extension are packed in a .crx file (are named zip file) but during development, you can map your working folder as an extension. This way you can quickly change and deploy code without the need of repackaging.&lt;br /&gt;
This is done by opening the extension page (type chrome://extensions/ in the address bar, or click Wrench icon &amp;gt; Extensions), and clicking Developer mode &amp;gt; Load unpacked extension.. on the page. After you make a change to the extension, just hit the Reload link below it.&lt;br /&gt;
After you’re done developing, click Pack extension.. and a crx file will be created for you. You can serve this file from your site and enable your site’s visitors to install it.&lt;br /&gt;
Google Chrome is by far the easiest browser to make extensions for, as you will see from the steps below.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #e69138; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;Create and load an extension&lt;/b&gt;&lt;/div&gt;In this section, you'll write an extension that adds a browser action to the toolbar of Google Chrome.&lt;br /&gt;
1. Create a folder somewhere on your computer to contain your extension's code.&lt;br /&gt;
2. Inside your extension's folder, create a text file called &lt;span style="background-color: yellow; color: orange; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;manifest.json&lt;/span&gt;, and put this in it:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;{
 "name": "TwitFinder",
 "version": "1.0",
 "description": "Find all tweets of your friends just by typing in their username.",
 "browser_action":{
  "default_icon": "twitter.png",
  "default_title":"TwitFinder by WebSpeaks.in",
  "popup": "tweet.html" //Tell chrome that our extension is going to show a popup
 },
 "icons":{
  "128":"twitter-128.png" //The icon to be shown in the list of extensions.
 },
 "permissions": [
  "http://*.twitter.com/",
  "https://*.googleapis.com/"
 ]
}
&lt;/pre&gt;3. Copy the icons (twitter.png and twitter-128.png) to the same folder.&lt;br /&gt;
4.Load the extension.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Bring up the extensions management page by clicking the wrench icon   and choosing Tools &amp;gt; Extensions.&lt;/li&gt;
&lt;li&gt;If Developer mode has a + by it, click the + to add developer information to the page. The + changes to a -, and more buttons and information appear.&lt;/li&gt;
&lt;li&gt;Click the Load unpacked extension button. A file dialog appears.&lt;/li&gt;
&lt;li&gt;In the file dialog, navigate to your extension's folder and click OK.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
If your extension is valid, its icon appears next to the address bar, and information about the extension appears in the extensions page, as the following screenshot shows.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-cZv4maglVK8/TgnFcefPExI/AAAAAAAAAJA/pnjw_cjuF-w/s1600/twitFinder_list.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="139" src="http://1.bp.blogspot.com/-cZv4maglVK8/TgnFcefPExI/AAAAAAAAAJA/pnjw_cjuF-w/s640/twitFinder_list.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
5. Now create a file tweet.html in the same directory with following contents (keep all the contents in tweet.html):&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #e69138; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;HTML Markup&lt;/span&gt;&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush:html"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div class="main"&amp;gt;
&amp;lt;form id="twitform" onsubmit="return false;"&amp;gt;Enter your Twitter Username : &amp;lt;input type="text" name="user" id="uname"&amp;gt;&amp;lt;input type="button" value="Get Profile" id="tweet_btn" /&amp;gt;&amp;lt;/form&amp;gt;
&amp;lt;div id="timeline"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div id="infodiv"&amp;gt;
 &amp;lt;h2&amp;gt;Additional Info:&amp;lt;/h2&amp;gt;
 &amp;lt;ul id="info"&amp;gt;
  &amp;lt;li&amp;gt;Name : &amp;lt;span id="twit_name"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Location : &amp;lt;span id="twit_loc"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Total Friends : &amp;lt;span id="twit_frnd"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;URL : &amp;lt;span id="twit_url"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Account Created at : &amp;lt;span id="twit_created"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;Followers : &amp;lt;span id="twit_flwr"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;
 &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b style="color: #e69138; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;jQuery Code&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;

/*********************************************************************/
/**The Twit jQuery plugin by Yusuke Horie to show the recent tweets**/
/*********************************************************************/
(function(jQuery){var _i=0;jQuery.fn.twit=function(user,options){if(typeof user!='string')return this;var
opts=jQuery.extend({},jQuery.fn.twit.defaults,options),c=jQuery.isFunction(opts.callback)?opts.callback:_callback,url='http://twitter.com/statuses/user_timeline/'+user+'.json',params={};opts.user=user;params.count=opts.count;return this.each(function(i,e){var $e=$(e);if(!$e.hasClass('twit'))$e.addClass('twit');jQuery.ajax({url:url,data:params,dataType:'jsonp',success:function(o){c.apply(this,[(o.results)?o.results:o,e,opts]);}});});};jQuery.fn.twit.defaults={user:null,callback:null,icon:true,username:true,text:true,count:200,limit:7,label:'Twitter',title:''};var _callback=function(o,e,opts){var $this=$(e);if(!o||o.length==0||$this.length==0)return false;$this.data('_inc',1);_i++;var username=o[0].user.screen_name,icon=o[0].user.profile_image_url;var h='&amp;lt;div class="twitHeader"&amp;gt;'+' &amp;lt;span class="twitLabel"&amp;gt;'+opts.label+'&amp;lt;/span&amp;gt;&amp;nbsp;&amp;nbsp;'+' &amp;lt;span class="twitTitle"&amp;gt;'+opts.title+'&amp;lt;/span&amp;gt;'+'&amp;lt;/div&amp;gt;';if(opts.icon||opts.username){h+='&amp;lt;div class="twitUser"&amp;gt;';if(opts.icon)
h+=' &amp;lt;a href="http://twitter.com/'+username+'/"&amp;gt;'+'  &amp;lt;img src="'+icon+'" alt="'+username+'" title="'+username+'" style="vertical-align:middle;" /&amp;gt;'+' &amp;lt;/a&amp;gt;&amp;nbsp;&amp;nbsp;';if(opts.username)
h+='&amp;lt;a href="http://twitter.com/'+username+'/"&amp;gt;'+username+'&amp;lt;/a&amp;gt;';h+='&amp;lt;/div&amp;gt;';}
h+='&amp;lt;ul class="twitBody" id="twitList'+_i+'"&amp;gt;'+_build(o,$this,opts)+'&amp;lt;/ul&amp;gt;';$this.html(h);$('a.twitEntryShow','#twitList'+_i).live('click',function(e){e.preventDefault();var $t=$(this);$t.parent().fadeOut(400,function(){var i=$this.data('_inc');i++;$this.data('_inc',i);if($t.hasClass('twitEntryAll')){$t.die('click');var start=(i*opts.limit)-opts.limit;$(this).after(_build(o,$this,opts,start,o.length)).remove();}else{$(this).after(_build(o,$this,opts)).remove();}});});};var _build=function(o,$t,opts,s,e){var
h='',inc=$t.data('_inc'),start=s||(inc*opts.limit)-opts.limit,end=e||((o.length&amp;gt;start+opts.limit)?start+opts.limit:o.length);for(var i=start;i&amp;lt;end;i++){var
t=o[i],username=t.user.screen_name,icon=t.user.profile_image_url;h+='&amp;lt;li class="twitEntry"&amp;gt;';if(opts.text){var text=t.text.replace(/(https?:\/\/[-_.!~*\'()a-zA-Z0-9;\/?:\@&amp;amp;=+\$,%#]+)/,function(u){var shortUrl=(u.length&amp;gt;30)?u.substr(0,30)+'...':u;return'&amp;lt;a href="'+u+'"&amp;gt;'+shortUrl+'&amp;lt;/a&amp;gt;';}).replace(/@([a-zA-Z0-9_]+)/g,'@&amp;lt;a href="http://twitter.com/$1"&amp;gt;$1&amp;lt;/a&amp;gt;').replace(/(?:^|\s)#([^\s\.\+:!]+)/g,function(a,u){return' &amp;lt;a href="http://twitter.com/search?q='+encodeURIComponent(u)+'"&amp;gt;#'+u+'&amp;lt;/a&amp;gt;';});h+=' &amp;lt;span&amp;gt;'+text+'&amp;lt;/span&amp;gt;';}
h+='&amp;lt;/li&amp;gt;';}
if(o.length&amp;gt;end){h+='&amp;lt;li class="twitNavi"&amp;gt;'+'&amp;lt;a href="#" class="twitEntryShow"&amp;gt;more&amp;lt;/a&amp;gt; &amp;nbsp;/&amp;nbsp;';if(o.length&amp;gt;opts.limit)
h+='&amp;lt;a href="#" class="twitEntryShow twitEntryAll"&amp;gt;all&amp;lt;/a&amp;gt;';h+='&amp;lt;/li&amp;gt;';}
return h;};})(jQuery);
&amp;lt;/script&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;

/**Code to fetch and display the tweets and profile information on the page**/

$(function()
{
 $('#uname').focus();
 function populate(){
  twitterusername = $('#uname').val();
  if(twitterusername != ''){
   $('#tweet_btn').attr('value','Please wait...');
   $('#timeline').twit(twitterusername); //Call the Twit plugin to fetch recent tweets
   $('#timeline').hide();
   $.getJSON('http://twitter.com/users/'+twitterusername+'.json?callback=?', //Retrieve user data from Twitter using the JSON
   function(data){
 /**Display the user data**/
    $('#tweet_btn').attr('value','Get Profile');
    $('.main').css({'background-image':'url('+data.profile_background_image_url+')'});
    $('#twit_uname').text(data.screen_name);
    $('#twit_loc').text(data.location);
    $('#twit_frnd').text(data.friends_count);
    $('#twit_url').text(data.url);
    $('#twit_created').text(data.created_at);
    $('#twit_name').text(data.name);
    $('#twit_flwr').text(data.followers_count);
    $('ul').css({'color':'#'+data.profile_text_color});
    $('#timeline').show();
    $('div#infodiv').show();
   });
  }
 }
 $('#tweet_btn').click(function(){
  populate();
 });
 $('#twitform').submit(function(){
  populate();
 });
})
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b style="color: #e69138; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;CSS Code&lt;/b&gt;:&lt;br /&gt;
&lt;pre class="brush:css"&gt;/**CSS Code to beautify our extension**/
body{
 font-size:10px;
 overflow-x:hidden;
 background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#EEE), to(#DDD));
 text-shadow:1px 1px 0 white;
}
div#infodiv{display:none;}
ul#info{padding:10px;margin:0;}
ul#info li{
 border-bottom:1px dashed #666666;
 margin-bottom:10px;
 list-style-type:none;
}
div.main{
 margin:auto;
 border:1px solid #CC0;
 float:none;
 width:520px;
 padding:10px;
 font-family:Verdana, Geneva, sans-serif;
 color:#03497e;
}
a{
 color:#336633;
 text-decoration:none;
 font:italic 1em Georgia, Times, serif;
}
h2{
 background-color: #FFFFFF;
 color:#33CCFF;
 font-size:12px;
 padding:5px 0 5px 5px;
 width:100%;
}
#tweet_btn{
 background-color:#cbf2ff;
 border:1px solid #33CCFF;
 color:#336633;
 font-weight:bold;
 -webkit-border-radius:4px;
}
#uname{
 background-color:#BDD7E3;
 border:1px solid #33CCFF;
 color:#0596D5;
 margin-right:10px;
}

/** Twit **/
.twit{
 background-color: #cbf2ff;
 padding: 7px;
 display:none;
}
.twitHeader {
  background-color: #fff;
  margin: 0;
  padding: 7px 7px 0 7px;
}
.twitLabel {
  font-weight: bold;
  font-size: 22px;
  color: #33ccff;
}
.twitTitle {
  font-weight: bold;
}
.twitUser {
  background-color: #fff;
  border-bottom: none;
  font-size:160%;
  padding: 7px;
}
.twitUser a{
  color:#222;
  font-weight:bold;
  text-decoration: none;
}
.twitBody {
  background-color: #ffffff;
  padding: 0 7px 7px 7px;
  margin: 0;
  list-style: none;
}
.twitEntry {
  padding: 6px 8px;
  margin: 0;
  border-bottom: dashed 1px #ccc;
  height: auto !important;
}
.twitNavi {
  clear: both;
  text-align: center;
  margin-top: 0;
  padding: 5px;
  background-color: #ffffff;
}
&lt;/pre&gt;&lt;br /&gt;
And now we are done with our first Google Chrome extension!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-384601055768547250?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3QEuDwWoDohlhai4mThgBlIJf7k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3QEuDwWoDohlhai4mThgBlIJf7k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3QEuDwWoDohlhai4mThgBlIJf7k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3QEuDwWoDohlhai4mThgBlIJf7k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=DSNQaBgvdR0:7AO0oSpbpZ0:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=DSNQaBgvdR0:7AO0oSpbpZ0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=DSNQaBgvdR0:7AO0oSpbpZ0:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=DSNQaBgvdR0:7AO0oSpbpZ0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=DSNQaBgvdR0:7AO0oSpbpZ0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=DSNQaBgvdR0:7AO0oSpbpZ0:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=DSNQaBgvdR0:7AO0oSpbpZ0:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/DSNQaBgvdR0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/384601055768547250/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/06/how-to-create-your-first-google-chrome.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/384601055768547250?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/384601055768547250?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/DSNQaBgvdR0/how-to-create-your-first-google-chrome.html" title="How to Create Your First Google Chrome Extension" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-C2JLlfnAWpY/TgnEjP6BcyI/AAAAAAAAAI8/LVqn6za-Bz0/s72-c/twitFinder.PNG" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/06/how-to-create-your-first-google-chrome.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0EMQXo_eSp7ImA9WhZaEE8.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-3804125960955242013</id><published>2011-06-25T02:09:00.000-07:00</published><updated>2011-06-25T10:08:00.441-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-25T10:08:00.441-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="animation" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="linkedin" /><category scheme="http://www.blogger.com/atom/ns#" term="webdesign" /><category scheme="http://www.blogger.com/atom/ns#" term="css" /><title>LinkedIn like news Gallery using jQuery &amp; CSS</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;The most popular professional social network has recently done a lot of design changes in its site. And the site has gone really awesome. I really many of their new design features. Their news gallery on home page attracted my mind towards it and I decided to create it for my readers. So here is LinkedIn style news gallery.... &lt;a href="http://demos.frnzzz.com/linkGallery/" target="_blank"&gt;See it working!&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dLNM4KqMwCM/TgWle-nXLMI/AAAAAAAAAI4/K63KeHoGmmo/s1600/linkGallery.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="128" src="http://2.bp.blogspot.com/-dLNM4KqMwCM/TgWle-nXLMI/AAAAAAAAAI4/K63KeHoGmmo/s400/linkGallery.PNG" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/linkGallery/" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a class="download" href="http://demos.frnzzz.com/d/?f=linkGallery/linkGallery.zip" target="_blank"&gt;Download Script&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
HTML Markup:&lt;br /&gt;
&lt;pre class="brush:html"&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Webspeaks.in | Linkein like news gallery&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div id="gallery"&amp;gt;
 &amp;lt;h2&amp;gt;LinkedIn Today&amp;lt;/h2&amp;gt;
 &amp;lt;ul&amp;gt;
  &amp;lt;li&amp;gt;
   &amp;lt;a href="http://www.webspeaks.in/2011/06/live-background-change-using-jquery.html" target="_blank"&amp;gt;
    &amp;lt;p class="hd"&amp;gt;Live background Change using jQuery&amp;lt;/p&amp;gt;
    &amp;lt;p class="link"&amp;gt;via webspeaks.in&amp;lt;/p&amp;gt;
    &amp;lt;p class="img"&amp;gt;&amp;lt;img src="http://1.bp.blogspot.com/-vxjOxEP6LB0/Te-8csJeSCI/AAAAAAAAAI0/TdlvX8z-wpE/s400/Webspeaks.in+-+Live+background+change+with+jQuery+2011-06-08+23-45-50.png" /&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;/a&amp;gt;
  &amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;
   &amp;lt;a href="http://www.webspeaks.in/2011/03/creating-stylish-graphs-with-php-yahoo.html" target="_blank"&amp;gt;
    &amp;lt;p class="hd"&amp;gt;Creating Stylish Graphs with PHP &amp;amp; Yahoo Charts&amp;lt;/p&amp;gt;
    &amp;lt;p class="link"&amp;gt;via webspeaks.in&amp;lt;/p&amp;gt;
    &amp;lt;p class="img"&amp;gt;&amp;lt;img src="https://lh4.googleusercontent.com/-RLDr7UzMvLc/TXi1TBe_mOI/AAAAAAAAAIU/O3k4CDJ9qpE/s400/y.PNG" /&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;/a&amp;gt;
  &amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;
   &amp;lt;a href="http://www.webspeaks.in/2011/03/in-place-form-editing-using-jquery.html" target="_blank"&amp;gt;
    &amp;lt;p class="hd"&amp;gt;In-Place Form Editing using jQuery&amp;lt;/p&amp;gt;
    &amp;lt;p class="link"&amp;gt;via webspeaks.in&amp;lt;/p&amp;gt;
    &amp;lt;p class="img"&amp;gt;&amp;lt;img src="https://lh4.googleusercontent.com/-HOPYmUk-cCM/TW_TspwS9QI/AAAAAAAAAIA/XMdLUFlPRdw/s400/formEdit.PNG" /&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;/a&amp;gt;
  &amp;lt;/li&amp;gt;
  &amp;lt;li class="continue"&amp;gt;
   &amp;lt;a href="http://webspeaks.in"&amp;gt;»&amp;lt;/a&amp;gt;
  &amp;lt;/li&amp;gt;
 &amp;lt;/ul&amp;gt;
&amp;lt;div&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
jQuery Code:&lt;br /&gt;
&lt;pre class="brush:javascript"&gt;&amp;lt;script type="text/javascript" src="../jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$(document).ready(function(){
 $('#gallery ul li').hover(function(){
  $(this).find('p.img').animate({'marginTop':'20px'}, 'fast');
  $(this).find('p.hd').css({'color':'#069'});
 }, function(){
  $(this).find('p.img').animate({'marginTop':'-17px'}, 'fast');
  $(this).find('p.hd').css({'color':'#333'});
 });
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
CSS Code:&lt;br /&gt;
&lt;pre class="brush:css"&gt;body{
 font-family: Arial, Helvetica, 'Nimbus Sans L', sans-serif;
}
#gallery h2{
 font-size:13px;
 font-weight:bold;
 margin-bottom:5px;
}
#gallery ul {
 list-style: none outside none; 
 overflow:hidden; 
 cursor:pointer; 
 width:666px; 
 border-top:2px solid #ededed;
 padding: 0;
 margin-top:0;
}
ul li{ 
 float:left; 
 padding:0 20px 0 0; 
 overflow:hidden;
 max-height:165px;
 _height:165px;
}
#gallery a{ color:#333; text-decoration:none;}
#gallery li p.hd{
 color:#333;
 display: block;
 font-size: 12px;
 max-height: 42px;
 min-height: 24px;
 _height: 42px;
 overflow: hidden;
 padding: 1px;
 width: 174px;
 height:28px;
}
#gallery li p.link
{
 margin:0;
 padding:0;
 color:#333;
 font-size: 11px;
 height: 13px;
 line-height: 13px;
 text-decoration:none;
 padding-left:3px;
}
#gallery li p.img{overflow:hidden; margin-top:-17px;}
#gallery li p.img img{ 
 height:109px; 
 width:176px; 
 border:1px solid #DEDEDE; 
 padding:2px; 
 overflow:hidden;
}
#gallery li.continue{
 margin-right: 0;
 width: auto;
 _display: inline;
 float: left;
 padding: 10px 0;
 position: relative;
 vertical-align: baseline;
}
#gallery li.continue a{
 color: #069;
 font-size: 40px;
 line-height: 142px;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-3804125960955242013?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dZsFECHH7ujIzeBEVlPhO-PVM0M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dZsFECHH7ujIzeBEVlPhO-PVM0M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dZsFECHH7ujIzeBEVlPhO-PVM0M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dZsFECHH7ujIzeBEVlPhO-PVM0M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=bZ4B4js8jow:Tt3WqIcEqOM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=bZ4B4js8jow:Tt3WqIcEqOM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=bZ4B4js8jow:Tt3WqIcEqOM:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=bZ4B4js8jow:Tt3WqIcEqOM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=bZ4B4js8jow:Tt3WqIcEqOM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=bZ4B4js8jow:Tt3WqIcEqOM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=bZ4B4js8jow:Tt3WqIcEqOM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/bZ4B4js8jow" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/3804125960955242013/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/06/linkedin-like-news-gallery-using-jquery.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3804125960955242013?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3804125960955242013?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/bZ4B4js8jow/linkedin-like-news-gallery-using-jquery.html" title="LinkedIn like news Gallery using jQuery &amp; CSS" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-dLNM4KqMwCM/TgWle-nXLMI/AAAAAAAAAI4/K63KeHoGmmo/s72-c/linkGallery.PNG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/06/linkedin-like-news-gallery-using-jquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEAQ30yeyp7ImA9WhZUFUg.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-1940806286998093894</id><published>2011-06-08T11:18:00.000-07:00</published><updated>2011-06-08T11:27:22.393-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-08T11:27:22.393-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="animation" /><category scheme="http://www.blogger.com/atom/ns#" term="jquery" /><category scheme="http://www.blogger.com/atom/ns#" term="webdesign" /><category scheme="http://www.blogger.com/atom/ns#" term="effects" /><category scheme="http://www.blogger.com/atom/ns#" term="css" /><title>Live background Change using jQuery</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;jQuery can be extremely useful for you if you want to beautify your web app. jQuery provide a number of simple ways to dynamically change the design of your web page. Here is a simple script that shows how to change the background image of your web page using jQuery.&lt;br /&gt;
&lt;br /&gt;
&lt;a class="demo" href="http://demos.frnzzz.com/liveBackground/" target="_blank"&gt;Live Demo&lt;/a&gt;&amp;nbsp;&lt;a target="_blank" class="download" href="http://demos.frnzzz.com/d/?f=liveBackground/liveBackground.zip"&gt;Download Script&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-vxjOxEP6LB0/Te-8csJeSCI/AAAAAAAAAI0/TdlvX8z-wpE/s1600/Webspeaks.in+-+Live+background+change+with+jQuery+2011-06-08+23-45-50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="193" src="http://1.bp.blogspot.com/-vxjOxEP6LB0/Te-8csJeSCI/AAAAAAAAAI0/TdlvX8z-wpE/s400/Webspeaks.in+-+Live+background+change+with+jQuery+2011-06-08+23-45-50.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;div style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;HTML Markup:&lt;/b&gt;&lt;/div&gt;&lt;pre class="brush:html"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Webspeaks.in | Live background change with jQuery&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;div id="main"&amp;gt;
 &amp;lt;div class="text"&amp;gt;&amp;lt;a href="#"&amp;gt;Live background change using jQuery &amp;lt;span class="small"&amp;gt;by&amp;lt;/span&amp;gt; &amp;lt;span class="title"&amp;gt;Webspeaks.in&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
 &amp;lt;div&amp;gt;
  &amp;lt;ul class="menu"&amp;gt;
   &amp;lt;li&amp;gt;&amp;lt;img src="1.gif" /&amp;gt;&amp;lt;/li&amp;gt;
   &amp;lt;li&amp;gt;&amp;lt;img src="2.jpg" /&amp;gt;&amp;lt;/li&amp;gt;
   &amp;lt;li&amp;gt;&amp;lt;img src="3.png" /&amp;gt;&amp;lt;/li&amp;gt;
   &amp;lt;li&amp;gt;&amp;lt;img src="4.jpg" /&amp;gt;&amp;lt;/li&amp;gt;
   &amp;lt;li&amp;gt;&amp;lt;img src="5.png" /&amp;gt;&amp;lt;/li&amp;gt;
   &amp;lt;li&amp;gt;&amp;lt;img src="6.jpg" /&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;div style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;jQuery Code:&lt;/b&gt;&lt;/div&gt;&lt;pre class="brush:javascript"&gt;&amp;lt;script type="text/javascript" src="../jquery.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$(function(){
 $('ul.menu').find('img').fadeTo('slow', 1);
 $('ul.menu').find('img').hover(function(){
  $(this).fadeTo('fast', 0.7);
  $('body').css({ 'background-image' : 'url('+$(this).attr('src')+')' });
 }, function(){
  $(this).fadeTo('slow', 1);
 });
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;div style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;CSS Code:&lt;/b&gt;&lt;/div&gt;&lt;pre class="brush:css"&gt;body{background-color:#CCCCCC;}
#main{margin:0; position:absolute; width:100%; text-align:center;bottom:100px;}
ul.menu{list-style-type:none;}
ul.menu li{ display:inline;}
img{height:90px; width:105px; border:5px solid #333333; padding:2px;-moz-border-radius: 5px;
 -webkit-border-radius: 5px;
 border-radius: 5px;
 cursor:pointer;
 margin:5px;
}
img:hover{border-color:#990099;}
.text a{background-color:#33CCCC; color:#FFFFFF; font-size:20px; font-weight:bold;
 font-family:Georgia, "Times New Roman", Times, serif; height:40px; line-height:40px;
 -moz-border-radius: 5px;
 -webkit-border-radius: 15px;
 border-radius: 15px;
 margin:10px;
 padding:10px;
 text-decoration:none;
}
.text .small{ font-size:16px;}
.text .title{ color:#993366;}
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-1940806286998093894?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3m5N6xzNWcKFFmodPG2UOYHNhRY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3m5N6xzNWcKFFmodPG2UOYHNhRY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3m5N6xzNWcKFFmodPG2UOYHNhRY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3m5N6xzNWcKFFmodPG2UOYHNhRY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=7fUXocH0lnc:Xpt_UgrRnSU:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=7fUXocH0lnc:Xpt_UgrRnSU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=7fUXocH0lnc:Xpt_UgrRnSU:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=7fUXocH0lnc:Xpt_UgrRnSU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=7fUXocH0lnc:Xpt_UgrRnSU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=7fUXocH0lnc:Xpt_UgrRnSU:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=7fUXocH0lnc:Xpt_UgrRnSU:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/7fUXocH0lnc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/1940806286998093894/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/06/live-background-change-using-jquery.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/1940806286998093894?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/1940806286998093894?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/7fUXocH0lnc/live-background-change-using-jquery.html" title="Live background Change using jQuery" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-vxjOxEP6LB0/Te-8csJeSCI/AAAAAAAAAI0/TdlvX8z-wpE/s72-c/Webspeaks.in+-+Live+background+change+with+jQuery+2011-06-08+23-45-50.png" height="72" width="72" /><thr:total>7</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/06/live-background-change-using-jquery.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUNQn46fCp7ImA9WhZUEk0.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-5371459828202028604</id><published>2011-06-04T09:42:00.000-07:00</published><updated>2011-06-04T09:51:33.014-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-04T09:51:33.014-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="admin" /><category scheme="http://www.blogger.com/atom/ns#" term="tips n tricks" /><category scheme="http://www.blogger.com/atom/ns#" term="magento" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Customize 'New Order' Email template in Magento</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Customizing the '&lt;b&gt;New Order Confirmation Email&lt;/b&gt;' template in Magento may be a havoc for the first time if you do not know the write way. But it is as easy as anything. Recently I needed to customize the item information in the 'New Order Confirmation Email'. I googled a number of links but found nothing useful. Then I decided to find my own way, and after 2 hours of hard work I found a simple way. Here are the steps to customize the email template:&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
1. In the Magento Admin panel go to &lt;span style="background-color: yellow;"&gt;'System &amp;gt; Transactional Emails'&lt;/span&gt; and click on &lt;span style="background-color: yellow;"&gt;'Add New Template'&lt;/span&gt;.&lt;br /&gt;
2. In the &lt;span style="background-color: yellow;"&gt;'Load default template'&lt;/span&gt; container select &lt;span style="background-color: yellow;"&gt;'New Order&lt;/span&gt;' in the &lt;span style="background-color: yellow;"&gt;'Template'&lt;/span&gt; dropdown. Alse select our desired &lt;span style="background-color: yellow;"&gt;'Locale&lt;/span&gt;'.&lt;br /&gt;
3. Click on &lt;span style="background-color: yellow;"&gt;'Load Template'&lt;/span&gt;. It will load the Default email template to edit for you. Now you can edit the 'Template Subject' and 'Template Content' to suit your needs. See the following screenshot:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-N8jcLMpKm2E/TephSVN6X_I/AAAAAAAAAIg/VSlkAVn6ekY/s1600/EMail_1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="443" src="http://4.bp.blogspot.com/-N8jcLMpKm2E/TephSVN6X_I/AAAAAAAAAIg/VSlkAVn6ekY/s640/EMail_1.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Here we want to edit the item information in the order email. The email template calls a layout file as:&lt;br /&gt;
&lt;pre class="brush:php"&gt;{{layout handle="sales_email_order_items" order=$order}}
&lt;/pre&gt;for the item information. So we will replace this line so that we can call our own custom template in place of the default layout file.&lt;br /&gt;
Replace &lt;br /&gt;
&lt;pre class="brush:php"&gt;{{layout handle="sales_email_order_items" order=$order}}&lt;/pre&gt;with &lt;br /&gt;
&lt;pre class="brush:php"&gt;{{block type='core/template' area='frontend' template='&amp;lt;module_name&amp;gt;/orderemail.phtml' order=$order}}&lt;/pre&gt;where&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; &lt;/span&gt;&lt;span style="background-color: orange; font-family: 'Courier New', Courier, monospace;"&gt;template='&amp;lt;module_name&amp;gt;/orderemail.phtml'&lt;/span&gt; tells Magento the path of template file to be called. We have also passed order variable in the call as &lt;span style="background-color: orange; font-family: 'Courier New', Courier, monospace;"&gt;order=$order&lt;/span&gt;, so the &lt;span class="Apple-style-span" style="background-color: orange;"&gt;$order&lt;/span&gt; variable is available to us in the template file that holds the current order information.&lt;br /&gt;
Save the template.&lt;br /&gt;
&lt;br /&gt;
4. Now create &lt;span style="background-color: orange; font-family: 'Courier New', Courier, monospace;"&gt;orderemail.phtml&lt;/span&gt; in the template directory of your custom module.&lt;br /&gt;
Full file path: &lt;span style="background-color: orange; font-family: 'Courier New', Courier, monospace;"&gt;app\design\frontend\default\default\template\&amp;lt;module_name&amp;gt;\orderemail.phtml&lt;/span&gt;&lt;br /&gt;
In this template file we have $order available to user. You can access the order id from &lt;span style="background-color: orange; font-family: 'Courier New', Courier, monospace;"&gt;$order&lt;/span&gt; variable as:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:php"&gt;$order_id = $this-&amp;gt;getData('order')-&amp;gt;getRealOrderId();
&lt;/pre&gt;Now you can access all order information here and write your custom HTML format to be shown in the email. You can change the way the item information is shown or add more item information in the email template. &lt;br /&gt;
&lt;br /&gt;
5. Now in Magento Admin panel go to &lt;span style="background-color: yellow;"&gt;'System &amp;gt; Configuration &amp;gt; Sales Emails'&lt;/span&gt;. In the '&lt;span style="background-color: yellow;"&gt;Order&lt;/span&gt;' tab select your newly created template in the &lt;span style="background-color: yellow;"&gt;'New Order Confirmation Template'&lt;/span&gt; dropdown. Save the options.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-UnB2ioPZt9A/TephhWAjjjI/AAAAAAAAAIk/1aNofvaNf08/s1600/EMail_2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="390" src="http://2.bp.blogspot.com/-UnB2ioPZt9A/TephhWAjjjI/AAAAAAAAAIk/1aNofvaNf08/s640/EMail_2.PNG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;And you are ready to send the customized email template!!!&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-5371459828202028604?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QJydGfcY3jzHLLECmhyyLz2FV24/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QJydGfcY3jzHLLECmhyyLz2FV24/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QJydGfcY3jzHLLECmhyyLz2FV24/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QJydGfcY3jzHLLECmhyyLz2FV24/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=UcYRBixgblI:1NOf1o6b7pc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=UcYRBixgblI:1NOf1o6b7pc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=UcYRBixgblI:1NOf1o6b7pc:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=UcYRBixgblI:1NOf1o6b7pc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=UcYRBixgblI:1NOf1o6b7pc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=UcYRBixgblI:1NOf1o6b7pc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=UcYRBixgblI:1NOf1o6b7pc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/UcYRBixgblI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/5371459828202028604/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/06/customize-new-order-email-template-in.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/5371459828202028604?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/5371459828202028604?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/UcYRBixgblI/customize-new-order-email-template-in.html" title="Customize 'New Order' Email template in Magento" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-N8jcLMpKm2E/TephSVN6X_I/AAAAAAAAAIg/VSlkAVn6ekY/s72-c/EMail_1.PNG" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/06/customize-new-order-email-template-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcHSHs_eip7ImA9WhZRFUU.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-186309364557592353</id><published>2011-04-11T22:48:00.000-07:00</published><updated>2011-04-11T23:00:39.542-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-11T23:00:39.542-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="performance" /><category scheme="http://www.blogger.com/atom/ns#" term="tips n tricks" /><category scheme="http://www.blogger.com/atom/ns#" term="technology" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><category scheme="http://www.blogger.com/atom/ns#" term="optimization" /><category scheme="http://www.blogger.com/atom/ns#" term="web" /><title>Learn FILTERS in PHP for Best Security Performance</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Today we will learn about a less used but powerful feature of PHP: the &lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;FILTERS&lt;/span&gt;&lt;/span&gt;. This extension filters data by either validating or sanitizing it. This is especially useful when the data source contains unknown (or foreign) data, like user supplied input. For example, this data may come from an &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;HTML&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;form. &lt;br /&gt;
There are two main types of filtering: validation and sanitization. &lt;br /&gt;
Validation is used to validate or check if the data meets certain qualifications. For example, passing in &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;FILTER_VALIDATE_EMAIL&lt;/span&gt;&lt;/span&gt; will determine if the data is a valid email address, but will not change the data itself.&lt;br /&gt;
Sanitization will sanitize the data, so it may alter it by removing undesired characters. For example, passing in &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;FILTER_SANITIZE_EMAIL&lt;/span&gt;&lt;span class="Apple-style-span" style="background-color: white;"&gt; &lt;/span&gt;&lt;/span&gt;will remove characters that are inappropriate for an email address to contain. That said, it does not validate the data. &lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Source:&amp;nbsp;&lt;a href="http://in.php.net/manual/en/book.filter.php" target="_blank"&gt;PHP.net&lt;/a&gt;&lt;/div&gt;&lt;b&gt;Note:&lt;/b&gt; &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;FILTER&lt;/span&gt;&lt;/span&gt; is available only in &lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;PHP&lt;/span&gt;&lt;/span&gt; version 5.2 or later.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Types of filters:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;&lt;li&gt;Validate filters&lt;/li&gt;
&lt;li&gt;Sanitize filters&lt;/li&gt;
&lt;li&gt;Other filters&lt;/li&gt;
&lt;li&gt;Filter flags&lt;/li&gt;
&lt;/ul&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Validate Filters:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_BOOLEAN:&lt;/b&gt; Returns TRUE for "1", "true", "on" and "yes". Returns FALSE otherwise. &lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_EMAIL:&lt;/b&gt; Validates value as e-mail.&lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_FLOAT&lt;/b&gt;: Validates value as float.&lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_INT&lt;/b&gt;: Validates value as integer, optionally from the specified range.&lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_&lt;/b&gt;&lt;b&gt;IP&lt;/b&gt;&lt;b&gt;:&lt;/b&gt; Validates value as IP address, optionally only IPv4 or IPv6 or not from private or reserved ranges.&lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_REGEXP:&lt;/b&gt; Validates value against regexp, a Perl-compatible regular expression. &lt;br /&gt;
&lt;b&gt;FILTER_VALIDATE_URL:&lt;/b&gt; Validates value as URL.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Examples:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;Validating Email address:&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
$email_a = 'foo@foo.com';
$email_b = 'invalid@email';

if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
echo "This ($email_a) email address is valid.";
}else{
echo "This ($email_a) email address is invalid.";
}
if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) {
echo "This ($email_b) email address is valid.";
}else{
echo "This ($email_b) email address is invalid.";
}

//Output
This (foo@foo.com) email address is valid.
This (invalid@email) email address is invalid.
?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;Validating &lt;/span&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;IP&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt; address:&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
$ip_a = '127.0.0.1';
$ip_b = '52.69';

if (filter_var($ip_a, FILTER_VALIDATE_IP)) {
echo "This ($ip_a) IP address is valid.";
}else{
echo "This ($ip_a) IP address is invalid.";
}
if (filter_var($ip_b, FILTER_VALIDATE_IP)) {
echo "This ($ip_b) IP address is valid.";
}else{
echo "This ($ip_b) IP address is invalid.";
}

//Output:
This (127.0.0.1) IP address is valid.
This (52.69) IP address is invalid.
?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Sanitize filters:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_EMAIL:&lt;/b&gt; Remove all characters except letters, digits and !#$%&amp;amp;'*+-/=?^_`{|}~@.[].&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_ENCODED:&lt;/b&gt; URL-encode string, optionally strip or encode special characters.&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_MAGIC_QUOTES:&lt;/b&gt; Apply addslashes().&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_NUMBER_FLOAT&lt;/b&gt;: Remove all characters except digits, +- and optionally .,eE. &lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_NUMBER_INT:&lt;/b&gt; Remove all characters except digits, plus and minus sign. &lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_SPECIAL_CHARS:&lt;/b&gt; HTML-escape '"&amp;lt;&amp;gt;&amp;amp; and characters with ASCII value less than 32, optionally strip or encode other special characters.&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_STRING&lt;/b&gt;: Strip tags, optionally strip or encode special characters.&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_STRIPPED:&lt;/b&gt; Alias of "FILTER_SANITIZE_STRING" filter.&lt;br /&gt;
&lt;b&gt;FILTER_SANITIZE_URL&lt;/b&gt;: Remove all characters except letters, digits and $-_.+!*'(),{}|\\^~[]`&amp;lt;&amp;gt;#%";/?:@&amp;amp;=.&lt;br /&gt;
&lt;b&gt;FILTER_UNSAFE_RAW:&lt;/b&gt; Do nothing, optionally strip or encode special characters.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;b&gt;Examples:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
$invalid_email = "(corrupted@-foo dot com)";

if ( !filter_var($sanitized_email, FILTER_VALIDATE_EMAIL) ) {
$sanitized_email = filter_var($invalid_email, FILTER_SANITIZE_EMAIL);
echo "This ($invalid_email) email address is invalid.\n";
echo "Sanitized  Email is:  $sanitized_email\n";    
}

//Output:
This ((corrupted@-foo dot com)) email address is invalid.
Sanitized  Email is:  corrupted@foo.com
?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Filtering GET &amp;amp; POST Variables:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
The &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="background-color: #f1c232;"&gt;filter_input()&lt;/span&gt;&lt;/span&gt; function gets a specific external variable by name and optionally filters it.&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;Usage&lt;/span&gt;:&lt;br /&gt;
&lt;pre class="brush:php"&gt;mixed filter_input ( int $type , string $variable_name [, int $filter = FILTER_DEFAULT [, mixed $options ]] )
&lt;/pre&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Parameters:&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;type&lt;/b&gt;: One of INPUT_GET, INPUT_POST, INPUT_COOKIE, INPUT_SERVER, or INPUT_ENV. &lt;br /&gt;
variable_name: Name of a variable to get.&lt;br /&gt;
&lt;b&gt;filter&lt;/b&gt;: The ID of the filter to apply. The Types of filters manual page lists the available filters.&lt;br /&gt;
options: Associative array of options or bitwise disjunction of flags. If filter accepts options, flags can be provided in "flags" field of array.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Return Values:&lt;/b&gt; Value of the requested variable on success, FALSE if the filter fails, or NULL if the variable_name variable is not set. If the flag FILTER_NULL_ON_FAILURE is used, it returns FALSE if the variable is not set and NULL if the filter fails. &lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
$search_html = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS);
$search_url = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_ENCODED);
echo "You have searched for $search_html.\n";
echo "&amp;lt;a href='?search=$search_url'&amp;gt;Search again.&amp;lt;/a&amp;gt;";
?&amp;gt;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-186309364557592353?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/N0R5tXLW71KarBigGhJa7CUg3OE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N0R5tXLW71KarBigGhJa7CUg3OE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/N0R5tXLW71KarBigGhJa7CUg3OE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/N0R5tXLW71KarBigGhJa7CUg3OE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=NlHpxvbIpl8:UwBTn0itZ7I:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=NlHpxvbIpl8:UwBTn0itZ7I:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=NlHpxvbIpl8:UwBTn0itZ7I:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=NlHpxvbIpl8:UwBTn0itZ7I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=NlHpxvbIpl8:UwBTn0itZ7I:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=NlHpxvbIpl8:UwBTn0itZ7I:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=NlHpxvbIpl8:UwBTn0itZ7I:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/NlHpxvbIpl8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/186309364557592353/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/04/learn-filters-in-php-for-best-security.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/186309364557592353?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/186309364557592353?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/NlHpxvbIpl8/learn-filters-in-php-for-best-security.html" title="Learn FILTERS in PHP for Best Security Performance" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/04/learn-filters-in-php-for-best-security.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcHRng_fyp7ImA9WhZSFUQ.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-3517985233066043618</id><published>2011-03-31T10:50:00.000-07:00</published><updated>2011-03-31T10:53:57.647-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-31T10:53:57.647-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tips n tricks" /><category scheme="http://www.blogger.com/atom/ns#" term="debug" /><category scheme="http://www.blogger.com/atom/ns#" term="magento" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Override Controllers in Magento</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While working in Magento you may sometimes run into situations where you would like to override the functionality of the Magento core controllers. But you cannot edit the core controllers of Magento as it will hinder you from upgrading your Magento version. So we have to find a simple solution for that. Don't worry, today we will see how to override Magento core controllers.&lt;br /&gt;
For this, you have to create a custom module. &lt;a href="http://www.webspeaks.in/2010/07/create-your-first-magento-module.html"&gt;If you do not know how to create a custom module, then read this post.&lt;/a&gt;&lt;br /&gt;
Now suppose we want to override the &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;checkout/cart&lt;/span&gt; controller. To do this, we will have to edit just two files in our custom module.&lt;br /&gt;
Suppose our custom module is present in the namespace &lt;strong&gt;'Company'&lt;/strong&gt; and our module is named as &lt;strong&gt;'Web'&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #990000; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Step 1:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style="color: #990000; font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;"&gt;Open the app\code\local\Company\Web\etc\config.xml and edit it as follows:&lt;/span&gt;&lt;br /&gt;
The name of the core module to be overridden is written in between the router tags. Here we want to override the checkout module so checkout is to be wrapped in &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;"&gt;&amp;lt;routers&amp;gt;&lt;/span&gt; tags.&lt;br /&gt;
After that we will tell Magento to call our custom module before the Mage/Checkout module&lt;br /&gt;
&lt;pre class="brush:xml"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;config&amp;gt;
&amp;lt;modules&amp;gt;
  &amp;lt;Company_Web&amp;gt;
    &amp;lt;version&amp;gt;0.0.1&amp;lt;/version&amp;gt;
  &amp;lt;/Company_Web&amp;gt;
&amp;lt;/modules&amp;gt;
&amp;lt;frontend&amp;gt;
  &amp;lt;routers&amp;gt;
    &amp;lt;checkout&amp;gt;&amp;lt;!-- Name of core module to be overridden  --&amp;gt;
      &amp;lt;args&amp;gt;
        &amp;lt;modules&amp;gt;
          &amp;lt;Company_Web before="Mage_Checkout"&amp;gt;Company_Web&amp;lt;/Company_Web&amp;gt;&amp;lt;!-- Tell Magento to call our custom module before the Mage/Checkout module --&amp;gt;
        &amp;lt;/modules&amp;gt;
      &amp;lt;/args&amp;gt;
    &amp;lt;/checkout&amp;gt;
  &amp;lt;/routers&amp;gt;
&amp;lt;/frontend&amp;gt;
&amp;lt;/config&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style="color: #990000;"&gt;Step 2:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style="color: #990000;"&gt;Now create the controller file to be overridden, CartController.php in our case. (app\code\local\Company\Web\controllers\CartController.php)&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
/**
 * Magento
 *
 * Override Mage_Checkout_Cart controller
 */


/**
 * IMPORTANT
 * Include the core file to be overridden
 */
require_once("Mage/Checkout/controllers/CartController.php");

/**
 * IMPORTANT
 * Extend the core controller in our custom controller.
 */
class Company_Web_CartController extends Mage_Checkout_CartController
{
    /**
     * Get current active quote instance
     *
     * @return Mage_Sales_Model_Quote
     */
    public function indexAction()
    {
        echo "This controller has been overridden.";
    }
}
&lt;/pre&gt;&lt;br /&gt;
And you are done now. Override what you want:)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-3517985233066043618?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UG-IvwcEQTlY99ucPV8VplZlqVs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UG-IvwcEQTlY99ucPV8VplZlqVs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UG-IvwcEQTlY99ucPV8VplZlqVs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UG-IvwcEQTlY99ucPV8VplZlqVs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=J2Q46tTqllo:aRKRyZBJU4k:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=J2Q46tTqllo:aRKRyZBJU4k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=J2Q46tTqllo:aRKRyZBJU4k:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=J2Q46tTqllo:aRKRyZBJU4k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=J2Q46tTqllo:aRKRyZBJU4k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=J2Q46tTqllo:aRKRyZBJU4k:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=J2Q46tTqllo:aRKRyZBJU4k:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/J2Q46tTqllo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/3517985233066043618/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/03/override-controllers-in-magento.html#comment-form" title="18 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3517985233066043618?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/3517985233066043618?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/J2Q46tTqllo/override-controllers-in-magento.html" title="Override Controllers in Magento" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><thr:total>18</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/03/override-controllers-in-magento.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMBQ387cCp7ImA9WhZSFEo.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-5889827513874168550</id><published>2011-03-30T00:26:00.000-07:00</published><updated>2011-03-30T00:34:12.108-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-30T00:34:12.108-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="technology" /><category scheme="http://www.blogger.com/atom/ns#" term="payment-gateway" /><category scheme="http://www.blogger.com/atom/ns#" term="maoneybookers" /><category scheme="http://www.blogger.com/atom/ns#" term="php" /><title>Implementing Moneybookers Payment Gateway with PHP</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;a href="http://1.bp.blogspot.com/-X7xbLHzd3G8/TZLaTZgB6AI/AAAAAAAAAIY/c7WSCK-Obew/s1600/money.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-X7xbLHzd3G8/TZLaTZgB6AI/AAAAAAAAAIY/c7WSCK-Obew/s400/money.PNG" width="325" /&gt;&lt;/a&gt;Today we will integrate a Payment gateway in our website. We are going to implement &lt;a href="http://moneybookers.com/" target="_blank"&gt;Moneybookers Payment Gateway&lt;/a&gt;. Moneybookers provide an easily customizable payment gateway that can be implemented without much headache. You just need to create two accounts on Moneybookers, one for the Merchant and other for the Buyer. Then send a request to Moneybookers to convert these accounts into test accounts (for testing purpose). This is a manual process as Moneybookers provide no sandbox account like PayPal for the developers. After your account has been approved as test account, you can start using it for transactions.&lt;br /&gt;
Moneybookers payment gateway gives you two options for the payment, either you can transfer the buyer to Moneybookers payment page or you can embed the iframe into your own page which looks more elegant. Here we will be following the second one i.e the iframe.&lt;br /&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Database structure:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Create table '&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;payment_details&lt;/span&gt;' as:&lt;br /&gt;
&lt;pre class="brush:sql"&gt;CREATE TABLE `payment_status` (
  `order_id` int(11) NOT NULL AUTO_INCREMENT,
  `transaction_id` varchar(255) DEFAULT NULL,
  `amount` float(10,2) DEFAULT NULL,
  `status` int(1) DEFAULT NULL,
  `payment_type` varchar(20) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `username` varbinary(255) DEFAULT NULL,
  PRIMARY KEY (`order_id`)
)
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Create the payment page:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
We will include our payment form inthis page using an iframe. This is simple and doesn't need anything special. We will pass the necessary information with the URL of the iframe as:&lt;br /&gt;
&lt;pre class="brush:html"&gt;&amp;lt;iframe src="http://yoursite.com/payment-form?email=&amp;lt;?php echo $email ?&amp;gt;&amp;amp;fname=&amp;lt;?php echo $FirstName ?&amp;gt;&amp;amp;lname=&amp;lt;?php echo $LastName ?&amp;gt;&amp;amp;address=&amp;lt;?php echo $Address ?&amp;gt;&amp;amp;address2=&amp;lt;?php echo $Address2 ?&amp;gt;&amp;amp;city=&amp;lt;?php echo $City ?&amp;gt;&amp;amp;postal_code=&amp;lt;?php echo $PostalCode ?&amp;gt;&amp;amp;country=&amp;lt;?php echo $CountryId ?&amp;gt;&amp;amp;state=&amp;lt;?php echo $State ?&amp;gt;" name="payment" height="600" width="610" border="0"&amp;gt;
 &amp;lt;/iframe&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Create the payment form:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Payment page starts with a form with a number of hidden fields for the payment process. We will autosubnit this form to proceed to the next step of payment.&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;MoneyBookers by WebSpeaks.in&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;?php
$email = $_GET['email'];
$fname = $_GET['fname'];
$lname = $_GET['lname'];
$address = $_GET['address'];
$address = $_GET['address'];
$address2 = $_GET['address2'];
$city = $_GET['city'];
$postal_code = $_GET['postal_code'];
$country = $_GET['country'];
$state = $_GET['state'];

$price = 10;
?&amp;gt;
&amp;lt;form action="https://www.moneybookers.com/app/payment.pl" target="_self" name="payment_form"&amp;gt;

 &amp;lt;input type="hidden" name="pay_to_email" value="your_merchant_email"&amp;gt; 
 &amp;lt;input type="hidden" name="pay_from_email" value="&amp;lt;?php echo $email ?&amp;gt;"&amp;gt;
 &amp;lt;input type="hidden" name="return_url" value="http://yoursite.com/payment_success.php"&amp;gt; &amp;lt;!-- URL to redirect after payment success --&amp;gt;
 &amp;lt;input type="hidden" name="cancel_url" value="http://yoursite.com/payment_cancel.php"&amp;gt;  &amp;lt;!-- URL to redirect after payment cancel --&amp;gt;
 &amp;lt;input type="hidden" name="status_url" value="http://yoursite.com/payment_status.php"&amp;gt; &amp;lt;!-- URL to get the payment response (not visible to user, called on backend) --&amp;gt;
 &amp;lt;input type="hidden" name="language" value="EN"&amp;gt; &amp;lt;!-- Language of payment --&amp;gt;

 &amp;lt;input type="hidden" name="hide_login" value="1"&amp;gt;  &amp;lt;!-- Whether to show the tiny login form with the payment form, no in our case --&amp;gt;

 &amp;lt;!-- Specifies a target in which the return_url value will be called upon successful payment from customer.  --&amp;gt;
 &amp;lt;!-- 1 = '_top', 2 = '_parent', 3 = '_self', 4= '_blank' --&amp;gt;
 &amp;lt;input type="hidden" name="return_url_target" value="1"&amp;gt;  
 &amp;lt;input type="hidden" name="cancel_url_target" value="1"&amp;gt; 

 &amp;lt;!-- Custom fields for your own needs --&amp;gt;
 &amp;lt;input type="hidden" name="merchant_fields" value="name, username, order_amount, user_id"&amp;gt; &amp;lt;!-- List all your custom fields here (comma separated, max 5)--&amp;gt;
 &amp;lt;input type="hidden" name="name" value="&amp;lt;?php echo $fname. ' '.$lname ?&amp;gt;"&amp;gt; &amp;lt;!-- Value of Custom 'name' --&amp;gt;
 &amp;lt;input type="hidden" name="username" value="&amp;lt;?php echo $username ?&amp;gt;"&amp;gt;  &amp;lt;!-- Value of Custom 'username' --&amp;gt;
 &amp;lt;input type="hidden" name="order_amount" value="&amp;lt;?php echo $price ?&amp;gt;"&amp;gt; &amp;lt;!-- Value of Custom 'order_amount' --&amp;gt;
 &amp;lt;input type="hidden" name="user_id" value="&amp;lt;?php echo $user_id ?&amp;gt;"&amp;gt;  &amp;lt;!-- Value of Custom 'user_id' --&amp;gt;

 &amp;lt;input type="hidden" name="amount_description" value="Testing Amount"&amp;gt;  &amp;lt;!-- Description of the amount --&amp;gt;
 &amp;lt;input type="hidden" name="amount" value="&amp;lt;?php echo $price ?&amp;gt;"&amp;gt;  &amp;lt;!-- Amount to be charged --&amp;gt;
 &amp;lt;input type="hidden" name="currency" value="GBP"&amp;gt;   &amp;lt;!-- Currency of payment --&amp;gt;
 &amp;lt;input type="hidden" name="firstname" value="&amp;lt;?php echo $fname ?&amp;gt;"&amp;gt;   &amp;lt;!-- Firstname of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="lastname" value="&amp;lt;?php echo $lname ?&amp;gt;"&amp;gt;    &amp;lt;!-- Lastname of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="email" value="&amp;lt;?php echo $email ?&amp;gt;"&amp;gt;    &amp;lt;!-- Email of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="address" value="&amp;lt;?php echo $address ?&amp;gt;"&amp;gt;     &amp;lt;!-- Address of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="city" value="&amp;lt;?php echo $city ?&amp;gt;"&amp;gt;     &amp;lt;!-- City of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="state" value="&amp;lt;?php echo $state ?&amp;gt;"&amp;gt;     &amp;lt;!-- State of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="postal_code" value="&amp;lt;?php echo $postal_code ?&amp;gt;"&amp;gt;     &amp;lt;!-- Postal_code of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="country" value="&amp;lt;?php echo $country ?&amp;gt;"&amp;gt;     &amp;lt;!-- Country code of buyer, need for autofilling --&amp;gt;
 &amp;lt;input type="hidden" name="detail1_description" value="New Product"&amp;gt;      &amp;lt;!-- Description heading of the payyment, shown after payment has been made --&amp;gt;
 &amp;lt;input type="hidden" name="detail1_text" value="&amp;lt;?php echo $product ?&amp;gt;"&amp;gt;      &amp;lt;!-- Detailed description of the payment, shown after payment has been made --&amp;gt;
 &amp;lt;input type="hidden" name="confirmation_note" value="Thanks for purchasing Voodoo Video!"&amp;gt; &amp;lt;!-- Confirmation message to be shown after payment has been made --&amp;gt; 

 &amp;lt;p&amp;gt;
  &amp;lt;input type="submit" class="submitBtn&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Receive Payment Status:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
In the payment form we have specified the '&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;status_url&lt;/span&gt;' field. This field specifies the URL on which the Moneybookers sends the status of the payment. It is URL to which the transaction details will be posted after the payment process is complete. Alternatively, you may specify an email address to which you would like to receive the results.  If the status_url is omitted, no transaction details will be sent to the Merchant. &lt;br /&gt;
&lt;b&gt;Detailed status description &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;‘2’ Processed&lt;/b&gt; – This status is sent when the transaction is processed and the funds have been received on your Moneybookers account.  &lt;br /&gt;
&lt;b&gt;‘0’ Pending&lt;/b&gt; – This status is sent when the customers pays via the pending bank transfer option. Such transactions will auto-process  IF  the bank transfer is received by Moneybookers. We strongly recommend that you do NOT process the order/transaction in your system upon receipt of a pending status from Moneybookers. &lt;br /&gt;
&lt;b&gt;‘-1’ Cancelled&lt;/b&gt; –  Pending transactions can either be cancelled manually by  the sender in their online account history or they will auto-cancel after 14 days if still pending. ‘-2’ Failed – This status is sent when the customer tries to pay via Credit Card or Direct debit but our provider declines the transaction. If you do not accept Credit Card or Direct debit payments via Moneybookers (see page  16) then you will never receive the failed status. &lt;br /&gt;
&lt;b&gt;‘-3’ Chargeback&lt;/b&gt;  –  This status could be received only if your account is configured to receive chargebacks. If this is the case, whenever a chargeback is received by Moneybookers, a -3 status will be posted on the status_url for the reversed transaction. &lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;Create payment_status.&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;php&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt; as:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="brush:php"&gt;$status = $_POST['status']/*Status of transaction*/
$username = $_POST['username'];/*Custom field*/
$user_id = $_POST['user_id'];/*Custom field*/
$amount = $_POST['amount'];/*Amount of transaction*/
$payment_type = $_POST['payment_type'];/*Type of Payment*/
$mb_transaction_id = $_POST['mb_transaction_id'];/*Moneybookers transaction id*/

/*save transaction details in database*/
mysql_query("INSERT INTO `payment_details` (`transaction_id`, `amount`, `status`, `payment_type`, `user_id`, `username`) VALUES ('".$mb_transaction_id."', '".$amount."', '".$status."', '".$payment_type."', '".$user_id."', '".$username."') ");
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Payment Success Page:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Create payment_success.php as&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
echo "Your payment has been received. Thanks for purchasing our product.";
?&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;Payment Cancel Page:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Create payment_cancel.php as&lt;br /&gt;
&lt;pre class="brush:php"&gt;&amp;lt;?php
echo "Your payment has been cancelled. Please try again.";
?&amp;gt;
&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-5889827513874168550?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M5tKRYumH-a_Oad9cD7eOEkTU0U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M5tKRYumH-a_Oad9cD7eOEkTU0U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M5tKRYumH-a_Oad9cD7eOEkTU0U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M5tKRYumH-a_Oad9cD7eOEkTU0U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=iolYNUtkERw:LUj6Zi71Udc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=iolYNUtkERw:LUj6Zi71Udc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=iolYNUtkERw:LUj6Zi71Udc:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=iolYNUtkERw:LUj6Zi71Udc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=iolYNUtkERw:LUj6Zi71Udc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=iolYNUtkERw:LUj6Zi71Udc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=iolYNUtkERw:LUj6Zi71Udc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/iolYNUtkERw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/5889827513874168550/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/03/today-we-will-integrate-payment-gateway.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/5889827513874168550?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/5889827513874168550?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/iolYNUtkERw/today-we-will-integrate-payment-gateway.html" title="Implementing Moneybookers Payment Gateway with PHP" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-X7xbLHzd3G8/TZLaTZgB6AI/AAAAAAAAAIY/c7WSCK-Obew/s72-c/money.PNG" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/03/today-we-will-integrate-payment-gateway.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UFSXg7fSp7ImA9WhZSFEw.&quot;"><id>tag:blogger.com,1999:blog-3112244016000402471.post-6501825854032671377</id><published>2011-03-29T10:12:00.000-07:00</published><updated>2011-03-29T10:20:18.605-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-29T10:20:18.605-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="magento" /><category scheme="http://www.blogger.com/atom/ns#" term="module" /><title>Update: Magento Frontend/Backend Modules Updated</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;On Request of my readers, I have uploaded the working examples of Magento frontend and backend modules. Also the previous tutorials of module creation have been modified to resolve problems.&lt;br /&gt;
&lt;br /&gt;
Download links:&lt;br /&gt;
&lt;br /&gt;
&lt;a class="download" href="http://demos.frnzzz.com/d/?f=magento/magentoModule.zip" target="_blank"&gt;Download Magento Module&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="download" href="http://demos.frnzzz.com/d/?f=magento/MagentoBackendModule.zip" target="_blank"&gt;Download Magento Backend Module&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now you can watch the upgraded modules on:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #38761d;"&gt;&lt;b&gt;&lt;a href="http://www.webspeaks.in/2010/07/create-your-first-magento-module.html"&gt;Create Your First Magento Module&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #38761d;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #38761d;"&gt;&lt;b&gt;&lt;a href="http://www.webspeaks.in/2010/08/create-your-first-adminbackend-module.html"&gt;Create Your First Admin (Backend) Module in Magento&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #38761d;"&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;&lt;div style="color: #38761d;"&gt;&lt;b&gt;&lt;a href="http://www.webspeaks.in/2010/08/create-admin-backend-module-in-magento.html"&gt;Create Admin (Backend) Module in Magento with Grids&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3112244016000402471-6501825854032671377?l=www.webspeaks.in' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nA_PQjxmMfrdKNT9cMzbvknMBnU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nA_PQjxmMfrdKNT9cMzbvknMBnU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nA_PQjxmMfrdKNT9cMzbvknMBnU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nA_PQjxmMfrdKNT9cMzbvknMBnU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=RsTGnKKrPuw:k4ZjY0mpP-o:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=RsTGnKKrPuw:k4ZjY0mpP-o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:KwTdNBX3Jqk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=RsTGnKKrPuw:k4ZjY0mpP-o:KwTdNBX3Jqk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=RsTGnKKrPuw:k4ZjY0mpP-o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=RsTGnKKrPuw:k4ZjY0mpP-o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?i=RsTGnKKrPuw:k4ZjY0mpP-o:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/WebSpeaks?a=RsTGnKKrPuw:k4ZjY0mpP-o:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/WebSpeaks?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WebSpeaks/~4/RsTGnKKrPuw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.webspeaks.in/feeds/6501825854032671377/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.webspeaks.in/2011/03/update-magento-frontendbackend-modules.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6501825854032671377?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3112244016000402471/posts/default/6501825854032671377?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WebSpeaks/~3/RsTGnKKrPuw/update-magento-frontendbackend-modules.html" title="Update: Magento Frontend/Backend Modules Updated" /><author><name>Arvind Bhardwaj</name><uri>http://www.blogger.com/profile/03106934539133356485</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://4.bp.blogspot.com/_1r5vwEFRAs4/TAdPaX-ZIXI/AAAAAAAAAFM/D2tHu8NMw_s/S220/Image137.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://www.webspeaks.in/2011/03/update-magento-frontendbackend-modules.html</feedburner:origLink></entry></feed>

