Thanks
nerbert for sharing the code.
I will give it a try and see if it works.
Cheers
P.s: where and how do I use this code?? as a plugin? if yes, then what hook should I use with??
Quote:
Originally Posted by nerbert
It happens I'm working on an update to a mod that ignores a list of forums. Here's a little code snippet for not listing selected forums:
Code:
$ignore_array = array(11,12,23,24); //example of forum id's you don't want to show
$cache = array();
foreach($vbulletin->forumcache AS $forumcache)
{
$i = $forumcache['forumid'];
if(!in_array($i, $ignore_array))
{
$cache[$i] = $forumcache;
}
}
$vbulletin->forumcache = $cache;
|
--------------- Added [DATE]1421029071[/DATE] at [TIME]1421029071[/TIME] ---------------
Quote:
Originally Posted by kh99
Well, I'm not sure if I completely understand. But I don't see why you couldn't copy forum.php to another name, then modify it do display only certain forums. It looks like it uses $vbulletin->forumcache, so maybe near the beginning you could delete the forums you don't want to display from $vbulletin->forumcache. You said you don't want to use mods, but it might be possible to do that in a plugin using hook forumhome_start. You could check for a parameter and adjust forumcache accordingly.
But I haven't actually tried this and sometimes you run in to things that don't work like you hoped, as I'm sure you know.
|
Thanks man, kh99
I wanted to make each forum in an independent page because my forums are a lot and each has many sub-forums. so if I made each set of forums in one page, it will be easier for readers and visitors to understand what's going easily.
ok, if copying forum.php is a lot easier, then what code do I have to change in the new .php file... is it this code:
PHP Code:
foreach ($parentlist AS $forumID)
{
$forumTitle =& $vbulletin->forumcache["$forumID"]['title'];
$navbits[fetch_seo_url('forum', array('forumid' => $forumID, 'title' => $forumTitle))] = $forumTitle;
}
HOW?? I have no clue how to start...!!
any idea??