View Single Post
  #78  
Old 09-15-2002, 09:23 PM
springbok's Avatar
springbok springbok is offline
 
Join Date: May 2002
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Please be warned that I have never coded a line of PHP before tonight, but have come up with a solution to the rotation for VB Banner Control 1.2. (Through much hacking of other people code and testing)

I have installed and tested both the Ad Management and VB Banner Control on my site but found the VB Banner Control to be the better (for my needs), but lacking a rotation facility. So I have removed the Ad Management one completely, installed VB Banner Control 1.2 from scratch again and made the following changes to get rotation working.

I do not know whether I am allowed to post this modification, if not please feel free to delete this post immediately.

I can confirm that I have been testing this for the past 4 hours and its working fine but - USE THIS AT YOUR OWN RISK - I cannot be held responsible if anything goes wrong.

1. So, do a complete installation of VB Banner Control 1.2 (I am using VBulletin 2.2.7 and its working great.).
2. Open /global.php
3. Find:
PHP Code:
  if ($getforum['styleoverride']==or $bbuserinfo['styleid']<2) {
    
$codestyleid=$getforum['styleid'];
  }

Below that add:

PHP Code:
// Banner Management
$bannerad=$DB_site->query_first("SELECT * FROM banner ORDER BY RAND()");

$bannerid=$bannerad['id'];
$bannerheight=$bannerad['height'];
$bannerwidth=$bannerad['width'];
$banner_text=$bannerad['banner_text']; 
No further file modifications required. So save or upload this file.

4. Normally with the VB Banner Control hack you would go through the Control Panel and use the getcode link and copy and paste that text into wherever you would want the banner to appear. Normally the Header template. If you are using this tweak you will not have to do this again. Just replace it with the following:


<a target='blank' href='http://www.yourdomain.com/click.php?bannerid=$bannerid'><img border='0' width='$bannerwidth' heigth='$bannerheight' alt='$banner_text' src='http://www.yourdomain.com/view.php?bannerid=$bannerid'></a>


Change the www.yourdomain.com with your sites correct domain name.

And that's it. Now you will have a fully operational banner rotation with all the banners you have in the banners table.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01243 seconds
  • Memory Usage 1,781KB
  • 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
  • (2)bbcode_php
  • (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