View Single Post
  #371  
Old 08-14-2006, 03:53 PM
jaybolt jaybolt is offline
 
Join Date: Jun 2004
Location: UK
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First off, this is probably the most useful vB hack I have installed. It helps me run my ad campaigns efficiently and with the minimum of fuss. This is how I have set up the hack:

1. In your global.php file for vBulletin, search for:

Code:
// templates to be included in every single page...
$globaltemplates = array_merge($globaltemplates, array(
	// the really important ones
In the list add:

Code:
// ADSERVER TEMPLATE ADDITION
       'adserver',
2. Create a new template called 'adserver' in your VB styles and templates area. This is the code I use:

Code:
<div style="position: absolute; top: 10px; right: 80px; padding: 1px; border: 2px #C0C0C0 solid;">

<if condition="$foruminfo['forumid']==24"><ad what="zone:3" /><else />
<if condition="$foruminfo['forumid']==105"><ad what="zone:3" /><else />
<if condition="$foruminfo['forumid']==106"><ad what="zone:3" /><else />
<if condition="$foruminfo['forumid']==11"><ad what="zone:4" /><else />
<if condition="$foruminfo['forumid']==18"><ad what="zone:5" /><else />
<if condition="$foruminfo['forumid']==14"><ad what="zone:7" /><else />
<if condition="$foruminfo['forumid']==16"><ad what="zone:8" /><else />
<if condition="$foruminfo['forumid']==69"><ad what="zone:9" /><else />

<ad what="zone:6" />
</if>
</if>
</if>
</if>
</if>
</if>
</if>
</if>
</div>
What is basically does is some CSS positioning to put the ad at the top right of the screen and then it assigns different forum ids to different ad zones within phpadsnew.

Finally, in your NAVBAR template in vb, add the following to the top of your template:
Code:
$adserver
And thats it - that should position your banner at the top right of your forum pages and should display the correct banner relating to your phpadsnew zone set up. It defaults in my case to showing 'zone:6' ads if no other forum is selected.

I hope this helps someone - made it very easy for me when I update my vbulletin versions.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01273 seconds
  • Memory Usage 1,767KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete