Thread: Ad banners
View Single Post
  #5  
Old 09-20-2006, 06:13 PM
Ntfu2 Ntfu2 is offline
 
Join Date: Feb 2006
Posts: 1,247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by satcruiser
Adding a banner is easy if you are running vbulletin version 3.5 or higher (with plug in capability)

acitvate the admincp control panel
click on add plug in
select hook location (forumhome_complete)
add the following PHP code in the PHP window

echo "<div align='right'>";
echo "<table border='0' cellpadding='0' cellspacing='0'>";
echo "<tr>";
echo "<td width='100%' align='right'>";
echo "<p align='justify'>";
echo "<a href='http://www.EXMAPLE.com/index.html' target='_blank'>";
echo "<img src='http://www.EXAMPLE.com/images/bn_banner.gif' border='0' align='right' width='200' height='80'>";
echo "</a>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";

Note***: IF a PHP line above does not start with "ECHO" then it is part of the previous line (darn wrapping) and should have a space after the last word of the previous line.

The above code will create a banner using image file bn_banner.gif and will create a new window (target _blank) when you click on the image. If you do not want to create new window then just remove (target _blank). WWW.EXAMPLE.COM is your website, you can use subdirectory if you want to point to your shopping cart for example use www.example.com/shopping/index.html

The only problem is that this code will be displayed only when you start the forum. If you want the advertisement to show in the threads or when someone reads a post, then just create two more plug ins at these hook locations using the same PHP code, the locations are (showthread_complete and forumdisplay_complete)

I do not know of a "hook location" where I would have to enter this code only once and make it appear on every page. If someone knows, any help will be appreciated.

I selected image size 200 by 80, you can use your own image size, I found it to look the best.

It took me sometime to figure this out, so I hope this will help you. Good luck
Maybe the most complicated way i've ever seen anyone add advertisements to their forums...ever
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01113 seconds
  • Memory Usage 1,771KB
  • 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
  • (1)bbcode_quote
  • (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