
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>Let&#039;s start again... &#187; Tips and Tricks</title>
	<atom:link href="http://blog.manchumahara.com/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.manchumahara.com</link>
	<description>&#34;Manchumahara&#34; ...... The virtual crazy vagabond and  a emotional stupid</description>
	<lastBuildDate>Fri, 23 Jul 2010 18:33:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Adding joomla native dropdown menu in frontend</title>
		<link>http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/</link>
		<comments>http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 10:59:28 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[joomla dropdown menu]]></category>
		<category><![CDATA[joomla tricks]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=570</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_570()',5000);window.setTimeout('loadDzone_570()',5000);window.setTimeout('loadTwitter_570()',5000);window.setTimeout('loadFBShare_570()',5000);window.setTimeout('loadFBLike_570()',5000);window.setTimeout('loadDelicious_570()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_570()',5000); }); function loadDigg_570(){ jQuery(document).ready(function($) { $('.dd-digg-570').remove();$('.DD_DIGG_AJAX_570').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&#38;title=Adding+joomla+native+dropdown+menu+in+frontend');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_570(){ jQuery(document).ready(function($) { $('.dd-dzone-570').remove();$('.DD_DZONE_AJAX_570').attr('width','52');$('.DD_DZONE_AJAX_570').attr('height','68');$('.DD_DZONE_AJAX_570').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&#038;title=Adding+joomla+native+dropdown+menu+in+frontend&#038;t=1'); }); } function loadTwitter_570(){ jQuery(document).ready(function($) { $('.dd-twitter-570').remove();$('.DD_TWITTER_AJAX_570').attr('width','50');$('.DD_TWITTER_AJAX_570').attr('height','61');$('.DD_TWITTER_AJAX_570').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_570(){ jQuery(document).ready(function($) { $('.dd-fbshare-570').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_570(){ jQuery(document).ready(function($) { $('.dd-fblike-570').remove();$('.DD_FBLIKE_AJAX_570').attr('width','450');$('.DD_FBLIKE_AJAX_570').attr('height','25');$('.DD_FBLIKE_AJAX_570').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&#38;show_faces=false'); }); } function loadDelicious_570(){ jQuery(document).ready(function($) { $('.dd-delicious-570').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_570()',5000);window.setTimeout('loadDzone_570()',5000);window.setTimeout('loadTwitter_570()',5000);window.setTimeout('loadFBShare_570()',5000);window.setTimeout('loadFBLike_570()',5000);window.setTimeout('loadDelicious_570()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_570()',5000); });</script><script type="text/javascript"> function loadDigg_570(){ jQuery(document).ready(function($) { $('.dd-digg-570').remove();$('.DD_DIGG_AJAX_570').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&amp;title=Adding+joomla+native+dropdown+menu+in+frontend');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_570(){ jQuery(document).ready(function($) { $('.dd-dzone-570').remove();$('.DD_DZONE_AJAX_570').attr('width','52');$('.DD_DZONE_AJAX_570').attr('height','68');$('.DD_DZONE_AJAX_570').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&title=Adding+joomla+native+dropdown+menu+in+frontend&t=1'); }); } function loadTwitter_570(){ jQuery(document).ready(function($) { $('.dd-twitter-570').remove();$('.DD_TWITTER_AJAX_570').attr('width','50');$('.DD_TWITTER_AJAX_570').attr('height','61');$('.DD_TWITTER_AJAX_570').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_570(){ jQuery(document).ready(function($) { $('.dd-fbshare-570').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_570(){ jQuery(document).ready(function($) { $('.dd-fblike-570').remove();$('.DD_FBLIKE_AJAX_570').attr('width','450');$('.DD_FBLIKE_AJAX_570').attr('height','25');$('.DD_FBLIKE_AJAX_570').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&amp;show_faces=false'); }); } function loadDelicious_570(){ jQuery(document).ready(function($) { $('.dd-delicious-570').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_570').text(msg);}); }); } function loadGBuzz_570(){ jQuery(document).ready(function($) { $('.dd-gbuzz-570').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-570'></div><a class='DiggThisButton DD_DIGG_AJAX_570 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-570'></div><iframe class='DD_DZONE_AJAX_570' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-570'></div><iframe class='DD_TWITTER_AJAX_570' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-570'></div><a class='DD_FBSHARE_AJAX_570' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-570'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/')+'&amp;title='+encodeURIComponent('Adding+joomla+native+dropdown+menu+in+frontend'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_570'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-570'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/#comments><span class='ctotal'>12</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/#comments></a></div></div></div></div><div style='clear:both'></div><dl id="attachment_571" class="wp-caption alignleft" style="width: 403px"><dt><img src="http://blog.manchumahara.com/wp-content/uploads/2010/06/jnativetopmenu1.png" alt="" title="jnativetopmenu1" width="393" height="129" class="size-full wp-image-571" /></dt><dd class="wp-caption-text">joomla native drop down menu</dd></dl><br />
I think it&#8217;s my 4th post about using joomla native resources like tab slider, tooltip, modal/popup window and I am very happy that I just tried to used the joomla admin top menu &#8230; the top to bottom drop down menu in front end and it&#8217;s working fine. I just used the joomla native resources and changed one line of code in mod_mainmenu module. I think for doing something test or creative things sometimes we can try to change core code little&#8230; just keep in mind where u are changing and change again while u upgrade again in future.</p>
<ul>
<li><a rel="bookmark follow" href="http://blog.manchumahara.com/2010/04/24/adding-joomla-native-modal-to-frontend/">Adding joomla native modal to frontend</a></li>
<li><a rel="bookmark follow" href="http://blog.manchumahara.com/2010/03/22/using-wordpress-native-thickbox/">Using wordpress native thickbox</a></li>
<li><a rel="bookmark follow" href="http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/">জুমলাতে নেটিভ টুলটিপ এর ব্যবহার</a></li>
<li><a rel="bookmark follow" href="http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/">Home made tab and slider module for joomla1.5</a></li>
</ul>
<p>Ok then let&#8217;s move for how we can use the main menu module  as &#8216;<em>top to bottom</em>&#8216; drop down menu like the joomla admin panel top menu. we will work on default template of joomla1.5<span id="more-570"></span></p>
<h4>Adding javascript file</h4>
<p>Create a new folder named js  in default template like this templates\rhuk_milkyway\js</p>
<p>Now copy two js files from admin default template from this location administrator\templates\khepri\js  or you can just copy the js folder from admin default template khepri to front end  default template rukh_milkway. That&#8217;s it. Btw, pls check you copied at least two files named menu.js and index.js. Now add the follow two lines in index.php file of default template before &lt;/head&gt;  tag like bellow</p>
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo $this-&gt;baseurl ?&gt;/templates/&lt;?php echo $this-&gt;template ?&gt;/js/menu.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php echo $this-&gt;baseurl ?&gt;/templates/&lt;?php echo $this-&gt;template ?&gt;/js/index.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<h4>Adding CSS or style code</h4>
<p>Open template.css file from your default template css folder i.e., templates\rhuk_milkyway\css   and  put this bellow css code at last or somewhere.</p>
<pre class="brush: css;">
#menu, #menu ul, #menu li { margin: 0; padding: 0; border: 0 none; }
#menu       { position:relative; z-index: 100;}
#menu li    { float:left;  position:relative; list-style: none; display: inline;}
#menu li a  { display:block; white-space: nowrap;  }
#menu li li { /*width: 100%;*/ clear: both;  /*FF 1.0.7 needs this */  }
#menu li ul { visibility: hidden; position:absolute; }
#menu li li ul {  top: 0; left: 0; }
#menu li.hover ul               {  visibility: visible; }
#menu li.hover ul li ul 		  {  visibility: hidden;  }
#menu li.hover li.hover ul      {  visibility: visible;  left: 100%; }
/* ---- Menu layout -------------------------- */
#menu li {
	border-left: 1px solid #fff;
	border-right: 1px solid #d8d8d8;
}
#menu li li { border: 0;}
#menu ul    { border: 0.1em solid #ccc; background: #f6f6f6 url(../images/bg-menu.gif) repeat-y left;}
#menu ul li.node { background: transparent url(../images/j_arrow.png) no-repeat right 50%; }
#menu ul li.separator { background: #DDE1E6 url(../images/bg-menu.gif);  height: 1px;  }
#menu a, #menu div {
	padding: 0.35em 1em 0.35em;
	margin: 0 1px 0 1px;
	color: #333333;
	line-height: 1.6em; vertical-align: middle;
	font-size: 11px; font-weight: bold; text-decoration: none;
	cursor: default;
	background-repeat: no-repeat; background-position: left 50%
}
#menu li.disabled a { color: gray; }
#menu ul a {
	font-size: 11px;
	font-weight: normal;
	padding-left: 25px;
	padding-right: 20px;
	line-height: 1.2em;
}
/* 1 level - hover */
#menu li.hover a {  background-color: #E7EDDF; border-left: 1px solid #6D9D2E;  border-right:1px solid #6D9D2E; margin: 0; }
/* 2 level - normal */
#menu li.hover li a { background-color: transparent; border: 0 none;   margin: 2px;  }
/* 2 level - hover */
#menu li.hover li.hover a { background-color: #E7EDDF; border: 1px solid #6D9D2E;  margin: 1px;   }
/* 3 level - normal */
#menu li.hover li.hover li a { background-color: transparent; border: 0 none;   margin: 2px;  }
/* 3 level - hover */
#menu li.hover li.hover li a:hover { background-color: #E7EDDF; border: 1px solid #6D9D2E;  margin: 1px;  }
/* submenu styling */
#submenu {
	list-style: none;
	padding: 0;
	margin: 0;
}
#submenu li {
	float: left;
	padding: 0;
	margin: 0;
}
#submenu li a,
#submenu span.nolink {
	cursor: pointer;
	padding: 0px 15px;
	border-right: 1px solid #ccc;
	font-weight: bold;
	color: #0B55C4;
	line-height: 12px;
	height: 12px;
}
#submenu span.nolink {
	color: #999;
}
#submenu a.active,
#submenu span.nolink.active {
	color: #000;
	text-decoration: underline;
}
</pre>
<p>I collected this css code from admin template khepri template css file. So we are still using the native resources <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Configure Menu module</h4>
<p>If you are using default template then the topmenu is published in user3 position . So go to module manager and find tehe module for top menu published in user3 position and set configuration like bellow screenshots.<br />
<dl id="attachment_573" class="wp-caption aligncenter" style="width: 489px"><dt><img src="http://blog.manchumahara.com/wp-content/uploads/2010/06/jnativetopmenu3.png" alt="" title="jnativetopmenu3" width="479" height="237" class="size-full wp-image-573" /></dt><dd class="wp-caption-text">Menu module configuration</dd></dl><br />
Please check above image I set the menu tag id is &#8220;menu&#8221;, we need this as fixed for our current moving <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . Another is menu style is &#8220;list&#8221;. And certainly as u are trying to make drop down menus so you can set end level as u need like 3/4 etc. Pls before doing that create some sub or sub sub menus for top level menus in topmenu category from your menu manager.</p>
<h4>Changing template code to accomodate for our new style top menu</h4>
<p>In your rukh_milkway   default template open the index.php file fine a line near this html code &lt;div id=&#8221;tabarea&#8221;&gt; . Sorry I can not give line number exactly now as I changed my default template many times <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Here is the code used in defailt templte and I make the comment except the module include line.</p>
<pre class="brush: xml;">
&lt;!--div id=&quot;tabarea&quot;&gt;
	&lt;div id=&quot;tabarea_l&quot;&gt;
		&lt;div id=&quot;tabarea_r&quot;&gt;
			&lt;div id=&quot;tabmenu&quot;&gt;
			&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;pill&quot;&gt;
				&lt;tr&gt;
					&lt;td class=&quot;pill_l&quot;&gt;&amp;nbsp;&lt;/td&gt;
					&lt;td class=&quot;pill_m&quot;&gt;
					&lt;div id=&quot;pillmenu&quot;--&gt;
						&lt;jdoc:include type=&quot;modules&quot; name=&quot;user3&quot; /&gt;
					&lt;!--/div&gt;
					&lt;/td&gt;
					&lt;td class=&quot;pill_r&quot;&gt;&amp;nbsp;&lt;/td&gt;
				&lt;/tr&gt;
				&lt;/table&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div--&gt;
</pre>
<p>You can use a simple line for the replacement of the above codes and fix your css as u need like this</p>
<pre class="brush: php;">
&lt;div class=&quot;topmenu&quot;&gt;
   &lt;jdoc:include type=&quot;modules&quot; name=&quot;user3&quot; /&gt;
&lt;/div&gt;
</pre>
<p>Hei, we are about to done <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Changing a <del datetime="2010-07-03T19:02:06+00:00">core</del> file of main menu module <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </h4>
<p><del datetime="2010-07-03T19:02:06+00:00">Yes I am not happy any more at this point as we going to change a line in a core file but what to say &#8230; if we want to do something great we can do a little hack to core and shout like &#8220;hei ! I don&#8217;t care to hack core if I need <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> &#8221;</del><br />
I am sorry I just forgot that we can ovverride the view part of any module and will do this now. Just check if there is any folder in your template named &#8220;html&#8221;, if not then create one. now created a folder in it named &#8220;mod_mainmenu&#8221;  and then <strong>copy</strong>  modules\mod_mainmenu\tmpl\default.php  and modules\mod_mainmenu\tmpl\index.html file from this location and paste in the new created folder mod_mainmenu ie, template\{yourtempalte folder}\html\mod_mainmenu</p>
<p>and <strong>now</strong><br />
open file <del datetime="2010-07-03T19:02:06+00:00">modules\mod_mainmenu\tmpl\</del>template\{yourtempalte folder}\html\mod_mainmenu\default.php and look for near line 36  and change this line to</p>
<pre class="brush: php;">
	if (($node-&gt;name() == 'li') &amp;&amp; isset($node-&gt;ul)) {
		$node-&gt;addAttribute('class', 'node parent');
	}
</pre>
<p>Pls notice that I added an extra class name &#8216;node&#8217; in 2nd line. that what we need exactly to use the core css file and js. <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here is another screenshot of the top  menu that we just made.</p>
<p><dl id="attachment_572" class="wp-caption aligncenter" style="width: 428px"><dt><img src="http://blog.manchumahara.com/wp-content/uploads/2010/06/jnativetopmenu2.png" alt="" title="jnativetopmenu2" width="418" height="106" class="size-full wp-image-572" /></dt><dd class="wp-caption-text">joomla native drop down menu2</dd></dl>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-570'></div><iframe class="DD_FBLIKE_AJAX_570" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2010/06/25/adding-joomla-native-dropdown-menu-in-frontend/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>জুমলাতে নেটিভ টুলটিপ</title>
		<link>http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/</link>
		<comments>http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 10:26:00 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=474</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_474()',5000);window.setTimeout('loadDzone_474()',5000);window.setTimeout('loadTwitter_474()',5000);window.setTimeout('loadFBShare_474()',5000);window.setTimeout('loadFBLike_474()',5000);window.setTimeout('loadDelicious_474()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_474()',5000); }); function loadDigg_474(){ jQuery(document).ready(function($) { $('.dd-digg-474').remove();$('.DD_DIGG_AJAX_474').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&#38;title=+%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%A4%E0%A7%87+%E0%A6%A8%E0%A7%87%E0%A6%9F%E0%A6%BF%E0%A6%AD+%E0%A6%9F%E0%A7%81%E0%A6%B2%E0%A6%9F%E0%A6%BF%E0%A6%AA+%E0%A6%8F%E0%A6%B0+%E0%A6%AC%E0%A7%8D%E0%A6%AF%E0%A6%AC%E0%A6%B9%E0%A6%BE%E0%A6%B0');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_474(){ jQuery(document).ready(function($) { $('.dd-dzone-474').remove();$('.DD_DZONE_AJAX_474').attr('width','52');$('.DD_DZONE_AJAX_474').attr('height','68');$('.DD_DZONE_AJAX_474').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&#038;title=+%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%A4%E0%A7%87+%E0%A6%A8%E0%A7%87%E0%A6%9F%E0%A6%BF%E0%A6%AD+%E0%A6%9F%E0%A7%81%E0%A6%B2%E0%A6%9F%E0%A6%BF%E0%A6%AA+%E0%A6%8F%E0%A6%B0+%E0%A6%AC%E0%A7%8D%E0%A6%AF%E0%A6%AC%E0%A6%B9%E0%A6%BE%E0%A6%B0&#038;t=1'); }); } function loadTwitter_474(){ jQuery(document).ready(function($) { $('.dd-twitter-474').remove();$('.DD_TWITTER_AJAX_474').attr('width','50');$('.DD_TWITTER_AJAX_474').attr('height','61');$('.DD_TWITTER_AJAX_474').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_474(){ jQuery(document).ready(function($) { $('.dd-fbshare-474').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_474(){ jQuery(document).ready(function($) { $('.dd-fblike-474').remove();$('.DD_FBLIKE_AJAX_474').attr('width','450');$('.DD_FBLIKE_AJAX_474').attr('height','25');$('.DD_FBLIKE_AJAX_474').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&#38;show_faces=false'); }); } function loadDelicious_474(){ jQuery(document).ready(function($) { $('.dd-delicious-474').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_474()',5000);window.setTimeout('loadDzone_474()',5000);window.setTimeout('loadTwitter_474()',5000);window.setTimeout('loadFBShare_474()',5000);window.setTimeout('loadFBLike_474()',5000);window.setTimeout('loadDelicious_474()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_474()',5000); });</script><script type="text/javascript"> function loadDigg_474(){ jQuery(document).ready(function($) { $('.dd-digg-474').remove();$('.DD_DIGG_AJAX_474').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&amp;title=+%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%A4%E0%A7%87+%E0%A6%A8%E0%A7%87%E0%A6%9F%E0%A6%BF%E0%A6%AD+%E0%A6%9F%E0%A7%81%E0%A6%B2%E0%A6%9F%E0%A6%BF%E0%A6%AA+%E0%A6%8F%E0%A6%B0+%E0%A6%AC%E0%A7%8D%E0%A6%AF%E0%A6%AC%E0%A6%B9%E0%A6%BE%E0%A6%B0');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_474(){ jQuery(document).ready(function($) { $('.dd-dzone-474').remove();$('.DD_DZONE_AJAX_474').attr('width','52');$('.DD_DZONE_AJAX_474').attr('height','68');$('.DD_DZONE_AJAX_474').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&title=+%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%A4%E0%A7%87+%E0%A6%A8%E0%A7%87%E0%A6%9F%E0%A6%BF%E0%A6%AD+%E0%A6%9F%E0%A7%81%E0%A6%B2%E0%A6%9F%E0%A6%BF%E0%A6%AA+%E0%A6%8F%E0%A6%B0+%E0%A6%AC%E0%A7%8D%E0%A6%AF%E0%A6%AC%E0%A6%B9%E0%A6%BE%E0%A6%B0&t=1'); }); } function loadTwitter_474(){ jQuery(document).ready(function($) { $('.dd-twitter-474').remove();$('.DD_TWITTER_AJAX_474').attr('width','50');$('.DD_TWITTER_AJAX_474').attr('height','61');$('.DD_TWITTER_AJAX_474').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_474(){ jQuery(document).ready(function($) { $('.dd-fbshare-474').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_474(){ jQuery(document).ready(function($) { $('.dd-fblike-474').remove();$('.DD_FBLIKE_AJAX_474').attr('width','450');$('.DD_FBLIKE_AJAX_474').attr('height','25');$('.DD_FBLIKE_AJAX_474').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&amp;show_faces=false'); }); } function loadDelicious_474(){ jQuery(document).ready(function($) { $('.dd-delicious-474').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_474').text(msg);}); }); } function loadGBuzz_474(){ jQuery(document).ready(function($) { $('.dd-gbuzz-474').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-474'></div><a class='DiggThisButton DD_DIGG_AJAX_474 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-474'></div><iframe class='DD_DZONE_AJAX_474' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-474'></div><iframe class='DD_TWITTER_AJAX_474' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-474'></div><a class='DD_FBSHARE_AJAX_474' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-474'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/')+'&amp;title='+encodeURIComponent('+%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%A4%E0%A7%87+%E0%A6%A8%E0%A7%87%E0%A6%9F%E0%A6%BF%E0%A6%AD+%E0%A6%9F%E0%A7%81%E0%A6%B2%E0%A6%9F%E0%A6%BF%E0%A6%AA+%E0%A6%8F%E0%A6%B0+%E0%A6%AC%E0%A7%8D%E0%A6%AF%E0%A6%AC%E0%A6%B9%E0%A6%BE%E0%A6%B0'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_474'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-474'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/#respond><span class='ctotal'>0</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/#respond></a></div></div></div></div><div style='clear:both'></div><p>Hei! it&#8217;s bengali unicode text, This post is wrriten for <a href="http://forum.amaderprojukti.com/viewtopic.php?f=60&#038;t=5759&#038;p=48460#p48460">amaderprojukti forum</a>.<br />
অনেক দিন বাংলায় ব্লগ বা টিপ্স কিছু লেখা হয় না। আজকের বিষয় আমার অনেক গুলো গার্লফ্রেন্ড এর ভেতর অন্যতম &#8220;জুমলা&#8221;। যদিও আজকের লেখাটা জুমলার একটি গোপন সুন্দর দিক নিয়ে আর তা হলো জুমলা ১.৫ এর নেটিভ টুলটিপ।<br />
প্রথম একটি ছবি দেখায়ঃ<br />
<img alt="tooltip" src="http://blog.manchumahara.com/wp-content/uploads/2010/06/tip.png" alt="tip.png" /><br />
এডমিন প্যানেলে কোন কিছু কনফিগারেশনে ঢুকলে বা অনেক সময় কোন লিঙ্কএ মাউস হোভার করলে উপরের মতো টুলটিপ দেখায়। একই রকম টুপটিপ চাইলে আমরা ফ্রন্ট এন্ড এ ব্যবহার করতে পারি আর তার জন্য এক্টিভ টেমপ্লেটে দরকার সামান্য পরিবর্তন, সেই পরিবর্তন কিভাবে করা যায় তা নিয়েই আজকের আলোচনা। পরের ছবিটি ফ্রন্ট এন্ড এর।<br />
<img alt="tootip" src="http://blog.manchumahara.com/wp-content/uploads/2010/04/tooltip.png" alt="tooltip.png" /></p>
<p><strong>কিভাবে ফ্রন্ট এন্ডে টুলটিপ ফিচার যুক্ত করবেনঃ</strong><br />
টুলটিপ ফিচার যুক্ত করার জন্য আপনাকে প্রথম টেমপ্লেটের ইন্ডেক্স ফাইল(index.php) এ একটি লাইন যুক্ত করতে হবে। যদি আপনি ডিফল্ট টেমপ্লেট ব্যবহার করেন তাহলে rhuk_milkyway  হচ্ছে আপনার টেমপ্লেট এর নাম, এর ভেতর index.php ফাইলটি ওপেন করুন কোন এডিটরে, এখন হেড ট্যাগ() এর আগে </p>
<p><span id="more-474"></span></p>
<pre class="brush: plain;">&lt;/head&gt;</pre>
<p>নিচের লাইনটি বসিয়ে দিনঃ</p>
<pre class="brush: plain;">
&lt;?php
JHTML::_('behavior.tooltip');
?&gt;
</pre>
<p>উপরের কোড টুকু যা করবে তা হলো কিছু জাভা স্ক্রিপ্ট এর কোড তৈরি করে দেবে যা আপনাকে টুলটিপ যুক্ত করতে সাহায্য করবে।</p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot;&gt;
    window.addEvent('domready', function(){
       var JTooltips = new Tips($$('.hasTip'),
       { maxTitleChars: 50, fixed: false});
    });
&lt;/script&gt;
</pre>
<p><strong>কন্টেন্ট এর ভেতর বা কিভাবে টুলটিপ এর টিপ যুক্ত করতে হবেঃ</strong><br />
ধরুন এখন এডমিন প্যানেল থেকে একটি আর্টিকেলে আমি লিখছি এমন একটি লাইন<br />
আমি <strong>আমাদের প্রযুক্তি</strong> ফোরামে এখন একটি টিউটোরিয়াল লিখছি।<br />
এখানে আমি চাই &#8220;আমাদের প্রযুক্তি&#8221;  শব্দবলীর উপর মাউস নিলে টিপ দেখাবে। এটা করার জন্য নিচের মতো লিখতে হবে।</p>
<pre class="brush: xml;">
আমি &lt;span title=&quot;আমাদের প্রযুক্তি ফোরাম:: আমাদের প্রযুক্তি বিজ্ঞান ও প্রযুক্তি বিষয়ক একটি ইউনিকোড কম্পেটিবল বাংলা ফোরাম &quot; class=&quot;hasTip&quot;&gt;আমাদের প্রযুক্তি&lt;/span&gt; ফোরামে এখন একটি টিউটোরিয়াল লিখছি।
</pre>
<p>এখানে প্রথমে</p>
<pre class="brush: xml;">&lt;span&gt;আমাদের প্রযুক্তি&lt;/span&gt;[/quote]
এরপর স্প্যান ট্যাগে এ টাইটেলে আমি বিশেষ ভাবে কিছু লিখেছি, এই টাইটেল ফ্রন্ট এন্ডে থাকবে না যা আসলে টুলটিপে পরিবর্তিত হবে। এখন খেয়াল করুন আমি ব্যবহার করেছি ::   এই রকম একটা সেপারেটর। এখানে :: এর আগের অংশ হবে টাইটেল আর ::  এর পরের অংশ হবে বর্ণনা।
[code='html']&lt;span title=&quot;আমাদের প্রযুক্তি ফোরাম:: আমাদের প্রযুক্তি বিজ্ঞান ও প্রযুক্তি বিষয়ক একটি ইউনিকোড কম্পেটিবল বাংলা ফোরাম &quot; &gt;আমাদের প্রযুক্তি&lt;/span&gt;[/quote]
তারপর
[code='html']&lt;span title=&quot;আমাদের প্রযুক্তি ফোরাম:: আমাদের প্রযুক্তি বিজ্ঞান ও প্রযুক্তি বিষয়ক একটি ইউনিকোড কম্পেটিবল বাংলা ফোরাম &quot; class=&quot;hasTip&quot;&gt;আমাদের প্রযুক্তি&lt;/span&gt;[/quote]
এখন যা করেছি স্প্যান ট্যাগে বসিয়ে দিয়েছি একটা ক্লাস নামে &quot;hasTip&quot;,
তাহলে পুরা লাইন হবে নিচের মতোঃ
[code ='html']
আমি &lt;span title=&quot;আমাদের প্রযুক্তি ফোরাম:: আমাদের প্রযুক্তি বিজ্ঞান ও প্রযুক্তি বিষয়ক একটি ইউনিকোড কম্পেটিবল বাংলা ফোরাম &quot; class=&quot;hasTip&quot;&gt;আমাদের প্রযুক্তি&lt;/span&gt; ফোরামে এখন একটি টিউটোরিয়াল লিখছি।
</pre>
<p>এখন যদি আপনি আর্টিকেলটা ফ্রন্ট এন্ডে দেখেন তাহলে নিচের ছবির মতো দেখাবে যদি "আমাদের প্রযুক্তি" লেখার উপর মাউস ধরেন।<br />
<img src="http://blog.manchumahara.com/wp-content/uploads/2010/06/tip2.png"  alt="tooltip" /></p>
<p>সব কিছু ঠিক ঠাক মতো হবার জন্য আপনাকে আরো একটা জিনিস চেক করতে হবে আর তা হলো টেমপ্লেট এর template.css ফাইলে এ নিচের মতো করে css কোড যদি না থাকে তাহলে বসিয়ে দিতে হবে।</p>
<pre class="brush: css;">
/* Tooltips */
.tool-tip {
   float: left;
   background: #ffc;
	border: 1px solid #D4D5AA;
   padding: 5px;
   max-width: 200px;
}
.tool-title {
   padding: 0;
   margin: 0;
   font-size: 100%;
   font-weight: bold;
   margin-top: -15px;
   padding-top: 15px;
   padding-bottom: 5px;
   background: url(../images/selector-arrow.png) no-repeat;
}
.tool-text {
   font-size: 100%;
   margin: 0;
}
</pre>
<p>আর templates\system\images  এই লোকেশন থেকে selector-arrow.png এই নামের ফাইলটা কপি করে  আপনার টেমপ্লেট এর ইমেজ(templates\rhuk_milkyway\images) ফোল্ডারে পেস্ট  করতে হবে। চাইলে কাস্টম টেমপ্লেটে একই ভাবে টুলটিপ যুক্ত করা যাবে।</p>
<p>আগামী পর্বে এটার আরো এডভান্সড ফিচার  নিয়ে আলোচনা করবো।</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-474'></div><iframe class="DD_FBLIKE_AJAX_474" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2010/06/13/adding-native-tooptip-in-jooma1-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mark active category in single page(wordpress)</title>
		<link>http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/</link>
		<comments>http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 07:45:04 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[css]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=461</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_461()',5000);window.setTimeout('loadDzone_461()',5000);window.setTimeout('loadTwitter_461()',5000);window.setTimeout('loadFBShare_461()',5000);window.setTimeout('loadFBLike_461()',5000);window.setTimeout('loadDelicious_461()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_461()',5000); }); function loadDigg_461(){ jQuery(document).ready(function($) { $('.dd-digg-461').remove();$('.DD_DIGG_AJAX_461').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&#38;title=Mark+active+category+in+single+page%28wordpress%29');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_461(){ jQuery(document).ready(function($) { $('.dd-dzone-461').remove();$('.DD_DZONE_AJAX_461').attr('width','52');$('.DD_DZONE_AJAX_461').attr('height','68');$('.DD_DZONE_AJAX_461').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&#038;title=Mark+active+category+in+single+page%28wordpress%29&#038;t=1'); }); } function loadTwitter_461(){ jQuery(document).ready(function($) { $('.dd-twitter-461').remove();$('.DD_TWITTER_AJAX_461').attr('width','50');$('.DD_TWITTER_AJAX_461').attr('height','61');$('.DD_TWITTER_AJAX_461').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_461(){ jQuery(document).ready(function($) { $('.dd-fbshare-461').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_461(){ jQuery(document).ready(function($) { $('.dd-fblike-461').remove();$('.DD_FBLIKE_AJAX_461').attr('width','450');$('.DD_FBLIKE_AJAX_461').attr('height','25');$('.DD_FBLIKE_AJAX_461').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&#38;show_faces=false'); }); } function loadDelicious_461(){ jQuery(document).ready(function($) { $('.dd-delicious-461').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_461()',5000);window.setTimeout('loadDzone_461()',5000);window.setTimeout('loadTwitter_461()',5000);window.setTimeout('loadFBShare_461()',5000);window.setTimeout('loadFBLike_461()',5000);window.setTimeout('loadDelicious_461()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_461()',5000); });</script><script type="text/javascript"> function loadDigg_461(){ jQuery(document).ready(function($) { $('.dd-digg-461').remove();$('.DD_DIGG_AJAX_461').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&amp;title=Mark+active+category+in+single+page%28wordpress%29');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_461(){ jQuery(document).ready(function($) { $('.dd-dzone-461').remove();$('.DD_DZONE_AJAX_461').attr('width','52');$('.DD_DZONE_AJAX_461').attr('height','68');$('.DD_DZONE_AJAX_461').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&title=Mark+active+category+in+single+page%28wordpress%29&t=1'); }); } function loadTwitter_461(){ jQuery(document).ready(function($) { $('.dd-twitter-461').remove();$('.DD_TWITTER_AJAX_461').attr('width','50');$('.DD_TWITTER_AJAX_461').attr('height','61');$('.DD_TWITTER_AJAX_461').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_461(){ jQuery(document).ready(function($) { $('.dd-fbshare-461').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_461(){ jQuery(document).ready(function($) { $('.dd-fblike-461').remove();$('.DD_FBLIKE_AJAX_461').attr('width','450');$('.DD_FBLIKE_AJAX_461').attr('height','25');$('.DD_FBLIKE_AJAX_461').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&amp;show_faces=false'); }); } function loadDelicious_461(){ jQuery(document).ready(function($) { $('.dd-delicious-461').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_461').text(msg);}); }); } function loadGBuzz_461(){ jQuery(document).ready(function($) { $('.dd-gbuzz-461').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-461'></div><a class='DiggThisButton DD_DIGG_AJAX_461 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-461'></div><iframe class='DD_DZONE_AJAX_461' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-461'></div><iframe class='DD_TWITTER_AJAX_461' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-461'></div><a class='DD_FBSHARE_AJAX_461' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-461'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/')+'&amp;title='+encodeURIComponent('Mark+active+category+in+single+page%28wordpress%29'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_461'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-461'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/#comments><span class='ctotal'>6</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/#comments></a></div></div></div></div><div style='clear:both'></div><p>I think my post title is not clear and it&#8217;s really not possible to tell every thing in just a simple post title <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> . Ok, I am taking about:<br />
1. WordPress<br />
2. Category menu in wordpress using wp_list_categories()</p>
<p>If you make a wordpress menu using category listing in wordpress then the html code will be like this<span id="more-461"></span></p>
<dl id="attachment_462" class="wp-caption alignnone" style="width: 660px"><dt><a href="http://blog.manchumahara.com/wp-content/uploads/2010/04/current.png"><img class="size-full wp-image-462" title="current" src="http://blog.manchumahara.com/wp-content/uploads/2010/04/current.png" alt="WordPress menu as category list" width="650" height="121" /></a></dt><dd class="wp-caption-text">WordPress menu as category list(click image to see full)</dd></dl>
<p>In the above picture , you see same thing twice , firt one<br />
1. when we are not in any category page(category archive page)<br />
2. when we are in a category archive page , the active category list gets a extra class name &#8220;current-cat&#8221;<br />
<strong>So my post is about when we are browsing any single post how can we mark the the category as &#8220;current-cat&#8221; that post belongs to so that the active category list can be styled using css.</strong></p>
<p>So to do that I got a plugin (please check <a href="http://www.screenshine.net/blog/1474_wordpress-plugin-show-active-category">here</a>) but i am not happy as the plugin put active class for anchor tag&#8230; Please check the plugin code.</p>
<pre class="brush: php;">
function show_active_category($text) {
	global $post;
	if( is_single() ) {
		$categories = wp_get_post_categories($post-&gt;ID);
		foreach( $categories as $catid ) {
			$cat = get_category($catid);
			if(preg_match('#&gt;' . $cat-&gt;name . '&lt;/a&gt;#', $text)) {
				$text = str_replace('&gt;' . $cat-&gt;name . '&lt;/a&gt;', ' class=&quot;active_category&quot;&gt;' . $cat-&gt;name . '&lt;/a&gt;', $text);
			}
		}
	}
	return $text;
}
add_filter('wp_list_categories', 'show_active_category');
</pre>
<p>and here is my version</p>
<pre class="brush: php;">
function show_active_category($text) {
global $post;
if( is_single() ) {
$categories = wp_get_post_categories($post-&gt;ID);
foreach( $categories as $cat )
{
//var_dump($cat);
if(preg_match('#
	&lt;li class=&quot;cat-item cat-item-'.$cat.'&quot;&gt;#', $text))
{
$text = str_replace('&lt;/li&gt;
	&lt;li class=&quot;cat-item cat-item-'.$cat.'&quot;&gt;', '&lt;/li&gt;
	&lt;li class=&quot;cat-item cat-item-'.$cat.' current-cat&quot;&gt;', $text);
}
}
}
return $text;
}
add_filter('wp_list_categories', 'show_active_category');
</pre>
<p>you can put the above your in your functions.php file and no need to install an extra plugin.</p>
<p>That&#8217;s it.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-461'></div><iframe class="DD_FBLIKE_AJAX_461" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2010/04/04/mark-active-category-in-single-pagewordpress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Playing with worpdress permalink</title>
		<link>http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/</link>
		<comments>http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 11:10:40 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Permalink]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[author base]]></category>
		<category><![CDATA[category base]]></category>
		<category><![CDATA[post slug]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[slug]]></category>
		<category><![CDATA[worpdress]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=414</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_414()',5000);window.setTimeout('loadDzone_414()',5000);window.setTimeout('loadTwitter_414()',5000);window.setTimeout('loadFBShare_414()',5000);window.setTimeout('loadFBLike_414()',5000);window.setTimeout('loadDelicious_414()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_414()',5000); }); function loadDigg_414(){ jQuery(document).ready(function($) { $('.dd-digg-414').remove();$('.DD_DIGG_AJAX_414').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&#38;title=Playing+with+worpdress+permalink');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_414(){ jQuery(document).ready(function($) { $('.dd-dzone-414').remove();$('.DD_DZONE_AJAX_414').attr('width','52');$('.DD_DZONE_AJAX_414').attr('height','68');$('.DD_DZONE_AJAX_414').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&#038;title=Playing+with+worpdress+permalink&#038;t=1'); }); } function loadTwitter_414(){ jQuery(document).ready(function($) { $('.dd-twitter-414').remove();$('.DD_TWITTER_AJAX_414').attr('width','50');$('.DD_TWITTER_AJAX_414').attr('height','61');$('.DD_TWITTER_AJAX_414').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_414(){ jQuery(document).ready(function($) { $('.dd-fbshare-414').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_414(){ jQuery(document).ready(function($) { $('.dd-fblike-414').remove();$('.DD_FBLIKE_AJAX_414').attr('width','450');$('.DD_FBLIKE_AJAX_414').attr('height','25');$('.DD_FBLIKE_AJAX_414').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&#38;show_faces=false'); }); } function loadDelicious_414(){ jQuery(document).ready(function($) { $('.dd-delicious-414').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_414()',5000);window.setTimeout('loadDzone_414()',5000);window.setTimeout('loadTwitter_414()',5000);window.setTimeout('loadFBShare_414()',5000);window.setTimeout('loadFBLike_414()',5000);window.setTimeout('loadDelicious_414()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_414()',5000); });</script><script type="text/javascript"> function loadDigg_414(){ jQuery(document).ready(function($) { $('.dd-digg-414').remove();$('.DD_DIGG_AJAX_414').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&amp;title=Playing+with+worpdress+permalink');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_414(){ jQuery(document).ready(function($) { $('.dd-dzone-414').remove();$('.DD_DZONE_AJAX_414').attr('width','52');$('.DD_DZONE_AJAX_414').attr('height','68');$('.DD_DZONE_AJAX_414').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&title=Playing+with+worpdress+permalink&t=1'); }); } function loadTwitter_414(){ jQuery(document).ready(function($) { $('.dd-twitter-414').remove();$('.DD_TWITTER_AJAX_414').attr('width','50');$('.DD_TWITTER_AJAX_414').attr('height','61');$('.DD_TWITTER_AJAX_414').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_414(){ jQuery(document).ready(function($) { $('.dd-fbshare-414').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_414(){ jQuery(document).ready(function($) { $('.dd-fblike-414').remove();$('.DD_FBLIKE_AJAX_414').attr('width','450');$('.DD_FBLIKE_AJAX_414').attr('height','25');$('.DD_FBLIKE_AJAX_414').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&amp;show_faces=false'); }); } function loadDelicious_414(){ jQuery(document).ready(function($) { $('.dd-delicious-414').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_414').text(msg);}); }); } function loadGBuzz_414(){ jQuery(document).ready(function($) { $('.dd-gbuzz-414').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-414'></div><a class='DiggThisButton DD_DIGG_AJAX_414 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-414'></div><iframe class='DD_DZONE_AJAX_414' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-414'></div><iframe class='DD_TWITTER_AJAX_414' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-414'></div><a class='DD_FBSHARE_AJAX_414' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-414'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/')+'&amp;title='+encodeURIComponent('Playing+with+worpdress+permalink'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_414'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-414'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/#comments><span class='ctotal'>2</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/#comments></a></div></div></div></div><div style='clear:both'></div><p>Today I will show how to play with wordpress permalink. If you are just working with a fresh wordpress installation then certainly you need to do some work with wordpress permalink structure. Just check in admin left menu <strong>Settings-&gt;Permalinks</strong><br />
Here is first look of your <em>default</em> permalink structure. Check your post and page url is like:<br />
<span id="more-414"></span><br />
<a href="http://blog.manchumahara.com/wp-content/uploads/2010/01/1.jpg"><img class="aligncenter size-full wp-image-416" title="1" src="http://blog.manchumahara.com/wp-content/uploads/2010/01/1.jpg" alt="wpdefaultpermalink" width="612" height="428" /></a><br />
<code>Post: http://sitename.com/?p=<strong>N</strong>, where N = post id<br />
Page: http://sitename.com/?page_id=<strong>N</strong>, where N = page id<br />
Category: http://sitename.com/?cat=<strong>N</strong> , where N =  category id<br />
Tag: http://sitename.com/?tag=<strong>TAG SLUG</strong>, pls check bellow what is slug<br />
Author:http://sitename.com/?author=<strong>N</strong>, where N = author id</code><br />
<!--more--><br />
Now, let&#8217;s change the permalink structure to any custom format&#8230; here I am choosing the <strong>Month and name</strong> format and see screenshot bellow<br />
<a href="http://blog.manchumahara.com/wp-content/uploads/2010/01/2.jpg"><img class="aligncenter size-full wp-image-417" title="wpcustompermalink" src="http://blog.manchumahara.com/wp-content/uploads/2010/01/2.jpg" alt="wpcustompermalink" width="546" height="83" /></a><br />
Oh, check another thing before and after changing permalink structure,if you are in edit more of any post or page, check bellow the subject box<br />
For default permalink: there is a option &#8220;Change permalinks&#8221;<br />
For custom permalink: there is a option &#8220;Edit&#8221;<br />
Check the screenshot bellow:</p>
<p><a href="http://blog.manchumahara.com/wp-content/uploads/2010/01/3.jpg"><img class="aligncenter size-full wp-image-418" title="wpcustompermalink2" src="http://blog.manchumahara.com/wp-content/uploads/2010/01/3.jpg" alt="wpcustompermalink2" width="570" height="210" /></a></p>
<p>Please check here what we are editing or getting automatic after saving first time(or auto save) the post &#8230; is called <strong>slug</strong> for that article, we use article name alias for joomla same way. if seo enabled in joomla then that alias is used. Ok ,now check after changing permalink to any custom format what happened to all permalinks like posts, page, author, category, tags etc. Let&#8217;s check<br />
Post and Page will get as the screenshot above (example http://localhost/blog/2010/01/playing-with-wordpress-permalinkslug-quick-seo/)<br />
<code><br />
Category: http://localhost/blog/<strong>category</strong>/<em>category slug</em>/<br />
Tag: http://localhost/blog/<strong>tag</strong>/<em>tag slug</em>/<br />
Author: http://localhost/blog/<strong>author</strong>/<em>author username(nick name) is here</em>/<br />
</code><br />
Check here for category,tag, author etc the bold part we are telling base like catgory base, tag base or author base. and the italic part is slug, Sometimes that base is also called slug for simplicity.</p>
<p><strong>Making post link .html</strong><br />
If think you cheked some wordpress site has post link as .html &#8230; more like static and more friend for google .. I mean search engines. No worry, it&#8217;s just easy. Put a .html in the custom permalink format of your post.<br />
Just write this in custom field<br />
<code>/%year%/%monthnum%/%postname%.html</code><br />
and my current blog post url is now<br />
<code>http://localhost/blog/2010/01/playing-with-wordpress-permalinkslug-quick-seo.html</code><br />
<strong>Making the url more short</strong><br />
I think now our url got too long and sometimes that is bad for serach engines. So while we write blog post we can keep the title <strong>long</strong>(not more than 160 may be&#8230; 160 length is good for search engines) but we will edit post or page slug <strong>as short as possible</strong>. That the trick &#8230; taking specially care as  do for your girl friend or your baby.<br />
Oh another way we can make the url short&#8230; let&#8217;s change the permalink again. Let change custom permalink as<br />
<code>/%postname%.html</code><br />
and my post link is more short now<br />
<code>http://localhost/blog/playing-with-wordpress-permalinkslug-quick-seo.html</code><br />
for news site we can use like this<br />
<code><br />
/<strong>newid</strong><em>%post_id%</em>/%postname%.html<br />
now link is like</p>
<p>http://localhost/blog/newid160/playing-with-wordpress-permalinkslug-quick-seo.html</p>
<p></code><br />
So I think we played too much with post permalink and now we know how to change the post permalink as we need. Isn&#8217;t it easy ?</p>
<p><strong>Chaning page link to .html</strong><br />
There is no easy way to change page link .html like post from wordpress but we can do it via a  plugin, acutally wordpress has that support to change permalink for page or others &#8230; so plugin authors can hack easily. To change page link like .html you can use this plugin<a rel="nofollow external" href="http://wordpress.grandslambert.com/plugins/custom-page-extensions.html" target="_blank">Custom Page Extensions</a></p>
<p><strong>Working with Category,Tag and Author base</strong><br />
Let&#8217;s play with category and tag base that is available in wp permalink.</p>
<p><a href="http://blog.manchumahara.com/wp-content/uploads/2010/01/5.jpg"><img class="aligncenter size-full wp-image-419" title="categorytagbase" src="http://blog.manchumahara.com/wp-content/uploads/2010/01/5.jpg" alt="categorytagbase" width="558" height="82" /></a><br />
<code>So now tag link be like<br />
http://localhost/blog/<strong>postbytag</strong>/<em>tag slug</em><br />
Category  link<br />
http://localhost/blog/<strong>topics</strong>/category slug<br />
</code><br />
Hei we are not finished yet. How about removing category base from category permalink ?<br />
let me explain if you don&#8217;t change category base that means default is &#8220;category&#8221; then<br />
<code>http://sitename.com/category/category slug<br />
and for child cateogory<br />
http://sitename.com/category/parent category slug/child category slug</code><br />
and now what I want to do is like bellow<br />
<code><br />
http://sitename.com/category slug<br />
http://sitename.com/child category slug<br />
</code></p>
<p>Yes we can do that I mean remove category base using plugin. I like to use <a rel="external nofollow" href="http://wordpress.org/extend/plugins/no-category-parents/" target="_blank">No category parents</a>. I have tested in a client&#8217;s site and it&#8217;s working fine.</p>
<p>Yap we can change author slig(base actually) too ,,, not remove, just change default author base &#8220;author&#8221; to any custom word like &#8220;blogger&#8221;, &#8220;contributors&#8221; etc.<br />
<code><br />
Old: http://www.sitename.com/<strong>author</strong>/manchupagla/<br />
New: http://www.sitename.com/<strong>contributors</strong>/manchupagla/<br />
</code></p>
<p>For this so many wordpress plugins are available. But I like to use <a rel="external nofollow" href="http://www.microkid.net/wordpress/author-slug/" target="_blank">Author Slug</a>, in codex check <a rel="external nofollow" href="http://wordpress.org/extend/plugins/author-slug/" target="_blank">here</a>. You can search codex for <a rel="external nofollow" href="http://wordpress.org/extend/plugins/search.php?q=Author+slug" target="_blank">such plugins</a>.</p>
<p>Heh heh talked too much today. I will recommend you to use another two plugins</p>
<ul>
<li>One for quick SEO <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">ALL in one SEO</a></li>
<li>For faster loading/caching <a href="http://wordpress.org/extend/plugins/wp-super-cache/" target="_blank">WP Super Cache</a></li>
</ul>
<p>Note: Check this post in bengali in amaderprojukti forum from <a href="http://forum.amaderprojukti.com/viewtopic.php?f=60&amp;t=4999&amp;p=42461#p42461" target="_blank">here</a>.</p>
<p>thank you for having patience to read this blog. Don&#8217;t forget to click share in social network and I like donation(check right col donation box <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-414'></div><iframe class="DD_FBLIKE_AJAX_414" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2010/01/17/playing-with-worpdress-permalink/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix wordpress plugin &#8220;GT post approval&#8221;</title>
		<link>http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/</link>
		<comments>http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 07:53:08 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpres plugin]]></category>
		<category><![CDATA[wp custom column]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_413()',5000);window.setTimeout('loadDzone_413()',5000);window.setTimeout('loadTwitter_413()',5000);window.setTimeout('loadFBShare_413()',5000);window.setTimeout('loadFBLike_413()',5000);window.setTimeout('loadDelicious_413()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_413()',5000); }); function loadDigg_413(){ jQuery(document).ready(function($) { $('.dd-digg-413').remove();$('.DD_DIGG_AJAX_413').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&#38;title=Fix+wordpress+plugin+%22GT+post+approval%22');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_413(){ jQuery(document).ready(function($) { $('.dd-dzone-413').remove();$('.DD_DZONE_AJAX_413').attr('width','52');$('.DD_DZONE_AJAX_413').attr('height','68');$('.DD_DZONE_AJAX_413').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&#038;title=Fix+wordpress+plugin+%22GT+post+approval%22&#038;t=1'); }); } function loadTwitter_413(){ jQuery(document).ready(function($) { $('.dd-twitter-413').remove();$('.DD_TWITTER_AJAX_413').attr('width','50');$('.DD_TWITTER_AJAX_413').attr('height','61');$('.DD_TWITTER_AJAX_413').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_413(){ jQuery(document).ready(function($) { $('.dd-fbshare-413').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_413(){ jQuery(document).ready(function($) { $('.dd-fblike-413').remove();$('.DD_FBLIKE_AJAX_413').attr('width','450');$('.DD_FBLIKE_AJAX_413').attr('height','25');$('.DD_FBLIKE_AJAX_413').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&#38;show_faces=false'); }); } function loadDelicious_413(){ jQuery(document).ready(function($) { $('.dd-delicious-413').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_413()',5000);window.setTimeout('loadDzone_413()',5000);window.setTimeout('loadTwitter_413()',5000);window.setTimeout('loadFBShare_413()',5000);window.setTimeout('loadFBLike_413()',5000);window.setTimeout('loadDelicious_413()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_413()',5000); });</script><script type="text/javascript"> function loadDigg_413(){ jQuery(document).ready(function($) { $('.dd-digg-413').remove();$('.DD_DIGG_AJAX_413').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&amp;title=Fix+wordpress+plugin+%22GT+post+approval%22');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_413(){ jQuery(document).ready(function($) { $('.dd-dzone-413').remove();$('.DD_DZONE_AJAX_413').attr('width','52');$('.DD_DZONE_AJAX_413').attr('height','68');$('.DD_DZONE_AJAX_413').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&title=Fix+wordpress+plugin+%22GT+post+approval%22&t=1'); }); } function loadTwitter_413(){ jQuery(document).ready(function($) { $('.dd-twitter-413').remove();$('.DD_TWITTER_AJAX_413').attr('width','50');$('.DD_TWITTER_AJAX_413').attr('height','61');$('.DD_TWITTER_AJAX_413').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_413(){ jQuery(document).ready(function($) { $('.dd-fbshare-413').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_413(){ jQuery(document).ready(function($) { $('.dd-fblike-413').remove();$('.DD_FBLIKE_AJAX_413').attr('width','450');$('.DD_FBLIKE_AJAX_413').attr('height','25');$('.DD_FBLIKE_AJAX_413').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&amp;show_faces=false'); }); } function loadDelicious_413(){ jQuery(document).ready(function($) { $('.dd-delicious-413').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_413').text(msg);}); }); } function loadGBuzz_413(){ jQuery(document).ready(function($) { $('.dd-gbuzz-413').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-413'></div><a class='DiggThisButton DD_DIGG_AJAX_413 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-413'></div><iframe class='DD_DZONE_AJAX_413' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-413'></div><iframe class='DD_TWITTER_AJAX_413' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-413'></div><a class='DD_FBSHARE_AJAX_413' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-413'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/')+'&amp;title='+encodeURIComponent('Fix+wordpress+plugin+%22GT+post+approval%22'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_413'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-413'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/#comments><span class='ctotal'>1</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/#comments></a></div></div></div></div><div style='clear:both'></div><p>Hello! 2010 is just knocking at door <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  .Hope to write lots of blog with my day2day thinking, learning and the problems I face every day.</p>
<p>Let me clear about this blog post: I think, you know that in wordpress we can add new coasdl in posts listing area. Check the bellow image of my post edit panel/listing(http://(yoursitename)/wp-admin/edit.php)<br />
<span id="more-413"></span><br />
<img class="aligncenter size-full wp-image-411" title="editpanel1" src="http://blog.manchumahara.com/wp-content/uploads/2009/12/editpanel1.png" alt="" width="395" height="247" /></p>
<p>If you check the plugin there is an extra col named GT Status. It&#8217;s here because I have installed the plugin <a rel="external nofollow" href="http://www.gt-globalwarming-awareness2007.org/wordpress/gt-post-approval-for-gt-globalwarming-awareness2007-wordpress-plugin/" target="_blank">GT-post-approval</a>. Check this in wordpress plugin repository from <a rel="external nofollow" href="http://wordpress.org/extend/plugins/gt-post-approval/" target="_blank">here</a>. Cool na ?  Let me show another screenshot after enabling another nice plugin named &#8220;<a rel="external nofollow" href="http://sivel.net/wordpress/simply-show-ids/" target="_blank">Simply Show IDs&#8221;</a>. Check that plugin wordpress plugin repository from <a rel="external nofollow" href="http://wordpress.org/extend/plugins/simply-show-ids/" target="_blank">here</a>. This plugin will add another extra col to show any post id so that we(at least normal blog user who doesn&#8217;t know how to pick post id) can  pick post id easily. Actually this plugin does</p>
<blockquote><p>&#8220;Simply shows the ID of Posts, Pages, Media, Links, Categories, Tags and Users in the admin tables for easy access. Very lightweight.&#8221;</p></blockquote>
<p><img class="aligncenter size-full wp-image-412" title="editpanel2" src="http://blog.manchumahara.com/wp-content/uploads/2009/12/editpanel2.png" alt="" width="481" height="219" />Check there are two extra col now.. ignore the blug arrow and messed up id with text &#8220;Reject&#8221;. Let me now explain why this messed up&#8230;<br />
<!--more--></p>
<h4>Conflict between &#8220;GT-post-approval&#8221; and &#8220;Simply show ids&#8221;</h4>
<p>Actually it&#8217;s not conflict but bug og gt-post-approval plugin(<em>latest Version: 0.3 b0.3</em>). let me show how it&#8217;s hooking the post edit extra col. check near line 113.</p>
<pre class="brush: php;">
// If current user is admin or editor
		if(current_user_can('edit_others_posts')){
			// Add the GT Status column
			add_filter('manage_posts_columns', 'gt_column');
			// Set the global array with the structure post_ID =&gt; gt_status, ...
			add_filter('the_posts', 'gt_post2status');
			// For each post in edit.php add a button approve/reject
			add_filter('manage_posts_custom_column', 'gt_return_status');
			// Add a CSS to emphasize the button approve
			add_filter('admin_head', 'gt_emphasize_to_aprove');
</pre>
<p>here I will highlight this filter function</p>
<pre class="brush: plain;">
// For each post in edit.php add a button approve/reject
add_filter('manage_posts_custom_column', 'gt_return_status');
</pre>
<p>Before I advance please in wordpress codex about <a rel="external nofollow" href="http://codex.wordpress.org/Function_Reference/add_filter" target="_blank">add_filter</a> and manage_posts_custom_column(no complete codex page yet but see <a rel="external nofollow" href="http://codex.wordpress.org/Plugin_API/Filter_Reference" target="_blank">this page</a> for all filter/hook functions)<br />
add_filter usage is like</p>
<pre class="brush: php;">
&lt;?php add_filter( $tag, $function_to_add, $priority, $accepted_args ); ?&gt;
</pre>
<p>check the last param $accepted_args. it&#8217;s definition is<br />
<em>(integer) (optional) The number of arguments the function(s) accept(s). In WordPress 1.5.1 and newer. hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run.<br />
Default: 1</em></p>
<p>So using this filter add_filter(&#8216;manage_posts_custom_column&#8217;, &#8216;gt_return_status&#8217;);   gt approve passed only one argument. But the hook manage_posts_custom_column action  takes two parameter , column name and post id. here is gt approve plugin&#8217;s gt-return_status function</p>
<pre class="brush: plain;">
// Print a button approve/reject for the current post
function gt_return_status(){
	global $id, $post_gt_aproved;
	// If current post is approved (see gt_post2status() function)
	if($post_gt_aproved[$id])
		echo &quot;&lt;a href='edit.php?gt_reject=$id&amp;amp;$_SERVER[QUERY_STRING]' class='edit'&gt;&quot;.__('Reject').'&lt;/a&gt;';
		// Note: I use also the query string for an easy redirect in the gt_redirect_after_change() function
	else
		echo &quot;&lt;a href='edit.php?gt_approve=$id&amp;amp;$_SERVER[QUERY_STRING]' class='edit gtaprove'&gt;&quot;.__('Approve').'&lt;/a&gt;';
}
</pre>
<p>that means it&#8217;s doesn&#8217;t handle with column name and this function is called each time an unknown column is triggered and messed up with other plugin which works with extra column &#8230;. grrr. The funny thing is that plugin I mean the function gt_return_status() handle the post id in tricky way&#8230;. Please don&#8217;t get me wrong.. that plugin works great and prefectly but I am just trying to improve it.</p>
<p>This is how i modified that plugin<br />
changing hook so that it takes two parameter and also priority is set</p>
<pre class="brush: php;">
// For each post in edit.php add a button approve/reject
add_filter('manage_posts_custom_column', 'gt_return_status',10, 2);
function gt_return_status($cname,$id){
	global $post_gt_aproved;
	if ($cname == 'gt_column'){
		// If current post is approved (see gt_post2status() function)
		if($post_gt_aproved[$id]){
			echo '&lt;a href=&quot;edit.php?gt_reject='.$id.'&amp;amp;'.$_SERVER['QUERY_STRING'].'&quot; class=&quot;edit&quot;&gt;'.__('Reject').'&lt;/a&gt;';
			// Note: I use also the query string for an easy redirect in the gt_redirect_after_change() function
		}
		else{
			echo '&lt;a href=&quot;edit.php?gt_approve='.$id.'&amp;amp;'.$_SERVER['QUERY_STRING'].'&quot; class=&quot;edit gtaprove&quot;&gt;'.__('Approve').'&lt;/a&gt;';
		}
	}
}
</pre>
<p>Here is my total modification about this plugin.</p>
<pre class="brush: plain;">
&lt;?php
/*
Plugin Name: GT Post Approval 0.3 Beta
Plugin URI: http://www.gt-globalwarming-awareness2007.org/wordpress/gt-post-approval-for-gt-globalwarming-awareness2007-wordpress-plugin/
Description: Add Approve/Reject buttoms visible just for administrators and editors in &lt;a href='edit.php'&gt;edit &gt; posts&lt;/a&gt;. Go to &lt;a href='options-general.php?page=gt-post-approval.php'&gt;Options &gt; Approval&lt;/a&gt; to choose where display not approved posts
Version: 0.3 b0.3
Author: Francesco Terenzani
Author URI: http://www.terenzani.it/
*/
//
// Self extension
//
if(function_exists('is_tag'))
	add_filter('gt_areas', 'gt_self_extension');
function gt_self_extension($array){
	$array['is_tag'] = 'Tags archive';
	return $array;
}
//
// Installation
//
// On activation of the plugin launch the install_gt_post_approval function below
register_activation_hook(__FILE__, 'install_gt_post_approval');
// Change the wp_posts table
function install_gt_post_approval(){
	global $wpdb;
	// If gt_status column do not exist
	if($wpdb-&gt;get_var(&quot;SHOW COLUMNS FROM $wpdb-&gt;posts LIKE 'gt_status'&quot;) != 'gt_status'){
		// Step 1, add gt_status column and set every post as approved (value 1)
		$wpdb-&gt;query(&quot;ALTER TABLE $wpdb-&gt;posts ADD gt_status INT( 1 ) NOT NULL DEFAULT '1'&quot;);
		// Step 2, change the default value of gt_status. New posts have to be approved
		$wpdb-&gt;query(&quot;ALTER TABLE $wpdb-&gt;posts CHANGE gt_status gt_status INT( 1 ) NOT NULL DEFAULT '0'&quot;);
	}
	// Unhelpful optiomisation <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
	add_option('gt_opt', 'empty', '', 'no');
	// Set default options
	$_POST['gt-form'] = true;
	$_POST['is_'] = array('is_author' =&gt; true, 'is_search' =&gt; true, 'is_single' =&gt; true);
	$_POST['gt-level'] = 10;
	gt_save_options();
}
//
// The_Loop
//
// Change the where clause from the wp_query class using the show_only_gt_approved function below
add_filter('posts_where', 'show_only_gt_approved');
// Show only GT Approved posts
// Disable the filter in admin area, in single page and in user defined areas
function show_only_gt_approved($where){
	if(is_admin() || is_page() || is_custom_defined() )
		return $where;
	return 'AND gt_status = 1 '.$where;
}
// Return true if we are in a user defined page of wordpress
// I feel this function very cool <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />
function is_custom_defined(){
	$callback = get_option('gt_opt_callback');
	if(is_array($callback)){
		do
			if(call_user_func(current($callback)))
				return true;
		while(next($callback));
	}
	return false;
}
//
// Optimisation
//
// Set the global array $post_gt_aproved with the structure: [post_ID] =&gt; gt_status
// I use it to know the gt_status without any other query
function gt_post2status($post_query_results){
	global $post_gt_aproved;
	$post_gt_aproved = array();
	for($i = 0, $j = count($post_query_results); $i &lt; $j; $i++)
		$post_gt_aproved[$post_query_results[$i]-&gt;ID] = $post_query_results[$i]-&gt;gt_status;
	return $post_query_results;
}
//
// Administration
//
// Change the admin area wp-admin/edit.php if current user is admin or editor
if(is_admin()){
	add_filter('init', 'gt_admin_status');
	function gt_admin_status(){
		global $wpdb;
		// If current user is admin or editor
		if(current_user_can('edit_others_posts')){
			// Add the GT Status column
			add_filter('manage_posts_columns', 'gt_column');
			// Set the global array with the structure post_ID =&gt; gt_status, ...
			add_filter('the_posts', 'gt_post2status');
			// For each post in edit.php add a button approve/reject
			add_filter('manage_posts_custom_column', 'gt_return_status',10, 2);
			// Add a CSS to emphasize the button approve
			add_filter('admin_head', 'gt_emphasize_to_aprove');
			// On click of approve/reject change the status in the database (value 1 -&gt; approved/0 -&gt; rejected)
			if(isset($_GET['gt_reject']) &amp;&amp; is_numeric($_GET['gt_reject'])){
				$wpdb-&gt;query(&quot;UPDATE $wpdb-&gt;posts SET gt_status = 0 WHERE ID = $_GET[gt_reject]&quot;);
				gt_redirect_after_change();
			}
			elseif(isset($_GET['gt_approve']) &amp;&amp; is_numeric($_GET['gt_approve'])){
				$wpdb-&gt;query(&quot;UPDATE $wpdb-&gt;posts SET gt_status = 1 WHERE ID = $_GET[gt_approve]&quot;);
				gt_redirect_after_change();
			}
		}
		// Auto approve a post if current user level is greater then X
		add_filter('wp_insert_post', 'gt_auto_approve');
	}
}
// Add the GT Status column
function gt_column($array){
	$array['gt_column'] = _('Post Status');
	return $array;
}
// Action function arguments: column name, post ID.
// Print a button approve/reject for the current post
function gt_return_status($cname,$id){
	global $post_gt_aproved;
	if ($cname == 'gt_column'){
		// If current post is approved (see gt_post2status() function)
		if($post_gt_aproved[$id]){
			echo '&lt;a href=&quot;edit.php?gt_reject='.$id.'&amp;amp;'.$_SERVER['QUERY_STRING'].'&quot; class=&quot;edit&quot;&gt;'.__('Reject').'&lt;/a&gt;';
			// Note: I use also the query string for an easy redirect in the gt_redirect_after_change() function
		}
		else{
			echo '&lt;a href=&quot;edit.php?gt_approve='.$id.'&amp;amp;'.$_SERVER['QUERY_STRING'].'&quot; class=&quot;edit gtaprove&quot;&gt;'.__('Approve').'&lt;/a&gt;';
		}
	}
}
// Redirect after change GT Status
function gt_redirect_after_change(){
	header('Location: '.preg_replace(&quot;/gt_(?:reject|approve)=[0-9]+[&amp;]?/&quot;, '', $_SERVER['REQUEST_URI']));
	exit();
}
// CSS for admin area
function gt_emphasize_to_aprove(){
?&gt;
	&lt;style type='text/css'&gt;.gtaprove{background:#adf;font-weight:bold}&lt;/style&gt;
&lt;?php
}
// Auto approve a post if current user level is greater then X
function gt_auto_approve($post_id){
	global $wpdb;
	if($_POST['post_status'] == 'publish' &amp;&amp; $_POST['prev_status'] != $_POST['post_status']){
		$level = get_option('gt_opt');
		$level = $level['gt-level'];
		if($level &gt; 0)
			if(current_user_can(&quot;level_$level&quot;))
				$wpdb-&gt;query(&quot;UPDATE $wpdb-&gt;posts SET gt_status = 1 WHERE ID = $post_id&quot;);
	}
}
//
// Options
//
function gt_add_options_page(){
	add_options_page('GT Post Approval', 'Approval', 10, 'gt-post-approval.php', 'gt_options_page');
}
add_filter('admin_menu','gt_add_options_page');
function gt_options_page(){
	// On submit save options
	gt_save_options();
	$options = get_option('gt_opt');
	// Options checked are here
	$checked =&amp; $options['is_'];
	$registered_inputs = gt_get_registered_options();
?&gt;
	&lt;div class=&quot;wrap&quot;&gt;
		&lt;h2&gt;GT Post Approval&lt;/h2&gt;
		&lt;form method='post' action='?&lt;?php echo $_SERVER['QUERY_STRING']?&gt;'&gt;
		&lt;fieldset class=&quot;options&quot;&gt;
			&lt;legend&gt;Not approved posts are visible just in: &lt;/legend&gt;
			&lt;?php foreach($registered_inputs as $input_name =&gt; $description){
				$checked[$input_name] = ($checked[$input_name]) ? 'checked=&quot;checked&quot;' : null;
				echo &lt;&lt;&lt;CODE
					&lt;p&gt;
						&lt;label for=&quot;is_[$input_name]&quot;&gt;
							&lt;input type='checkbox' id=&quot;is_[$input_name]&quot; name=&quot;is_[$input_name]&quot; $checked[$input_name] /&gt; $description
						&lt;/label&gt;
					&lt;/p&gt;
CODE;
			} ?&gt;
		&lt;/fieldset&gt;
		&lt;fieldset class=&quot;options&quot;&gt;
			&lt;legend&gt;Auto approve posts if current user level is: &lt;/legend&gt;
			&lt;p&gt;&lt;label for='gt-level'&gt;Range 0-10:
				&lt;input type=&quot;text&quot; size='2' id='gt-level' name='gt-level' value='&lt;?php echo $options['gt-level'] ?&gt;' /&gt;&lt;/label&gt;
				&lt;br /&gt;&lt;em&gt;0 or empty value to reject every post by default.&lt;/em&gt;&lt;/p&gt;
			&lt;p class='submit'&gt;
				&lt;input type='submit' name='gt-form' value='Update Options &amp;raquo;' /&gt;
				&lt;input type='hidden' name='gt-form' value='1' /&gt;
			&lt;/p&gt;
		&lt;/fieldset&gt;
		&lt;/form&gt;
	&lt;/div&gt;
&lt;?php
}
function gt_save_options(){
	if(isset($_POST['gt-form'])){
		$registered_callbacks = gt_get_registered_options();
		if(is_array($_POST['is_']))
			foreach($_POST['is_'] as $is_what =&gt; $on)
				if($on &amp;&amp; $registered_callbacks[$is_what])
					// I will run this functions in is_custom_defined()
					$callback[] = $is_what;
		update_option( 'gt_opt_callback', $callback );
		update_option( 'gt_opt', array( 'is_' =&gt; $_POST['is_'], 'gt-level' =&gt; gt_get_option_level() ) );
	}
}
function gt_get_registered_options(){
	return apply_filters('gt_areas', array ('is_author' =&gt; 'Author\'s archive', 'is_search' =&gt; 'Search results', 'is_feed' =&gt; 'Feeds', 'is_date' =&gt; 'Post per data archive', 'is_single' =&gt; 'Single post page'));
}
function gt_get_option_level(){
	if( is_numeric( $_POST['gt-level']) ){
		if ( $_POST['gt-level'] &gt; 10 )
			return 10;
		if ( $_POST['gt-level'] &lt; 0 )
			return 0;
		return $_POST['gt-level'];
	}
	return 0;
}
?&gt;
</pre>
<p>Here you will get a great discussion about managing custom column in post edit screen. <a rel="external nofollow" href="http://scompt.com/blog/archives/2007/10/20/adding-custom-columns-to-the-wordpress-manage-posts-screen" target="_blank">have a look please</a>.</p>
<p>Good news I am coming with my own plugin about this concept of custom column in diff edit screen like posts, pages, tags etc. I think my plugin will increase usability in those places.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-413'></div><iframe class="DD_FBLIKE_AJAX_413" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2009/12/29/fix-wordpress-plugin-gt-post-approval/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix wp plugin &#8220;Post and Page Excerpt Widgets&#8221;</title>
		<link>http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/</link>
		<comments>http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 07:53:52 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[query_posts]]></category>
		<category><![CDATA[widget]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_405()',5000);window.setTimeout('loadDzone_405()',5000);window.setTimeout('loadTwitter_405()',5000);window.setTimeout('loadFBShare_405()',5000);window.setTimeout('loadFBLike_405()',5000);window.setTimeout('loadDelicious_405()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_405()',5000); }); function loadDigg_405(){ jQuery(document).ready(function($) { $('.dd-digg-405').remove();$('.DD_DIGG_AJAX_405').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&#38;title=Fix+wp+plugin+%22Post+and+Page+Excerpt+Widgets%22+not+to+break+conditional+tag');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_405(){ jQuery(document).ready(function($) { $('.dd-dzone-405').remove();$('.DD_DZONE_AJAX_405').attr('width','52');$('.DD_DZONE_AJAX_405').attr('height','68');$('.DD_DZONE_AJAX_405').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&#038;title=Fix+wp+plugin+%22Post+and+Page+Excerpt+Widgets%22+not+to+break+conditional+tag&#038;t=1'); }); } function loadTwitter_405(){ jQuery(document).ready(function($) { $('.dd-twitter-405').remove();$('.DD_TWITTER_AJAX_405').attr('width','50');$('.DD_TWITTER_AJAX_405').attr('height','61');$('.DD_TWITTER_AJAX_405').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_405(){ jQuery(document).ready(function($) { $('.dd-fbshare-405').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_405(){ jQuery(document).ready(function($) { $('.dd-fblike-405').remove();$('.DD_FBLIKE_AJAX_405').attr('width','450');$('.DD_FBLIKE_AJAX_405').attr('height','25');$('.DD_FBLIKE_AJAX_405').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&#38;show_faces=false'); }); } function loadDelicious_405(){ jQuery(document).ready(function($) { $('.dd-delicious-405').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_405()',5000);window.setTimeout('loadDzone_405()',5000);window.setTimeout('loadTwitter_405()',5000);window.setTimeout('loadFBShare_405()',5000);window.setTimeout('loadFBLike_405()',5000);window.setTimeout('loadDelicious_405()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_405()',5000); });</script><script type="text/javascript"> function loadDigg_405(){ jQuery(document).ready(function($) { $('.dd-digg-405').remove();$('.DD_DIGG_AJAX_405').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&amp;title=Fix+wp+plugin+%22Post+and+Page+Excerpt+Widgets%22+not+to+break+conditional+tag');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_405(){ jQuery(document).ready(function($) { $('.dd-dzone-405').remove();$('.DD_DZONE_AJAX_405').attr('width','52');$('.DD_DZONE_AJAX_405').attr('height','68');$('.DD_DZONE_AJAX_405').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&title=Fix+wp+plugin+%22Post+and+Page+Excerpt+Widgets%22+not+to+break+conditional+tag&t=1'); }); } function loadTwitter_405(){ jQuery(document).ready(function($) { $('.dd-twitter-405').remove();$('.DD_TWITTER_AJAX_405').attr('width','50');$('.DD_TWITTER_AJAX_405').attr('height','61');$('.DD_TWITTER_AJAX_405').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_405(){ jQuery(document).ready(function($) { $('.dd-fbshare-405').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_405(){ jQuery(document).ready(function($) { $('.dd-fblike-405').remove();$('.DD_FBLIKE_AJAX_405').attr('width','450');$('.DD_FBLIKE_AJAX_405').attr('height','25');$('.DD_FBLIKE_AJAX_405').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&amp;show_faces=false'); }); } function loadDelicious_405(){ jQuery(document).ready(function($) { $('.dd-delicious-405').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_405').text(msg);}); }); } function loadGBuzz_405(){ jQuery(document).ready(function($) { $('.dd-gbuzz-405').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-405'></div><a class='DiggThisButton DD_DIGG_AJAX_405 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-405'></div><iframe class='DD_DZONE_AJAX_405' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-405'></div><iframe class='DD_TWITTER_AJAX_405' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-405'></div><a class='DD_FBSHARE_AJAX_405' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-405'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/')+'&amp;title='+encodeURIComponent('Fix+wp+plugin+%22Post+and+Page+Excerpt+Widgets%22+not+to+break+conditional+tag'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_405'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-405'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/#respond><span class='ctotal'>0</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/#respond></a></div></div></div></div><div style='clear:both'></div><p><a rel="external nofollow" href="http://sillybean.net/code/wordpress/post-and-page-excerpt-widgets/" target="_blank">Post and Page Excerpt Widgets</a> is a nice plugin to show post/page excerpt as as widget in sidebar position. You can download it from wp code from <a rel="external nofollow" href="http://wordpress.org/extend/plugins/post-and-page-excerpt-widgets/" target="_blank">here</a>. One I thing I noticed about this plugin is it has a common bug that I faced many times while using <a rel="external nofollow" href="http://codex.wordpress.org/Template_Tags/query_posts" target="_blank">query_posts</a>. When I use this query_posts it&#8217;s break some conditional loop like is_home(), is_category() etc but there is another function <a rel="external nofollow" href="http://codex.wordpress.org/Template_Tags/get_posts" target="_blank">get_posts</a> in wordpress that does the same thing but don&#8217;t have similar problem. Once I discussed about this problem in one of my old posts. Please check that posts for better sense from here <a rel="internal follow" href="http://blog.manchumahara.com/2009/03/15/is_home-is_single-is_category-is-not-working-in-wp/" target="_blank">is_home-is_single-is_category-is-not-working-in-wp!</a>.</p>
<p>Let me focus to this writing again <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
As Post and Page Excerpt Widgets is using the query_posts function for custom query it make&#8217;s problem for conditional tags. Let me show u solution and it&#8217;s like my that posts.<br />
In you theme functions.php add a new function if not exists yet</p>
<p><span id="more-405"></span></p>
<pre class="brush: php;">
 function php4_clone($object) {
  	if (version_compare(phpversion(), '5.0') &lt; 0) {
   		return $object;
  	} else {
   		return @clone($object);
  	}
 }
</pre>
<p><!--more--></p>
<p>Now open the plugin file page-and-post-excerpt-widgets.php  and search for string &#8220;query_posts&#8221;. I think you should find matching in two places. Let&#8217;s take care of them now.<br />
before that line 		query_posts(&#8216;page_id=&#8217;.$page_ID);<br />
add this line</p>
<pre class="brush: php;">
$query_backup = php4_clone($GLOBALS['wp_query']);
</pre>
<p>and after the while look that means<br />
after this line endwhile;  add</p>
<pre class="brush: php;">
$GLOBALS['wp_query'] = $query_backup;
</pre>
<p>Do same thing for both matching. That will save u for not breaking any conditional tags like is_home() etc in your theme. I think wordpress should include such seucurity in core query_posts function so that it does not break the default wordpress&#8217;s <a rel="external nofollow" href="http://codex.wordpress.org/The_Loop" target="_blank"><strong>The Loop</strong></a>.</p>
<p>Sometimes I can not find that why <a rel="external nofollow" href="http://codex.wordpress.org/Conditional_Tags" target="_blank">wordpress conditional tag</a> is not working in my theme and that makes me really crazy !</p>
<p>Guys if you find this post help full then please take care the large social bookmark icon bellow <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-405'></div><iframe class="DD_FBLIKE_AJAX_405" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2009/12/25/fix-wp-plugin-post-and-page-excerpt-widgets-not-to-break-conditional-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home made tab and slider module for joomla1.5</title>
		<link>http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/</link>
		<comments>http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 17:34:52 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Joomla Extention]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[joomla module]]></category>
		<category><![CDATA[joomlatab module]]></category>
		<category><![CDATA[js]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=400</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_400()',5000);window.setTimeout('loadDzone_400()',5000);window.setTimeout('loadTwitter_400()',5000);window.setTimeout('loadFBShare_400()',5000);window.setTimeout('loadFBLike_400()',5000);window.setTimeout('loadDelicious_400()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_400()',5000); }); function loadDigg_400(){ jQuery(document).ready(function($) { $('.dd-digg-400').remove();$('.DD_DIGG_AJAX_400').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&#38;title=Home+made+tab+and+slider+module+for+joomla1.5');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_400(){ jQuery(document).ready(function($) { $('.dd-dzone-400').remove();$('.DD_DZONE_AJAX_400').attr('width','52');$('.DD_DZONE_AJAX_400').attr('height','68');$('.DD_DZONE_AJAX_400').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&#038;title=Home+made+tab+and+slider+module+for+joomla1.5&#038;t=1'); }); } function loadTwitter_400(){ jQuery(document).ready(function($) { $('.dd-twitter-400').remove();$('.DD_TWITTER_AJAX_400').attr('width','50');$('.DD_TWITTER_AJAX_400').attr('height','61');$('.DD_TWITTER_AJAX_400').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_400(){ jQuery(document).ready(function($) { $('.dd-fbshare-400').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_400(){ jQuery(document).ready(function($) { $('.dd-fblike-400').remove();$('.DD_FBLIKE_AJAX_400').attr('width','450');$('.DD_FBLIKE_AJAX_400').attr('height','25');$('.DD_FBLIKE_AJAX_400').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&#38;show_faces=false'); }); } function loadDelicious_400(){ jQuery(document).ready(function($) { $('.dd-delicious-400').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_400()',5000);window.setTimeout('loadDzone_400()',5000);window.setTimeout('loadTwitter_400()',5000);window.setTimeout('loadFBShare_400()',5000);window.setTimeout('loadFBLike_400()',5000);window.setTimeout('loadDelicious_400()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_400()',5000); });</script><script type="text/javascript"> function loadDigg_400(){ jQuery(document).ready(function($) { $('.dd-digg-400').remove();$('.DD_DIGG_AJAX_400').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&amp;title=Home+made+tab+and+slider+module+for+joomla1.5');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_400(){ jQuery(document).ready(function($) { $('.dd-dzone-400').remove();$('.DD_DZONE_AJAX_400').attr('width','52');$('.DD_DZONE_AJAX_400').attr('height','68');$('.DD_DZONE_AJAX_400').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&title=Home+made+tab+and+slider+module+for+joomla1.5&t=1'); }); } function loadTwitter_400(){ jQuery(document).ready(function($) { $('.dd-twitter-400').remove();$('.DD_TWITTER_AJAX_400').attr('width','50');$('.DD_TWITTER_AJAX_400').attr('height','61');$('.DD_TWITTER_AJAX_400').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_400(){ jQuery(document).ready(function($) { $('.dd-fbshare-400').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_400(){ jQuery(document).ready(function($) { $('.dd-fblike-400').remove();$('.DD_FBLIKE_AJAX_400').attr('width','450');$('.DD_FBLIKE_AJAX_400').attr('height','25');$('.DD_FBLIKE_AJAX_400').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&amp;show_faces=false'); }); } function loadDelicious_400(){ jQuery(document).ready(function($) { $('.dd-delicious-400').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_400').text(msg);}); }); } function loadGBuzz_400(){ jQuery(document).ready(function($) { $('.dd-gbuzz-400').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-400'></div><a class='DiggThisButton DD_DIGG_AJAX_400 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-400'></div><iframe class='DD_DZONE_AJAX_400' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-400'></div><iframe class='DD_TWITTER_AJAX_400' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-400'></div><a class='DD_FBSHARE_AJAX_400' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-400'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/')+'&amp;title='+encodeURIComponent('Home+made+tab+and+slider+module+for+joomla1.5'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_400'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-400'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/#comments><span class='ctotal'>50</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/#comments></a></div></div></div></div><div style='clear:both'></div><h4>Change Log:</h4>
<p><strong>Update 14, January, 2010</strong></p>
<p>WOW, This extension has been approved by JED Team. <a href="http://extensions.joomla.org/extensions/style-a-design/tabs-a-slides/11018">Pls visit it and place you rating</a>.</p>
<p><strong>Update 8, June, 2010(Must see)</strong></p>
<ul>
<li>Fixed a bug for php error, it was a typo error</li>
<li>Transition parameter was missing for slider, it&#8217;s fixed now</li>
<li>Download file is updated! Please reinstall or update the files only. Changes are in the mod_simplejoomlatabslider.xml, mod_simplejoomlatabslider.php and helper.php file</li>
</ul>
<p><img class="alignleft size-full wp-image-401" title="tab" src="http://blog.manchumahara.com/wp-content/uploads/2009/12/tab.png" alt="tab" width="265" height="268" />If you check joomla1.5.x backend(joomla1.x had same)  in any component or module configuration the right col accordian slider is common. In some components u should see tab too.To make such  tab and slider is just so easy !</p>
<p>I think you are thinking about my post title, why I used the words &#8220;home made&#8221;. Because I am going to show you how u can make such a tab/slider module for front end just using joomla own resource. Joomla gives some execillent api to make html grid, tab, slider etc within a moment. <a href="http://api.joomla.org/Joomla-Framework/HTML/JPane.html" target="_blank">JPane</a> is such an api to make tab and slider. <a href="http://docs.joomla.org/How_to_use_the_JPane_classes_in_a_component" target="_blank">Here</a> you will get some code example about how to make tab using JPane.</p>
<p><span id="more-400"></span></p>
<pre class="brush: php;">
jimport('joomla.html.pane');
//1st Parameter: Specify 'tabs' as appearance
//2nd Parameter: Starting with third tab as the default (zero based index)
//open one!
$pane = &amp;JPane::getInstance('tabs', array('startOffset'=&gt;2));
echo $pane-&gt;startPane( 'pane' );
echo $pane-&gt;startPanel( 'Example Panel 1', 'panel1' );
echo &quot;This is panel1&quot;;
echo $pane-&gt;endPanel();
echo $pane-&gt;startPanel( 'Example Panel 2', 'panel2' );
echo &quot;This is panel2&quot;;
echo $pane-&gt;endPanel();
echo $pane-&gt;startPanel( 'Example Panel 3', 'panel3' );
echo &quot;This is panel3&quot;;
echo $pane-&gt;endPanel();
echo $pane-&gt;endPane();
</pre>
<p>note: I thinkf or editor problem sample code may be mseesed up but the download module is ok <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you check this line<br />
$pane = &#038;JPane::getInstance(&#8216;tabs&#8217;, array(&#8216;startOffset&#8217;= &gt;2));<br />
here first parameter is about making tab, If you want to make slider then use like this<br />
$pane = &#038;JPane::getInstance(&#8216;sliders&#8217;, array(&#8216;startOffset&#8217;= &gt;2));<br />
startOffset should be 0 for normal uses. For quick access just check the file \jtest\libraries\joomla\html\pane.php  (windows style path here <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) for the api.</p>
<p>One problem is, if you want to use this tab/slider in front end u need to copy some css code from backend css file and  it&#8217;s in administrator\templates\khepri\css\general.css  from line 231 to line 288 and here is teh css code bellow that I found there.</p>
<p>
<pre class="brush: css;">
/* pane-sliders  */
.pane-sliders .title {
	margin: 0;
	padding: 2px;
	color: #666;
	cursor: pointer;
}
.pane-sliders .panel   { border: 1px solid #ccc; margin-bottom: 3px;}
.pane-sliders .panel h3 { background: #f6f6f6; color: #666}
.pane-sliders .content { background: #f6f6f6; }
.pane-sliders .adminlist     { border: 0 none; }
.pane-sliders .adminlist td  { border: 0 none; }
.jpane-toggler  span     { background: transparent url(../images/j_arrow.png) 5px 50% no-repeat; padding-left: 20px;}
.jpane-toggler-down span { background: transparent url(../images/j_arrow_down.png) 5px 50% no-repeat; padding-left: 20px;}
.jpane-toggler-down {  border-bottom: 1px solid #ccc; }
/* tabs */
dl.tabs {
	float: left;
	margin: 10px 0 -1px 0;
	z-index: 50;
}
dl.tabs dt {
	float: left;
	padding: 4px 10px;
	border-left: 1px solid #ccc;
	border-right: 1px solid #ccc;
	border-top: 1px solid #ccc;
	margin-left: 3px;
	background: #f0f0f0;
	color: #666;
}
dl.tabs dt.open {
	background: #F9F9F9;
	border-bottom: 1px solid #F9F9F9;
	z-index: 100;
	color: #000;
}
div.current {
	clear: both;
	border: 1px solid #ccc;
	padding: 10px 10px;
}
div.current dd {
	padding: 0;
	margin: 0;
}
</pre>
</p>
<p>feeling boring ? heh heh.</p>
<p>I have made a tab/slidder module using Jpane and the above css code. It&#8217;s just and I named it <strong>&#8220;mod_simplejoomlatabslider&#8221;</strong>. If you are interested to check my module download from bellow and let me know. But pls keep in mind that, it&#8217;s just simple tab/slider module <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  </p>
<h4>Download</h4>
Note: There is a file embedded within this post, please visit this post to download the file.
<h4>Installation</h4>
<ul>
<li>Download &amp; install like any other joomla module</li>
<li>Enabel this module to any module position</li>
<li><strong>Write module position name to load other modules as tab</strong></li>
<li><strong>Publish other modules which u want to put  in that above mentioned module position.</strong></li>
</ul>
<p>Check my screenshot of setting bellow:</p>
<p><img class="aligncenter size-full wp-image-423" title="modulesett" src="http://blog.manchumahara.com/wp-content/uploads/2009/12/modulesett.jpg" alt="" width="366" height="263" /></p>
<p>thank guys <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Oh here another screenshot of slider style of my module<img class="aligncenter size-full wp-image-402" title="slider" src="http://blog.manchumahara.com/wp-content/uploads/2009/12/slider.png" alt="slider" width="265" height="290" /></p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-400'></div><iframe class="DD_FBLIKE_AJAX_400" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2009/12/02/home-made-tab-and-slider-module-for-joomla1-5/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Send ajax request in wordpress using wpnonce</title>
		<link>http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/</link>
		<comments>http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 22:14:43 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wpnonce]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=394</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_394()',5000);window.setTimeout('loadDzone_394()',5000);window.setTimeout('loadTwitter_394()',5000);window.setTimeout('loadFBShare_394()',5000);window.setTimeout('loadFBLike_394()',5000);window.setTimeout('loadDelicious_394()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_394()',5000); }); function loadDigg_394(){ jQuery(document).ready(function($) { $('.dd-digg-394').remove();$('.DD_DIGG_AJAX_394').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&#38;title=Send+ajax+request+in+wordpress+using+wpnonce');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_394(){ jQuery(document).ready(function($) { $('.dd-dzone-394').remove();$('.DD_DZONE_AJAX_394').attr('width','52');$('.DD_DZONE_AJAX_394').attr('height','68');$('.DD_DZONE_AJAX_394').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&#038;title=Send+ajax+request+in+wordpress+using+wpnonce&#038;t=1'); }); } function loadTwitter_394(){ jQuery(document).ready(function($) { $('.dd-twitter-394').remove();$('.DD_TWITTER_AJAX_394').attr('width','50');$('.DD_TWITTER_AJAX_394').attr('height','61');$('.DD_TWITTER_AJAX_394').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_394(){ jQuery(document).ready(function($) { $('.dd-fbshare-394').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_394(){ jQuery(document).ready(function($) { $('.dd-fblike-394').remove();$('.DD_FBLIKE_AJAX_394').attr('width','450');$('.DD_FBLIKE_AJAX_394').attr('height','25');$('.DD_FBLIKE_AJAX_394').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&#38;show_faces=false'); }); } function loadDelicious_394(){ jQuery(document).ready(function($) { $('.dd-delicious-394').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_394()',5000);window.setTimeout('loadDzone_394()',5000);window.setTimeout('loadTwitter_394()',5000);window.setTimeout('loadFBShare_394()',5000);window.setTimeout('loadFBLike_394()',5000);window.setTimeout('loadDelicious_394()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_394()',5000); });</script><script type="text/javascript"> function loadDigg_394(){ jQuery(document).ready(function($) { $('.dd-digg-394').remove();$('.DD_DIGG_AJAX_394').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&amp;title=Send+ajax+request+in+wordpress+using+wpnonce');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_394(){ jQuery(document).ready(function($) { $('.dd-dzone-394').remove();$('.DD_DZONE_AJAX_394').attr('width','52');$('.DD_DZONE_AJAX_394').attr('height','68');$('.DD_DZONE_AJAX_394').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&title=Send+ajax+request+in+wordpress+using+wpnonce&t=1'); }); } function loadTwitter_394(){ jQuery(document).ready(function($) { $('.dd-twitter-394').remove();$('.DD_TWITTER_AJAX_394').attr('width','50');$('.DD_TWITTER_AJAX_394').attr('height','61');$('.DD_TWITTER_AJAX_394').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_394(){ jQuery(document).ready(function($) { $('.dd-fbshare-394').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_394(){ jQuery(document).ready(function($) { $('.dd-fblike-394').remove();$('.DD_FBLIKE_AJAX_394').attr('width','450');$('.DD_FBLIKE_AJAX_394').attr('height','25');$('.DD_FBLIKE_AJAX_394').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&amp;show_faces=false'); }); } function loadDelicious_394(){ jQuery(document).ready(function($) { $('.dd-delicious-394').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_394').text(msg);}); }); } function loadGBuzz_394(){ jQuery(document).ready(function($) { $('.dd-gbuzz-394').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-394'></div><a class='DiggThisButton DD_DIGG_AJAX_394 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-394'></div><iframe class='DD_DZONE_AJAX_394' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-394'></div><iframe class='DD_TWITTER_AJAX_394' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-394'></div><a class='DD_FBSHARE_AJAX_394' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-394'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/')+'&amp;title='+encodeURIComponent('Send+ajax+request+in+wordpress+using+wpnonce'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_394'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-394'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/#comments><span class='ctotal'>1</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/#comments></a></div></div></div></div><div style='clear:both'></div><p><img class="alignleft size-full wp-image-395" title="wpsecuritythumb" src="http://blog.manchumahara.com/wp-content/uploads/2009/11/wpsecuritythumb.jpg" alt="wpsecuritythumb" width="130" height="130" />let&#8217;s send ajax request in wordpress using wpnonce</p>
<p>Hei, I am not going to discuss what is <a rel="external nofollow" href="http://www.google.com/search?q=wpnonce&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:en-US:official&amp;client=firefox-a" target="_blank">wpnonce</a> and why you should use this in your plugin or how important to use this to secure your plugin <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
But here I am going to discuss how you can use wpnonce in ajax request, I mean if your plugin handles ajax request.<br />
Steps that we need to follow are:</p>
<blockquote><p>One: Create wpnonce value.<br />
Two: Send wpnonce value as an extra parameter with ajax requestion<br />
Three: Check ajax referrer with the wpnonce value that was created in step one and sent in step two.</p></blockquote>
<p>Ok, how to create a wpnonce value ?<br />
we need to use wordpress function wp_create_nonce() . See wordpress codex <a rel="external nofollow" href="http://codex.wordpress.org/Function_Reference/wp_create_nonce" target="_blank">here</a>.<br />
&lt; ?php $my_wpnonce= wp_create_nonce  (&#8216;you-look-nice&#8217;); ?&gt; // &#8220;you-look-nice&#8221; is just a string, u can use whatever u want. here $my_wpnonce  will get a hash from wp_create_nonce. Oh that is not direct hash of &#8220;you-look-nice&#8221; but based on user id, time and that string. To know more about this function please check pluggable.php in wp-includes folder</p>
<p>Now send wpnonce value $my_wpnonce as an extra parameter while seding ajax req.<span id="more-394"></span></p>
<p>Now to process the ajax request in your script at first u need to include the wp-config.php or how u handle this.. no problem. Just use this line after this to check the ajax referrer.</p>
<p>&lt; ?php check_ajax_referer(&#8220;you-look-nice&#8221;);  ?&gt;   /// &#8220;you-look-nice&#8221;   ya same string that u used making wpnoce&#8230;.<br />
If the nonce value is not same then the hacker will be just got fucked!<br />
note: check <a rel="external nofollow" href="http://codex.wordpress.org/Function_Reference/check_ajax_referer" target="_blank">codex here</a> for the function check_ajax_referer.</p>
<p>That&#8217;s it man.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-394'></div><iframe class="DD_FBLIKE_AJAX_394" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2009/11/08/send-ajax-request-in-wordpress-using-wpnonce/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RSS news ticker using jquery and Slick RSS module</title>
		<link>http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/</link>
		<comments>http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:41:43 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Java script]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Joomla Extention]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[rss]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/?p=388</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_388()',5000);window.setTimeout('loadDzone_388()',5000);window.setTimeout('loadTwitter_388()',5000);window.setTimeout('loadFBShare_388()',5000);window.setTimeout('loadFBLike_388()',5000);window.setTimeout('loadDelicious_388()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_388()',5000); }); function loadDigg_388(){ jQuery(document).ready(function($) { $('.dd-digg-388').remove();$('.DD_DIGG_AJAX_388').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&#38;title=RSS+news+ticker+using+jquery+and+Slick+RSS+module+in+joomla');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_388(){ jQuery(document).ready(function($) { $('.dd-dzone-388').remove();$('.DD_DZONE_AJAX_388').attr('width','52');$('.DD_DZONE_AJAX_388').attr('height','68');$('.DD_DZONE_AJAX_388').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&#038;title=RSS+news+ticker+using+jquery+and+Slick+RSS+module+in+joomla&#038;t=1'); }); } function loadTwitter_388(){ jQuery(document).ready(function($) { $('.dd-twitter-388').remove();$('.DD_TWITTER_AJAX_388').attr('width','50');$('.DD_TWITTER_AJAX_388').attr('height','61');$('.DD_TWITTER_AJAX_388').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_388(){ jQuery(document).ready(function($) { $('.dd-fbshare-388').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_388(){ jQuery(document).ready(function($) { $('.dd-fblike-388').remove();$('.DD_FBLIKE_AJAX_388').attr('width','450');$('.DD_FBLIKE_AJAX_388').attr('height','25');$('.DD_FBLIKE_AJAX_388').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&#38;show_faces=false'); }); } function loadDelicious_388(){ jQuery(document).ready(function($) { $('.dd-delicious-388').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_388()',5000);window.setTimeout('loadDzone_388()',5000);window.setTimeout('loadTwitter_388()',5000);window.setTimeout('loadFBShare_388()',5000);window.setTimeout('loadFBLike_388()',5000);window.setTimeout('loadDelicious_388()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_388()',5000); });</script><script type="text/javascript"> function loadDigg_388(){ jQuery(document).ready(function($) { $('.dd-digg-388').remove();$('.DD_DIGG_AJAX_388').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&amp;title=RSS+news+ticker+using+jquery+and+Slick+RSS+module+in+joomla');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_388(){ jQuery(document).ready(function($) { $('.dd-dzone-388').remove();$('.DD_DZONE_AJAX_388').attr('width','52');$('.DD_DZONE_AJAX_388').attr('height','68');$('.DD_DZONE_AJAX_388').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&title=RSS+news+ticker+using+jquery+and+Slick+RSS+module+in+joomla&t=1'); }); } function loadTwitter_388(){ jQuery(document).ready(function($) { $('.dd-twitter-388').remove();$('.DD_TWITTER_AJAX_388').attr('width','50');$('.DD_TWITTER_AJAX_388').attr('height','61');$('.DD_TWITTER_AJAX_388').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_388(){ jQuery(document).ready(function($) { $('.dd-fbshare-388').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_388(){ jQuery(document).ready(function($) { $('.dd-fblike-388').remove();$('.DD_FBLIKE_AJAX_388').attr('width','450');$('.DD_FBLIKE_AJAX_388').attr('height','25');$('.DD_FBLIKE_AJAX_388').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&amp;show_faces=false'); }); } function loadDelicious_388(){ jQuery(document).ready(function($) { $('.dd-delicious-388').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_388').text(msg);}); }); } function loadGBuzz_388(){ jQuery(document).ready(function($) { $('.dd-gbuzz-388').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-388'></div><a class='DiggThisButton DD_DIGG_AJAX_388 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-388'></div><iframe class='DD_DZONE_AJAX_388' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-388'></div><iframe class='DD_TWITTER_AJAX_388' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-388'></div><a class='DD_FBSHARE_AJAX_388' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-388'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/')+'&amp;title='+encodeURIComponent('RSS+news+ticker+using+jquery+and+Slick+RSS+module+in+joomla'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_388'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-388'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/#comments><span class='ctotal'>3</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/#comments></a></div></div></div></div><div style='clear:both'></div><p><img class="alignleft size-medium wp-image-389" title="newsticker" src="http://blog.manchumahara.com/wp-content/uploads/2009/10/newsticker-300x125.jpg" alt="newsticker" width="300" height="125" />Let me clear first about what is Slick RSS</p>
<p>Slick RSS is a joomla module that Parse and Display RSS Feed News with DHTML Teaser Tooltip. For details pls visit <a href="http://extensions.joomla.org/extensions/external-contents/rss-readers/1649">this link</a>.</p>
<p>ok , let me tell what I am going to do next. That module is great to show rss feed from another site and I want to use it as a news ticker and it can be named as rss news ticker. ok then let&#8217;s make it done.</p>
<p>I am going to use js library <a href="http://www.jquery.com/">jQuery</a> and it&#8217;s plugin <a href="http://plugins.jquery.com/project/BBCnewsTicker">BBCNewsTicker</a>. Please download latest version of jquery and that plugin this the given link.</p>
<p>Now, install the module Slick RSS in your joomla site and publish in any module position. Now I am going to make little change in the module code so that it can be  configured for newsticker.</p>
<p>open the file default.php from modules\mod_slick_rss\tmpl and check link near 39</p>
<p><span id="more-388"></span></p>
<pre class="brush: php;">
&lt;ul class=&quot;slick-rss-list&lt;?php echo $params-&gt;get('moduleclass_sfx'); ?&gt;&quot; id=&quot;slick-rss-list&lt; ?php echo $params-&gt;get('moduleclass_sfx'); ?&gt;&quot; style=&quot;margin-left:0px;padding-left:0px;&quot;&gt;
</pre>
<p>here I am adding id to ul tag so that the jquery plugin can catch that and do newsticking <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>oh btw,$params-&gt;get(&#8216;moduleclass_sfx&#8217;)  that is the class sufix that u add to that module, it urgent to give module suffix here and don&#8217;t give same class sufix for another copy of same module in same page. In that the first module be working as newsticker as both more than one module&#8217;s ul tag is getting same id.</p>
<p>Next task is to add jquery and it&#8217;s plugin and do that newsticking&#8230; <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
I am putting them in index.php of the current active template. make folder named js in your current template folder if there is none and put the jquery file and it&#8217;s plugin in that folder . now put the these lines in your index.php template file</p>
<pre class="brush: jscript;">
&lt;script src=&quot;&lt;?php echo $this-&gt;baseurl; ?&gt;/templates/js/jquery-1.2.6.pack.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;&lt;?php echo $this-&gt;baseurl; ?&gt;/templates/js/newsticker.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;// &lt; ![CDATA[
jQuery.noConflict();
jQuery(document).ready( function(){
var options = {newsList: &quot;#slick-rss-list_rssnews&quot;, tickerRate: 80, loopDelay: 3000,	startDelay: 10, 		placeHolder1: &quot;_&quot;}
jQuery().newsTicker(options);
});
// ]]&gt;&lt;/script&gt;
</pre>
<p>Look the above code I used the jquery file name jquery-1.2.6.pack.js  and it&#8217;s plugin newsticker.js .So if u are using latest version of jquery or it&#8217;s news ticker plugin then put the file names carefull in the code&#8230;</p>
<p>another line check here</p>
<pre class="brush: php;">
var options = {newsList: &quot;#slick-rss-list_rssnews&quot;, tickerRate: 80, loopDelay: 3000,	startDelay: 10, 		placeHolder1: &quot;_&quot;}
</pre>
<p>here #slick-rss-list_rssnews   # is jquery syntax to catch slick-rss-list_rssnews as id   and _rssnews  is the class suffix for the Slick RSS module that I put from admin panel in the module configuration. If you put any thing then the id will be like #slick-rss-list{class suffix here without 2nd bracket} in this format. I think you are clear.</p>
<p>Oh u may ask why I wrote that line jQuery.noConflict();  and jQuery in place of $ sign.. heh to avoid conflict with other js library. You can search jquery seach about this noConflict mode.</p>
<p>Another thing is put the above code in footer of yout index.php file so that the loading time of jquery and it&#8217;s plugin doesn&#8217;t make any problem for site loading. For first time before the site loaded completely(before the dom is ready) the rss feed will be shown as listed like</p>
<p>list1<br />
list2<br />
list2</p>
<p>so if u make the ul tag height as the the line height of list item from css then it will seems that before the dom ready first news is displayed. When the dom is ready jquery plugin will start to work <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>waiting for your feedback <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>wana see demo of my work ? ok check <a href="http://www.gdpglobal.com/">here</a> .If this link doesn&#8217;t work in future then check <a href="http://www.gdpglobal.com">main domain</a> of that link as this is a demo site now <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-388'></div><iframe class="DD_FBLIKE_AJAX_388" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2009/10/26/rss-news-ticker-using-jquery-and-slick-rss-module-in-joomla/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>জুমলার ডিফল্ট টেমপ্লেটে</title>
		<link>http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/</link>
		<comments>http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 04:06:36 +0000</pubDate>
		<dc:creator>Manchumahara(Sabuj Kundu)</dc:creator>
				<category><![CDATA[Bangla Blogs]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[joomla bangla tips]]></category>
		<guid isPermaLink="false">http://blog.manchumahara.com/2009/10/02/%e0%a6%9c%e0%a7%81%e0%a6%ae%e0%a6%b2%e0%a6%be%e0%a6%b0-%e0%a6%a1%e0%a6%bf%e0%a6%ab%e0%a6%b2%e0%a7%8d%e0%a6%9f-%e0%a6%9f%e0%a7%87%e0%a6%ae%e0%a6%aa%e0%a7%8d%e0%a6%b2%e0%a7%87%e0%a6%9f%e0%a7%87/</guid>
		<description><![CDATA[jQuery(document).ready(function($) { window.setTimeout('loadDigg_384()',5000);window.setTimeout('loadDzone_384()',5000);window.setTimeout('loadTwitter_384()',5000);window.setTimeout('loadFBShare_384()',5000);window.setTimeout('loadFBLike_384()',5000);window.setTimeout('loadDelicious_384()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_384()',5000); }); function loadDigg_384(){ jQuery(document).ready(function($) { $('.dd-digg-384').remove();$('.DD_DIGG_AJAX_384').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&#38;title=%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%B0+%E0%A6%A1%E0%A6%BF%E0%A6%AB%E0%A6%B2%E0%A7%8D%E0%A6%9F+%E0%A6%9F%E0%A7%87%E0%A6%AE%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A7%87%E0%A6%9F%E0%A7%87+%E0%A6%AA%E0%A7%87%E0%A6%9C%E0%A6%BF%E0%A6%A8%E0%A7%87%E0%A6%B6%E0%A6%A8%E0%A7%87+%E0%A6%A1%E0%A6%BF%E0%A6%9C%E0%A6%BF%E0%A6%9F+%E0%A6%95%E0%A6%BF%E0%A6%AD%E0%A6%BE%E0%A6%AC%E0%A7%87+%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE+%E0%A6%95%E0%A6%B0%E0%A6%AC%E0%A7%87%E0%A6%A8+%3F');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_384(){ jQuery(document).ready(function($) { $('.dd-dzone-384').remove();$('.DD_DZONE_AJAX_384').attr('width','52');$('.DD_DZONE_AJAX_384').attr('height','68');$('.DD_DZONE_AJAX_384').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&#038;title=%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%B0+%E0%A6%A1%E0%A6%BF%E0%A6%AB%E0%A6%B2%E0%A7%8D%E0%A6%9F+%E0%A6%9F%E0%A7%87%E0%A6%AE%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A7%87%E0%A6%9F%E0%A7%87+%E0%A6%AA%E0%A7%87%E0%A6%9C%E0%A6%BF%E0%A6%A8%E0%A7%87%E0%A6%B6%E0%A6%A8%E0%A7%87+%E0%A6%A1%E0%A6%BF%E0%A6%9C%E0%A6%BF%E0%A6%9F+%E0%A6%95%E0%A6%BF%E0%A6%AD%E0%A6%BE%E0%A6%AC%E0%A7%87+%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE+%E0%A6%95%E0%A6%B0%E0%A6%AC%E0%A7%87%E0%A6%A8+%3F&#038;t=1'); }); } function loadTwitter_384(){ jQuery(document).ready(function($) { $('.dd-twitter-384').remove();$('.DD_TWITTER_AJAX_384').attr('width','50');$('.DD_TWITTER_AJAX_384').attr('height','61');$('.DD_TWITTER_AJAX_384').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&#038;source=manchumahara&#038;style=normal&#038;service=bit.ly&#038;service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_384(){ jQuery(document).ready(function($) { $('.dd-fbshare-384').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_384(){ jQuery(document).ready(function($) { $('.dd-fblike-384').remove();$('.DD_FBLIKE_AJAX_384').attr('width','450');$('.DD_FBLIKE_AJAX_384').attr('height','25');$('.DD_FBLIKE_AJAX_384').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&#38;show_faces=false'); }); } function loadDelicious_384(){ jQuery(document).ready(function($) { $('.dd-delicious-384').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&#38;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count [...]]]></description>
			<content:encoded><![CDATA[<script type="text/javascript">jQuery(document).ready(function($) { window.setTimeout('loadDigg_384()',5000);window.setTimeout('loadDzone_384()',5000);window.setTimeout('loadTwitter_384()',5000);window.setTimeout('loadFBShare_384()',5000);window.setTimeout('loadFBLike_384()',5000);window.setTimeout('loadDelicious_384()',5000);$('.delicious-normal-img,.delicious-compact-img').hide();window.setTimeout('loadGBuzz_384()',5000); });</script><script type="text/javascript"> function loadDigg_384(){ jQuery(document).ready(function($) { $('.dd-digg-384').remove();$('.DD_DIGG_AJAX_384').attr('href','http://digg.com/submit?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&amp;title=%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%B0+%E0%A6%A1%E0%A6%BF%E0%A6%AB%E0%A6%B2%E0%A7%8D%E0%A6%9F+%E0%A6%9F%E0%A7%87%E0%A6%AE%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A7%87%E0%A6%9F%E0%A7%87+%E0%A6%AA%E0%A7%87%E0%A6%9C%E0%A6%BF%E0%A6%A8%E0%A7%87%E0%A6%B6%E0%A6%A8%E0%A7%87+%E0%A6%A1%E0%A6%BF%E0%A6%9C%E0%A6%BF%E0%A6%9F+%E0%A6%95%E0%A6%BF%E0%A6%AD%E0%A6%BE%E0%A6%AC%E0%A7%87+%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE+%E0%A6%95%E0%A6%B0%E0%A6%AC%E0%A7%87%E0%A6%A8+%3F');$.getScript('http://widgets.digg.com/buttons.js'); }); } function loadDzone_384(){ jQuery(document).ready(function($) { $('.dd-dzone-384').remove();$('.DD_DZONE_AJAX_384').attr('width','52');$('.DD_DZONE_AJAX_384').attr('height','68');$('.DD_DZONE_AJAX_384').attr('src','http://widgets.dzone.com/links/widgets/zoneit.html?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&title=%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%B0+%E0%A6%A1%E0%A6%BF%E0%A6%AB%E0%A6%B2%E0%A7%8D%E0%A6%9F+%E0%A6%9F%E0%A7%87%E0%A6%AE%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A7%87%E0%A6%9F%E0%A7%87+%E0%A6%AA%E0%A7%87%E0%A6%9C%E0%A6%BF%E0%A6%A8%E0%A7%87%E0%A6%B6%E0%A6%A8%E0%A7%87+%E0%A6%A1%E0%A6%BF%E0%A6%9C%E0%A6%BF%E0%A6%9F+%E0%A6%95%E0%A6%BF%E0%A6%AD%E0%A6%BE%E0%A6%AC%E0%A7%87+%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE+%E0%A6%95%E0%A6%B0%E0%A6%AC%E0%A7%87%E0%A6%A8+%3F&t=1'); }); } function loadTwitter_384(){ jQuery(document).ready(function($) { $('.dd-twitter-384').remove();$('.DD_TWITTER_AJAX_384').attr('width','50');$('.DD_TWITTER_AJAX_384').attr('height','61');$('.DD_TWITTER_AJAX_384').attr('src','http://api.tweetmeme.com/button.js?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&source=manchumahara&style=normal&service=bit.ly&service_api=R_190f1ddf89c3ac3860d6f995977d37ef'); }); } function loadFBShare_384(){ jQuery(document).ready(function($) { $('.dd-fbshare-384').remove(); $.getScript('http://static.ak.fbcdn.net/connect.php/js/FB.Share'); }); } function loadFBLike_384(){ jQuery(document).ready(function($) { $('.dd-fblike-384').remove();$('.DD_FBLIKE_AJAX_384').attr('width','450');$('.DD_FBLIKE_AJAX_384').attr('height','25');$('.DD_FBLIKE_AJAX_384').attr('src','http://www.facebook.com/plugins/like.php?href=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&amp;show_faces=false'); }); } function loadDelicious_384(){ jQuery(document).ready(function($) { $('.dd-delicious-384').remove();$('.delicious-normal-img,.delicious-compact-img').show();$.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/&amp;callback=?',function(data) {var msg ='';var count = 0;if (data.length > 0) {count = data[0].total_posts;if(count ==0){msg = 'Save';}else if(count ==1){msg = '1 save';}else{msg = count + ' saves'}}else{msg = 'Save';}$('#DD_DELICIOUS_AJAX_384').text(msg);}); }); } function loadGBuzz_384(){ jQuery(document).ready(function($) { $('.dd-gbuzz-384').remove();$.getScript('http://www.google.com/buzz/api/button.js'); }); }</script><div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-digg-ajax-load dd-digg-384'></div><a class='DiggThisButton DD_DIGG_AJAX_384 DiggMedium'></a></div><div class='dd_button'><div class="topsy_widget_data"><!--{"url":"http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/","style":"big","theme":"blue","nick":""}--></div></div><div class='dd_button'><div class='dd-dzone-ajax-load dd-dzone-384'></div><iframe class='DD_DZONE_AJAX_384' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-twitter-ajax-load dd-twitter-384'></div><iframe class='DD_TWITTER_AJAX_384' src='#' height='0' width='0' scrolling='no' frameborder='0'></iframe></div><div class='dd_button'><div class='dd-fbshare-ajax-load dd-fbshare-384'></div><a class='DD_FBSHARE_AJAX_384' name='fb_share' type='box_count' share_url='http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/' href='http://www.facebook.com/sharer.php'></a></div><div class='dd_button'><script src='http://www.stumbleupon.com/hostedbadge.php?s=5&amp;r=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/'></script></div><div class='dd_button'><div class='dd-delicious-ajax-load dd-delicious-384'></div><a href='http://delicious.com/save' onclick="window.open('http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url='+encodeURIComponent('http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/')+'&amp;title='+encodeURIComponent('%E0%A6%9C%E0%A7%81%E0%A6%AE%E0%A6%B2%E0%A6%BE%E0%A6%B0+%E0%A6%A1%E0%A6%BF%E0%A6%AB%E0%A6%B2%E0%A7%8D%E0%A6%9F+%E0%A6%9F%E0%A7%87%E0%A6%AE%E0%A6%AA%E0%A7%8D%E0%A6%B2%E0%A7%87%E0%A6%9F%E0%A7%87+%E0%A6%AA%E0%A7%87%E0%A6%9C%E0%A6%BF%E0%A6%A8%E0%A7%87%E0%A6%B6%E0%A6%A8%E0%A7%87+%E0%A6%A1%E0%A6%BF%E0%A6%9C%E0%A6%BF%E0%A6%9F+%E0%A6%95%E0%A6%BF%E0%A6%AD%E0%A6%BE%E0%A6%AC%E0%A7%87+%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE+%E0%A6%95%E0%A6%B0%E0%A6%AC%E0%A7%87%E0%A6%A8+%3F'),'delicious', 'toolbar=no,width=550,height=550'); return false;"><div class='delicious-normal-img'><img src='http://blog.manchumahara.com/wp-content/plugins/digg-digg/image/delicious.png' alt='Delicious' /><div class='delicious-normal-text' id='DD_DELICIOUS_AJAX_384'></div></div></a></div><div class='dd_button'><div class='dd-gbuzz-ajax-load dd-gbuzz-384'></div><a title='Post on Google Buzz' class='google-buzz-button' href='http://www.google.com/buzz/post' data-button-style='normal-count' data-url='http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/'></a></div><div class='dd_button'><div id='dd_comments'><a class='clcount' href=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/#comments><span class='ctotal'>5</span><br /><span class='cmsg'>Comments</span></a><a class='clink' href=http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/#comments></a></div></div></div></div><div style='clear:both'></div><p>আমি ব্যক্তিগত ভাবে যা করি যখন জুমলার জন্য কোন নতুন টেমপ্লেট বানায় তখন ডিফল্ট টেমপ্লেট rhuk_milkyway কপি করে নতুন নাম দিয়ে অপ্রয়োজনীয় ছবি, সিএসএস কোড ইত্যাদি সব মুছে ফেলি। এরপর নিজের মতো করে কোড করি সব কিছু। একথা বলার কারণ এইটা যে আমরা যদি ডিফল্ট টেমপ্লেট ব্যবহার করি তাহলে একটা ফাইলে সামান্য কিছু কোড যুক্ত করেই পেজিনেশনের ডিজিটগুলো বাংলা করে ফেলতে পারি।</p>
<p>এখন দেখি কি করে করা যায়। যদি ভালো করে খেয়াল করেন তাহলে নিশ্চয় templates\rhuk_milkyway\html এই ডিরেক্টরীতে pagination.php নামে একটা ফাইল আছে। এই ফাইলটা প্রথমে utf-8 হিসাবে সংরক্ষণ(save) করুন। এরপর<br />
ফাইলের একদম শেষে ?> এর আগে নিচের কোড কপি পেস্ট করুন।<span id="more-384"></span></p>
<pre class="brush: php;">
//function to convert english digits to bangla digits
function convertEngtoBanglaDate($rdate){
	$latin = array('1','2','3','4','5','6','7','8','9','0');
	$bangla  = array('১','২','৩','৪','৫','৬','৭','৮','৯','০');
      	return str_replace($latin, $bangla, $rdate);
} //end convertEngtoBanglaDate</pre>
<p>এখন যা করবো pagination_item_active() এবং pagination_item_inactive() ফাংশন দুইটি সামান্য মডিফাই করবো। মডিফাই করার পর যা হবে তা নিচে দিলামঃ</p>
<pre class="brush: php;">
function pagination_item_active(&amp;amp;$item) {
	return &quot;&lt;a href=\&quot;&quot;.$item-&gt;link.&quot;\&quot; title=\&quot;&quot;.$item-&gt;text.&quot;\&quot;&gt;&quot;.convertEngtoBanglaDate($item-&gt;text).&quot;&lt;/a&gt;&quot;;
}
function pagination_item_inactive(&amp;amp;$item) {
	return &quot;&lt;span&gt;&quot;.convertEngtoBanglaDate($item-&gt;text).&quot;&lt;/span&gt;&quot;;
}
</pre>
<p> নিশ্চয় ভাবছেন এখনতো বাংলা ইংলিশ যে ল্যাঙ্গুয়েজই সেট করি না কেন এডমিন থেকে পেজিনেশনের ডিজিট সব সময় বাংলায় দেখাচ্ছে <img src='http://blog.manchumahara.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . হ্যাঁ ভয় পাবেন না। আমরা উপরোক্ত ফাংশন দুইটি আবার মডিফাই করবো।</p>
<pre class="brush: php;">
function pagination_item_active(&amp;amp;$item) {
	$lang = JFactory::getLanguage();
 	if($lang-&gt;_lang == &quot;bn-BD&quot;){
 		return &quot;&lt;a href=\&quot;&quot;.$item-&gt;link.&quot;\&quot; title=\&quot;&quot;.$item-&gt;text.&quot;\&quot;&gt;&quot;.convertEngtoBanglaDate($item-&gt;text).&quot;&lt;/a&gt;&quot;;
 	}
 	else{
 		return &quot;&lt;a href=\&quot;&quot;.$item-&gt;link.&quot;\&quot; title=\&quot;&quot;.$item-&gt;text.&quot;\&quot;&gt;&quot;.$item-&gt;text.&quot;&lt;/a&gt;&quot;;
 	}
}
function pagination_item_inactive(&amp;amp;$item) {
	$lang = JFactory::getLanguage();
 	if($lang-&gt;_lang == &quot;bn-BD&quot;){
 		return &quot;&lt;span&gt;&quot;.convertEngtoBanglaDate($item-&gt;text).&quot;&lt;/span&gt;&quot;;
 	}
 	else
 	{
 		return &quot;&lt;span&gt;&quot;.$item-&gt;text.&quot;&lt;/span&gt;&quot;;
 	}
}
</pre>
<p>এখন যদি আপনি ল্যাঙ্গুয়েজ এডমিন থেকে বাংলা সেট করেন শুধুমাত্র তাহলেই পেজিনেশনে বাংলা ডিজিট শো করবে। ধন্যবাদ। </p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-fblike-ajax-load dd-fblike-384'></div><iframe class="DD_FBLIKE_AJAX_384" src='#' height='0' width='0' scrolling='no' frameborder='0' allowTransparency='true'></iframe></div></div></div><div style='clear:both'></div><!-- Social Buttons Shared Counts Generated by Digg Digg plugin v4.2,
    Author : Yong Mook Kim
    Website : http://www.mkyong.com/blog/digg-digg-wordpress-plugin/ -->
Comment is open. You can participate in the discussion
by visiting <a href='http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/'>here</a>
]]></content:encoded>
			<wfw:commentRss>http://blog.manchumahara.com/2009/10/02/bangla-digit-in-joomla-pagination/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
