No announcement yet.

Template conditionals

  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Template conditionals

    Can anyone give me the code I would need to use if I wanted to have in one of my ad placement templates, a conditional that would allow me to place my adsense in certain forum ids, but adbrite in other forum ids. Also how could I also place the adsense code on my front page at the same time I sense that an if, elseif, and else is needed, but I'm a bit thick and don't know how to do it...using vb 4.1.10

  • #2
    You would better to ask questions like these at

    Here is an article about vb4 template conditionals:

    Here is the code:
    HTML Code:
    <vb:if condition="in_array($forum['forumid'], array(1,2,3))">
    Show adbrite for forum 1, 2 and 3
    <vb:elseif condition="in_array($forum['forumid'], array(4,5,6))" />
    Show adsense for forum 4, 5 and 6
    You can use more than one 'else', also you can use !in_array which means not in these forums..
    Note: this will not work in all templates plus any customizations considered as not supported.
    Please feel free to contact me if you have any questions or concerns

    Links: vBulletin Manual - Code Documentation - FAQ - Bug Tracker - Lemon Juice
    vBulletin 5 Connect: Extensions - Articles - Features - Purchases


    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.