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

Reply
 
Thread Tools
Banner rotation Details »»
Banner rotation
Version: , by Crazy Mofo Crazy Mofo is offline
Developer Last Online: Jul 2003 Show Printable Version Email this Page

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

sorry too brin this subject up again but i couldnt find a script that changes every 10th time that u visit any1 got any ideas?

If not anyone got a good java script that just changes the the banner i only want it too change between the 2 changing each time u visit the site not every 20 secs blah blah..

Thx
Crazy

Show Your Support

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

Comments
  #2  
Old 04-19-2002, 02:04 AM
Crazy Mofo Crazy Mofo is offline
 
Join Date: Nov 2001
Location: Newcastle,UK
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cmon there must be some j-script wizard
Reply With Quote
  #3  
Old 04-19-2002, 01:14 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.spoono.com/codebase/php/?link=Ad" target="_blank">http://www.spoono.com/codebase/php/?link=Ad</a>
Reply With Quote
  #4  
Old 04-19-2002, 09:26 PM
Crazy Mofo Crazy Mofo is offline
 
Join Date: Nov 2001
Location: Newcastle,UK
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool but that aint really javascript
Reply With Quote
  #5  
Old 04-20-2002, 12:45 AM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

u don't need JavaScript... why use it? PHP is much better
Reply With Quote
  #6  
Old 04-20-2002, 01:28 AM
Crazy Mofo Crazy Mofo is offline
 
Join Date: Nov 2001
Location: Newcastle,UK
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yea but i want too add the script too the top ov me style
Reply With Quote
  #7  
Old 04-20-2002, 05:26 PM
Pilot Pilot is offline
 
Join Date: Oct 2001
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
// banner rotate in JS

var currentdate = 0;
var core = 0;

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}

rand = getRandomNum(10000,999999);

// Array of links and images

link = new initArray(
"/cgi-bin/ads.pl?banner=NonSSI;page="+rand+"",
"/cgi-bin/ads.pl?banner=NonSSI;page="+rand+"",
"http://kansas.valueclick.com/redirect?host=XXXXXXX&size=468x60&b="+rand+"&v=0");

image = new initArray(
"/cgi-bin/ads.pl?page="+rand+"",
"/cgi-bin/ads.pl?page="+rand+"",
"http://kansas.valueclick.com/cycle?host=XXXXXXX&size=468x60&b="+rand+"&noscript=1");

var currentdate = new Date();
var secs = currentdate.getSeconds();
var core = secs % image.length;

var ranlink  = link[core];
var ranimage = image[core];
var text  = "Click to visit advertiser (a new window will open)";

document.write('<center><a href=\"' +ranlink+ '\" target=\"_blank\">');
document.write('<img src=\"'+ranimage+'\" border=0 width=468 height=60 alt=\"'+text+'\"></a></center>');
Reply With Quote
  #8  
Old 04-20-2002, 05:28 PM
Pilot Pilot is offline
 
Join Date: Oct 2001
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The above JS will select a URL link and image randomly from an array in the code. In my case I use it simply to select from an internal banner ad system and an external one. The rand variable is a randomiser for the ad systems and is not required for simple banner ad rotation.

I call the JS from a template but keep the JS in a server file so that it can be easily changed.
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 01:47 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.05635 seconds
  • Memory Usage 2,265KB
  • Queries Executed 23 (?)
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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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