Many forum admins want guests (or other users who don't have access to a private forum) to see that there are threads and posts in that forum. Under the current system, if a user doesn't have access to a forum then it will show 0 threads and 0 posts in the forum listing. You can use this method to show the true counts regardless of forum permissions.
Note, If you have a ton of forums then this code can add a lot of processing time to your forumhome and forumdisplay pages.
Go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start
Add this code:
Then go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level1_post
Replace the red code...
...with the blue code:
Make a similar change to the forumhome_forumbit_level2_post template.
Note, If you have a ton of forums then this code can add a lot of processing time to your forumhome and forumdisplay pages.
Go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start
Add this code:
Code:
// IF FORUMHOME OR FORUMDISPLAY PAGE if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay') { // GET FORUM COUNTERS $forumcounts= $DB_site->query("SELECT forumid, replycount, threadcount FROM " . TABLE_PREFIX . "forum "); // SET VALUES while ($forumcount = $DB_site->fetch_array($forumcounts)) { $forumreply[$forumcount[forumid]] = $forumcount[replycount]; $forumthread[$forumcount[forumid]] = $forumcount[threadcount]; } }
Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> forumhome_forumbit_level1_post
Replace the red code...
Code:
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td> <td class="alt1">[color=red]$forum[threadcount][/color]</td> <td class="alt2">[color=red]$forum[replycount][/color]</td> <if condition="$vboptions['showmoderatorcolumn']"> <td class="alt1"><div class="smallfont">$forum[moderators] </div></td> </if>
Code:
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td> <td class="alt1">[color=blue]{$GLOBALS[forumthread][$forum[forumid]]}[/color]</td> <td class="alt2">[color=blue]{$GLOBALS[forumreply][$forum[forumid]]}[/color]</td> <if condition="$vboptions['showmoderatorcolumn']"> <td class="alt1"><div class="smallfont">$forum[moderators] </div></td> </if>
Comment