<?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://manchumahara.com/tips-and-tricks/feed/" rel="self" type="application/rss+xml" /><link>http://manchumahara.com</link> <description>&#34;Manchumahara&#34; ...... The virtual, crazy, vagabond and  an emotional stupid!</description> <lastBuildDate>Thu, 02 Feb 2012 13:47:24 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Virtuemart2.0 content plugin support/fix for joomla1.6+</title><link>http://manchumahara.com/2011/12/27/virtuemart2-0-content-plugin-supportfix-for-joomla1-6/</link> <comments>http://manchumahara.com/2011/12/27/virtuemart2-0-content-plugin-supportfix-for-joomla1-6/#comments</comments> <pubDate>Tue, 27 Dec 2011 08:57:01 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Joomla]]></category> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[virtuemart2]]></category><guid isPermaLink="false">http://manchumahara.com/?p=700</guid> <description><![CDATA[I see virtuemart2 is compatible with joomla 1.6 , hope for 1.7 too. I see there is a issue for content plugin compatibility for vm2 in joomla1.6. Then checked the vm2 code where the plugin event if fired. I see &#8230; <a href="http://manchumahara.com/2011/12/27/virtuemart2-0-content-plugin-supportfix-for-joomla1-6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I see <a href="http://virtuemart.net/downloads">virtuemart2</a> is compatible with joomla 1.6 , hope for 1.7 too. I see there is a issue for content plugin compatibility for vm2 in joomla1.6. Then checked the vm2 code where the plugin event if fired. I see the plugin trigger method is not compatible with 1.6 content plugin structure, the hook name is for old  joomla 1.5 series</p><p>note: paths are windows style<br /> folder  components\com_virtuemart\views\productdetails  open file view.html.php line 97<br /> <span id="more-700"></span></p><pre class="brush: php; title: ; notranslate">
if ( VmConfig::get('enable_content_plugin',0)) {
			// add content plugin //
			$dispatcher	=&amp; JDispatcher::getInstance();
			JPluginHelper::importPlugin('content');
			$product-&gt;text = $product-&gt;product_desc;
			$params = &quot;&quot;;
                        //var_dump($product);
			$results = $dispatcher-&gt;trigger('onPrepareContent',array (&amp; $product, &amp; $params, 0));
			$product-&gt;product_desc = $product-&gt;text;
		}
</pre><p>Here the content plugin trigger event is for 1.5 series. from joomla 1.6 the &#8220;onContentPrepare&#8221; and also takes one more input.</p><p>So for line 104 there should be a check for joomla version and add conditional event hook.</p><p>It&#8217;s not hard to check the joomla version. sample code used in k2 component</p><pre class="brush: php; title: ; notranslate">
// Determine Joomla! version
		if(version_compare( JVERSION, '1.6.0', 'ge' )) {
			define('K2_JVERSION','16');
		}
		else {
			define('K2_JVERSION','15');
		}
</pre><p>here is how the code can be for both 1.5 and 1.6+ content plugins support</p><pre class="brush: php; title: ; notranslate">
if ( VmConfig::get('enable_content_plugin',0)) {
			// add content plugin //
                        // Determine Joomla! version
                        if(version_compare( JVERSION, '1.6.0', 'ge' )) {
                                define('VMJ2_JVERSION','16');
                        }
                        else {
                                define('VMJ2_JVERSION','15');
                        }

			$dispatcher	=&amp; JDispatcher::getInstance();
			JPluginHelper::importPlugin('content');
			$product-&gt;text = $product-&gt;product_desc;
			$params = &quot;&quot;;
                        //var_dump($product);
                        if(VMJ2_JVERSION=='16'){
                            $results = $dispatcher-&gt;trigger('onContentPrepare',array ('com_virtuemart.productdetails',&amp; $product, &amp; $params, 0));
                        }
                        else{
                            $results = $dispatcher-&gt;trigger('onPrepareContent',array (&amp; $product, &amp; $params, 0));
                        }

			$product-&gt;product_desc = $product-&gt;text;
		}
</pre><p>Note2: I have opened a thread on virtuemart forum <a href="http://forum.virtuemart.net/index.php?topic=95485.0" target="_blank">here.</a></p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/12/27/virtuemart2-0-content-plugin-supportfix-for-joomla1-6/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/12/27/virtuemart2-0-content-plugin-supportfix-for-joomla1-6/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress</title><link>http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/</link> <comments>http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/#comments</comments> <pubDate>Fri, 21 Oct 2011 10:17:22 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://manchumahara.com/?p=694</guid> <description><![CDATA[I think the post title &#8220;Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress&#8221; says all what I want to say. I was just thinking to make admin like category or term widget to use on front end &#8230; <a href="http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><img src="http://manchumahara.com/wp-content/uploads/2011/10/hirarchycalcategory.png" alt="" title="hirarchycalcategory" width="230" height="286" class="alignleft size-full wp-image-695" /><br /> I think the post title &#8220;Hirarchycal Category or Custom Taxonomy Select or Radio list for wordpress&#8221;  says all what I want to say. I was just thinking to make admin like category or term widget to use on front end or theme or other places. So I took the code from wordpress core and used it. So here I am sharing the code with all.<br /> <span id="more-694"></span></p><h4>Select and Radio functions and classess:</h4><p>Select:</p><pre class="brush: php; title: ; notranslate">
&lt;?php
//
// Category Checklists
//

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 */
if(!class_exists('Walker_Category_Checklist')){
class Walker_Category_Checklist extends Walker {
	var $tree_type = 'category';
	var $db_fields = array ('parent' =&gt; 'parent', 'id' =&gt; 'term_id'); //TODO: decouple this

	function start_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;ul class='children'&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function end_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;/ul&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function start_el(&amp;$output, $category, $depth, $args) {
		extract($args);
		if ( empty($taxonomy) )
			$taxonomy = 'category';

		if ( $taxonomy == 'category' )
			$name = 'post_category';
		else
                        $name = $taxonomy;
			//$name = 'tax_input['.$taxonomy.']';

		$class = in_array( $category-&gt;term_id, $popular_cats ) ? ' class=&quot;popular-category&quot;' : '';
		//$output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                $output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                //$output .= '&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot; class=&quot;customcheckbox&quot; name=&quot;'.$name.'[]&quot; '.checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ).' value=&quot;'.$category-&gt;term_id.'&quot; /&gt; '.esc_html( apply_filters('the_category', $category-&gt;name )).'&lt;/label&gt;';
                //'&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot; class=&quot;customcheckbox&quot; name=&quot;language[]&quot; '.$check.' value=&quot;'.$language_list-&gt;cat_ID.'&quot; /&gt; '.$language_list-&gt;cat_name.'&lt;/label&gt;';
	}

	function end_el(&amp;$output, $category, $depth, $args) {
		$output .= &quot;&lt;/li&gt;\n&quot;;
                //$output .= &quot;\n&quot;;
	}
}
}
/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 *
 * @param unknown_type $post_id
 * @param unknown_type $descendants_and_self
 * @param unknown_type $selected_cats
 * @param unknown_type $popular_cats
 */
if(!function_exists('wp_category_checklist')){
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
	wp_terms_checklist($post_id,
	 	array(
			'taxonomy' =&gt; 'category',
			'descendants_and_self' =&gt; $descendants_and_self,
			'selected_cats' =&gt; $selected_cats,
			'popular_cats' =&gt; $popular_cats,
			'walker' =&gt; $walker,
			'checked_ontop' =&gt; $checked_ontop
  ));
}
}
/**
 * Taxonomy independent version of wp_category_checklist
 *
 * @since 3.0.0
 *
 * @param int $post_id
 * @param array $args
 */
