Announcement

Collapse
No announcement yet.

Creating per category advertising?

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

  • Creating per category advertising?

    Hi,

    I was wondering if anyone had an effective way of managing ads on vbulletin. In my case, I have found solutions for serving the ads and rotations etc. I'm trying to figure out a method to show per category ads.

    The only idea I've had so far would be making a different theme for each category and then editing the code so each section has separate ads, but this seems like an less than ideal way of achieving this.

    Does anyone else have experience with setting up this type of system?

    Thanks

  • #2
    You can use this conditional code in most of the major templates to display something for one forumid:

    Code:
    <if condition="$forumid == X">
    
    </if>
    Or to show something for multiple forumids:

    Code:
    <if condition="in_array($forumid, array(X,Y,Z))">
    
    </if>
    You can duplicate this code to cover multiple different banners for multiple different forumids.

    Comment


    • #3
      Originally posted by Jake Bunce View Post
      You can use this conditional code in most of the major templates to display something for one forumid:

      Code:
      <if condition="$forumid == X">
      
      </if>
      Or to show something for multiple forumids:

      Code:
      <if condition="in_array($forumid, array(X,Y,Z))">
      
      </if>
      You can duplicate this code to cover multiple different banners for multiple different forumids.
      Thanks for the reply, that was going to be my second question, but you got it. That seems like a better option, I'll probably go with that unless I can find a more automated option.

      Thanks for the info.

      Comment


      • #4
        One last question, I was planning to set this up by having an include in my header calling "ads.php" which would have all my if statements and ad codes.

        If I have many "if" statements, lets say between 25-100 is that going to cause any delays when visitors view my pages? Is it considered standard practice to have that many "if" statements or would that be considered a bad idea?

        Thanks

        Comment


        • #5
          It shouldn't slow things down. Little "if" statements like this are light weight.

          Comment


          • #6
            Sounds good, thank you for your help Jake it is greatly appreciated.

            Comment


            • #7
              I have set this up and it works perfect, but I realized all non-forum related pages are left blank since I've not specified "if" statements for them. How can I use this same technique for other pages such as the home page, search results, members page, etc etc?

              Edit: Actually, perhaps it would make sense and be much easier to manage if I just use "else" and then make 1 ad for all "non-forum specific" sections of my site? I doubt advertisers would want to target just the members page or just the search results etc. The only problem is all the if statements are broken down, but maybe I could put 1 main if statement like....

              <if condition="in_array($forumid, array(all forum ids))">
              all my per category ad codes
              else
              general sections ad code

              could this work?
              Thanks
              Last edited by gfx-help.com; Sat 16 Aug '08, 2:37pm.

              Comment


              • #8
                You can do like this:

                Code:
                <if condition="THIS_SCRIPT == 'index'">
                
                </if>
                You include the name of the file, minus the ".php".

                Comment


                • #9
                  Is there any way to use the "else" and then have a general advertisement code.

                  for example...

                  IF
                  category 1
                  ad code 1

                  IF
                  category 2
                  ad code 2

                  ELSE
                  general ad code


                  If I need to specify every page it will be a pain so this way seems much more efficient if possible.

                  Comment

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