Announcement

Collapse
No announcement yet.

Wasn't there a thread her about conditionals?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
    tribedude
    Senior Member

  • tribedude
    replied
    thanks Joe D!

    Leave a comment:

  • BirdOPrey5
    Senior Member

  • BirdOPrey5
    replied
    There shouldn't be any noticeable slowdown. But yes, it's going to be a lot of code. The only other option would be to create some sort of plugin rather than a bunch of template conditionals but that would be more difficult for most people then template conditionals.

    Just put plenty of spacing in the templates so you it looks nice and is easy to follow- don't worry about blank lines you don't see them once the page is rendered anyway.

    Leave a comment:

  • tribedude
    Senior Member

  • tribedude
    replied
    I want to segment my forum for advertisers into various channels based on forum topic - target each individual forum with its own DFP ad tag. At the same time I want our members to see one 728x90 ad and the nonmembers to see three 300x250 boxes in the ad_navbar_below slot. I am trying to get my head around this...

    I will need 16 separate forums set up. I reckon the ad_navbar_below slot is going to be pretty full.
    Do I just stack them up like this? I am testing it now with ad_sized images in a few forums and it seems to be working...

    1. Health Forum
    Members see one health targeted 728x90 ad, nonmembers see three Health targeted 300x250 ads
    2. Jobs Forum
    Members see one Jobs targeted 728x90 ad, nonmembers see three Jobs targeted 300x250 ads
    3. Sports Forum
    Members see one Sports targeted 728x90 ad, nonmembers see three Sports targeted 300x250 ads

    etc

    Are all these conditionals going to slow down my page loads?

    Leave a comment:

  • BirdOPrey5
    Senior Member

  • BirdOPrey5
    replied
    yes, replace Your Code/Text Here with your <img> code.

    Leave a comment:

  • tribedude
    Senior Member

  • tribedude
    replied
    Originally posted by Lynne View Post
    Display Information only on index page:
    <if condition="THIS_SCRIPT == 'index'"> Your Code/Text Here </if>

    If I wanted to test this out by displaying a 300x250 image file, do I need to put image tags around it in the Your Code/Text Here spotin order for it to display on vb, right?
    tribedude
    Senior Member
    Last edited by tribedude; Thu 15 Aug '13, 10:04am.

    Leave a comment:

  • BirdOPrey5
    Senior Member

  • BirdOPrey5
    replied
    Suggest you read up on this article - http://www.vbulletin.org/forum/showthread.php?t=215032

    The if /else syntax is explained at the bottom.

    Leave a comment:

  • tribedude
    Senior Member

  • tribedude
    replied
    I currently have usergroup conditionals that show larger size ads (3 x 300x250 above the navbar) to guests and non members, and smaller size ads(one 728x90 above the navbar) to registered full members. Is there a way I can keep this, yet also use conditionals to serve the separate Adsense tags into only 5 forums while serving DFP tags into the rest? Like this:

    1. Everyone would get adsense tags in those 5 forums and adsense tags would also be on on the index page.
    2. Everyone would get DFP tags (not enabled for adsense) in all other forums except the above 5
    ​3. Registered members would see a 728x90 size ad above the navbar sitewide
    4. Everyone else would see three 300x250 box size ads above the navbar.



    Leave a comment:

  • BirdOPrey5
    Senior Member

  • BirdOPrey5
    replied
    There would be no benefit of combining due to increased complexity of the combined if... else... statements.

    Leave a comment:

  • tribedude
    Senior Member

  • tribedude
    replied
    Originally posted by snakes1100 View Post
    Yes, you can serve both at the same time.

    Display Information in one specific forum:
    <if condition="$forum[forumid] == X"> Your Code/Text Here </if>

    Display Information in all forums while excluding one specific forum:
    <if condition="$forum[forumid] != X"> Your Code/Text Here </if>

    Display Information in multiple forums & exclude the rest of your forums:
    <if condition="in_array($forum['forumid'], array(X,XX,XXX))"> Your Code/Text Here </if>

    Can I combine a couple of these together to accomplish my purpose? Thanks for all the tips everyone!

    Leave a comment:

  • Lynne
    Former vBulletin Support

  • Lynne
    replied
    Display Information only on index page:
    <if condition="THIS_SCRIPT == 'index'"> Your Code/Text Here </if>

    Leave a comment:

  • tribedude
    Senior Member

  • tribedude
    replied
    What about the main forum index page? Is there a conditional to run ads on it? Or do I have to manually pop Adsense code into that?

    Leave a comment:

  • snakes1100
    Senior Member

  • snakes1100
    replied
    Yes, you can serve both at the same time.

    Display Information in one specific forum:
    <if condition="$forum[forumid] == X"> Your Code/Text Here </if>

    Display Information in all forums while excluding one specific forum:
    <if condition="$forum[forumid] != X"> Your Code/Text Here </if>

    Display Information in multiple forums & exclude the rest of your forums:
    <if condition="in_array($forum['forumid'], array(X,XX,XXX))"> Your Code/Text Here </if>

    Leave a comment:

  • tribedude
    Senior Member

  • tribedude
    started a topic Wasn't there a thread her about conditionals?

    Wasn't there a thread her about conditionals?

    Currently we are serving ads sitewide with DFP, but from now on I need to put Adsense tags in 5 specific forums on our site only, while using our standard DFP tags on the rest of the forums to serve other ad networks. What is the best way to do this?

    Can I use conditionals to serve the Adsense into the 5 forums and also use them to serve DFP tags into the rest? Or do I have to hard code the Adsense tags into each of the 5 forums somehow, and then hard code the balance of the forums with the DFP tags...?

    Can one of you masters give me some tips?

Related Topics

Collapse

Working...
X