vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with fetch_child_forums (https://vborg.vbsupport.ru/showthread.php?t=184271)

tehtide 07-03-2008 12:02 PM

Help with fetch_child_forums
 
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


All times are GMT. The time now is 04:07 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
  • Page Generation 0.00927 seconds
  • Memory Usage 1,706KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete