<?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>Ashfame &#124; Tech Blog &#187; programming</title>
	<atom:link href="http://blog.ashfame.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ashfame.com</link>
	<description>Hacking life of Power Users and Webmasters</description>
	<lastBuildDate>Thu, 15 Dec 2011 23:35:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://blog.ashfame.com/?pushpress=hub'/>
<cloud domain='blog.ashfame.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Fetch comments of a specific category in WordPress</title>
		<link>http://blog.ashfame.com/2011/04/get-comments-category-wordpress/</link>
		<comments>http://blog.ashfame.com/2011/04/get-comments-category-wordpress/#comments</comments>
		<pubDate>Sun, 17 Apr 2011 18:31:34 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=907</guid>
		<description><![CDATA[WordPress already provides an easy function for fetching the comments get_comments() but the function only supports fetching comments of a particular user, or for a particular post and not fetching comments of a particular category. The code for the former two cases, is pretty simple but the last one is not so simple. Here are [...]<ul>
		<li><a href="http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/" rel="bookmark">Show recent comments of a particular user in WordPress</a><!-- (27.9)--></li>
		<li><a href="http://blog.ashfame.com/2010/04/wordpress-plugin-move-comments-between-posts-change-parents/" rel="bookmark">WordPress Plugin to move comments between posts and change parents</a><!-- (23.6)--></li>
		<li><a href="http://blog.ashfame.com/2011/04/pagination-approach-get-posts-wordpress/" rel="bookmark">Pagination approach using get_posts() in WordPress</a><!-- (21)--></li>
		<li><a href="http://blog.ashfame.com/2007/12/wordpress-bug-fix-categories-shows-incorrect-number-posts-2/" rel="bookmark">WordPress Bug &#038; its Fix : Categories shows incorrect number of posts</a><!-- (17.1)--></li>
		<li><a href="http://blog.ashfame.com/2010/07/display-posts-from-another-wordpress-installation/" rel="bookmark">Display posts from another WordPress installation</a><!-- (14.6)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>WordPress already provides an easy function for fetching the comments <strong>get_comments()</strong> but the function only supports fetching comments of a particular user, or for a particular post and not fetching comments of a particular category. The code for the former two cases, is pretty simple but the last one is not so simple. Here are the code snippets as examples:</p>
<h2>Fetching Comments of a particular user</h2>
<pre class="brush: php; title: ; notranslate">
$args = array( 'number' =&gt; 10, 'status' =&gt; 'approve', 'user_id' =&gt; 1 );
$comments_list_by_user = get_comments( $args );
print_r ( $comments_list_by_user );
</pre>
<h2>Fetching Comments of a particular post</h2>
<pre class="brush: php; title: ; notranslate">
$args = array( 'number' =&gt; 10, 'status' =&gt; 'approve', 'post_id' =&gt; 30 );
$comments_list_post = get_comments( $args );
print_r ( $comments_list_post );
</pre>
<h2>Fetching Comments of a particular category</h2>
<p>Here is how you can fetch comments for a specific category:</p>
<pre class="brush: php; title: ; notranslate">
// Posts per page setting
$ppp = get_option('posts_per_page'); // either use the WordPress global Posts per page setting or set a custom one like $ppp = 10;
$custom_offset = 0; // If you are dealing with your custom pagination, then you can calculate the value of this offset using a formula

// category (can be a parent category)
$category_parent = 3;

// lets fetch sub categories of this category and build an array
$categories = get_terms( 'category', array( 'child_of' =&gt; $category_parent, 'hide_empty' =&gt; false ) );
$category_list =  array( $category_parent );
foreach( $categories as $term ) {
 $category_list[] = (int) $term-&gt;term_id;
}

// fetch posts in all those categories
$posts = get_objects_in_term( $category_list, 'category' );

$sql = &quot;SELECT comment_ID, comment_date, comment_content, comment_post_ID
 FROM {$wpdb-&gt;comments} WHERE
 comment_post_ID in (&quot;.implode(',', $posts).&quot;) AND comment_approved = 1
 ORDER by comment_date DESC LIMIT $ppp OFFSET $custom_offset&quot;;

$comments_list = $wpdb-&gt;get_results( $sql );

if ( count( $comments_list ) &gt; 0 ) {
 $date_format = get_option( 'date_format' );
 echo '&lt;ul&gt;';
 foreach ( $comments_list as $comment ) {
 echo '&lt;li&gt;Comment: '.substr( $comment-&gt;comment_content, 0, 50 ).'..&lt;br /&gt;'.date( $date_format, strtotime( $comment-&gt;comment_date ) ).'&lt;br /&gt;Post: &lt;a href=&quot;'.get_permalink( $comment-&gt;comment_post_ID ).'&quot;&gt;'.get_the_title( $comment-&gt;comment_post_ID ).'&lt;/a&gt;&lt;/li&gt;';
 }
 echo '&lt;/ul&gt;';
} else {
 echo '&lt;p&gt;No comments&lt;/p&gt;';
}
?&gt;
</pre>
<p>What we have done here is that, first we fetch sub categories of the category specified so as to include comments on those posts too which are under a sub-category of the specified category. Then we build an array of all these categories, where we need to look up for comments. Then we fetch the posts ID under those categories and then we use a query to fetch the comments on those posts. Finally, we display them as per our need by iterating <strong>$comments_list</strong>.</p>
<p>In case you want to fetch the comments of a  particular user under a specific category, then you can just change the SQL query in the above code to this:</p>
<pre class="brush: php; title: ; notranslate">
$user_id = 1; // change this to the user ID either manually or let it come from some other code
$sql = &quot;SELECT comment_ID, comment_date, comment_content, comment_post_ID
 FROM {$wpdb-&gt;comments} WHERE
 comment_post_ID in (&quot;.implode(',', $posts).&quot;) AND comment_approved = 1 AND user_id = $user_id
 ORDER by comment_date DESC LIMIT $ppp OFFSET $custom_offset&quot;;
</pre>
<p>I have used simple names for variables here to make it easy to understand. Always take care to provide your code in its own namespace, choose unique (non-generic) names. Read <a href="http://andrewnacin.com/2010/05/11/in-wordpress-prefix-everything/">prefix everything in WordPress</a>.</p>
<p>Need help? Got questions? Comment section is all yours! <img src='http://blog.ashfame.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
		<li><a href="http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/" rel="bookmark">Show recent comments of a particular user in WordPress</a><!-- (27.9)--></li>
		<li><a href="http://blog.ashfame.com/2010/04/wordpress-plugin-move-comments-between-posts-change-parents/" rel="bookmark">WordPress Plugin to move comments between posts and change parents</a><!-- (23.6)--></li>
		<li><a href="http://blog.ashfame.com/2011/04/pagination-approach-get-posts-wordpress/" rel="bookmark">Pagination approach using get_posts() in WordPress</a><!-- (21)--></li>
		<li><a href="http://blog.ashfame.com/2007/12/wordpress-bug-fix-categories-shows-incorrect-number-posts-2/" rel="bookmark">WordPress Bug &#038; its Fix : Categories shows incorrect number of posts</a><!-- (17.1)--></li>
		<li><a href="http://blog.ashfame.com/2010/07/display-posts-from-another-wordpress-installation/" rel="bookmark">Display posts from another WordPress installation</a><!-- (14.6)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2011/04/get-comments-category-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Pagination approach using get_posts() in WordPress</title>
		<link>http://blog.ashfame.com/2011/04/pagination-approach-get-posts-wordpress/</link>
		<comments>http://blog.ashfame.com/2011/04/pagination-approach-get-posts-wordpress/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 18:31:05 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=910</guid>
		<description><![CDATA[Yesterday, I talk about using WP_query or query_posts or get_posts and today I am going to explain the approach I use to have pagination using get_posts(). The other two methods take care of the pagination by them self by just passing the paged parameter along with the function call. But get_posts() is more of a [...]<ul>
		<li><a href="http://blog.ashfame.com/2011/04/difference-wp-query-vs-query-posts-vs-get-posts/" rel="bookmark">Which one to use WP_Query vs query_posts() vs get_posts()?</a><!-- (21.8)--></li>
		<li><a href="http://blog.ashfame.com/2011/04/get-comments-category-wordpress/" rel="bookmark">Fetch comments of a specific category in WordPress</a><!-- (17.2)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (12.6)--></li>
		<li><a href="http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/" rel="bookmark">Adding a custom user profile field to registration in WordPress</a><!-- (11.9)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-bbpress-content-inside-wordpress/" rel="bookmark">Show bbPress content inside WordPress</a><!-- (11.7)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I talk about using <a href="http://blog.ashfame.com/2011/04/difference-wp-query-vs-query-posts-vs-get-posts/">WP_query or query_posts or get_posts</a> and today I am going to explain the approach I use to have pagination using <strong>get_posts()</strong>. The other two methods take care of the pagination by them self by just passing the <em>paged</em> parameter along with the function call. But <strong>get_posts()</strong> is more of a raw function which I used to create paginated data on the basis of already existing pagination.</p>
<p>Here for the sake of explanation of approach, I am making the content paginated where content is already paginated. We will make our extra content work in order to the global <strong>$paged</strong> variable.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Posts Per Page option
$ppp = get_option('posts_per_page');

if (!is_paged()) {
	$custom_offset = 0;
} else {
	$custom_offset = $ppp*($paged-1);
}

// Lets suppose we are querying for posts of a certain author in a particular category
$args = array(
'numberposts' =&gt; $ppp,
'offset' =&gt; $custom_offset,
'category' =&gt; 7, // Category ID of category 'Articles'
'author' =&gt; $author_id
);

$posts_data = get_posts( $args );

if ( count( $posts_data ) &gt; 0 ) {
	echo '&lt;ul&gt;';
	foreach ( $posts_data as $post ) {
		echo '&lt;li&gt;&lt;a href=&quot;'.get_permalink( $post-&gt;ID ).'&quot;&gt;'.$post-&gt;post_title.'&lt;/a&gt;&lt;/li&gt;';
	}
	echo '&lt;/ul&gt;';
} else {
	echo '&lt;p&gt;No articles by this user&lt;/p&gt;';
}
?&gt;
</pre>
<p>This way the code make use of the global <strong>$paged</strong> variable to see which page it is on, and set the value of offset accordingly making the fetched content using get_posts itself paginated. On Page 1, the offset will be zero, it will fetch the posts limited by the posts per page value and on Page 2, the offset will be calculated to leave the posts already shown on previous page and query further posts limited by the posts per page value.</p>
<p>Got questions? Comment section is down below.</p>
<ul>
		<li><a href="http://blog.ashfame.com/2011/04/difference-wp-query-vs-query-posts-vs-get-posts/" rel="bookmark">Which one to use WP_Query vs query_posts() vs get_posts()?</a><!-- (21.8)--></li>
		<li><a href="http://blog.ashfame.com/2011/04/get-comments-category-wordpress/" rel="bookmark">Fetch comments of a specific category in WordPress</a><!-- (17.2)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (12.6)--></li>
		<li><a href="http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/" rel="bookmark">Adding a custom user profile field to registration in WordPress</a><!-- (11.9)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-bbpress-content-inside-wordpress/" rel="bookmark">Show bbPress content inside WordPress</a><!-- (11.7)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2011/04/pagination-approach-get-posts-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pomodoro Timer in Ubuntu</title>
		<link>http://blog.ashfame.com/2011/04/pomodoro-timer-in-ubuntu/</link>
		<comments>http://blog.ashfame.com/2011/04/pomodoro-timer-in-ubuntu/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 18:31:12 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[NotifyOSD]]></category>
		<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=906</guid>
		<description><![CDATA[I finally decided to try Pomodoro technique to see how well it can improve my productivity as I am a lot disorganised, lazy sorta geek (well who isn&#8217;t?). So I built up a small script which acts as a Pomodoro timer for me using Ubuntu notification system (Do read it if you haven&#8217;t, you need [...]<ul>
		<li><a href="http://blog.ashfame.com/2011/04/ubuntu-notification-system/" rel="bookmark">Using Ubuntu Notification System &#8211; NotifyOSD</a><!-- (21.9)--></li>
		<li><a href="http://blog.ashfame.com/2011/01/connect-ftp-server-ubuntu-without-client/" rel="bookmark">Connect to a FTP server in Ubuntu without any FTP client</a><!-- (18.7)--></li>
		<li><a href="http://blog.ashfame.com/2011/03/quickly-setup-localhost-environment-ubuntu/" rel="bookmark">Quickly setup a localhost environment in Ubuntu</a><!-- (16.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/3-creative-ways-showcasing-best-content-sidebar/" rel="bookmark">3 creative ways of showcasing your best content on sidebar</a><!-- (6)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>I finally decided to try Pomodoro technique to see how well it can improve my productivity as I am a lot disorganised, lazy sorta geek (well who isn&#8217;t?). So I built up a small script which acts as a Pomodoro timer for me using <a href="http://blog.ashfame.com/2011/04/ubuntu-notification-system/">Ubuntu notification system</a> (Do read it if you haven&#8217;t, you need to install lib-notify package for this script to work).</p>
<p>I have created a launcher in my top panel, with which I start a new <em>pomodori</em> (name for a new period of time, lets call it a Pomodoro anyway). It calls up the script which alerts me that a new Pomodoro (time period) has started and then alert me again when the timer ends and I should take a small break.</p>
<p>Here is the script:</p>
<pre class="brush: bash; title: ; toolbar: false; notranslate">
DISPLAY=:0 notify-send -t 1000 -i /home/ashfame/Dropbox/Ubuntu/icons/pomodoro.png &quot;New Pomodoro starts&quot; &quot;You have 25 minutes to work.&quot;
# 25 minutes timer
sleep 1500
DISPLAY=:0 notify-send -t 1000 -i /home/ashfame/Dropbox/Ubuntu/icons/pomodoro.png &quot;Pomodoro ends&quot; &quot;Take a break!&quot;
</pre>
<p>As soon as I click the launcher, the first notification appears telling me that a new Pomodoro has started.</p>
<p><img class="aligncenter" src="http://blog.ashfame.com/wp-content/uploads/2011/04/pomodoro-starts.png" alt="pomodoro starts" /></p>
<p>Then it sleeps for 1500 secs = 25 minutes. And after that the second notification appears telling me that the Pomodoro has ended.</p>
<p><img class="aligncenter" src="http://blog.ashfame.com/wp-content/uploads/2011/04/pomodoro-ends.png" alt="pomodoro ends" /></p>
<p>I just take a 3-5 minutes break or even longer (I am the boss!), and then I again click on the launcher starting another Pomodoro and I work for another 25 minutes. You can use the same tomato icon, if you want.</p>
<p><img class="aligncenter" src="http://blog.ashfame.com/wp-content/uploads/2011/04/pomodoro.png" alt="pomodoro" /></p>
<p>Enjoy the awesomeness of Ubuntu and ditch Windows, yes I am an Ubuntu advocate and will push you to switch all the time <img src='http://blog.ashfame.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Have your say in the comments!</p>
<ul>
		<li><a href="http://blog.ashfame.com/2011/04/ubuntu-notification-system/" rel="bookmark">Using Ubuntu Notification System &#8211; NotifyOSD</a><!-- (21.9)--></li>
		<li><a href="http://blog.ashfame.com/2011/01/connect-ftp-server-ubuntu-without-client/" rel="bookmark">Connect to a FTP server in Ubuntu without any FTP client</a><!-- (18.7)--></li>
		<li><a href="http://blog.ashfame.com/2011/03/quickly-setup-localhost-environment-ubuntu/" rel="bookmark">Quickly setup a localhost environment in Ubuntu</a><!-- (16.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/3-creative-ways-showcasing-best-content-sidebar/" rel="bookmark">3 creative ways of showcasing your best content on sidebar</a><!-- (6)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2011/04/pomodoro-timer-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress Evil Post Series</title>
		<link>http://blog.ashfame.com/2011/03/wordpress-evil-post-series/</link>
		<comments>http://blog.ashfame.com/2011/03/wordpress-evil-post-series/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 18:31:37 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp-evil]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=901</guid>
		<description><![CDATA[Yeah! That sounded right. This is a post series where I will show you how to use WordPress to do evil, unethical things which surely doesn&#8217;t mean WordPress is a bad piece of software. Its really a great one considering every thing has its share of Pros &#38; Cons. Remember, just like we say, Technology [...]<ul>
		<li><a href="http://blog.ashfame.com/2009/11/wordpress-cms-series/" rel="bookmark">WordPress CMS Series</a><!-- (27)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (24.5)--></li>
		<li><a href="http://blog.ashfame.com/2010/04/handling-wordpress-post-revisions-correctly/" rel="bookmark">Handling WordPress Post Revisions the right way</a><!-- (21.7)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/highlight-first-post-bbpress/" rel="bookmark">How to highlight first post in bbPress</a><!-- (18.9)--></li>
		<li><a href="http://blog.ashfame.com/2010/02/post-twitter-updates-tweets-facebook-automatically/" rel="bookmark">Post Twitter updates on Facebook automatically</a><!-- (15.6)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>Yeah! That sounded right. This is a post series where I will show you how to use WordPress to do evil, unethical things which surely doesn&#8217;t mean WordPress is a bad piece of software. Its really a great one considering every thing has its share of Pros &amp; Cons. Remember, just like we say, Technology is neither good or bad, its the use which can be classified as good or bad. Similarly, I will be using a technology product (WordPress), to do things for fun and educative purposes. You better be aware to avoid that happening with you, or sometimes use it <img src='http://blog.ashfame.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>You are welcome for the following:</p>
<ul>
<li>Comment anything relevant! You can criticise my series too, I won&#8217;t mind!</li>
<li>Tip me for the next Evil Post.</li>
<li>Write a Guest Post for <strong>WP Evil</strong> Series (Decision of accepting it as a qualified <strong>WordPress Evil Post Series</strong> will be totally on me, though)</li>
</ul>
<p>That said, first post in the series will be up in a few minutes.</p>
<ul>
		<li><a href="http://blog.ashfame.com/2009/11/wordpress-cms-series/" rel="bookmark">WordPress CMS Series</a><!-- (27)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (24.5)--></li>
		<li><a href="http://blog.ashfame.com/2010/04/handling-wordpress-post-revisions-correctly/" rel="bookmark">Handling WordPress Post Revisions the right way</a><!-- (21.7)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/highlight-first-post-bbpress/" rel="bookmark">How to highlight first post in bbPress</a><!-- (18.9)--></li>
		<li><a href="http://blog.ashfame.com/2010/02/post-twitter-updates-tweets-facebook-automatically/" rel="bookmark">Post Twitter updates on Facebook automatically</a><!-- (15.6)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2011/03/wordpress-evil-post-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show recent comments of a particular user in WordPress</title>
		<link>http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/</link>
		<comments>http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 21:08:37 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=876</guid>
		<description><![CDATA[A friend asked for a help in his project where he required to list all the comments a registered user made on the site. So just for play, I created a small plugin which provides you with a shortcode which you can use on a page link example.com/my-comments/ or whatever. I am zipping it up [...]<ul>
		<li><a href="http://blog.ashfame.com/recent-comments/" rel="bookmark">Recent Comments</a><!-- (33.5)--></li>
		<li><a href="http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/" rel="bookmark">Adding a custom user profile field to registration in WordPress</a><!-- (29.1)--></li>
		<li><a href="http://blog.ashfame.com/2011/04/get-comments-category-wordpress/" rel="bookmark">Fetch comments of a specific category in WordPress</a><!-- (27.1)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (25.7)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-bbpress-content-inside-wordpress/" rel="bookmark">Show bbPress content inside WordPress</a><!-- (25.2)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>A friend asked for a help in his project where he required to list all the comments a registered user made on the site. So just for play, I created a small plugin which provides you with a shortcode which you can use on a page link example.com/my-comments/ or whatever.</p>
<p>I am zipping it up as a plugin but you can copy paste the code inside your <a href="http://blog.ashfame.com/2010/11/using-wordpress-functions-php/">functions.php file</a> and you should be fine.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/*
Plugin Name: Show Recent Comments by a particular user
Plugin URI: http://blog.ashfame.com/?p=876
Description: Provides a shortcode which you can use to show recent comments by a particular user
Author: Ashfame
Author URI: http://blog.ashfame.com/
License: GPL
Usage:
*/

add_shortcode ( 'show_recent_comments', 'show_recent_comments_handler' );

function show_recent_comments_handler( $atts, $content = null )
{
	extract( shortcode_atts( array(
		&quot;count&quot; =&gt; 10,
		&quot;pretty_permalink&quot; =&gt; 0
		), $atts ));

	$output = ''; // this holds the output

	if ( is_user_logged_in() )
	{
		global $current_user;
		get_currentuserinfo();

		$args = array(
			'user_id' =&gt; $current_user-&gt;ID,
			'number' =&gt; $count, // how many comments to retrieve
			'status' =&gt; 'approve'
			);

		$comments = get_comments( $args );
		if ( $comments )
		{
			$output.= &quot;&lt;ul&gt;\n&quot;;
			foreach ( $comments as $c )
			{
			$output.= '&lt;li&gt;';
			if ( $pretty_permalink ) // uses a lot more queries (not recommended)
				$output.= '&lt;a href=&quot;'.get_comment_link( $c-&gt;comment_ID ).'&quot;&gt;';
			else
				$output.= '&lt;a href=&quot;'.get_settings('siteurl').'/?p='.$c-&gt;comment_post_ID.'#comment-'.$c-&gt;comment_ID.'&quot;&gt;';
			$output.= $c-&gt;comment_content;
			$output.= '&lt;/a&gt;';
			$output.= &quot;&lt;/li&gt;\n&quot;;
			}
			$output.= '&lt;/ul&gt;';
		}
	}
	else
	{
		$output.= &quot;&lt;h2&gt;You should be logged in to see your comments. Make sense?&lt;/h2&gt;&quot;;
		$output.= '&lt;h2&gt;&lt;a href=&quot;'.get_settings('siteurl').'/wp-login.php?redirect_to='.get_permalink().'&quot;&gt;Login Now &amp;rarr;&lt;/a&gt;&lt;/h2&gt;';
	}
	return $output;
}
?&gt;
</pre>
<p>You can use in a post or page as follows:</p>
<pre class="brush: php; title: ; notranslate">
[show_recent_comments]
</pre>
<p>This will show last 10 comments of the current user.</p>
<pre class="brush: php; title: ; notranslate">
[show_recent_comments count=15]
</pre>
<p>You can change the number of comments you want by providing it with the value of count.</p>
<p>Now, if you notice, they do link to the respective comments but links are not pretty permalinks. I don&#8217;t recommend you do this (because it increases the query count), but if you really want to have pretty permalinks, you can use the shortcode as follows:</p>
<pre class="brush: php; title: ; notranslate">
[show_recent_comments count=15 pretty_permalink=1]
</pre>
<p>or just with the default count of 10 as follows:</p>
<pre class="brush: php; title: ; notranslate">
[show_recent_comments pretty_permalink=1]
</pre>
<p>I should highlight the fact that the current user (registered member) will see the comments he or she has made. If you are not logged in, it asks you to login and after login brings you back on the post or page where you are using this shortcode.</p>
<p>You can use this code to make changes as per your need. You can use this shortcode anywhere in your theme by calling it as follows:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo do_shortcode( '[show_recent_comments count=15]' ); ?&gt;
</pre>
<p>And I think if you use it like that outside the loop, it won&#8217;t bring the user back to the previous page. You will need to change the <em>get_permalink()</em> call near the end of the plugin.</p>
<p>Good thing is that it works correctly with cache plugins such as WP Super Cache or W3 Total Cache because logged in users are served live pages instead of cached pages. Correct me if I am wrong.</p>
<p><a href="http://blog.ashfame.com/wp-content/uploads/2011/01/wp-plugin-comments-user.php.zip">Download Show Recent Comments plugin</a></p>
<p>Other than that, if you have any questions, comment section is all yours!</p>
<ul>
		<li><a href="http://blog.ashfame.com/recent-comments/" rel="bookmark">Recent Comments</a><!-- (33.5)--></li>
		<li><a href="http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/" rel="bookmark">Adding a custom user profile field to registration in WordPress</a><!-- (29.1)--></li>
		<li><a href="http://blog.ashfame.com/2011/04/get-comments-category-wordpress/" rel="bookmark">Fetch comments of a specific category in WordPress</a><!-- (27.1)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (25.7)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-bbpress-content-inside-wordpress/" rel="bookmark">Show bbPress content inside WordPress</a><!-- (25.2)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Adding a custom user profile field to registration in WordPress</title>
		<link>http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/</link>
		<comments>http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 20:30:00 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/2010/11/adding-a-custom-field-to-registration-in-wordpress/</guid>
		<description><![CDATA[Sometime back a friend of mine asked me how can he add a custom registration field to the WordPress registration page, I asked him to google it as I have come across a lot of such tutorials but he was unable to do so and then I found the issue that either the tutorial is [...]<ul>
		<li><a href="http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/" rel="bookmark">Show recent comments of a particular user in WordPress</a><!-- (27.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (21.9)--></li>
		<li><a href="http://blog.ashfame.com/2008/02/custom-wordpress-smilies/" rel="bookmark">Free Custom WordPress Smilies</a><!-- (21.1)--></li>
		<li><a href="http://blog.ashfame.com/2009/05/cancel-godaddy-domain-registration-order/" rel="bookmark">Cancel Godaddy Domain Registration Order</a><!-- (18.5)--></li>
		<li><a href="http://blog.ashfame.com/2011/03/creating-backdoor-wordpress/" rel="bookmark">Creating a backdoor in WordPress</a><!-- (15.4)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>Sometime back a friend of mine asked me how can he add a custom registration field to the WordPress registration page, I asked him to google it as I have come across a lot of such tutorials but he was unable to do so and then I found the issue that either the tutorial is for adding a custom user profile field or adding an existing field to the registration form and even coupling up the two won’t do it and requires some change of code and that can be hard for someone who doesn’t swim in code at all. Pun intended!</p>
<p>First, I would write create a custom user field so that it can be operated from the WordPress profile page and then add that field in the registration form. To keep it general and useful for everyone, I would be adding a simple Twitter handle field.</p>
<h2>Adding a custom user profile field</h2>
<pre class="brush: php; title: ; notranslate">
/**
 * Add additional custom field
 */

add_action ( 'show_user_profile', 'my_show_extra_profile_fields' );
add_action ( 'edit_user_profile', 'my_show_extra_profile_fields' );

function my_show_extra_profile_fields ( $user )
{
?&gt;
	&lt;h3&gt;Extra profile information&lt;/h3&gt;
	&lt;table class=&quot;form-table&quot;&gt;
		&lt;tr&gt;
			&lt;th&gt;&lt;label for=&quot;twitter&quot;&gt;Twitter&lt;/label&gt;&lt;/th&gt;
			&lt;td&gt;
				&lt;input type=&quot;text&quot; name=&quot;twitter&quot; id=&quot;twitter&quot; value=&quot;&lt;?php echo esc_attr( get_the_author_meta( 'twitter', $user-&gt;ID ) ); ?&gt;&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
				&lt;span class=&quot;description&quot;&gt;Please enter your Twitter username.&lt;/span&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;
&lt;?php
}

add_action ( 'personal_options_update', 'my_save_extra_profile_fields' );
add_action ( 'edit_user_profile_update', 'my_save_extra_profile_fields' );

function my_save_extra_profile_fields( $user_id )
{
	if ( !current_user_can( 'edit_user', $user_id ) )
		return false;
	/* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */
	update_usermeta( $user_id, 'twitter', $_POST['twitter'] );
}
</pre>
<h2>Adding a field on the registration form / registration page</h2>
<pre class="brush: php; title: ; notranslate">
/**
 * Add cutom field to registration form
 */

add_action('register_form','show_first_name_field');
add_action('register_post','check_fields',10,3);
add_action('user_register', 'register_extra_fields');

function show_first_name_field()
{
?&gt;
	&lt;p&gt;
	&lt;label&gt;Twitter&lt;br/&gt;
	&lt;input id=&quot;twitter&quot; type=&quot;text&quot; tabindex=&quot;30&quot; size=&quot;25&quot; value=&quot;&lt;?php echo $_POST['twitter']; ?&gt;&quot; name=&quot;twitter&quot; /&gt;
	&lt;/label&gt;
	&lt;/p&gt;
&lt;?php
}

function check_fields ( $login, $email, $errors )
{
	global $twitter;
	if ( $_POST['twitter'] == '' )
	{
		$errors-&gt;add( 'empty_realname', &quot;&lt;strong&gt;ERROR&lt;/strong&gt;: Please Enter your twitter handle&quot; );
	}
	else
	{
		$twitter = $_POST['twitter'];
	}
}

function register_extra_fields ( $user_id, $password = &quot;&quot;, $meta = array() )
{
	update_user_meta( $user_id, 'twitter', $_POST['twitter'] );
}
</pre>
<p>If you are using this on before WordPress 3.1, then your input box will not be styled like that of username and email. Its fixed in WP 3.1 though.<br />
For earlier versions, change the <code>id</code> of the input field on <strong>Line 14</strong> to <code>user_email</code></p>
<pre class="brush: php; title: ; wrap-lines: true; notranslate">
	&lt;input id=&quot;user_email&quot; type=&quot;text&quot; tabindex=&quot;30&quot; size=&quot;25&quot; value=&quot;&lt;?php echo $_POST['twitter']; ?&gt;&quot; name=&quot;twitter&quot; /&gt;
</pre>
<p>To get this custom field, you can use <code>get_the_author_meta()</code> to return its value or <code>the_author_meta()</code> for displaying it.</p>
<pre class="brush: php; title: ; wrap-lines: true; notranslate">
the_author_meta( $meta_key, $user_id ); // $meta_key = 'twitter' in our case
</pre>
<p>I am also attaching the whole code as a plugin that you can activate on your WordPress installation.</p>
<p><a href="http://blog.ashfame.com/wp-content/uploads/2010/11/custom-registration-fields.zip">Download Plugin</a></p>
<p>This concludes the tutorial for adding an Custom user profile field which is an input text box but there may be certain cases where you would like to use select dropdowns, radio buttons or checkboxes. Right? I will cover that in the next post.</p>
<p>If you have any questions, use the comment section &amp; I will try to help.</p>
<ul>
		<li><a href="http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/" rel="bookmark">Show recent comments of a particular user in WordPress</a><!-- (27.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/show-custom-excerpt-post-wordpres/" rel="bookmark">Show custom excerpts of the post in WordPress</a><!-- (21.9)--></li>
		<li><a href="http://blog.ashfame.com/2008/02/custom-wordpress-smilies/" rel="bookmark">Free Custom WordPress Smilies</a><!-- (21.1)--></li>
		<li><a href="http://blog.ashfame.com/2009/05/cancel-godaddy-domain-registration-order/" rel="bookmark">Cancel Godaddy Domain Registration Order</a><!-- (18.5)--></li>
		<li><a href="http://blog.ashfame.com/2011/03/creating-backdoor-wordpress/" rel="bookmark">Creating a backdoor in WordPress</a><!-- (15.4)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2010/11/add-custom-field-registration-wordpress/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Install / Change bbPress to a different language</title>
		<link>http://blog.ashfame.com/2010/11/install-change-bbpress-language/</link>
		<comments>http://blog.ashfame.com/2010/11/install-change-bbpress-language/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 19:15:00 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[bbPress]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/2010/11/install-change-bbpress-in-a-different-language/</guid>
		<description><![CDATA[Today I am going to write a quick post on how one can switch the language in bbPress forums as I saw someone asking about it on bbPress.org official forums. Installing bbPress in a different language or changing it to a different language in an already installed bbPress follows exactly the same procedure. There is [...]<ul>
		<li><a href="http://blog.ashfame.com/2009/09/change-existing-bbpress-install-into-svn/" rel="bookmark">How to change an existing bbPress install into a SVN one</a><!-- (38.3)--></li>
		<li><a href="http://blog.ashfame.com/2009/08/change-gravatar-size-bbpress-theme/" rel="bookmark">Change gravatar size in bbPress theme</a><!-- (27.5)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/install-bbpress-locally-offline-on-your-computer/" rel="bookmark">Install bbPress locally offline on your computer</a><!-- (26)--></li>
		<li><a href="http://blog.ashfame.com/2009/08/install-bbpress-via-svn/" rel="bookmark">How to install bbPress via SVN</a><!-- (25.8)--></li>
		<li><a href="http://blog.ashfame.com/2010/07/wordpress-dashboard-different-language/" rel="bookmark">WordPress dashboard in different language</a><!-- (24)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>Today I am going to write a quick post on how one can switch the language in bbPress forums as I saw someone asking about it on <a href="http://bbpress.org/forums/">bbPress.org official forums</a>.</p>
<p><strong>Installing bbPress in a different language</strong> or <strong>changing it to a different language in an already installed bbPress</strong> follows exactly the same procedure. There is no difference in them as no permanent changes are made. In other words, nothing is written to the database. Obviously that doesn’t count the content you already have in posts.</p>
<p>Before you can switch the language, you would need the .mo file for your desired language. You can obtain the .mo file either from the Official server by Automattic &#8211; <a title="http://svn.automattic.com/bbpress-i18n/" href="http://svn.automattic.com/bbpress-i18n/">http://svn.automattic.com/bbpress-i18n/</a> or a local mirror maintained by _ck_ @ bbshowcase.org &#8211; <a title="http://bbshowcase.org/forums/topic/bbpress-translation-internationalization-into-local-languages#post-1133" href="http://bbshowcase.org/forums/topic/bbpress-translation-internationalization-into-local-languages#post-1133">http://bbshowcase.org/forums/topic/bbpress-translation-internationalization-into-local-languages#post-1133</a></p>
<p>Now when you have obtained the language file, create a folder named<strong> my-languages</strong> in bbPress root for version <strong>1.0+</strong> and a folder named <strong>languages</strong> under <strong>bb-includes</strong> folder incase you are using version <strong>0.9</strong></p>
<p>Now open <strong>bb-config.php</strong> file (found in bbPress root), and edit this line.</p>
<pre class="brush: php; title: ; notranslate">define( 'BB_LANG', '' );</pre>
<p>Change it to</p>
<pre class="brush: php; title: ; wrap-lines: true; notranslate">
define( 'BB_LANG', 'es_ES' ); // for Spanish language and a corresponding es_ES.mo file needs to be present in the language folder
</pre>
<p>That’s it. If you did both the steps correctly, then you should be able to check out the new language on your forums.</p>
<p>If you have any questions, then let me know and I will try to cover it up in a post.</p>
<ul>
		<li><a href="http://blog.ashfame.com/2009/09/change-existing-bbpress-install-into-svn/" rel="bookmark">How to change an existing bbPress install into a SVN one</a><!-- (38.3)--></li>
		<li><a href="http://blog.ashfame.com/2009/08/change-gravatar-size-bbpress-theme/" rel="bookmark">Change gravatar size in bbPress theme</a><!-- (27.5)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/install-bbpress-locally-offline-on-your-computer/" rel="bookmark">Install bbPress locally offline on your computer</a><!-- (26)--></li>
		<li><a href="http://blog.ashfame.com/2009/08/install-bbpress-via-svn/" rel="bookmark">How to install bbPress via SVN</a><!-- (25.8)--></li>
		<li><a href="http://blog.ashfame.com/2010/07/wordpress-dashboard-different-language/" rel="bookmark">WordPress dashboard in different language</a><!-- (24)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2010/11/install-change-bbpress-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[bbPress Plugin] Remove meta generator tag</title>
		<link>http://blog.ashfame.com/2009/09/bbpress-plugin-remove-meta-generator-tag/</link>
		<comments>http://blog.ashfame.com/2009/09/bbpress-plugin-remove-meta-generator-tag/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 06:30:36 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[bbPress]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=600</guid>
		<description><![CDATA[Flaws are everywhere. The point is how quickly they are fixed but it seems that some users are lazy enough not to upgrade or go on for a vacation before they decide to update. bbPress adds a meta generator tag to the page which shows up the bbPress version but it is advised to remove [...]<ul>
		<li><a href="http://blog.ashfame.com/2009/11/disable-bbpress-registrations/" rel="bookmark">[bbPress Plugin] How to disable bbPress registrations</a><!-- (29.5)--></li>
		<li><a href="http://blog.ashfame.com/2009/10/fix-bb-attachments-plugin-of-bbpress/" rel="bookmark">Fix bb-attachments plugin of bbPress</a><!-- (25.7)--></li>
		<li><a href="http://blog.ashfame.com/2008/02/safely-remove-usb-drive-safely-remove-hardware-icon-disappears-system-tray/" rel="bookmark">How to safely remove your USB drive when Safely Remove Hardware icon disappears from the system tray</a><!-- (22)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/highlight-first-post-bbpress/" rel="bookmark">How to highlight first post in bbPress</a><!-- (18.4)--></li>
		<li><a href="http://blog.ashfame.com/2010/07/remove-wordpress-multisite-data/" rel="bookmark">Remove WordPress Multisite data</a><!-- (16.8)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>Flaws are everywhere. The point is how quickly they are fixed but it seems that some users are lazy enough not to upgrade or go on for a vacation before they decide to update. bbPress adds a meta generator tag to the page which shows up the bbPress version but it is advised to remove it so that at a later date no one gets to know if you are running an older version which has un-patched flaws &amp; could be exploited.</p>
<pre class="brush: xml; title: ; notranslate">&lt;meta name=&quot;generator&quot; content=&quot;bbPress 1.0.2&quot; /&gt;</pre>
<p>In bbPress 1.0+ you can remove the meta tag generator by adding a single line of code to your functions.php file to your theme&#8217;s folder. If there is no functions.php file in your theme folder then create a new one with the name and add this line:</p>
<pre class="brush: php; title: ; notranslate">remove_action('bb_head', 'bb_generator');</pre>
<p>For those who don’t want to do this by editing a file and would prefer to do it by a plugin, here is a tiny plugin to do the same.</p>
<p><a href="http://blog.ashfame.com/wp-content/uploads/2009/09/bbpress-plugin-remove-meta-generator-tag.zip">Download bbPress Plugin</a></p>
<ul>
		<li><a href="http://blog.ashfame.com/2009/11/disable-bbpress-registrations/" rel="bookmark">[bbPress Plugin] How to disable bbPress registrations</a><!-- (29.5)--></li>
		<li><a href="http://blog.ashfame.com/2009/10/fix-bb-attachments-plugin-of-bbpress/" rel="bookmark">Fix bb-attachments plugin of bbPress</a><!-- (25.7)--></li>
		<li><a href="http://blog.ashfame.com/2008/02/safely-remove-usb-drive-safely-remove-hardware-icon-disappears-system-tray/" rel="bookmark">How to safely remove your USB drive when Safely Remove Hardware icon disappears from the system tray</a><!-- (22)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/highlight-first-post-bbpress/" rel="bookmark">How to highlight first post in bbPress</a><!-- (18.4)--></li>
		<li><a href="http://blog.ashfame.com/2010/07/remove-wordpress-multisite-data/" rel="bookmark">Remove WordPress Multisite data</a><!-- (16.8)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2009/09/bbpress-plugin-remove-meta-generator-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show content on basis of logged in status of users in bbPress</title>
		<link>http://blog.ashfame.com/2009/09/show-content-logged-in-status-users-bbpress/</link>
		<comments>http://blog.ashfame.com/2009/09/show-content-logged-in-status-users-bbpress/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 09:29:10 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[How To / Tutorials]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Tips n Tricks]]></category>
		<category><![CDATA[bbPress]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=588</guid>
		<description><![CDATA[No big deal here, just basic php stuff here. Here I will show how to use bb_is_user_logged_in function to dynamically produce output on the basis that the user is logged in or not. Example #1 (Show ads only for non-logged in members and not for logged in members) Example #2 (Show some content only if [...]<ul>
		<li><a href="http://blog.ashfame.com/2009/11/show-bbpress-content-inside-wordpress/" rel="bookmark">Show bbPress content inside WordPress</a><!-- (39.3)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/show-post-count-topics-started-bbpress/" rel="bookmark">Show post count and topics started in bbPress</a><!-- (25.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/bbpress-forum-list-post-topic-count-wordpress/" rel="bookmark">Show bbPress forum list with posts &#038; topics count in WordPress</a><!-- (23.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/3-creative-ways-showcasing-best-content-sidebar/" rel="bookmark">3 creative ways of showcasing your best content on sidebar</a><!-- (22.5)--></li>
		<li><a href="http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/" rel="bookmark">Show recent comments of a particular user in WordPress</a><!-- (19)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>No big deal here, just basic php stuff here. Here I will show how to use <strong>bb_is_user_logged_in</strong> function to dynamically produce output on the basis that the user is logged in or not.</p>
<p>Example #1 (Show ads only for non-logged in members and not for logged in members)</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
    if ( bb_is_user_logged_in() ) {
/* Add adsense or other ad code here*/
    }?&gt;
</pre>
<p>Example #2 (Show some content only if the user is logged in)</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
    if ( bb_is_user_logged_in() ) {
/* Add the private content here or some code */
    }?&gt;
</pre>
<p>Example#3 (Do more stuff)</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
    if ( bb_is_user_logged_in() ) {
/* You are logged in – do something for members */
    }
    else {
/* You are not logged in – do something for guests */
    }?&gt;
</pre>
<p>So you can do anything on the basis that the current user is logged in or not. Need more help? Ask in the comments and I will be glad to help you out.</p>
<ul>
		<li><a href="http://blog.ashfame.com/2009/11/show-bbpress-content-inside-wordpress/" rel="bookmark">Show bbPress content inside WordPress</a><!-- (39.3)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/show-post-count-topics-started-bbpress/" rel="bookmark">Show post count and topics started in bbPress</a><!-- (25.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/11/bbpress-forum-list-post-topic-count-wordpress/" rel="bookmark">Show bbPress forum list with posts &#038; topics count in WordPress</a><!-- (23.4)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/3-creative-ways-showcasing-best-content-sidebar/" rel="bookmark">3 creative ways of showcasing your best content on sidebar</a><!-- (22.5)--></li>
		<li><a href="http://blog.ashfame.com/2011/01/show-recent-comments-particular-user-wordpress/" rel="bookmark">Show recent comments of a particular user in WordPress</a><!-- (19)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2009/09/show-content-logged-in-status-users-bbpress/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Programming Contests, Challenges and Online Judges</title>
		<link>http://blog.ashfame.com/2008/10/programming-contests-challenges-online-judges/</link>
		<comments>http://blog.ashfame.com/2008/10/programming-contests-challenges-online-judges/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 18:35:25 +0000</pubDate>
		<dc:creator>Ashfame</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[programming challenges]]></category>
		<category><![CDATA[programming questions]]></category>

		<guid isPermaLink="false">http://blog.ashfame.com/?p=453</guid>
		<description><![CDATA[I can call myself a programmer, not the one who can stand &#38; kick ass but yeah who can code &#38; develop algorithms. I always wanted to improve on my skill set but never got the time to practice. Now I think I will be doing that forgotten thing whenever I have time. I came [...]<ul>
		<li><a href="http://blog.ashfame.com/2008/10/online-clipboard-cl1pnet/" rel="bookmark">Cl1p.net is my Online Clipboard</a><!-- (12.7)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/share-day-to-day-incidents-online/" rel="bookmark">Share your day to day incidents online</a><!-- (12)--></li>
		<li><a href="http://blog.ashfame.com/2008/03/virustotal-scan-files-anti-viruses-online/" rel="bookmark">VirusTotal &#8211; Scan files from different anti viruses online</a><!-- (11.7)--></li>
		<li><a href="http://blog.ashfame.com/2008/08/zoho-quick-easy-online-invoicing/" rel="bookmark">Zoho : Quick &#038; Easy Online Invoicing</a><!-- (11.6)--></li>
		<li><a href="http://blog.ashfame.com/2010/11/play-blur-online-tunngle/" rel="bookmark">How to play Blur online using Tunngle</a><!-- (11.6)--></li>
	</ul>
]]></description>
			<content:encoded><![CDATA[<p>I can call myself a programmer, not the one who can stand &amp; kick ass but yeah who can code &amp; develop algorithms. I always wanted to improve on my skill set but never got the time to practice. Now I think I will be doing that forgotten thing whenever I have time. I came across a post on ThinkDigit forum where Sykora had listed some of the sites where one can test one&#8217;s capabilities. Tracing a little and I came across lucentbeing.com with a remake of that post. So I am sharing that list of sites with you.<br />
There are different types of skill testing methods, here are the main three:</p>
<ul>
<li><strong>Contests</strong> are usually played out between participants in real time.</li>
<li><strong>Challenges</strong> are mostly formats where you do the problem in your own time and submit the answer &#8212; your score will increase if your answer verified.</li>
<li><strong>Online Judges</strong> are similar to challenges, but require you to submit the code itself, rather than the answer. The code will be run on the server, and you&#8217;ll be told if your program passed. Online Judges are usually more difficult than Challenges because the server imposes a time limit.</li>
</ul>
<p><span id="more-453"></span>These are some of the challenges I&#8217;ve found the most interesting :</p>
<h2><a href="http://projecteuler.net/">Project Euler</a></h2>
<p><strong>Languages </strong>: Anything</p>
<p>Project Euler is a collection of (mostly) mathematical problems that (in general) you&#8217;ll have to write some sort of program to solve. It&#8217;s a challenge (in the above sense of the word), so you have as much time as you want to solve the problems in any order using any language. It has the usual ranking system so you can compare yourself to everyone else, as well as within your country. New puzzles are added almost every week or so, but it can vary. The problems range from ridiculously easy, to impossibly hard. Each problem has its own forum thread, where people post how they solved it, with the code they used. However one can access the thread for a problem only if they&#8217;ve solved it.</p>
<h2><a href="http://spoj.pl/">Sphere Online Judge (SPOJ)</a></h2>
<p><strong>Languages </strong>: Lots. Check the site for the full list.</p>
<p>SPOJ is good because it combines problems from almost every other source. They&#8217;re not mathematical, just normal Computer Science problems. The 3 main limitations that they place on you are the running time, memory usage and code size. There are 1000s of problems, most of them are easy to solve in general, but hard to solve within the restraints imposed.</p>
<h2><a href="http://icpcres.ecs.baylor.edu/onlinejudge/">UVa Online Judge</a></h2>
<p><strong>Languages </strong>: C, C++, Java, Pascal</p>
<p>The same as structure as SPOJ, except you can only use those 4 languages. Whether or not you consider this a handicap, or simply a tougher rule set is your choice. It has lots of problems, some of them are duplicates of SPOJ (or may be it&#8217;s the other way around). In general, very challenging algorithmic problems.</p>
<h2><a href="http://pythonchallenge.com/">The Python Challenge</a></h2>
<p><strong>Languages </strong>: It should be fairly obvious&#8230;</p>
<p>A dedicated challenge for python. As far as format goes, it&#8217;s the same as KlueLESS, but with some required knowledge of Python. For some levels you&#8217;ll need extra modules not provided with the standard distribution, but all of them are free downloads. This is possibly the best way to get interested in Python. There are 33 levels, and they get hard fairly quickly.</p>
<h2><a href="http://osix.net/">The Open Source Institute</a></h2>
<p><strong>Languages </strong>: Any</p>
<p>OSIX has a number of challenges, including the main &#8220;Geek Challenges&#8221; which are a series of problems one after the other. The problems are very interesting, but also get hard fairly quickly. Other problem types involve Bonus Levels, which are what you do when you get stuck on the main Geek Challenge. You can attempt these in any order. They also have reverse engineering challenges, and tests for various topics. The site is a bit buggy though (login issues).</p>
<h2><a href="http://codegolf.com/">Code Golf</a></h2>
<p>The main focus of code golf is to solve the problem using the <em>minimum number of keystrokes</em>. The problems here are amazingly thought out, and the site in general is nice to read (no programming relevance, but it helps). You are ranked based on the number of bytes of your code, so the shorter the better. Solving these problems is by no means difficult. Coming anywhere near the top scores is insanely hard.</p>
<h2><a href="http://hackits.de/">Hackits</a></h2>
<p><strong>Languages </strong>: Any, for most challenges.</p>
<p>Hackits is new for me, and it&#8217;s very similar to OSIX. It has 6 challenge branches, including the main, logic and oktranon, which are logic challenges, crypt &#8211; a crypto challenge; script &#8211; a java script challenge; and misc, which doesn&#8217;t fit under any category. The difficulty varies, and there is a lot of non-programming work to do, before you actually find out exactly what you&#8217;re supposed to program.</p>
<h2>My Thoughts</h2>
<p>Finally I have find the perfect thing to do when you are free. I have joined Project Euler right away and will be peeking in for more. So what are you into?</p>
<p>Thanks to Sykora! [via <a href="http://lucentbeing.com/blog/programming-contests-challenges-and-online-judges">Lucentbeing.com</a>]</p>
<ul>
		<li><a href="http://blog.ashfame.com/2008/10/online-clipboard-cl1pnet/" rel="bookmark">Cl1p.net is my Online Clipboard</a><!-- (12.7)--></li>
		<li><a href="http://blog.ashfame.com/2009/09/share-day-to-day-incidents-online/" rel="bookmark">Share your day to day incidents online</a><!-- (12)--></li>
		<li><a href="http://blog.ashfame.com/2008/03/virustotal-scan-files-anti-viruses-online/" rel="bookmark">VirusTotal &#8211; Scan files from different anti viruses online</a><!-- (11.7)--></li>
		<li><a href="http://blog.ashfame.com/2008/08/zoho-quick-easy-online-invoicing/" rel="bookmark">Zoho : Quick &#038; Easy Online Invoicing</a><!-- (11.6)--></li>
		<li><a href="http://blog.ashfame.com/2010/11/play-blur-online-tunngle/" rel="bookmark">How to play Blur online using Tunngle</a><!-- (11.6)--></li>
	</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ashfame.com/2008/10/programming-contests-challenges-online-judges/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

