Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
How do I assign a trigger(?) to a template? Details »»
How do I assign a trigger(?) to a template?
Version: , by Lanigironu Lanigironu is offline
Developer Last Online: May 2005 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-08-2002 Last Update: Never Installs: 0
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-08-2002, 06:12 AM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
if (($bbuserinfo[usergroupid]==or $bbuserinfo[usergroupid]==or $bbuserinfo[usergroupid]==7)) {
        
$modbutton="<a href=\"http://www.abudokan.com/mod_directory/index.php\"><img src=\"http://www.abudokan.com/images/top_mod.gif\" border=\"0\" alt=\"Moderator Panel\"></a>";
    } else {
        
$modbutton='';
    } 
above
PHP Code:
$header=''
I hope I read your question right and was able to answer for you.
Reply With Quote
  #3  
Old 03-09-2002, 04:17 AM
Lanigironu Lanigironu is offline
 
Join Date: Mar 2002
Location: Toronto, Canada
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 03-09-2002, 06:53 PM
bigmattyh's Avatar
bigmattyh bigmattyh is offline
 
Join Date: Nov 2001
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 03-09-2002, 07:27 PM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the string to use to assign your term to a template:

PHP Code:
eval("\$my_message .= \"".gettemplate("my_message")."\";"); 
Reply With Quote
  #6  
Old 03-09-2002, 10:06 PM
Lanigironu Lanigironu is offline
 
Join Date: Mar 2002
Location: Toronto, Canada
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just replace my_message with whatever I need, right?

Thanks a lot.
Reply With Quote
  #7  
Old 03-10-2002, 02:00 AM
slideboxer's Avatar
slideboxer slideboxer is offline
 
Join Date: Dec 2001
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bingo...
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 05:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04869 seconds
  • Memory Usage 2,261KB
  • Queries Executed 20 (?)
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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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_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