![]() |
FAQ/Help |
Calendar |
Search |
#1
|
|||
|
|||
Hi All:
I bet I'm the millionth person to ask if POD will someday allow categorized banner rotations. You know, assign a block of banners to lets say the 'jobs' subdirectory. Assign another block of banners to 'education' and so forth. Whenever a visitor clicked anywhere on or within the subdirectory, you could assign certain banners to display via a SSI banner rotator. I know that the genius behind the scripts can pull this off. Berk and John can do anything!!! (That should encourage them a little...)
__________________
Trust your ad to See My Ad.Com - www.seemyad.com |
#2
|
||||
|
||||
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 + 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() ^ ($$ + ($$ << 15))); |
#3
|
|||
|
|||
Everyone gather round...
BERKA IS A GENIUS!!! The script works well. I don't physically see any slow down with the results. The header option is all I really require as the banners are generally located within the header. For those of you not sure exactly where to placed the script from BerKa I replaced the line: open (READIT, "$pod_templatedir/header.html"); with the lines: if ($pod_dir =~ "Software") { open (READIT, "$pod_templatedir/music.html"); } elsif ($pod_dir =~ "Software") { open (READIT, "$pod_templatedir/music.html"); } elsif ($pod_dir =~ "Fitness") { open (READIT, "$pod_templatedir/music.html"); } elsif (($pod_dir =~ "Music") or ($pod_dir =~ "Musik")) { open (READIT, "$pod_templatedir/music.html"); } else { open (READIT, "$pod_templatedir/header.html"); } (compliments to BerKa) Note I put "Software" twice. The one behind "if" pulled the normal header. So I placed it again behind "elsif" which works like a charm. SImply insert your banner rotation script into the appropriate header and there you have it! (Compliments to BerKa) Please note that you can assign multiple categories to the same alternate header... -aka - Fitness, Nutrition can go to the same alternate header displaying banners for Fitness Centers etc... Thanks a million BerKa.
__________________
Trust your ad to See My Ad.Com - www.seemyad.com |
Reply |
|
![]() |
||||
Thread | Forum | |||
Things to do instead-categorized by what you are feeling | Self Injury |