PDA

View Full Version : where to call includes


nickmay1
08-16-2008, 10:20 AM
I am new to vBulletin, so my apologies if this question has been answered many times before.

I want to grab a list of all forums from the database and splurge them as a menu of links on the right side of the page, to make navigation easier. Since it will be on pretty much EVERY page the user sees, I want to create a variable containing my content, then spit it out in the template.

Reading various posts on this board tells me how to use the VB database abstraction layer - the table to interrogate is pretty obvious - but - I am not clear on where I should "hook in" to vbulletin.

Is there a standard place to call a 3rd party include? Global.php seems to get called by everything - is that the place to do it?

Any help much appreciated,

Regards

Nick May

Dismounted
08-16-2008, 11:40 AM
The hook you'll want is global_start - it is executed on (nearly) every page and will fit your purpose. You can use the vBulletin database class to then query for the information you need. Make sure you take in account permissions for forums though.

nickmay1
08-16-2008, 11:54 AM
Thank you very much - exactly the information I needed.

best wishes

nick may