Hi,
I have been playing around the following three files
forumdisplay.php
/includes/functions_forumlist.php
forum.php
I tried to find how many sections in each category I was able to find out how to display the overall numbers
of sections in each category and the problem it that despite the permissions as it shows like there is 16 sections this forum yet it for that user it should be 4 sections as I have hidden all the rest
What I have done is made a global variable at the top of
forumdisplay.php file
PHP Code:
global $numberinforums;
and below the following
PHP Code:
$forumbits = construct_forum_bit($foruminfo['forumid']);
added the following for loop
PHP Code:
for(int k=0; k < sizeof($foruminfo['childlist']); k++){
$numberinforums++;
}
it loops through sizeof($foruminfo['childlist']) which is does how many elements r there in the array of each forum
yet I want to wrap the loop with if statements
like following
PHP Code:
for(int k=0; k < sizeof($foruminfo['childlist']); k++){
if(the user can see this forum increase counter){
$numberinforums++;
}
}
then I use in the forumdisplay template the following
PHP Code:
{vb:raw numberinforums}
and to display the counter in the FORUMHOME I applied almost the same code
apart from the loop statement instead this
PHP Code:
sizeof($foruminfo['childlist'])
added the following in /includes/functions_forumlist.php
PHP Code:
sizeof($children)
I would really appreciate any tip or help anybody would give it to me
to apply the each section permission on each counter
Looking forward to the awsome helpers
Many thanks in advance