Announcement

Collapse
No announcement yet.

Different Advertisements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Different Advertisements

    I know its possible to have advertisements on the forum, but is it possible to have different sponsors for different areas of the forums?

  • #2
    Each file in vBulletin has a DEFINE for THIS_SCRIPT which means you can identify where you are on the forum. You can use in your templates a template conditional to determine this. Based on that you can use one banner for the index.php file and one for the showthread.php file. The THIS_SCRIPT is usually the filename, minus the .php.

    So, for index.php you can do this:

    <if condition="THIS_SCRIPT == 'index'">You're on the forum index right now</if>

    And for the users who browse a thread and read posts, you could use this:

    <if condition="THIS_SCRIPT == 'showthread'">You're on a thread right now</if>


    You could also use $foruminfo[] to determine in which particular forum you are. Using the forumid. Example, if your announcement forum is ID 1, you will have forumid == 1. Using $foruminfo['forumid'] == 1 you can then show content on only that announcement forum:

    <if condition="$foruminfo['forumid'] == '1'">This is our announcement forum!</if>

    As you can see, you can go many directions with conditionals. You can even show advertisements to only guests, or only members, and even in more details, for example, only to normal members, but hide it from premium usergroups.

    Here's our documentation about template conditionals for the style system: http://www.vbulletin.com/docs/html/t...e_conditionals

    Comment


    • #3
      So, then, in the example of:
      <if condition="THIS_SCRIPT == 'index'">You're on the forum index right now</if>

      And for the users who browse a thread and read posts, you could use this:

      <if condition="THIS_SCRIPT == 'showthread'">You're on a thread right now</if>

      I would put the ad code, or the banner URL after the =? or how does that work?

      Comment


      • #4
        No, the conditional goes AROUND your ad code.


        <if condition here>

        your code here

        </if>



        You add this condition in the template for that page. So if you modify the header or navbar or footer, you can use this conditional and your advertising code in there.

        Comment

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