Webmastersite.net
Register Log In

Changing ad banners based on category

Comments on Changing ad banners based on category

jeffbab
Beginner

Usergroup: Customer
Joined: Sep 26, 2007

Total Topics: 2
Total Comments: 3
jeffbab
Posted Sep 27, 2007 - 1:59 PM:

Hi. Was wondering if anyone knew of a way to display different ads depending on what category the surfer was currently viewing?

I use a banner rotating script that I pull ads from. (phpadsnew) It normally just involves placing a little bit of code on the page you want to display the ads on. You create different zones of ads so only relevant ads get displayed where you want them.

I can edit the wrapper.tpl to put my banner code in, but then it is going to be displaying the same set of banner ads on every page of the site, no matter what category you are in.

Say I had a category called "basketball". I want to be able to display only ads relating to basketball in the category.

Normally I would just set up the banners in phpadsnew and then insert the proper code for each category onto whatever page it was needed, but I don't think that can work in this situation because there is really only the wrapper.tpl to edit.

Any ideas? Thanks



Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Sep 29, 2007 - 6:46 PM:

See scripts.webmastersite.net/w...onditionals-syntax-69.html and scripts.webmastersite.net/w...category-variables-11.html

So <IF {CATNAME} is basketball>basketball ads here</IF> (but it's probably better to use id numbers since titles can change).
VintageAgain
Member

Usergroup: Customer
Joined: Apr 27, 2004

Total Topics: 5
Total Comments: 17
Posted Jan 05, 2008 - 11:53 PM:

So if your running 100 Catagories.. and offering 100 seperate banners, 1 per catagory. You'd have to add 100 lines of code, one for each banner code, am I right ?

Hummm
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jan 07, 2008 - 9:27 AM:

By that point it makes more sense to get a banner management system, which should allow you to pass some sort of identifier to specify which ad to grab.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.