Version: , by apfeifer
Developer Last Online: Jan 2007
Version: 2.2.x
Rating:
Released: 11-02-2001
Last Update: Never
Installs: 70
No support by the author.
Hack: User's Percent of Total Posts
Version of vB: 2.2.0, although may work on earlier versions but not tested
Current Version: 1.0.0
Description: This gives you a user's percent of the total posts on your forum.
Once again, this is a small hack but show's something interesting. Enjoy!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
A combination of a couple of hacks and a fix for the error when there are no posts on the entire board: by kreft
Total Threads And Percentage Of Total Posts & Threads In Users Profile
A combination of User's Percent of Total Posts by apfeifer &
User Has Started X Threads by tubedogg
member.php
FIND:
PHP Code:
if ($userinfo[customtitle]==2)
$userinfo[usertitle] = htmlspecialchars($userinfo[usertitle]);
$userinfo[datejoined]=vbdate($dateformat,$userinfo[joindate]);
ADD this after:
PHP Code:
$startcount = $DB_site->query_first("SELECT COUNT(title) AS starts FROM thread WHERE postusername='$userinfo[username]' AND open!='10'");
$starts = $startcount[starts];
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=$countposts['posts'];
if ($totalposts == 0) { $totalposts=$totalposts + 1; }
$percentoftotalposts = round(($userinfo[posts] / $totalposts) * 100,2);
$counttotalthreads=$DB_site->query_first('SELECT count(*) AS threads FROM thread');
$totalthreads=$counttotalthreads['threads'];
if ($totalthreads == 0) { $totalthreads=$totalthreads + 1; }
$percentageoftotalthreads = round(($starts / $totalthreads) * 100,2);
getinfo template
FIND:
<tr>
<td bgcolor=""><normalfont><b>Total Posts:</b></normalfont></td>
<td bgcolor=""><normalfont>$userinfo[posts]($postsperday posts per day)</normalfont></td>
</tr>
ADD this after:
<tr>
<td bgcolor=""><normalfont><b>Total Threads:</b></normalfont></td>
<td bgcolor=""><normalfont>$starts</normalfont></td>
</tr>
<tr>
<td bgcolor=""><normalfont><b>Percent of Total Posts & Threads:</b></normalfont></td>
<td bgcolor=""><normalfont>$percentoftotalposts% of total posts | $percentageoftotalthreads% of total threads</normalfont></td>
</tr>
well maybe someone can help me. I'm using version 2.2.7.
Whats happening is it's showing the % of post, but not the PPD (post per day). I'm using the original of this hack. All i want is the PPD to show up again. how would i go about fixing this?
Thanks.
<tr>
<td bgcolor="#1C5780"><normalfont><b>Total Posts:</b></normalfont></td>
<td bgcolor="#1C5780"><normalfont>$userinfo[posts] ($postsperday posts per day / $percentoftotalposts% of total posts)</normalfont></td>
</tr>
and what I did to member.php
PHP Code:
// grab the total number of posts to compare to this users
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=$countposts['posts'];
working excellent in profile view, but how would i get it to work in my phpportals top ten page, i tried just adding "/ $percentoftotalposts% of total posts"