Welcome to Geeklog Monday, December 11 2017 @ 07:59 am EST


Status: offline

coffeelove

Forum User
Newbie
Registered: 24/05/2009
Posts: 7
artistic
Hey all, just thought I'd post this for other people to use also.

Place the following code in a static page with the following options:

Add to menu = FALSE
Page format = Left & Right
Post Mode = HTML
Centerblock = TRUE
Position = Bottom of Page
Topic = All
In a block = TRUE
PHP = execute PHP

Make sure to edit the $baseURL to be relevant to your banner folder on your site, and to edit the individual banner entries so that they reflect what you want them to show.
PHP Formatted Code

// Set this to your URL including full path to images folder via HTTP
$baseURL="http:/domain.com/images/path/";

 // Leave this set to 1 unless you are doing something funky with your banner rotation
$rand1=1;

 // Change this value to the maximum number of banners that you have
$rand2=2;

// Banner Number 1
$Img1 = "image.png";
$Alt1 = "ALT text for this banner";
$Url1 = "http:/doamin2.com/";
$Desc1 = "Text to display with banner";

// Banner Number 2
$Img2 = "image.jpg";
$Alt2 = "ALT text for this banner";
$Url2 = "http:/domain3.com/";
$Desc2 = "Text to display with banner";

// ---------- No Need to Edit Below This Line Except to change Banner Layout ----------
$num = rand ($rand1,$rand2); // Calculate Random number to pick banner options

$Image = ${'Img'.$num};
$Alt = ${'Alt' .$num};
$URL = ${'Url'.$num};
$DESC = ${'Desc'.$num};
// ---------- End of NO EDIT Area ----------

// Setup Banner Layout here
$BANNER = "<div width=\"70%\" style=\"border:1px solid; padding:5px;\"><p><a href=\"".$URL."\"><img src=\"".$baseURL.$Image."\" alt=\"".$Alt."\" class=\"floatright\" /></a>".$DESC."</p></div>";

Print $BANNER;
 


Also, down here on the bottom: you can edit the $BANNER variable to properly mesh with your site.

I hope this helps somebody, cuz it took me forever to figure out how to do this correctly.

Status: offline

rdunne

Forum User
Junior
Registered: 02/07/2007
Posts: 27
hi , do yo have an example of this?

Status: offline

coffeelove

Forum User
Newbie
Registered: 24/05/2009
Posts: 7
sure do, just take a look at my site: http://thesizer.net/ and scroll all the way to the bottom of the page. Hit refresh a few times to see the banner change.

Status: offline

coffeelove

Forum User
Newbie
Registered: 24/05/2009
Posts: 7
embarrassed
sorry for the absolute lack of there being anyting as an example on my site at the moment of this writing, user-error: i hit the wrong button and wiped my site clean. currently working on getting it back up and running, but have switched over to glFusion. have received absolutely no headaches with it so far on a clean install.

Status: offline

coffeelove

Forum User
Newbie
Registered: 24/05/2009
Posts: 7
okdokey... site is mostly back up. i've just been lazy about putting ads back into the pages. but you can grab a functional phps from my downloads area.

All times are EST. The time is now 07:59 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content