Just wanted something simple that changed the banner and link on each build. I was messing around thinking of using over complicated methods when all I really needed to do was this:
All I would use are about 5 diff banners so I put this into site_html_templates.pl:
in the globals:
rban => &rban,
then at the bottom add this sub routine (changing $count to the number of banners your using and changing the url's etc...:
sub rban {
# --------------------------------------------------------
my ($rando, $rand, $count);
$count = 5;
# Get a random banner on each build
$rand = int(rand ($count + 0.5));
if ($rand eq 1) {
$rando = "<a href=\"/url 1 here\"><IMG SRC="image 1 url here" ALT="image 1"></a>";
}
if ($rand eq 2) {
$rando = "<a href=\"/ url 2 here\"><IMG SRC="image 2 url here" ALT="image 2"></a>";
}
if ($rand eq 3) {
$rando = "<a href=\"/ url 3 here\"><IMG SRC="image 3 url here" ALT="image 3"></a>";
}
if ($rand eq 4) {
$rando = "<a href=\"/ url 4 here\"><IMG SRC="image 4 url here" ALT="image 4"></a>";
}
if ($rand eq 5) {
$rando = "<a href=\"/ url 5 here\"><IMG SRC="image 5 url here" ALT="image 5"></a>";
}
return $rando;
}
Then add <%rban%> wherever you want the banner to be displayed.
(Also I've added a few things to do the following: count the number of times each banner is displayed, count the number of clicks each banner gets, display them via graphs on a results template, I'll post the code for this soon)
Good Luck!
Glenn
http://mir.spaceports.com/~glennu/
All I would use are about 5 diff banners so I put this into site_html_templates.pl:
in the globals:
rban => &rban,
then at the bottom add this sub routine (changing $count to the number of banners your using and changing the url's etc...:
sub rban {
# --------------------------------------------------------
my ($rando, $rand, $count);
$count = 5;
# Get a random banner on each build
$rand = int(rand ($count + 0.5));
if ($rand eq 1) {
$rando = "<a href=\"/url 1 here\"><IMG SRC="image 1 url here" ALT="image 1"></a>";
}
if ($rand eq 2) {
$rando = "<a href=\"/ url 2 here\"><IMG SRC="image 2 url here" ALT="image 2"></a>";
}
if ($rand eq 3) {
$rando = "<a href=\"/ url 3 here\"><IMG SRC="image 3 url here" ALT="image 3"></a>";
}
if ($rand eq 4) {
$rando = "<a href=\"/ url 4 here\"><IMG SRC="image 4 url here" ALT="image 4"></a>";
}
if ($rand eq 5) {
$rando = "<a href=\"/ url 5 here\"><IMG SRC="image 5 url here" ALT="image 5"></a>";
}
return $rando;
}
Then add <%rban%> wherever you want the banner to be displayed.
(Also I've added a few things to do the following: count the number of times each banner is displayed, count the number of clicks each banner gets, display them via graphs on a results template, I'll post the code for this soon)
Good Luck!
Glenn
http://mir.spaceports.com/~glennu/

