PDA

View Full Version : Help with fetch_child_forums


tehtide
07-03-2008, 12:02 PM
I'm in the process of creating a page for out vbulletin that will have each of the forums latest posts in a tabbed area for ease of organization.

the code I'm developing is using a function fetch_child_forums and I'm having an issue with it...

Basically I'm calling the function in a for/next loop as the code loops through each of the tabs and setups the forum views. I'm calling it like this:
$forumids = array(5,7,13);
foreach ($forumids as $forumid)
{
$childforums = fetch_child_forums($forumid, 'ARRAY');

// do stuff
unset($childforums);
}

My problem is that everytime I loop the return from fetch_child_forums is the previous child fourms, plus the new child forums. It is like that the new child forums are stacked ontop of the array instead of destroying the array and creating a new one.

I've got to be missing something here...

thanks in advance

sockwater
07-03-2008, 07:00 PM
fetch_child_forums saves the child forums in a static variable and adds to them. Try looping through $vbulletin->forumcache

tehtide
07-04-2008, 12:34 PM
Ok... cool. That's what I've been missing

// Runs into wall
/// Smack self in head... lol

Ghostt
03-31-2011, 02:37 PM
can you show us please the full result? thanks