PDA

View Full Version : Post Count on Forum Home - statistics


telc
03-23-2005, 01:26 AM
How can I have the postcount on the index.php show the total # of posts ever posted, counting posts that have been deleted.


In vb2x it could be done this way.

https://vborg.vbsupport.ru/showpost.php?p=357370&postcount=4

deathemperor
03-23-2005, 10:57 AM
Xenon said 2 ways of displaying postcount, one is the real total number of posts on your forum, the 2nd is the unreal posts which includes deleted posts, so to make it's as your need just make: 1 for total posts that still there, make 2-1=3 for the posts that were deleted.

telc
03-23-2005, 11:00 AM
Were can I get these values. All I really need is the max(postid) and threadid

deathemperor
03-23-2005, 11:05 AM
no just max(postid) , you can refer the link above of Xenon to modify, I believe it's different in vb3 but somehow it would just query all posts that way, beside it requires your php + vb3 knowledge.

Trigunflame
03-23-2005, 11:53 AM
Open your index.php in your main forum directory.

Look for this at the bottom:

eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('FORUMHOME') . '");');


Above this add:


// Total Members
$totalPosts = $DB_site->query_first("SELECT max( postid ) AS total FROM " . TABLE_PREFIX . "post");


Open your FORUMHOME template, and add $totalPost[total] wherever you want it to display.

telc
03-23-2005, 12:19 PM
Thanks! I was going to add that query but I wasnt sure if the variable already existed. So I didnt want to add the extra overhead of a new query. But it seems to be working great.