if(!function_exists('wp_terms_checklist')){
function wp_terms_checklist($post_id = 0, $args = array()) {
 	$defaults = array(
		'descendants_and_self' =&gt; 0,
		'selected_cats' =&gt; false,
		'popular_cats' =&gt; false,
		'walker' =&gt; null,
		'taxonomy' =&gt; 'category',
		'checked_ontop' =&gt; false
	);
	extract( wp_parse_args($args, $defaults), EXTR_SKIP );

	if ( empty($walker) || !is_a($walker, 'Walker') )
		$walker = new Walker_Category_Checklist;

	$descendants_and_self = (int) $descendants_and_self;

	$args = array('taxonomy' =&gt; $taxonomy);

	$tax = get_taxonomy($taxonomy);
	$args['disabled'] = !current_user_can($tax-&gt;cap-&gt;assign_terms);

	if ( is_array( $selected_cats ) )
		$args['selected_cats'] = $selected_cats;
	elseif ( $post_id )
		$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' =&gt; 'ids')));
	else
		$args['selected_cats'] = array();

	if ( is_array( $popular_cats ) )
		$args['popular_cats'] = $popular_cats;
	else
		$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' =&gt; 'ids', 'orderby' =&gt; 'count', 'order' =&gt; 'DESC', 'number' =&gt; 10, 'hierarchical' =&gt; false ) );

	if ( $descendants_and_self ) {
		$categories = (array) get_terms($taxonomy, array( 'child_of' =&gt; $descendants_and_self, 'hierarchical' =&gt; 0, 'hide_empty' =&gt; 0 ) );
		$self = get_term( $descendants_and_self, $taxonomy );
		array_unshift( $categories, $self );
	} else {
		$categories = (array) get_terms($taxonomy, array('get' =&gt; 'all'));
	}

	if ( $checked_ontop ) {
		// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
		$checked_categories = array();
		$keys = array_keys( $categories );

		foreach( $keys as $k ) {
			if ( in_array( $categories[$k]-&gt;term_id, $args['selected_cats'] ) ) {
				$checked_categories[] = $categories[$k];
				unset( $categories[$k] );
			}
		}

		// Put checked cats on top
		echo call_user_func_array(array(&amp;$walker, 'walk'), array($checked_categories, 0, $args));
	}
	// Then the rest of them
	echo call_user_func_array(array(&amp;$walker, 'walk'), array($categories, 0, $args));
}
}
?&gt;
</pre><p>Radio:</p><pre class="brush: php; title: ; notranslate">
&lt;?php
//
// Category Checklists
//

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 */
if(!class_exists('Walker_Category_Radiolist')){
class Walker_Category_Radiolist extends Walker {
	var $tree_type = 'category';
	var $db_fields = array ('parent' =&gt; 'parent', 'id' =&gt; 'term_id'); //TODO: decouple this

	function start_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;ul class='children'&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function end_lvl(&amp;$output, $depth, $args) {
		$indent = str_repeat(&quot;\t&quot;, $depth);
		$output .= &quot;$indent&lt;/ul&gt;\n&quot;;
                //$output .= &quot;$indent\n&quot;;
	}

	function start_el(&amp;$output, $category, $depth, $args) {
		extract($args);
		if ( empty($taxonomy) )
			$taxonomy = 'category';

		if ( $taxonomy == 'category' )
			$name = 'post_category';
		else
                        $name = $taxonomy;
			//$name = 'tax_input['.$taxonomy.']';

		$class = in_array( $category-&gt;term_id, $popular_cats ) ? ' class=&quot;popular-category&quot;' : '';
		//$output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;checkbox&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                $output .= &quot;\n&lt;li id='{$taxonomy}-{$category-&gt;term_id}'$class&gt;&quot; . '&lt;label class=&quot;selectit&quot;&gt;&lt;input value=&quot;' . $category-&gt;term_id . '&quot; type=&quot;radio&quot; name=&quot;'.$name.'[]&quot; id=&quot;in-'.$taxonomy.'-' . $category-&gt;term_id . '&quot;' . checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /&gt; ' . esc_html( apply_filters('the_category', $category-&gt;name )) . '&lt;/label&gt;';
                //$output .= '&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.esc_html( apply_filters('the_category', $category-&gt;name )).$category-&gt;term_id.'&quot; class=&quot;customcheckbox&quot; name=&quot;'.$name.'[]&quot; '.checked( in_array( $category-&gt;term_id, $selected_cats ), true, false ).' value=&quot;'.$category-&gt;term_id.'&quot; /&gt; '.esc_html( apply_filters('the_category', $category-&gt;name )).'&lt;/label&gt;';
                //'&lt;label class=&quot;fullsize customcheckboxl&quot; for=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;'.$language_list-&gt;cat_name.$language_list-&gt;cat_ID.'&quot; class=&quot;customcheckbox&quot; name=&quot;language[]&quot; '.$check.' value=&quot;'.$language_list-&gt;cat_ID.'&quot; /&gt; '.$language_list-&gt;cat_name.'&lt;/label&gt;';
	}

	function end_el(&amp;$output, $category, $depth, $args) {
		$output .= &quot;&lt;/li&gt;\n&quot;;
                //$output .= &quot;\n&quot;;
	}
}
}
/**
 * {@internal Missing Short Description}}
 *
 * @since 2.5.1
 *
 * @param unknown_type $post_id
 * @param unknown_type $descendants_and_self
 * @param unknown_type $selected_cats
 * @param unknown_type $popular_cats
 */
if(!function_exists('wp_category_radiolist')){
function wp_category_radiolist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
        wp_terms_radiolist($post_id,
            array(
                    'taxonomy' =&gt; 'category',
                    'descendants_and_self' =&gt; $descendants_and_self,
                    'selected_cats' =&gt; $selected_cats,
                    'popular_cats' =&gt; $popular_cats,
                    'walker' =&gt; $walker,
                    'checked_ontop' =&gt; $checked_ontop
        ));
    }
}
/**
 * Taxonomy independent version of wp_category_checklist
 *
 * @since 3.0.0
 *
 * @param int $post_id
 * @param array $args
 */
if(!function_exists('wp_terms_radiolist')){
function wp_terms_radiolist($post_id = 0, $args = array()) {
 	$defaults = array(
		'descendants_and_self' =&gt; 0,
		'selected_cats' =&gt; false,
		'popular_cats' =&gt; false,
		'walker' =&gt; null,
		'taxonomy' =&gt; 'category',
		'checked_ontop' =&gt; false
	);
	extract( wp_parse_args($args, $defaults), EXTR_SKIP );

	if ( empty($walker) || !is_a($walker, 'Walker') )
		$walker = new Walker_Category_Radiolist;

	$descendants_and_self = (int) $descendants_and_self;

	$args = array('taxonomy' =&gt; $taxonomy);

	$tax = get_taxonomy($taxonomy);
	$args['disabled'] = !current_user_can($tax-&gt;cap-&gt;assign_terms);

	if ( is_array( $selected_cats ) )
		$args['selected_cats'] = $selected_cats;
	elseif ( $post_id )
		$args['selected_cats'] = wp_get_object_terms($post_id, $taxonomy, array_merge($args, array('fields' =&gt; 'ids')));
	else
		$args['selected_cats'] = array();

	if ( is_array( $popular_cats ) )
		$args['popular_cats'] = $popular_cats;
	else
		$args['popular_cats'] = get_terms( $taxonomy, array( 'fields' =&gt; 'ids', 'orderby' =&gt; 'count', 'order' =&gt; 'DESC', 'number' =&gt; 10, 'hierarchical' =&gt; false ) );

	if ( $descendants_and_self ) {
		$categories = (array) get_terms($taxonomy, array( 'child_of' =&gt; $descendants_and_self, 'hierarchical' =&gt; 0, 'hide_empty' =&gt; 0 ) );
		$self = get_term( $descendants_and_self, $taxonomy );
		array_unshift( $categories, $self );
	} else {
		$categories = (array) get_terms($taxonomy, array('get' =&gt; 'all'));
	}

	if ( $checked_ontop ) {
		// Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
		$checked_categories = array();
		$keys = array_keys( $categories );

		foreach( $keys as $k ) {
			if ( in_array( $categories[$k]-&gt;term_id, $args['selected_cats'] ) ) {
				$checked_categories[] = $categories[$k];
				unset( $categories[$k] );
			}
		}

		// Put checked cats on top
		echo call_user_func_array(array(&amp;$walker, 'walk'), array($checked_categories, 0, $args));
	}
	// Then the rest of them
	echo call_user_func_array(array(&amp;$walker, 'walk'), array($categories, 0, $args));
}
}
?&gt;
</pre><h4>Usages:</h4><pre class="brush: php; title: ; notranslate">
&lt;ul class=&quot;nonbulletlist&quot;&gt;
                         &lt;?php
                            wp_terms_radiolist($postid, array( 'taxonomy' =&gt; 'category') );
                          ?&gt;
                    &lt;/ul&gt;
