Home Menu

Menu


Reply
Thread Tools Display Modes
  #1  
Old Oct 04, 2001, 09:00 PM
freddy freddy is offline
Member
 
Member Since: Oct 2001
Location: USA
Posts: 40
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

advertisement
  #2  
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)));



  #3  
Old Oct 07, 2001, 09:39 PM
freddy freddy is offline
Member
 
Member Since: Oct 2001
Location: USA
Posts: 40
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
Views: 391

attentionThis is an old thread. You probably should not post your reply to it, as the original poster is unlikely to see it.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Things to do instead-categorized by what you are feeling ickydog2006 Self Injury 3 Feb 01, 2007 12:12 AM


All times are GMT -5. The time now is 12:36 PM.
Powered by vBulletin® — Copyright © 2000 - 2025, Jelsoft Enterprises Ltd.




 

My Support Forums

My Support Forums is the online community that was originally begun as the Psych Central Forums in 2001. It now runs as an independent self-help support group community for mental health, personality, and psychological issues and is overseen by a group of dedicated, caring volunteers from around the world.

 

Helplines and Lifelines

The material on this site is for informational purposes only, and is not a substitute for medical advice, diagnosis or treatment provided by a qualified health care provider.

Always consult your doctor or mental health professional before trying anything you read here.