![]() |
Forum Post Count
I want the total post count for a forum on my vBulletin Board to not count toward the board's total post count. Can this be done?
|
Forums And Moderators > Forum Manager > Find the one you want > Count Posts Made in this Forum Towards User Post Counts > No!
|
Quote:
Not user post counts, total board count. Basically, I want to subtract the number of posts already in a forum from the board total. |
Ah, poor reading on my part :(
Not sure of any ways to do it without editing the code or manipulating it with a plugin. |
Does anyone else know how to do this?
|
Are you simply talking about the post count on the index.php page? It looks like the total post count is grabbed from the forumcache and you can probably use construct_forum_bit (in functions_forumlist.php) to get the reply count for that particular forum and then just do a quick calculation to spit out what you want.
|
Thanks Lynne. I have no idea how I would do that though. Any advice?
|
Quote:
|
I get what you are saying.
Seems pretty hard though.. |
Actually, I just relooked and saw it's already there in the cache (and I don't know what I was thinking of using that function - middle of the afternoon brain fart or something). You can see it totaling up the posts in the function, just grab the total for that forum and do what you want with it:
Code:
if (is_array($vbulletin->forumcache)) |
Thanks so much Lynne. What file is that though and where is it located? I looked in the "functions_forumlist.php" file and it wasn't in there. Well, I did a search in the file for "$forumpostcount" and didn't find it.
|
It's at the bottom of the index.php page. The line in red is what I added, so you aren't going to find $forumpostcount anywhere.
|
Thanks, Lynne. I am still confused about what I need this to look like exactly though.
if ($forum['forumid'] == xx) $forumpostcount = $forum['replycount']; Could you maybe give me an example so I don't mess anything up? |
xx is the forumid you want to get the post count of and then it will be stored in $forumpostcount (or whatever you want to call that variable). Then you can use that number to calculate the total posts on the board minus those in that forum.
|
You must do the calculation in the file before the reply count is formatted using vb_number_format().
|
OK, I am officially confused now :(
@ Lynne: Are you saying all I have to do is insert that line of code but just add the forum ID for the forum I wish not to count toward the board's total count? @ Dismounted: huh? |
Add that line, but change the xx to the forum id. Then, the line will give you the post count in that forum. Then, outside of the loop, you need to perform your calculation ($totalposts - $forumpostcount) and, as Hanson said, you need to do that before you format the number (a couple lines down from that code).
I would strongly suggest you just play with this on your test site. You will learn a lot by just trying things out. That will help you in the long run because you will be more willing to modify other modifications and personalize your site. |
unfortunately, I don't have a test site. Also, what do you mean when you say outside of the loop?
|
|
All times are GMT. The time now is 04:09 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|