</pre><p>In the above code $poistid  is id of any wordpress post, if for new post it can be zero.  here I used category as taxonomy but tag or any custom taxonomy can be used.  I think this will helpfull for front end post submission form or helper code for plugin/themes.</p><p>thanks</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/10/21/hirarchycal-category-or-custom-taxonomy-select-or-radio-list-for-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>আসুন ওয়ার্ডপ্রেসের ড্যাশ বোর্ড পরিস্কার করি</title><link>http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/</link> <comments>http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/#comments</comments> <pubDate>Thu, 26 May 2011 13:23:01 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Bangla Blogs]]></category> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[Wordpress Themes]]></category><guid isPermaLink="false">http://manchumahara.com/?p=677</guid> <description><![CDATA[ওয়ার্ডপ্রেসের এডমিন প্যানেলে লগিন করলেই একগাদা বক্স এসে হাজির হয়। যদিও স্ক্রিন অপশন থেকে সেগুলো সহজে তাড়ানো যায় কিন্তু যদি এমন হয় এডমিন নিজেই ড্যাশবোর্ড পরিস্কার করে রেখে দিলেন নতুন সদস্যের জন্য। তবে এই পরিস্কার এর কাজটা আমরা করবো সামান্য &#8230; <a href="http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>ওয়ার্ডপ্রেসের এডমিন প্যানেলে লগিন করলেই একগাদা বক্স এসে হাজির হয়। যদিও স্ক্রিন অপশন থেকে সেগুলো সহজে তাড়ানো যায় কিন্তু যদি এমন হয় এডমিন নিজেই ড্যাশবোর্ড পরিস্কার করে রেখে দিলেন নতুন সদস্যের জন্য। তবে এই পরিস্কার এর কাজটা আমরা করবো সামান্য কিছু পিএইচপি কোডিং করে।</p><p>ধাপ একঃ প্রথমে আপনার থীমের functions.php ফাইলে এ ২টি ফাংশন লিখতে হবে। মনে রাখবেন প্লাগিন এর কোডগুলো চাইলে functions.php ফাইলেও লেখা যায়। তাহলে শুরু করা যাকঃ</p><pre class="brush: php; title: ; notranslate">
    //Define the function which unsets the boxes
    function remove_dashboard_widgets() {
            global $wp_meta_boxes;
            myprint_r($wp_meta_boxes);
            /*
            //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
            # Remove plugins feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_plugins']);
            # Remove &quot;WordPress News&quot;
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_secondary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
            # Remove incoming links feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_incoming_links']);

            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['events_dashboard_window']);
           */
    }
    // Now hook in to the action
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets', 20, 0);

    //better print_r function taken from
    //http://stackoverflow.com/questions/1386331/php-print-r-nice-table
    function myprint_r($my_array) {
        if (is_array($my_array)) {
            echo &quot;&lt;table border=1 cellspacing=0 cellpadding=3 width=100%&gt;&quot;;
            echo '&lt;tr&gt;&lt;td colspan=2 style=&quot;background-color:#333333;&quot;&gt;&lt;strong&gt;&lt;font color=white&gt;ARRAY&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
            foreach ($my_array as $k =&gt; $v) {
                    echo '&lt;tr&gt;&lt;td valign=&quot;top&quot; style=&quot;width:40px;background-color:#F0F0F0;&quot;&gt;';
                    echo '&lt;strong&gt;' . $k . &quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&quot;;
                    myprint_r($v);
                    echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
            }
            echo &quot;&lt;/table&gt;&quot;;
            return;
        }
        echo $my_array;
    }
</pre><p><span id="more-677"></span><br /> ড্যাসবোর্ড এর বক্স বা উইডগেট গুলো একটা গ্লোবাল ভেরিয়েবল $wp_meta_boxes (টাইপ এরে) এ থাকে । এটা একটা মাল্টিডাইমেনশনাল এরে। যদি উপরের কোডটা লিখে ওয়ার্ডপ্রেসের এডমিন প্যানেলে প্রবেশ করেন তাহলে <a href="http://www.webpagescreenshot.info/img/259669-525201150932PM">এই ছবির</a> মতো দেখতে পারবেন।</p><p>দুইঃ এখন আমরা এটা দেখে দেখে বক্স বা উইডগেট গুলো বন্ধ করবো<br /> এখন আমরা remove_dashboard_widgets ফাংশনের কমেন্ট করা অংশ এক্টিভ করবো এবং দরকারে myprint_r($wp_meta_boxes); লাইনটা কমেন্ট করে দেবো।</p><pre class="brush: php; title: ; notranslate">
    //Define the function which unsets the boxes
    function remove_dashboard_widgets() {
            global $wp_meta_boxes;
            //myprint_r($wp_meta_boxes);
            //var_dump('&lt;pre&gt;'.$wp_meta_boxes.'&lt;/pre&gt;');

            //unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
            # Remove plugins feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_plugins']);
            # Remove &quot;WordPress News&quot;
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_secondary']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
            # Remove incoming links feed
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_incoming_links']);

            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
            unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
            unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
            //unset($wp_meta_boxes['dashboard']['normal']['core']['events_dashboard_window']);

    }
</pre><p>তিনঃ অনেক সময় নতুন প্লাগিন ড্যাশবোর্ড এ নতুন বক্স যুক্ত করে যা আমরা ধাপ এক এর মতো দেখে দেখে বন্ধ করে দিতে পারি। তবে এই কাজের জন্য দরকার হবে সামান্য পিএইচপি জ্ঞান <img src='http://manchumahara.com/wp-includes/images/smilies/icon_confused.gif' alt=':-?' class='wp-smiley' /></p><p>চারঃ<br /> ভাবছি একটা প্লাগিন নামিয়ে ফেলবো যেখান থেকে কি কি বক্স আছে তা ইচ্ছা মতো বন্ধ করা যাবে আবার দরকার এক্টিভেট করে দেওয়া যাবে।<br /> কেউ চাইলে আমার সাথে এই প্লাগিন এর কাজে অংশ নিতে পারেন। আমি আইডিয়া এবং কোড স্যাম্পেল দিয়ে দেবো শুরু করার জন্য এবং আপনাকে বাদ বাকী কাজটা সারতে হবে।</p><p>লেখাটি <a target="_blank" href="http://forum.amaderprojukti.com/viewtopic.php?f=60&#038;t=6629&#038;p=52949#p52949">আমাদের প্রযুক্তি ফোরামে</a> পূর্বে প্রকাশিত।</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/05/26/lets-clean-wordpress-dashboard/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Adding custom article submission form in joomla</title><link>http://manchumahara.com/2011/04/11/adding-custom-article-submission-form-in-joomla/</link> <comments>http://manchumahara.com/2011/04/11/adding-custom-article-submission-form-in-joomla/#comments</comments> <pubDate>Mon, 11 Apr 2011 07:38:57 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Joomla]]></category> <category><![CDATA[Tips and Tricks]]></category><guid isPermaLink="false">http://manchumahara.com/?p=669</guid> <description><![CDATA[In joomla registered user can submit article from front end. Today I am going to show how we can create new/custom view for article submission form. Here we need to go some technical steps. So let&#8217;s make a plan what &#8230; <a href="http://manchumahara.com/2011/04/11/adding-custom-article-submission-form-in-joomla/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>In joomla registered user can submit article from front end. Today I am going to show how we can create new/custom view for article submission form. Here we need to go some technical steps. So let&#8217;s make a plan what we are going to do:</p><ol><li>Create new view</li><li>Add custom option for that view via xml configuration</li><li>Adding new menu with the new custom view</li><li><strong>Edit a core</strong> file to make this happen.</li></ol><h4>Create new view</h4><p>To create a new view(view of MVC model used in joomla) at first copy paste the two files(form.php and form.xml) and rename as form2.php and form2.xml from directory components/com_content/views/article/tmpl.</p><p>Now modify the code for form2.php<br /> <span id="more-669"></span></p><pre class="brush: php; title: ; notranslate">
&lt;?php // no direct access
defined('_JEXEC') or die('Restricted access');

$config =&amp; JFactory::getConfig();
$publish_up =&amp; JFactory::getDate($this-&gt;article-&gt;publish_up);
$publish_up-&gt;setOffset($config-&gt;getValue('config.offset'));
$publish_up = $publish_up-&gt;toFormat();

if (! isset($this-&gt;article-&gt;publish_down) || $this-&gt;article-&gt;publish_down == 'Never') {
	$publish_down = JText::_('Never');
} else {
	$publish_down =&amp; JFactory::getDate($this-&gt;article-&gt;publish_down);
	$publish_down-&gt;setOffset($config-&gt;getValue('config.offset'));
	$publish_down = $publish_down-&gt;toFormat();
}
?&gt;

&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
&lt;!--
function setgood() {
	// TODO: Put setGood back
	return true;
}

var sectioncategories = new Array;
&lt;?php
$i = 0;
foreach ($this-&gt;lists['sectioncategories'] as $k=&gt;$items) {
	foreach ($items as $v) {
		echo &quot;sectioncategories[&quot;.$i++.&quot;] = new Array( '$k','&quot;.addslashes( $v-&gt;id ).&quot;','&quot;.addslashes( $v-&gt;title ).&quot;' );\n\t\t&quot;;
	}
}
?&gt;

