MitsuStyle MitsuStyle

Go Back   MitsuStyle > The Homefront! > The Parking Lot - On & Off Topic

Reply
 
Thread Tools Display Modes
Old 11-21-2004   #1
AJ
Area code 166 represent
 
AJ's Avatar
 

Join Date: Aug 2003
Location: Crystal, MN
Posts: 10,329
Send a message via AIM to AJ Send a message via Yahoo to AJ
Anyone really good with PHP or JS? Rotating Banner Questions

I am having some issues getting a rotating banner script set up in the header of the forums. I have the banners sized already, and on the server. But I can't for the life of me get the script up and working right. Anyone know of one that would rotating a few (3 or 4) banners at the top of the forum upon page refresh?

Thanks!
__________________
'16 Focus ST - Daily Duty
'93 mr2 - Track car in progress

Last edited by admin; 12-02-2004 at 12:40 AM..
AJ is offline   Reply With Quote
Old 11-22-2004   #2
LightningGSX
Hellbound
 

Join Date: Nov 2003
Location: St Paul
Posts: 1,390
How about a timed banner rotator?
__________________
-Nulli Secundus-
LightningGSX is offline   Reply With Quote
Old 11-22-2004   #3
scheides
flips McGee
 
scheides's Avatar
As much as I'd prefer to run php over JS, here's a few examples. These are all cgi-based, which is probably the best way to run them, but you could probably rip out some of the code and use it as a header:

http://www.autoinstaller.de/banner-rotator.html

http://www.geocities.com/jsmaster/banrot.html

http://www.geocities.com/SiliconValley/7116/banner2.zip

http://javascript.internet.com/messages/banner-ads.html

http://www.bloke.com/javascript/AdRotation/

PM know if you need help,

-scheides
scheides is offline   Reply With Quote
Old 11-22-2004   #4
Jakey
Asshat King
 
Jakey's Avatar
 

Join Date: Oct 2003
Location: Decorah / Ames, Iowa
Posts: 3,683
Send a message via MSN to Jakey
I don't know if it would be any help at all but I've got a copy of Flash MX 2004 and Dreamweaver MX 2004 if it would help you out.
__________________
DSMSTYLE MAFIA - Holdin' Down the Cornfields of IA
'92 Laser RS AWD & '01 Grand Prix GTP

Proud to be a Cyclone

Check it out: Racers Against Street Racing
Jakey is offline   Reply With Quote
Old 12-01-2004   #5
AJ
Area code 166 represent
 
AJ's Avatar
 

Join Date: Aug 2003
Location: Crystal, MN
Posts: 10,329
Send a message via AIM to AJ Send a message via Yahoo to AJ
I am still working on this, and wonder is anyone else has any ideas. Thus far I have been unable to use anything llisted. I either get all the banners placed at the top in a mess or I get nothing.
__________________
'16 Focus ST - Daily Duty
'93 mr2 - Track car in progress
AJ is offline   Reply With Quote
Old 12-01-2004   #6
AJ
Area code 166 represent
 
AJ's Avatar
 

Join Date: Aug 2003
Location: Crystal, MN
Posts: 10,329
Send a message via AIM to AJ Send a message via Yahoo to AJ
this is the code I am trying to use:

-----


Code:

$bannerrand = rand(1, X);

and then use the number generated in your template whereever you want the banner, for instance in the "header" template. Example; rotating three banners (X=3 in the code above):
Code:

<if condition="$bannerrand == '1'">
<a href="Banner 1 hyperlink"><img src="Banner 1 Image URL" /></a>
<else />
<if condition="$bannerrand == '2'">
<a href="Banner 2 hyperlink"><img src="Banner 2 Image URL" /></a>
<else />
<a href="Banner 3 hyperlink"><img src="Banner 3 Image URL" /></a>
</if>



Anyone know why the thing won't rotate the banners with the code like this and just display them all at the top of the fourms together?
__________________
'16 Focus ST - Daily Duty
'93 mr2 - Track car in progress
AJ is offline   Reply With Quote
Old 12-02-2004   #7
SuperSleeper
 
SuperSleeper's Avatar
 

Join Date: Jan 2004
Location: Apple Valley, MN
Drives: 2012 Audi S4
Posts: 860
Send a message via AIM to SuperSleeper
Check out this site... may have some resources for you.

http://www.zend.com/apps.php?CID=35

Otherwise try this code:

function randInt(min,max)
{
var div = (max - min) + 1
var randNum = Math.random()
for (var i = 0; i <= div - 1; i++)
{
if (randNum >= i / div && randNum < (i+1) / div)
{return i + min}
}
}


var abc = randInt(1,5);

if (abc == 1) {

document.write("<\"Your 1. HTML-Banner-Code\">");

}

if (abc == 2) {

document.write("<\"Your 2. HTML-Banner-Code\">");

}

if (abc == 3) {

document.write("<\"Your 3. HTML-Banner-Code\">");

}

if (abc == 4) {

document.write("<\"Your 4. HTML-Banner-Code\">");

}

if (abc == 5) {

document.write("<\"Your 5. HTML-Banner-Code\">");

}

The "document.write" function is Javascript, and probably not necessary for the code to work. Haven't tested the code though, so don't hold your breath.

Last edited by SuperSleeper; 12-02-2004 at 01:01 AM..
SuperSleeper is offline   Reply With Quote
Old 12-02-2004   #8
scheides
flips McGee
 
scheides's Avatar
What OS is your server? Why don't you just link to a static image, but setup a cron job changing what that static image is every 1, 2, 4, 5, 10 minuts, or whatever. Whenever your peak time is for the day, you could charge a premium to whomever wants to advertise more during that time, just like TV!

If you want code for this, let me know, it'd be *super* complicated

-scheides

ps--cache-crazy browsers such as IE might not load the current version of the image right away, but would realize it after a few clicks/page reloads.
scheides is offline   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



All times are GMT -5. The time now is 01:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.