vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adverts depending on forums (https://vborg.vbsupport.ru/showthread.php?t=245266)

LoonyToons 06-25-2010 12:23 PM

Adverts depending on forums
 
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


All times are GMT. The time now is 09:26 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00924 seconds
  • Memory Usage 1,708KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete