View Single Post
 
Old Oct 07, 2001, 09:42 AM
BeRKA's Avatar
BeRKA BeRKA is offline
Member
 
Member Since: Aug 2001
Location: Sweden, Stockholm
Posts: 40
I am not the genius behind the pod script, but to do this fix is quite simple...
(You will have to polish this code for your pod version.)

I have used my earlier idea about how to have different header.html and a random script
that I use for something else.
The modifications are made in the podvars.pm file.

first:
Use the header.html idea presented in an earlier post, and add an extra variable for the category
You would like random banners for.
elsif ($pod_dir =~ "Asimov")
{
open (READIT, "$pod_templatedir/asimov.html");
$msgqqq .= &p_bann();
}

2:
before the line sub pod_page_header{
add this.
$msgqqq .= " ";

3:
Just before the end of the file, add the subroutine:
sub p_bann {
return $bannercodes[int(rand($#bannercodes &#43 1))];
}

4:
In the beginning of the file, add the bannercodes.
@bannercodes = ("bannercode1", "bannercode2", "bannercode3", "bannercode4", "bannercode5");

5:
change the line
return $pod_header.$pod_ph_text;
to
return $pod_header.$pod_ph_text.$msgqqq;

Thats it.
Good luck.

And maybe You would want a randomseed in the begining:
srand(time() ^ ($$ &#43 ($$ << 15)));