Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2006, 10:36 PM
mdevour mdevour is offline
 
Join Date: Feb 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Teach a man to fish?

Hi there,

This is my first forum project and I'm busily updating my stale HTML skills while starting to learn about CSS, PHP, MySQL, and vBulletin. Rather than ask a bunch of "How do I..." type questions, I'd like to learn enough about the way vBulletin works to work out a few of my own answers. That's the "Teach a man to fish" part.

My first step beyond simple Admin config things is to change the behavior of the template for Category strips on the forum index page depending on which one it is. I was told there is a variable for the forum id that I ought to be able to use as the argument to a template conditional.

I bet there are dozens of useful variables besides the forum ID, that I could use for stuff like this if I knew what they were.

Is there documentation for what variables there are?

Where in all these vBulletin files are variables like that declared? (Where's the source code??!)

How do I find out what values they can have, their scope, and so on?

Are there some development tools I need to learn?

Yep, pretty basic questions. I thank you if you can help me answer some of them!

Mike D.
Reply With Quote
  #2  
Old 02-18-2006, 10:38 PM
Borgs8472 Borgs8472 is offline
 
Join Date: Apr 2004
Posts: 924
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mdevour
Is there documentation?

Where in all these files are variables like that declared?

How do I find out what values they can have, their scope, and so on?

Are there some development tools I need to learn?

Yep, pretty basic questions. I thank you if you can help me answer them!

Mike D.
http://www.vbulletin.com/docs/

Best of luck
Reply With Quote
  #3  
Old 02-18-2006, 10:56 PM
mdevour mdevour is offline
 
Join Date: Feb 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Borgs!

I've got the vBulletin manual printed out and sitting right next to me. It's 400 pages. I've been through nearly all of it at least once.

It doesn't seem to answer my questions.

I need a bit more of an answer than RTFM. At least I need to know which manual I need to read. Or maybe which chapter.

Mike D.
Reply With Quote
  #4  
Old 02-19-2006, 12:16 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

in my opinion you should look at the default templates and files in which they use the varibles in there. and almost all varibles in php files can be used in templates, of course if they are used properly.

for the forum id condition, if you are in forum showing, then $forum[forumid] would be it.
Reply With Quote
  #5  
Old 02-19-2006, 05:02 AM
mdevour mdevour is offline
 
Join Date: Feb 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Greetings deathemperor. Thanks for the reply.

Boy, I haven't delved into program code this deep in 20 years, at least.

If I'm reading this right...
The forumhome template uses the variable $forumbits to pull in the complete block of html that constitutes the list of displayed categories and forums.

$forumbits is assigned its value by a function called construct_forum_bit which lives in the file function_forumbits.php ...

forumid is used as an index into the iforumcache array which is filled by the cache_ordered_forums function (which also lives in function_forumbits.php) with a list of values for forumid, I think... but it gets unclear here.

Where is the array $forum defined and given values? Ugh!

Somehow the function construct_forum_bit finishes doing its thing and passes a value to $forumbits, which is finally pulled into the forumhome template which is pulled in at the very end of index.php to display the forum home page... Whew!
Okay, stepping back from the details, I'm tracing the operation of the default index page, through its template, into various php functions that generate bits to fill the template... whose locations I can only know by looking up function names in the API documentation in the vBulletin Member Area...

But there still doesn't seem to be an easy to find listing of where variables are used or declared... For instance, I lose track above because the $forum array comes in from somewhere, but I don't know what it contains or where that comes in from.

If I'm lucky, wherever $forumid is used it always corresponds to the same forum in my list of forums, regardless of permissions, etc... Needless to say, I get a bit boggled! :nervous:

Okay, deathemperor, is that the kind of process I need to be doing here? Or are there some ways to streamline this?!! :cross-eyed:

Thanks for your input, Lucius. I appreciate any help that'll keep me from running down a bunch of blind alleys!

Mike D.
Reply With Quote
  #6  
Old 02-20-2006, 01:34 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can hardly understand what you want to do. are you working on the forumhome ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:21 PM.


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.01963 seconds
  • Memory Usage 2,211KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete