MyBB Community Forums

Full Version: help with function build_forumbits in the index.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i was wondering if someone could help me identify the format in which this function passes information to the $forum variable


eg.
FROM index.php
$forum_list = build_forumbits();
$forums = $forum_list['forum_list'];

from the above i followed the function to inc/functions.php and found
FROM inc/functions/forumlist.php
// Return an array of information to the parent forum including child forums list, counters and lastpost information
	return array(
		"forum_list" => $forum_list,


can someone please explain the format so i can replace the ['forum_list']
with a format of numbers eg 1,0 or something so that i can display only certain forums on the index page using the $fid

eg

$forum = $forum_list[$fid] 
or something alike ...it is for a under construction plugin thanksBig Grin
/**
* Build a list of forum bits.
*
* @param int The parent forum to fetch the child forums for (0 assumes all)
* @param int The depth to return forums with.
* @return array Array of information regarding the child forums of this parent forum
*/
function build_forumbits($pid=0, $depth=1)
Your answer is in the $pid param.
replace return array(

with

$debugresult = array(
... );
print "<pre>build_forumbits($pid, $depth):\n" . htmlentities(print_r($debugresult, true)) . "</pre>";
return $debugresult;

That's how I found out about the format when I wrote my Subforum Bulb plugin that also modifies build_forumbits().