PDA

View Full Version : Adverts depending on forums


LoonyToons
06-25-2010, 12:23 PM
Hi guys,

I have a problem that I'm sure some of you will have come across.

Our forum currently has an advert after the first post in every thread.
We use software to rotate those adverts if required.

However, we want to be able to show adverts on a per sub-forum basis.

Example forum list

Programming Languages
- ASP (all threads show advert 1 after the first post)
- PHP (all threads show advert 2 after the first post)
- PERL (all threads show advert 3 after the first post)


I hope that it's clear what we want to achieve, and any help would be gratefully received!

Thanks in advance :)

BirdOPrey5
06-25-2010, 03:45 PM
Use IF statements to choose which ad to display based on the current forum.

<if condition="$thread[forumid] == 1">
--HTML for Banner 1 Code--
</if>
<if condition="$thread[forumid] == 2">
--HTML for Banner 2 Code--
</if>
<if condition="$thread[forumid] == 3">
--HTML for Banner 3 Code--
</if>

Change the number of the forumid to match the forumid's of the forums you want.

LoonyToons
06-29-2010, 01:12 PM
Thanks BirdOPrey5!

I'm guessing that I need to change showthread.php...but I can't see where I would need to change the code...?

BirdOPrey5
06-29-2010, 04:06 PM
Actually for the first post I think you need to edit postbit (or postbit_legacy). Search for: $ad_location[ad_showthread_firstpost_start]

Better yet just put the if statement in the template: ad_showthread_firstpost_start
Put it around the entire block of code... You can access all the other built in ad locations from the Ad Location Templates as well.

ChopSuey
06-29-2010, 11:35 PM
I'd rather

Style Manager > Your Style > Ad Location Templates

Much easier IMO