Current time: 05-24-2012, 04:07 PM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with function build_forumbits in the index.php
11-10-2008, 06:27 AM (This post was last modified: 11-10-2008 06:28 AM by Jitendra M.)
Post: #1
help with function build_forumbits in the index.php
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
Code:
$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
Code:
// 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

Code:
$forum = $forum_list[$fid]
or something alike ...it is for a under construction plugin thanksBig Grin

[Image: darkmew.png]

I reject your reality and substitute my own.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-13-2008, 05:00 PM
Post: #2
RE: help with function build_forumbits in the index.php
PHP Code:
/**
* 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.

Find all posts by this user
Quote this message in a reply
11-13-2008, 06:08 PM
Post: #3
RE: help with function build_forumbits in the index.php
replace return array(

with

Code:
$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().

Google SEO | Gravatar | Hooks | HTMLPurifier | Overview | Patches | PluginLibrary
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication