vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Different Banners (https://vborg.vbsupport.ru/showthread.php?t=84461)

tzdesigner 09-06-2002 01:04 AM

Different Banners
 
Im making a adv. forum and I want to know how to get banners to change everytime the index.php refreshs.

BearDoc 09-06-2002 12:56 PM

use java or cgi

assassingod 09-06-2002 01:58 PM

I did used to know the code for that using javascript. I guess I can use all my brainpower to think of it for you. Otherwise you'll have to use PHP, which is for vB.org.

I think I know the code for it in PHP as well :rolleyes:

EDIT: Ok, I remembered it almost straight away. here it is (Add this to your body tag, where you want the banner to appear.) Bits in blue require you to change whatever is there.

This will have 3 different images each time the person refreshes DOnt forget to change the width/height ETC.

Code:

<SCRIPT LANGUAGE="JavaScript">
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
txt="TEXT";
url="URL";
alt="ALT TEXT";
banner="BANNER URL";
width="468";
height="60";
}
if (ad==2) {
txt="TEXT";
url="URL";
alt="ALT TEXT";
banner="BANNER URL";
width="468";
height="60";
}
if (ad==3) {
txt="TEXT";
url="URL";
alt="ALT TEXT";
banner="BANNER URL";
width="468";
height="60";
}
document.write('<center>');
document.write('<a href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>');
</SCRIPT>




I think thats it

tzdesigner 09-06-2002 07:07 PM

ok ty

assassingod 09-06-2002 07:31 PM

If that doesnt work, PM me

tzdesigner 09-06-2002 08:37 PM

ok well im purchasing my license this weekend so Ill be testing it sometime next week. But if it doesnt work I'll PM you for sure...thanks again

assassingod 09-06-2002 09:33 PM

Ah, ok, hope it works:)

No problem:)

Tony G 09-07-2002 12:28 AM

That would be a useful script. But remember, this is a Template discussion forum. For files head over to vB.org.

Thank you.

assassingod 09-07-2002 12:31 AM

Its not a PHP file edit though? :confused: But I think I see the point you're making. No JS or PHP, only HTML???

tzdesigner 09-07-2002 01:13 AM

vb.com is a churchs website,lol :)


All times are GMT. The time now is 12:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02290 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete