Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 01-10-2011, 07:04 PM
siliconfinance siliconfinance is offline
 
Join Date: Mar 2007
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to add a plugin for use on the forumhome page??

I created a template that includes a banner rotator script which I incorporate in my vBulletin ad templates via plugin. I obtained the plugin code here:
https://vborg.vbsupport.ru/showt...36#post1300336

This plugin works when I place the banner template into my ad_header_end template. Yay!

I recently decided that I would also like to display banners on the FORUM HOME page between forums. I have isolated the relevant vbulletin FORUMHOME template (forumhome_forumbit_level2_post) that I would like to incorporate the banner template, but the plugin will not execute when I insert my banner rotator template into that template.

I assume I need to create a new plugin with a different hook location in order to fetch the template that includes the banner rotator script.

I have searched google and vbulletin.org extensively without success.

Any guidance someone can provide would be greatly appreciated.

Lynne has been very helpful over at vb .com but I think I need some input from some more experienced folks.
Reply With Quote
  #2  
Old 01-10-2011, 08:10 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try making a plugin using hook location forumbit_display. You may not have to duplicate all the code, you might just be able to declare your variables as global in the new plugin. (Since the forumhome templates are eval'd in a function, they won't be able to access variables from elsewhere unless there's a global statement).
Reply With Quote
  #3  
Old 01-10-2011, 08:44 PM
siliconfinance siliconfinance is offline
 
Join Date: Mar 2007
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Try making a plugin using hook location forumbit_display. You may not have to duplicate all the code, you might just be able to declare your variables as global in the new plugin. (Since the forumhome templates are eval'd in a function, they won't be able to access variables from elsewhere unless there's a global statement).
Since I am new to this, can you guide me as to what code to include in the plugin?
Reply With Quote
  #4  
Old 01-10-2011, 08:53 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't tell you exactly since it depends on what your plugin does and what your template changes are. But I think whatever variables you are trying to put in the template should be declared as global. For instance if you're trying to display an ad by putting $ad in the template somewhere, then you'd put

Code:
global $ad;
as the plugin code. (That is, a new plugin using hook location forumbit_display and only that one line of code).

ETA: if you haven't created a plugin before: Go to "Plugins and Products" in the admin comtrol panel, choose "Add New Plugin". Choose the hook location and make up a title (so you'll remember what it is later). Put the code in the big text area, select "Yes" to make it active, and save.
Reply With Quote
  #5  
Old 01-10-2011, 09:02 PM
siliconfinance siliconfinance is offline
 
Join Date: Mar 2007
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is what I have.

I have banner code in a custom template

I want that template to be incorporated in this template (via a plugin): forumhome_forumbit_level2_post

I am trying to figure out how that plugin needs to be written in this thread.

--------------- Added [DATE]1294702744[/DATE] at [TIME]1294702744[/TIME] ---------------

Thank you very much. I added the ';' that you added and everything works now!

Thank you!!!
Reply With Quote
Reply

Thread Tools
Display Modes

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:23 PM.


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.10532 seconds
  • Memory Usage 2,190KB
  • Queries Executed 11 (?)
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_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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