function submitbutton(pressbutton) {
	var form = document.adminForm;
	if (pressbutton == 'cancel') {
		submitform( pressbutton );
		return;
	}
	try {
		form.onsubmit();
	} catch(e) {
		alert(e);
	}

	// do field validation
	var text = &lt;?php echo $this-&gt;editor-&gt;getContent( 'text' ); ?&gt;
	if (form.title.value == '') {
		return alert ( &quot;&lt;?php echo JText::_( 'Article must have a title', true ); ?&gt;&quot; );
	} else if (text == '') {
		return alert ( &quot;&lt;?php echo JText::_( 'Article must have some text', true ); ?&gt;&quot;);
	} else if (parseInt('&lt;?php echo $this-&gt;article-&gt;sectionid;?&gt;')) {
		// for articles
		if (form.catid &amp;&amp; getSelectedValue('adminForm','catid') &lt; 1) {
			return alert ( &quot;&lt;?php echo JText::_( 'Please select a category', true ); ?&gt;&quot; );
		}
	}
	&lt;?php echo $this-&gt;editor-&gt;save( 'text' ); ?&gt;
	submitform(pressbutton);
}
//--&gt;
&lt;/script&gt;
&lt;?php if ($this-&gt;params-&gt;get('show_page_title', 1)) : ?&gt;
&lt;div class=&quot;componentheading&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('pageclass_sfx')); ?&gt;&quot;&gt;&lt;?php echo $this-&gt;escape($this-&gt;params-&gt;get('page_title')); ?&gt;&lt;/div&gt;
&lt;?php endif; ?&gt;
&lt;form action=&quot;&lt;?php echo $this-&gt;action ?&gt;&quot; method=&quot;post&quot; name=&quot;adminForm&quot; onSubmit=&quot;setgood();&quot;&gt;
&lt;fieldset&gt;
&lt;legend&gt;&lt;?php echo JText::_('Editor'); ?&gt;&lt;/legend&gt;
&lt;table class=&quot;adminform&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;
	&lt;td&gt;
		&lt;div style=&quot;float: left;&quot;&gt;
			&lt;label for=&quot;title&quot;&gt;
				&lt;?php echo JText::_( 'Title' ); ?&gt;:
			&lt;/label&gt;
			&lt;input class=&quot;inputbox&quot; type=&quot;text&quot; id=&quot;title&quot; name=&quot;title&quot; size=&quot;50&quot; maxlength=&quot;100&quot; value=&quot;&lt;?php echo $this-&gt;escape($this-&gt;article-&gt;title); ?&gt;&quot; /&gt;
			&lt;input class=&quot;inputbox&quot; type=&quot;hidden&quot; id=&quot;alias&quot; name=&quot;alias&quot; value=&quot;&lt;?php echo $this-&gt;escape($this-&gt;article-&gt;alias); ?&gt;&quot; /&gt;
		&lt;/div&gt;
		&lt;div style=&quot;float: right;&quot;&gt;
			&lt;button type=&quot;button&quot; onclick=&quot;submitbutton('save')&quot;&gt;
				&lt;?php echo JText::_('Save') ?&gt;
			&lt;/button&gt;
			&lt;button type=&quot;button&quot; onclick=&quot;submitbutton('cancel')&quot;&gt;
				&lt;?php echo JText::_('Cancel') ?&gt;
			&lt;/button&gt;
		&lt;/div&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;?php
echo $this-&gt;editor-&gt;display('text', $this-&gt;article-&gt;text, '100%', '400', '70', '15');
?&gt;
&lt;/fieldset&gt;
&lt;fieldset&gt;
&lt;legend&gt;&lt;?php echo JText::_('Publishing'); ?&gt;&lt;/legend&gt;
&lt;table class=&quot;adminform&quot;&gt;
&lt;!--tr&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;sectionid&quot;&gt;
			&lt;?php echo JText::_( 'Section' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;?php echo $this-&gt;lists['sectionid']; ?&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;catid&quot;&gt;
			&lt;?php echo JText::_( 'Category' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;?php echo $this-&gt;lists['catid']; ?&gt;
	&lt;/td&gt;
&lt;/tr--&gt;
&lt;input type=&quot;hidden&quot; name=&quot;sectionid&quot; value=&quot;&lt;?php  echo $this-&gt;params-&gt;get('customsectionid', 0); ?&gt;&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;catid&quot; value=&quot;&lt;?php  echo $this-&gt;params-&gt;get('customcategoryid', 0); ?&gt;&quot; /&gt;
&lt;?php if ($this-&gt;user-&gt;authorize('com_content', 'publish', 'content', 'all')) : ?&gt;
&lt;!--tr&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;state&quot;&gt;
			&lt;?php echo JText::_( 'Published' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;?php echo $this-&gt;lists['state']; ?&gt;
	&lt;/td&gt;
&lt;/tr--&gt;
&lt;input type=&quot;hidden&quot; name=&quot;state&quot; value=&quot;&lt;?php  echo $this-&gt;params-&gt;get('customstate', 1); ?&gt;&quot; /&gt;
&lt;?php endif; ?&gt;
&lt;!--tr&gt;
	&lt;td width=&quot;120&quot; class=&quot;key&quot;&gt;
		&lt;label for=&quot;frontpage&quot;&gt;
			&lt;?php echo JText::_( 'Show on Front Page' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;?php echo $this-&gt;lists['frontpage']; ?&gt;
	&lt;/td&gt;
&lt;/tr--&gt;
&lt;input type=&quot;hidden&quot; name=&quot;frontpage&quot; value=&quot;&lt;?php  echo $this-&gt;params-&gt;get('customfrontpage', 0); ?&gt;&quot; /&gt;
&lt;tr&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;created_by_alias&quot;&gt;
			&lt;?php echo JText::_( 'Author Alias' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;input type=&quot;text&quot; id=&quot;created_by_alias&quot; name=&quot;created_by_alias&quot; size=&quot;50&quot; maxlength=&quot;100&quot; value=&quot;&lt;?php echo $this-&gt;escape($this-&gt;article-&gt;created_by_alias); ?&gt;&quot; class=&quot;inputbox&quot; /&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;display:none;&quot;&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;publish_up&quot;&gt;
			&lt;?php echo JText::_( 'Start Publishing' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
	    &lt;?php echo JHTML::_('calendar', $publish_up, 'publish_up', 'publish_up', '%Y-%m-%d %H:%M:%S', array('class'=&gt;'inputbox', 'size'=&gt;'25',  'maxlength'=&gt;'19')); ?&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;display:none;&quot;&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;publish_down&quot;&gt;
			&lt;?php echo JText::_( 'Finish Publishing' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
	    &lt;?php echo JHTML::_('calendar', $publish_down, 'publish_down', 'publish_down', '%Y-%m-%d %H:%M:%S', array('class'=&gt;'inputbox', 'size'=&gt;'25',  'maxlength'=&gt;'19')); ?&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;display:none;&quot;&gt;
	&lt;td valign=&quot;top&quot; class=&quot;key&quot;&gt;
		&lt;label for=&quot;access&quot;&gt;
			&lt;?php echo JText::_( 'Access Level' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;?php echo $this-&gt;lists['access']; ?&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr style=&quot;display:none;&quot;&gt;
	&lt;td class=&quot;key&quot;&gt;
		&lt;label for=&quot;ordering&quot;&gt;
			&lt;?php echo JText::_( 'Ordering' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;?php echo $this-&gt;lists['ordering']; ?&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/fieldset&gt;

&lt;fieldset style=&quot;display:none;&quot;&gt;
&lt;legend&gt;&lt;?php echo JText::_('Metadata'); ?&gt;&lt;/legend&gt;
&lt;table class=&quot;adminform&quot;&gt;
&lt;tr&gt;
	&lt;td valign=&quot;top&quot; class=&quot;key&quot;&gt;
		&lt;label for=&quot;metadesc&quot;&gt;
			&lt;?php echo JText::_( 'Description' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;textarea rows=&quot;5&quot; cols=&quot;50&quot; style=&quot;width:500px; height:120px&quot; class=&quot;inputbox&quot; id=&quot;metadesc&quot; name=&quot;metadesc&quot;&gt;&lt;?php echo str_replace('&amp;','&amp;amp;',$this-&gt;article-&gt;metadesc); ?&gt;&lt;/textarea&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td  valign=&quot;top&quot; class=&quot;key&quot;&gt;
		&lt;label for=&quot;metakey&quot;&gt;
			&lt;?php echo JText::_( 'Keywords' ); ?&gt;:
		&lt;/label&gt;
	&lt;/td&gt;
	&lt;td&gt;
		&lt;textarea rows=&quot;5&quot; cols=&quot;50&quot; style=&quot;width:500px; height:50px&quot; class=&quot;inputbox&quot; id=&quot;metakey&quot; name=&quot;metakey&quot;&gt;&lt;?php echo str_replace('&amp;','&amp;amp;',$this-&gt;article-&gt;metakey); ?&gt;&lt;/textarea&gt;
	&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/fieldset&gt;

&lt;input type=&quot;hidden&quot; name=&quot;option&quot; value=&quot;com_content&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;&lt;?php echo $this-&gt;article-&gt;id; ?&gt;&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;version&quot; value=&quot;&lt;?php echo $this-&gt;article-&gt;version; ?&gt;&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;created_by&quot; value=&quot;&lt;?php echo $this-&gt;article-&gt;created_by; ?&gt;&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;referer&quot; value=&quot;&lt;?php echo str_replace(array('&quot;', '&lt;', '&gt;', &quot;'&quot;), '', @$_SERVER['HTTP_REFERER']); ?&gt;&quot; /&gt;
&lt;?php echo JHTML::_( 'form.token' ); ?&gt;
&lt;input type=&quot;hidden&quot; name=&quot;task&quot; value=&quot;&quot; /&gt;
&lt;/form&gt;
&lt;?php echo JHTML::_('behavior.keepalive'); ?&gt;
</pre><p>Here what we did is,</p><p>We set fixed section id got from menu option[see about this bellow in xml modify section], fixed category id, fixed option for publish state, fixed option for front page publish etc&#8230; just check the modified code. Also we hide some blocks using css so that the form submit page is more clean, you can remove that changes if you want.<br /> Now we need to modify the xml file to put the custom/new title, descriptions so that while creating menu we get the new menu with new title &amp; description.  So this is what I changed the xml file</p><h4>Add custom option for that view via xml configuration</h4><pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;metadata&gt;
	&lt;layout title=&quot;Article Submission Layout2&quot;&gt;
		&lt;message&gt;
			&lt;![CDATA[ARTICLE SUBMISSION LAYOUT2 DESC]]&gt;
		&lt;/message&gt;
	&lt;/layout&gt;
	&lt;state&gt;
		&lt;name&gt;Article Submission Layout3&lt;/name&gt;
		&lt;description&gt;ARTICLE SUBMISSION LAYOUT3 DESC&lt;/description&gt;
		&lt;params&gt;
			&lt;param name=&quot;customsectionid&quot; type=&quot;text&quot; default=&quot;&quot; label=&quot;Section ID&quot; description=&quot;Put section ID&quot; /&gt;
			&lt;param name=&quot;customcategoryid&quot; type=&quot;text&quot; default=&quot;&quot; label=&quot;Category ID&quot; description=&quot;Put category ID&quot; /&gt;
			&lt;param name=&quot;customstate&quot; type=&quot;radio&quot; default=&quot;1&quot; label=&quot;Default Published&quot; description=&quot;Articles will be default published&quot;&gt;
				&lt;option value=&quot;0&quot;&gt;No&lt;/option&gt;
				&lt;option value=&quot;1&quot;&gt;Yes&lt;/option&gt;
            &lt;/param&gt;
            &lt;param name=&quot;customfrontpage&quot; type=&quot;radio&quot; default=&quot;0&quot; label=&quot;Default show on frontpage&quot; description=&quot;Defautl show the articles in front page&quot;&gt;
				&lt;option value=&quot;0&quot;&gt;No&lt;/option&gt;
				&lt;option value=&quot;1&quot;&gt;Yes&lt;/option&gt;
            &lt;/param&gt;
		&lt;/params&gt;
	&lt;/state&gt;
&lt;/metadata&gt;
</pre><p>Here the changed titles are<br /> Article Submission Layout -&gt; Article Submission Layout<strong>2</strong><br /> ARTICLE SUBMISSION LAYOUT DESC -&gt; ARTICLE SUBMISSION LAYOUT<strong>2</strong> DESC</p><p>To add the new strings we need to add two lines more in language file. Open file administrator/language/en-GB/en-GB.com_content.ini  and add at bottom of that file<br /> ARTICLE SUBMISSION LAYOUT2=Custom Article Submission Layout<br /> ARTICLE SUBMISSION LAYOUT2 DESC=Allows Users to submit an Article. Note: this will only work for Authors and above!</p><p>And we added some new options so that we can set from menu</p><ul><li>Set(fixed) category for posting(here category will be set as hidden field)</li><li>Set(fixed) section for posting(here category will be set as hidden field)</li><li>Set option for auto publish or not</li><li>Set option for publish in front page or not</li></ul><h4>Adding new menu with the new custom view</h4><p>Ok, now go to menu manager and try to create  new menu for article submit, I think you will get new option for submit form. Select that and fill the options in right for the menu&#8230; remember ? &#8230;we set some custom option in xml file for adding some fixed option to show in front end submit form ?<br /> <img class="aligncenter size-full wp-image-672" title="articlesubmit" src="http://manchumahara.com/wp-content/uploads/2011/04/articlesubmit.png" alt="" width="340" height="247" /><br /> <img class="aligncenter size-full wp-image-673" title="articlesubmit2" src="http://manchumahara.com/wp-content/uploads/2011/04/articlesubmit2.png" alt="" width="863" height="301" /></p><h4><strong>Edit a core</strong> file to make this happen</h4><p>So as I told you, to load the new template(that form, form2 are actually view) from view(view.html.php is the view file that loads the templates). Open file components/com_content/views/article/view.html.php  and add few lines after line 52</p><pre class="brush: php; title: ; notranslate">
if($this-&gt;getLayout() == 'form2') {
			$this-&gt;_displayForm($tpl);
			return;
		}
</pre>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/04/11/adding-custom-article-submission-form-in-joomla/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/04/11/adding-custom-article-submission-form-in-joomla/feed/</wfw:commentRss> <slash:comments>16</slash:comments> </item> <item><title>Show/Hide comment status text in wordpress</title><link>http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/</link> <comments>http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/#comments</comments> <pubDate>Tue, 29 Mar 2011 04:48:47 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category><guid isPermaLink="false">http://manchumahara.com/?p=665</guid> <description><![CDATA[I am again confused if my post title is perfect or not So let me explain, sometimes we disable comment for any post or page and at last the text shows &#8220;Comments are closed&#8221; or something else in different ways. &#8230; <a href="http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I am again confused if my post title is perfect or not <img src='http://manchumahara.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> So let me explain, sometimes we disable comment for any post or page and at last the text shows &#8220;Comments are closed&#8221;  or something else in different ways. But in commercial projects we need to follow some good design where in some posts or pages we may need to enable comment or not. So, let&#8217;s put a trick in theme to show the comment text(comment status in more smart way)</p><p>In latest wordpress version the loop is in the loop.php file in the theme folder. So for comment we will get this line</p><pre class="brush: php; title: ; notranslate">
&lt;?php comments_template( '', true ); ?
</pre><p>But how about we put</p><pre class="brush: php; title: ; notranslate">
&lt;?php if($post-&gt;comment_status == &quot;open&quot;){comments_template( '', true );} ?&gt;
</pre><p>That means if comment is off then we will not show any text like &#8220;Comments are closed&#8221; . I strongly believe this trick will make the design clean in some condition <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p>Thank you</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/03/29/showhide-comment-status-text-in-wordpress/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>CSS3 Dropdown menu for wordpress default theme</title><link>http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/</link> <comments>http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/#comments</comments> <pubDate>Mon, 28 Mar 2011 10:05:14 +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://manchumahara.com/?p=660</guid> <description><![CDATA[At first look at the demo of a pure css3 dropdownload menu. For more details see the main post link here. I was thinking to make the default wordpress drop down menu like this and I just tried and did &#8230; <a href="http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>At first look at the demo of a <a rel="nofollow external" href="http://www.webdesignerwall.com/demo/css3-dropdown-menu/css-gradient-dropdown.html" target="_blank">pure css3 dropdownload menu</a>. For more details see the main post link <a rel="nofollow external" href="http://webdesignerwall.com/tutorials/css3-dropdown-menu" target="_blank">here</a>.<br /> <img class="aligncenter size-full wp-image-661" title="css3dropdownloadmenu" src="http://manchumahara.com/wp-content/uploads/2011/03/css3dropdownloadmenu.png" alt="" width="629" height="186" /><br /> <span id="more-660"></span><br /> I was thinking to make the default wordpress drop down menu like this and I just tried and did this. Though you may need little adjustment if you use this with any custom theme. Also I added the dropdown menu with my custom theme used in <a rel="follow internal" href="http://idea52.com" target="_blank">idea52.com</a>. See my output</p> <img class="size-full wp-image-662" title="css3dropdownloadmenu2" src="http://manchumahara.com/wp-content/uploads/2011/03/css3dropdownloadmenu2.png" alt="" width="865" height="321" /><p>So let&#8217;s make the default top dropdown menu like above. We need to play with our default theme stylesheet style.css. Open file style.css file from theme twentyten and find the line</p><pre class="brush: css; title: ; notranslate">
/* =Menu
-------------------------------------------------------------- */
</pre><p>And find code like</p><pre class="brush: css; title: ; notranslate">
/* =Content
-------------------------------------------------------------- */
</pre><p>We need remove code or replace all css code between those two line and paste with the following code.</p><pre class="brush: css; title: ; notranslate">
#access {
	/*background: #000;*/
	display: block;
	float: left;
	margin: 0 auto;
	width: 940px;
}
#access .menu-header,
div.menu {
	font-size: 13px;
	margin:0;
	width: 928px;
}
#access .menu-header ul,div.menu ul {
	list-style: none;
	margin: 0;
}
#access .menu-header li,div.menu li {
/*	float: left;
	position: relative;*/
}
/*
#access a {
	color: #aaa;
	display: block;
	line-height: 38px;
	padding: 0 10px;
	text-decoration: none;
}
#access ul ul {
	box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
	-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
	-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
	display: none;
	position: absolute;
	top: 38px;
	left: 0;
	float: left;
	width: 180px;
	z-index: 99999;
}
#access ul ul li {
	min-width: 180px;
}
#access ul ul ul {
	left: 100%;
	top: 0;
}
#access ul ul a {
	background: #333;
	line-height: 1em;
	padding: 10px;
	width: 160px;
	height: auto;
}
#access li:hover &gt; a,
#access ul ul :hover &gt; a {
	background: #333;
	color: #fff;
}
#access ul li:hover &gt; ul {
	display: block;
}
#access ul li.current_page_item &gt; a,
#access ul li.current-menu-ancestor &gt; a,
#access ul li.current-menu-item &gt; a,
#access ul li.current-menu-parent &gt; a {
	color: #fff;
}
* html #access ul li.current_page_item a,
* html #access ul li.current-menu-ancestor a,
* html #access ul li.current-menu-item a,
* html #access ul li.current-menu-parent a,
* html #access ul li a:hover {
	color: #fff;
}
*/
#access ul { width: 940px;
	margin: 0;
	padding: 7px 6px 0;
	line-height: 100%;
	border-radius: 2em;

	-webkit-border-radius: 2em;
	-moz-border-radius: 2em;

	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);

	background: #8b8b8b; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9', endColorstr='#7a7a7a'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#a9a9a9), to(#7a7a7a)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #a9a9a9,  #7a7a7a); /* for firefox 3.6+ */

	border: solid 1px #6d6d6d;
}
#access ul li {
	margin: 0 5px;
	padding: 0 0 8px;
	float: left;
	position: relative;
	list-style: none;
}
#access ul li.current_page_item a.level_0{}
/* main level link */
#access ul a {
	font-weight: bold;
	color: #e7e5e5;
	text-decoration: none;
	display: block;
	padding:  8px 20px;
	margin: 0;
	-webkit-border-radius: 1.6em;
	-moz-border-radius: 1.6em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
/* main level link hover */
#access ul li.current-menu-item a.level_0, #access ul li.current-menu-item a.level_0:hover, #access ul li:hover &gt; a {
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#access ul ul li:hover a, #access ul li:hover li a {
	background: none;
	border: none;
	color: #666;
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
}
#access ul ul a:hover {
	background: #0399d4 !important; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec', endColorstr='#0186ba'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#04acec), to(#0186ba)) !important; /* for webkit browsers */
	background: -moz-linear-gradient(top,  #04acec,  #0186ba) !important; /* for firefox 3.6+ */

	color: #fff !important;
	-webkit-border-radius: 0;
	-moz-border-radius: 0;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#access ul ul {
	background: #ddd; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cfcfcf'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#cfcfcf)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #fff,  #cfcfcf); /* for firefox 3.6+ */

	display: none;
	margin: 0;
	padding: 0;
	width: 185px;
	position: absolute;
	top: 35px;
	left: 0;
	border: solid 1px #b4b4b4;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#access ul li:hover &gt; ul {
	display: block;
}
#access ul ul li {
	float: none;
	margin: 0;
	padding: 0;
}
#access ul ul a {
	font-weight: normal;
	text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#access ul ul ul {
	left: 181px;
	top: -3px;
}
/* rounded corners for first and last child */
#access ul ul li:first-child &gt; a {
	-webkit-border-top-left-radius: 9px;
	-moz-border-radius-topleft: 9px;
	-webkit-border-top-right-radius: 9px;
	-moz-border-radius-topright: 9px;
}
#access ul ul li:last-child &gt; a {
	-webkit-border-bottom-left-radius: 9px;
	-moz-border-radius-bottomleft: 9px;
	-webkit-border-bottom-right-radius: 9px;
	-moz-border-radius-bottomright: 9px;
}

/* clearfix */
#access ul:after {
	content: &quot;.&quot;;
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}
#access ul {
	display: inline-block;
}
html[xmlns] #access ul {
	display: block;
}
* html #access ul {
	height: 1%;
}

#access ul li.current-menu-ancestor a.level_0{
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
#access ul ul li.current-menu-ancestor a{ }
</pre><p>Oh we need to add few lines in functions.php file for better support</p><p>open functions.php file and add at last</p><pre class="brush: php; title: ; notranslate">
function walker_nav_menu_start_el_adddepth($item_output, $item, $depth, $args)
{
    $item_output = str_replace('&lt;a href=&quot;', '&lt;a class=&quot;level_'.$depth.'&quot; href=&quot;',$item_output);
    return $item_output;

}
add_filter('walker_nav_menu_start_el','walker_nav_menu_start_el_adddepth', 10,4);
</pre><p>Also note that the css code will not work exactly if browser is not css3 supported or need to add some exception rules in some cases.<br /> Wait wait, you can do the same thing for joomla1.5 default template&#8217;s pillmenu(top main menu) and replace the pillmenu css with following, I think you know where to edit, if not then find yourself, I am busy.</p><pre class="brush: css; title: ; notranslate">
/* horizontal pill menu */
table.pill {
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}
/*
td.pill_l {
  background: url(../images/mw_menu_cap_l.png) no-repeat;
  width:  20px;
  height: 32px;

}

td.pill_m {
  background: url(../images/mw_menu_normal_bg.png) repeat-x;
  padding: 0;
  margin: 0;
  width: auto;
}

td.pill_r {
  background: url(../images/mw_menu_cap_r.png) no-repeat;
  width:  19px;
  height: 32px;
}

#pillmenu {
  white-space: nowrap;
  height: 32px;
  float: left;
}

#pillmenu ul {
  margin: 0;
  padding: 0;
  list-style:none;
}

#pillmenu li {
	float: left;
	background: url(../images/mw_menu_separator.png) top right no-repeat;
	margin: 0;
	padding: 0;
}

#pillmenu a {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
	float:left;
  display:block;
  height: 24px;
  line-height: 24px;
  padding: 0 20px;
  color: #000;
  text-decoration: none;
}

#pillmenu a#active_menu-nav {
	margin-top:2px;
	height: 21px;
	line-height: 21px;
	background-position: 0 0;
}
*/
#pillmenu {
	/*background: #000;*/
	display: block;
	float: left;
	margin: 0 auto;
	width: 940px;
}
#pillmenu .menu-header,
div.menu {
	font-size: 13px;
	margin:0;
	width: 928px;
}
#pillmenu .menu-header ul,div.menu ul {
	list-style: none;
	margin: 0;
}
#pillmenu .menu-header li,div.menu li {
/*	float: left;
	position: relative;*/
}
#pillmenu ul { width: 940px;
	margin: 0;
	padding: 7px 6px 0;
	line-height: 100%;
	border-radius: 2em;

	-webkit-border-radius: 2em;
	-moz-border-radius: 2em;

	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);

	background: #8b8b8b; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9', endColorstr='#7a7a7a'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#a9a9a9), to(#7a7a7a)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #a9a9a9,  #7a7a7a); /* for firefox 3.6+ */

	border: solid 1px #6d6d6d;
}
#pillmenu ul li {
	margin: 0 5px;
	padding: 0 0 8px;
	float: left;
	position: relative;
	list-style: none;
}
#pillmenu ul li.current_page_item a.level_0{}
/* main level link */
#pillmenu ul a {
	font-weight: bold;
	color: #e7e5e5;
	text-decoration: none;
	display: block;
	padding:  8px 20px;
	margin: 0;
	-webkit-border-radius: 1.6em;
	-moz-border-radius: 1.6em;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
	text-align:left;
}
/* main level link hover */
#pillmenu ul li.active a, #pillmenu ul li.current-menu-item a.level_0:hover, #pillmenu ul li:hover &gt; a {
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#pillmenu ul ul li:hover a, #pillmenu ul li:hover li a {
	background: none;
	border: none;
	color: #666;
	-webkit-box-shadow: none;
	-moz-box-shadow: none;
}
#pillmenu ul ul a:hover {
	background: #0399d4 !important; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec', endColorstr='#0186ba'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#04acec), to(#0186ba)) !important; /* for webkit browsers */
	background: -moz-linear-gradient(top,  #04acec,  #0186ba) !important; /* for firefox 3.6+ */

	color: #fff !important;
	-webkit-border-radius: 0;
	-moz-border-radius: 0;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#pillmenu ul ul {
	background: #ddd; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cfcfcf'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#cfcfcf)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #fff,  #cfcfcf); /* for firefox 3.6+ */
	display: none;
	margin: 0;
	padding: 0;
	width: 185px;
	position: absolute;
	top: 35px;
	left: 0;
	border: solid 1px #b4b4b4;
	-webkit-border-radius: 10px;
	-moz-border-radius: 10px;
	border-radius: 10px;
	-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#pillmenu ul li:hover &gt; ul {
	display: block;
}
#pillmenu ul ul li {
	float: none;
	margin: 0;
	padding: 0;
}
#pillmenu ul ul a {
	font-weight: normal;
	text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#pillmenu ul ul ul {
	left: 181px;
	top: -3px;
}
/* rounded corners for first and last child */
#pillmenu ul ul li:first-child &gt; a {
	-webkit-border-top-left-radius: 9px;
	-moz-border-radius-topleft: 9px;
	-webkit-border-top-right-radius: 9px;
	-moz-border-radius-topright: 9px;
}
#pillmenu ul ul li:last-child &gt; a {
	-webkit-border-bottom-left-radius: 9px;
	-moz-border-radius-bottomleft: 9px;
	-webkit-border-bottom-right-radius: 9px;
	-moz-border-radius-bottomright: 9px;
}

/* clearfix */
#pillmenu ul:after {
	content: &quot;.&quot;;
	display: block;
	clear: both;
	visibility: hidden;
	line-height: 0;
	height: 0;
}
#pillmenu ul {
	display: inline-block;
}
/*
html[xmlns] #pillmenu ul {
	display: block;
}
* html #pillmenu ul {
	height: 1%;
}
*/

#pillmenu ul li.current-menu-ancestor a.level_0{
	background: #d1d1d1; /* for non-css3 browsers */
	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
	background: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#a1a1a1)); /* for webkit browsers */
	background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */
	color: #444;
	border-top: solid 1px #f8f8f8;
	-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
#pillmenu ul ul li.current-menu-ancestor a{ }
</pre><p>and see my output for a local site in joomla1.5 with default template.<br /> <img class="aligncenter size-full wp-image-664" title="css3dropdownloadmenu3" src="http://manchumahara.com/wp-content/uploads/2011/03/css3dropdownloadmenu3.png" alt="" width="557" height="250" /><br /> Thank you for reading.</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/03/28/css3-dropdown-menu-for-wordpress-default-theme/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Loading only component in joomla</title><link>http://manchumahara.com/2011/03/18/loading-only-component-in-joomla/</link> <comments>http://manchumahara.com/2011/03/18/loading-only-component-in-joomla/#comments</comments> <pubDate>Fri, 18 Mar 2011 14:42:22 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Joomla]]></category> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[modal]]></category><guid isPermaLink="false">http://manchumahara.com/?p=658</guid> <description><![CDATA[I am not sure if my post title is perfect about what I want to express , let me clear. When we hit any link in joomla that must load any component with modules, header, footer &#8230; etc so many &#8230; <a href="http://manchumahara.com/2011/03/18/loading-only-component-in-joomla/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I am not sure if my post title is perfect about what I want to express <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> , let me clear. When we hit any link in joomla that must load any component with modules, header, footer &#8230; etc so many things. But what we need to do  if we want to load only the component part ? Ok if still you are not clear, then go to your template index.php file and check what you do with the following line</p><pre class="brush: plain; title: ; notranslate">&lt;jdoc:include type=&quot;component&quot; /&gt;</pre><p>Yes I am talking about how we can load only the component with any link that the above line does. let you are in a link in your site for com_content, for me now I am in that link in my local test site. http://localhost/jtest/index.php?option=com_content&amp;view=category&amp;layout=blog&amp;id=1&amp;Itemid=50</p><p>If I go to the  link I see full site. Ok now if I modify the url by appending &amp;tmpl=component at end</p><p>http://localhost/jtest/index.php?option=com_content&#038;view=category&#038;layout=blog&#038;id=1&#038;Itemid=50&#038;tmpl=component</p><p>I see only the component part.  Please try yourself. This is how we can just show the component part. If you check your template folder there is a file named component.php which actually shows if component only link is opens. If that file is missing in your template then find in the system template folder. Also there are another two template files for error.php and offline.php which shows the error page and site offline mode page.</p><p>Now let me discuss when you may need to load the component only part. Let&#8217;s you want to show something via joomla native popup window, like you want to make popup login you can do this trick. <a href="http://manchumahara.com/2010/04/24/adding-joomla-native-modal-to-frontend/" target="_blank">Once I wrote a article about how to make modal (popup window) using joomla native modal javascript library.</a></p><p>Example: go to my joomla demo site  <a href="http://idea52.com/old/">http://idea52.com/old/</a> click the feedback button, it will load the com_contact component in joomla native modal window.</p><p>Thank you.</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2011/03/18/loading-only-component-in-joomla/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2011/03/18/loading-only-component-in-joomla/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>How to Insert custom Quicktags into the WordPress Editor</title><link>http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/</link> <comments>http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/#comments</comments> <pubDate>Fri, 24 Dec 2010 19:31:00 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[editor]]></category> <category><![CDATA[quick tags]]></category><guid isPermaLink="false">http://manchumahara.com/?p=647</guid> <description><![CDATA[WordPress has two type of editor, one is visual/wysiwyw that is tinymce or replace with other such editors and another is HTML editor that is we call quick tag editor. Today, I want to write something about how to add &#8230; <a href="http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>WordPress has two type of editor, one is visual/wysiwyw that is tinymce or replace with other such editors and another is HTML editor that is we call quick tag editor. Today, I want to write something about how to add custom quick tags or custom buttons. I search about it in google and most guides to edit core quick tag javascript file. But I don&#8217;t like that and I made my own hack in my own way,  though experts may think it&#8217;s childish <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p>So let come to point, I wanted to add some buttons that will give me option to add custom class name  so that I can format the text well. Same thing can be done via Visual editor but you have to use a plugin named &#8220;<a href="http://wordpress.org/extend/plugins/tinymce-advanced/" target="_blank">Tinymce Advanced</a>&#8221; which helps to add more advance buttons like styles(class lists) and so on. But for HTML mode or  for quick tags editor I didn&#8217;t such plugins.<br /> <span id="more-647"></span><br /> Let&#8217;s start , output will be like the bellow image</p><p><img class="aligncenter size-full wp-image-648" title="quicktags" src="http://manchumahara.com/wp-content/uploads/2010/12/quicktags.png" alt="" width="839" height="198" /></p><h4>Step 1: Adding action for editor</h4><pre class="brush: php; title: ; notranslate">
add_action( 'edit_form_advanced', 'manchumahara_quicktags');
add_action( 'edit_page_form',');
</pre><h4>Step 2: Function to hook</h4><pre class="brush: php; title: ; notranslate">
function manchumahara_quicktags()
{

    ?&gt;
    &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
    // &lt;![CDATA[
        //edButton(id, display, tagStart, tagEnd, access, open)
        edbuttonlength = edButtons.length;
        edbuttonlength_t = edbuttonlength;
        //alert(edButtons);
        edButtons[edbuttonlength++] = new edButton('ed_itemname','Item Name','&lt;span class=&quot;itemleft&quot;&gt;','&lt;/span&gt;');
        edButtons[edbuttonlength++] = new edButton('ed_itemprice','Item Price','&lt;span class=&quot;itemprice&quot;&gt;','&lt;/span&gt;');
        edButtons[edbuttonlength++] = new edButton('ed_itemcaption','Item Caption','&lt;span class=&quot;itemcaption&quot;&gt;','&lt;/span&gt;');
            //alert(edButtons[edButtons.length]);
               (function(){

              if (typeof jQuery === 'undefined') {
                     return;
              }
              jQuery(document).ready(function(){
                     jQuery(&quot;#ed_toolbar&quot;).append('&lt;br/&gt;&lt;input type=&quot;button&quot; value=&quot;Item Name&quot; id=&quot;ed_itemname&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, edbuttonlength_t);&quot; title=&quot;Item Name&quot; /&gt;');
                     jQuery(&quot;#ed_toolbar&quot;).append('&lt;input type=&quot;button&quot; value=&quot;Item Price&quot; id=&quot;ed_itemprice&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, edbuttonlength_t+1);&quot; title=&quot;Item Price&quot; /&gt;');
                     jQuery(&quot;#ed_toolbar&quot;).append('&lt;input type=&quot;button&quot; value=&quot;Item Caption&quot; id=&quot;ed_itemcaption&quot; class=&quot;ed_button&quot; onclick=&quot;edInsertTag(edCanvas, edbuttonlength_t+2);&quot; title=&quot;Item Caption&quot; /&gt;');
              });
       }());
    // ]]&gt;
    &lt;/script&gt;
    &lt;?php

}
</pre><p>Explanation: Here I have added three buttons named &#8220;Itemname&#8221;, &#8220;Itemprice&#8221; and &#8220;Itemcaption&#8221;  and after those buttons are clicked  with some text selected each will  put a span class and so so&#8230;</p><p>I have used jquery to push the buttons to edButtons  array. To see how the quick tag js works see the file in wp-inclides/js/quicktags.dev.js  for better sense.</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/12/25/how-to-insert-custom-quicktags-into-the-wordpress-editor/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Adding custom generator tag in joomla</title><link>http://manchumahara.com/2010/11/17/adding-custom-generator-tag-in-joomla/</link> <comments>http://manchumahara.com/2010/11/17/adding-custom-generator-tag-in-joomla/#comments</comments> <pubDate>Tue, 16 Nov 2010 20:41:45 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Joomla]]></category> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[generator tag]]></category><guid isPermaLink="false">http://manchumahara.com/?p=640</guid> <description><![CDATA[Joomla creates a generator meta tag automatically. If you view source of your joomla site you can search for meta tag &#8220;generator&#8221;. The default generator tag looks like We can modify this generator tag and also can put option in &#8230; <a href="http://manchumahara.com/2010/11/17/adding-custom-generator-tag-in-joomla/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Joomla creates a generator meta tag automatically. If you view source of your joomla site you  can search for meta tag &#8220;generator&#8221;. The default generator tag looks like</p><pre class="brush: plain; title: ; notranslate">
&lt;meta name=&quot;generator&quot; content=&quot;Joomla! 1.5 - Open Source Content Management&quot; /&gt;
</pre><p>We can modify this generator tag and also can put option in our custom joomla template to change this meta tag to site name or something different. so let&#8217;s start <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>In you template index&#8217;s file header tag you can write  a line like bellow</p><pre class="brush: php; title: ; notranslate">
&lt;?php
$this-&gt;setGenerator(&quot;your custom generator name&quot;);
$this-&gt;setGenerator(&quot;&quot;); // you can leave that as blank too
?&gt;
</pre><p>We can set a option in template</p><p>in template index.php  file</p><pre class="brush: php; title: ; notranslate">
&lt;?php
 	  $myconfig = new JConfig();
	  $mysitename = $myconfig-&gt;sitename;
 ?&gt;
 &lt;?php
 if($this-&gt;params-&gt;get('removegeneratortag') == &quot;yes&quot;):
	// Remove the generator meta tag
	$this-&gt;setGenerator($mysitename);
endif;
 ?&gt;
</pre><p>in params.ini file  add extra line<br /> removegeneratortag=yes</p><p>in templateDetails.xml file</p><pre class="brush: xml; title: ; notranslate">
&lt;params&gt;
		&lt;param name=&quot;removegeneratortag&quot; type=&quot;list&quot; default=&quot;yes&quot; label=&quot;Remove Joomla Generator Tag&quot; description=&quot;Remove or disable joomla generator tag from head tag for security reason&quot;&gt;
			&lt;option value=&quot;yes&quot;&gt;Yes&lt;/option&gt;
			&lt;option value=&quot;no&quot;&gt;No&lt;/option&gt;
		&lt;/param&gt;
	&lt;/params&gt;
</pre><p>before</p><pre class="brush: plain; title: ; notranslate">&quot;&lt;/install&gt;&quot;'</pre><p> tag</p><p>you are done. I think now you can add/customize in your own way as you need. If you don&#8217;t know how to modify the above code then don&#8217;t try <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /></p><p>Thank you</p>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/11/17/adding-custom-generator-tag-in-joomla/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/11/17/adding-custom-generator-tag-in-joomla/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Adding vertical fixed feedback button</title><link>http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/</link> <comments>http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/#comments</comments> <pubDate>Wed, 25 Aug 2010 11:50:00 +0000</pubDate> <dc:creator>Manchumahara(Sabuj Kundu)</dc:creator> <category><![CDATA[Tips and Tricks]]></category> <category><![CDATA[wordpress]]></category> <category><![CDATA[Wordpress Themes]]></category> <category><![CDATA[css]]></category> <category><![CDATA[html]]></category><guid isPermaLink="false">http://manchumahara.com/?p=592</guid> <description><![CDATA[update: 06.09.2010 Wana use as wordpress or joomla plugin ? then buy from my official website Downloads For Joomla For WordPress The Story If you still didn&#8217;t notice, please check again there is a vertical feedback button in my blog &#8230; <a href="http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>update: 06.09.2010<br /> Wana use as wordpress or joomla plugin ? then buy from my official website</p><h4>Downloads</h4><p><a href="http://idea52.com/product/fixed-vertical-feedback-button-for-joomla">For Joomla</a><br /> <a href="http://idea52.com/product/fixed-vertical-feedback-button-for-wordpress">For WordPress</a></p><h4>The Story</h4><p>If you still didn&#8217;t notice, please check again there is a vertical feedback button in my blog , right side. So, sometimes people asks me how to do that ,,, any one can read the source code or having debug tool like <a href="http://getfirebug.com/" target="_blank">firebug</a> for firefox can see the source code and add in his own site. But max time, it&#8217;s true that we don&#8217;t want to learn by reading or google about any problem, we just ask other to get ready made solution. Even we don&#8217;t write in forums about our problems &#8230;. grr&#8230;</p><p>So here is answer of the those question, &#8220;How I added the vertical feedback button?&#8221;</p><p>I know how html works and how css works , I know where to edit in wordpress theme. So many days ago I saw that in a site and copied the source code and image and added in my site <img src='http://manchumahara.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br /> <strong>I am showing for default wordpress theme tweentyten</strong> and all paths shown bellow are windows style as windows is my primary os.</p><p><strong>Step1:</strong> Copy this <a href="http://manchumahara.com/wp-content/uploads/2010/08/feedback_tab_white.png">image</a> to your wp-contentthemestwentytenimages folder first.</p><p><strong>Step2:</strong> Open style.css file from wp-contentthemestwentyten  dir and ready to add some css code <img src='http://manchumahara.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br /> Step3: In the file style.css file at last line add the following css codes<br /> <span id="more-592"></span></p><pre class="brush: css; title: ; notranslate">
body &gt; a#feedbackright {
background:url(&quot;images/feedback_tab_white.png&quot;) no-repeat scroll 50% 50% #0066CC;
display:block;
height:90px;
line-height:0;
padding:5px;
position:fixed;
right:0;
/*left:0;*/
text-indent:-99999px;
top:50%;
width:22px;
}
body &gt; a#feedbackright:hover {
background-color:#FF8B00;
}
</pre><p>Here if you want to show in  left side then comment the right:0; line and uncomment the line left:0; Also if you want to up down the position of the feedback button then edit the value for top:50%</p><p><strong>Step3.: </strong>Open footer.php from the same dir of style.css file and go to bottom of that file to add the following lines after the end of wrapper div(<strong>here I have added the end tag of wrapper div so that you get easily</strong>)</p><pre class="brush: xml; title: ; notranslate">&lt;/div&gt;&lt;!-- #wrapper --&gt;
&lt;a href=&quot;&lt;?php echo get_permalink(here will be your contact page id); ?&gt;&quot; id=&quot;feedbackright&quot;&gt;feedback&lt;/a&gt;</pre><p>look in the above code there is something &#8220;here will be your contact page id&#8221;  you have to replace this text with your contact page id. if you don&#8217;t know how to get page id then you can install <a href="http://sivel.net/wordpress/simply-show-ids/">this wordpress plugin</a> and activate, then go to any menu from left column for listing like posts, pages, categories, tags etc you will see an extra line at right col for id. Ok let your contact page id is 2 then the line will be like</p><p>note: here I am writing the last tag of wrapper div</p><pre class="brush: xml; title: ; notranslate">&lt;a href=&quot;&lt;?php echo get_permalink(2); ?&gt;&quot; id=&quot;feedbackright&quot;&gt;feedback&lt;/a&gt;</pre><p>Step4: now it&#8217;s time you do it and let me know.</p><blockquote><p>Wana use as wordpress or joomla plugin ? then buy from my official website</p><h4>Downloads</h4><p><a href="http://idea52.com/product/fixed-vertical-feedback-button-for-joomla">For Joomla</a><br /> <a href="http://idea52.com/product/fixed-vertical-feedback-button-for-wordpress">For WordPress</a></p></blockquote>Comment is open. You can participate in the discussion by visiting <a href='http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/'>here</a> ]]></content:encoded> <wfw:commentRss>http://manchumahara.com/2010/08/25/adding-vertical-fixed-feedback-button/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 23/111 queries in 0.357 seconds using disk: basic
Object Caching 1032/1129 objects using disk: basic

Served from: manchumahara.com @ 2012-02-05 18:16:52 -->
