The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I'm trying to understand the code better before attempting a modification to the forumhome_forumbit_level1_nopost template.
Where does the $forum array variable come from? Where is it declared, initialized, assigned values, whatever? What is its scope? What does it contain? As far as I can tell, the Code Documentation in the Members Area does not include an index by variable, so how else can I find information about them? What is a better way to answer this question for myself, rather than asking random questions like this on the forum? I'm barely starting to understand PHP, so I don't know the tools or techniques yet. Please point me in the right direction! Thanks! Mike D. |
#2
|
||||
|
||||
![]()
Best way: Lookup where the Template (forumhome_forumbit_level) is being called, and you will see the context, scope of variables, etc.
Hint: construct_forum_bit() in functions_forumlist.php |
#3
|
|||
|
|||
![]()
Thank you for your time, Andreas.
I've already traced program flow all the way from index.php down to construct_forum_bit()... But at that point the $forum array is being used heavily, having already been declared and assigned values. I need to see the part of the code where it's created. I am very early in my effort to pick apart the vBulletin code base. I am beginning to be able to read PHP, though I'd be hard pressed to write it. I don't have a clue where I should begin to look, in this stack of dozens of php files, for the place where $forum is created and initialized (or modified). Should I drop to a linux command line and grep something like '$forum = array'??? Or is there a framework for how the coders organized things that I need to know more about? I'm trying to get to the point where I can answer questions like this for myself, so any foundational information you can see that I'm lacking, I would welcome. Thanks again, Mike D. |
#4
|
||||
|
||||
![]()
In construct_forum_bit you can find this line:
PHP Code:
The cache is build from table forum by build_forum_permissions() in includes/adminfunctions.php, when a forum is added/modified, permissions changed, etc. As this is cached data, it does not necessarily contain the current values for replies, threads, etc. This is where cache_ordered_forums() comes into play: It reads the current data from table forum (and other tables if necessary), merges them into $vbulletin->forumcache To answer such questions yourself, you have to track down the data flow. |
#5
|
|||
|
|||
![]()
D'oh!
And if I hadn't read past the line in construct_forum_bits() that calls fetch_last_post_array(), I'd have been able to find out where $forum was defined by looking up fetch_last_post_array() in the Code Documentation, which would have gotten me to look in functions_forumlist.php again, about 3 screenfuls above where I was at already. <sigh> Okay, now I just have to study build_forum_permissions() to get my bearings on what they're putting in the cache. This is excruciating. Quote:
Mike D. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|