<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress plugin browser Topic: Post Count</title>
<link>http://bbpress.org/plugins/</link>
<description>bbPress plugin browser Topic: Post Count</description>
<language>en</language>
<pubDate>Fri, 10 Oct 2008 23:07:24 +0000</pubDate>

<item>
<title>Radium on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-728</link>
<pubDate>Fri, 11 Jan 2008 22:52:51 +0000</pubDate>
<dc:creator>Radium</dc:creator>
<guid isPermaLink="false">728@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;Oh my, I missed a big problem with the code above. That shows the current users post count on everyone's profile. Here is the correct code:&#60;/p&#62;
&#60;p&#62;$htg_postcount = array();&#60;/p&#62;
&#60;p&#62;function post_count($id = null) {&#60;br /&#62;
if ( get_post_author_id() &#38;#38;&#38;#38; $id == null)&#60;br /&#62;
echo 'Posts: ' . get_post_count( get_post_author_id() );&#60;br /&#62;
else if ( !get_post_author_id() &#38;#38;&#38;#38; $id != null )&#60;br /&#62;
echo '&#60;strong&#62;Posts&#60;/strong&#62;' . get_post_count( $id );&#60;br /&#62;
else&#60;br /&#62;
echo 'error';&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;function get_post_count ( $id ) {&#60;br /&#62;
global $bbdb;&#60;br /&#62;
global $htg_postcount;&#60;br /&#62;
if($htg_postcount[$id]==''){&#60;br /&#62;
$htg_postcount[$id] = $bbdb-&#38;gt;get_var(&#34;SELECT count(*) FROM $bbdb-&#38;gt;posts WHERE poster_id = $id AND post_status = 0&#34;);&#60;br /&#62;
}&#60;br /&#62;
return $htg_postcount[$id];&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;With this code you must put this on your profile page: &#38;lt;?php post_count($user-&#38;gt;ID) ?&#38;gt; and this on your post page: &#38;lt;?php post_count() ?&#38;gt;
&#60;/p&#62;</description>
</item>
<item>
<title>Radium on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-727</link>
<pubDate>Fri, 11 Jan 2008 21:22:18 +0000</pubDate>
<dc:creator>Radium</dc:creator>
<guid isPermaLink="false">727@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;In case anyone is having trouble adding the post count to profile pages I modified HowToGeek's code to work in both profiles and posts. Here goes:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$htg_postcount = array();

function post_count() {
if ( get_post_author_id() )
	echo &#38;#39;Posts: &#38;#39; . get_post_count( get_post_author_id() );
else if ( bb_get_current_user_info( &#38;#39;id&#38;#39; ) )
	echo &#38;#39;&#38;lt;strong&#38;gt;Posts&#38;lt;/strong&#38;gt;&#38;#39; . get_post_count( bb_get_current_user_info( &#38;#39;id&#38;#39; ) );
echo &#38;#39;&#38;#39;;
}

function get_post_count ( $id ) {
global $bbdb;
global $htg_postcount;
if($htg_postcount[$id]==&#38;#39;&#38;#39;){
$htg_postcount[$id] = $bbdb-&#38;gt;get_var(&#38;quot;SELECT count(*) FROM $bbdb-&#38;gt;posts WHERE poster_id = $id AND post_status = 0&#38;quot;);
}
return $htg_postcount[$id];
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Just place &#60;code&#62;&#38;lt;?php post_count() ?&#38;gt;&#60;/code&#62; in posts.php and/or profile.php anywhere you want.&#60;/p&#62;
&#60;p&#62;I placed mine in the following locations:&#60;/p&#62;
&#60;p&#62;in profile.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php bb_profile_data(); ?&#38;gt;

&#38;lt;?php profile_last_online(); ?&#38;gt;

&#38;lt;?php post_count() ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and in post.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;strong&#38;gt;&#38;lt;?php post_author_link(); ?&#38;gt;&#38;lt;/strong&#38;gt;
			  &#38;lt;small&#38;gt;&#38;lt;?php post_author_title(); ?&#38;gt;&#38;lt;/small&#38;gt;
			  &#38;lt;?php post_count() ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>HowToGeek on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-465</link>
<pubDate>Tue, 31 Jul 2007 01:36:25 +0000</pubDate>
<dc:creator>HowToGeek</dc:creator>
<guid isPermaLink="false">465@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;I modified this plugin to be a little more efficient. In the original version, if you have a topic with 30 replies between two people, you'd end up with 30 SQL statements that fetch the entire set of posts for each user. Not terribly efficient.&#60;/p&#62;
&#60;p&#62;I changed it to use the count(*) instead, and also to cache those counts in a hashtable instead. That way the topic with 30 replies between two people would only have 2 sql statements executed, not 30. Still not perfect, but quite a bit better. I also removed the error notice.&#60;/p&#62;
&#60;p&#62;Here's the full code, which you are welcome to change as much as you want:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
$htg_postcount = array();&#60;/p&#62;
&#60;p&#62;function post_count() {&#60;br /&#62;
	if (  get_post_author_id() )&#60;br /&#62;
		echo 'Posts: ' . get_post_count( get_post_author_id() );&#60;br /&#62;
	else&#60;br /&#62;
		echo '';&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;function get_post_count ( $id ) {&#60;br /&#62;
	global $bbdb;&#60;br /&#62;
	global $htg_postcount;&#60;br /&#62;
	if($htg_postcount[$id]==''){&#60;br /&#62;
		$htg_postcount[$id] = $bbdb-&#38;gt;get_var(&#34;SELECT count(*) FROM $bbdb-&#38;gt;posts WHERE poster_id = $id AND post_status = 0&#34;);&#60;br /&#62;
	}&#60;br /&#62;
	return $htg_postcount[$id];&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>twofivethreetwo on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-243</link>
<pubDate>Thu, 17 May 2007 20:53:29 +0000</pubDate>
<dc:creator>twofivethreetwo</dc:creator>
<guid isPermaLink="false">243@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;Thanks for this plugin. I'm using it just in my post.php using the code Nitallica posted.
&#60;/p&#62;</description>
</item>
<item>
<title>Nitallica on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-214</link>
<pubDate>Tue, 24 Apr 2007 19:08:03 +0000</pubDate>
<dc:creator>Nitallica</dc:creator>
<guid isPermaLink="false">214@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;afrodude:  I put mine in post.php, under the author_link&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;?php if (function_exists(&#38;#39;post_count&#38;#39;)) { ?&#38;gt;
&#38;lt;small&#38;gt;&#38;lt;em&#38;gt;&#38;lt;?php post_count() ?&#38;gt;&#38;lt;/em&#38;gt;&#38;lt;/small&#38;gt;
&#38;lt;?php } ?&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;That way, if I ever decide to remove it, it won't muck up my template. :)
&#60;/p&#62;</description>
</item>
<item>
<title>jpfieber on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-209</link>
<pubDate>Fri, 20 Apr 2007 02:42:03 +0000</pubDate>
<dc:creator>jpfieber</dc:creator>
<guid isPermaLink="false">209@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;Does this display the total number of posts in the entire forum, the number of posts a user has posted, or ?
&#60;/p&#62;</description>
</item>
<item>
<title>afrodude on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-148</link>
<pubDate>Mon, 19 Mar 2007 16:54:33 +0000</pubDate>
<dc:creator>afrodude</dc:creator>
<guid isPermaLink="false">148@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;Where do I insert this code?
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-102</link>
<pubDate>Fri, 23 Feb 2007 04:10:57 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">102@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;Odd, I use mine in my profile pages.  Of course, I use my second function to pull it out.&#60;/p&#62;
&#60;p&#62;Not a bad idea to make it more usable with profile pages, I'll work on this for the next release.
&#60;/p&#62;</description>
</item>
<item>
<title>fel64 on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-101</link>
<pubDate>Fri, 23 Feb 2007 01:44:35 +0000</pubDate>
<dc:creator>fel64</dc:creator>
<guid isPermaLink="false">101@http://bbpress.org/plugins/</guid>
<description>&#60;p&#62;Tried implementing this in the profile, had a problem. Seems like it has to be used in the equivalent of the loop? But it was easy to modify. I simply changed &#60;code&#62;function post_code()&#60;/code&#62; to:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function post_count( $id = &#38;#39;&#38;#39; ) 	{
	if (  get_post_author_id() ) 	{
		echo get_post_count( get_post_author_id() );	}
	elseif ( isset( $id ) )		{
		echo get_post_count( $id );		}
	else	{
		echo &#38;#39;Error&#38;#39;;	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;meaning that if you wanted to call it in a user profile all you had to do is pass &#60;code&#62;$user-&#38;gt;ID&#60;/code&#62; as a parameter.&#60;/p&#62;
&#60;p&#62;I like the plugin, but it would be good if you could update it with this or something similar. :)
&#60;/p&#62;</description>
</item>
<item>
<title>ardentfrost on "Post Count"</title>
<link>http://bbpress.org/plugins/topic/post-count/#post-42</link>
<pubDate>Fri, 12 Jan 2007 19:25:10 +0000</pubDate>
<dc:creator>ardentfrost</dc:creator>
<guid isPermaLink="false">42@http://bbpress.org/plugins/</guid>
<description>Allows post count to be easily displayed, just add</description>
</item>

</channel>
</rss>
