The Arcive of vBulletin Modifications Site. |
|
How do I assign a trigger(?) to a template? Details »»
|
|||||||||||||||||||||||||||
|
How do I assign a trigger(?) to a template?
Developer Last Online: May 2005
I created a template that mentions all the super mods and admins of the board. We used to have it in the header, but with more styles, differing from each other, it gets a bit complicated to update it if needed.
So what I want is to assign a trigger like $modslist or something, so I can put that in each header and have it called from the template that way. How would I do that? Show Your Support
|
|||||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Whenever I want to add something like this I usually do it in my global.php.
I have a button appear on the top of my header for my moderators to link to the moderator cp. In my global.php I entered this code PHP Code:
PHP Code:
|
|
#3
|
|||
|
|||
|
This isn't quite what I need though.
Basically I want to be able to put "$modslist" in a template, and it would show whatever "$modslist" is assigned as. I want "$modslist" to actually show the template called "modslist". Is this clear enough? I really don't know how to explain this better. |
|
#4
|
||||
|
||||
|
It really depends on where you're going to use it. If you're sure you'll be using it on several pages, then you may want to edit global.php and define $modslist there. On the other hand, if you know you're probably only going to use it on the main page, or the forumdisplaypage, you'd want to define $modslist there. The idea is that you don't want to clutter global.php with a bunch of extra code, if you really don't need it there.
So step 1: where are you doing to use it? As for defining the variable (step 2), this takes a little experience with MySQL and the vB functions and database class. You just need to create a query that returns the moderators for the given forum and pass those values into $modslist. As for the specific code, hopefully someone will be able to help you, if you need it. |
|
#5
|
||||
|
||||
|
This is the string to use to assign your term to a template:
PHP Code:
|
|
#6
|
|||
|
|||
|
I just replace my_message with whatever I need, right?
Thanks a lot. |
|
#7
|
||||
|
||||
|
bingo...
|
![]() |
|
|