Different forums, different headers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jorg
    New Member
    • Apr 2005
    • 14
    • 3.0.7

    #16
    already a solution for this problem? I have the same problem... showing 2 banners in a certain forum. So it seems something is wrong with the if else statement.

    Code:
    <if condition="$forumid == 17">
        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="images_pb/shark/17/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
    </if>
    <else />
        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
    </if>

    Comment

    • Jake Bunce
      Senior Member
      • Dec 2000
      • 46598
      • 3.6.x

      #17
      Your conditional structure is wrong. You are ending the first "if" before the "else" such that the else belongs to no "if" statement. Remove the red code and it will be syntactically correct:

      Code:
      <if condition="$forumid == 17">
      	<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="images_pb/shark/17/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
      [color=red]</if>[/color]
      <else />
      	<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
      </if>

      Comment

      • Jorg
        New Member
        • Apr 2005
        • 14
        • 3.0.7

        #18
        Thanks! It works... is it possible to give more forumid's in the same if statement? Or do I have to make a new if statement for each forumid?

        Comment

        • Jorg
          New Member
          • Apr 2005
          • 14
          • 3.0.7

          #19
          okay, found it..

          <if condition="$forumid == 17 OR $forumid == 18">

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #20
            That works, but I like this method better:

            Code:
            <if condition="in_array($forumid, array(17,18))">

            Comment

            • Jorg
              New Member
              • Apr 2005
              • 14
              • 3.0.7

              #21
              Okay, no I have the same problem again, showing 2 banners, instead of one. Probably I'm missing something.

              Code:
              [COLOR=black]<if condition="in_array($forumid, array(20,26,27,5))">
              [/COLOR][COLOR=black]SHOW PICTURE
              [/COLOR]
              [COLOR=black]<if condition="in_array($forumid, array(17,30))">[/COLOR]
              [COLOR=black]SHOW PICTURE [/COLOR]
                
              [COLOR=black]<else />[/COLOR]
              SHOW PICTURE
              [COLOR=black]</if>[/COLOR]

              Comment

              • Jorg
                New Member
                • Apr 2005
                • 14
                • 3.0.7

                #22
                Well, I thought I would try to solve this by myself... I was looking into the code of this and other vbulletin stuff, but then I had to ask myself in which language this is written? The if/else statement above is not php. So which language do I have to learn so I know how to program in vbulletin? xhtml I see in the headers, but then I still can't find any info on the if/else statement as used here... Can anyone tell me???

                Noob trying to become a non-noob.

                Comment

                • mikecp421
                  Senior Member
                  • Aug 2005
                  • 453
                  • 5.3.x

                  #23
                  I learned if else statements in C++, maybe thats the part of it
                  lincolnsofdistinction.org

                  Comment

                  • Jorg
                    New Member
                    • Apr 2005
                    • 14
                    • 3.0.7

                    #24
                    I thought I would put the same piece of code translated to php into the header, but it still gives 2 banners next to each other.

                    Code:
                    if (condition="in_array($forumid, array(20,26,27,5))")
                    {
                        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="../rotator/sharkbait/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
                    }
                    
                    else if (condition="in_array($forumid, array(17,30))")
                    {
                        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="../rotator/sp-atl/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
                    }
                    
                    else
                    {
                        <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="../rotator/shark/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
                    }
                    Help!

                    Comment

                    • Jorg
                      New Member
                      • Apr 2005
                      • 14
                      • 3.0.7

                      #25
                      Found the solution:

                      Code:
                      <if condition="in_array($forumid, array(20,26,27,5))">
                          <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="../rotator/sharkbait/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
                      
                      <else />
                          <if condition="in_array($forumid, array(17,30))">
                              <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="../rotator/sp-atl/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
                          <else />
                              <td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="../rotator/shark/rotator.php" border="0" alt="$vboptions[bbtitle]" /></a></td>
                          </if>
                      </if>
                      more info on: http://www.vbulletin.com/docs/html/t...e_conditionals

                      Comment

                      • Jose Amaral Rego
                        Senior Member
                        • Feb 2005
                        • 11058
                        • 1.1.x

                        #26
                        Will this rotate a banner without using a banner hack?


                        This is a discussion forum powered by vBulletin. To find out about vBulletin, go to http://www.vbulletin.com/ .

                        Comment

                        • Jake Bunce
                          Senior Member
                          • Dec 2000
                          • 46598
                          • 3.6.x

                          #27
                          No, but this might work for you.

                          Comment

                          • Jose Amaral Rego
                            Senior Member
                            • Feb 2005
                            • 11058
                            • 1.1.x

                            #28
                            Thank you for the information, until I can figure out phpAdsNew. I think I will try your method instead .

                            Thanks once again Jake.
                            Last edited by Jose Amaral Rego; Mon 5 Dec '05, 10:27am.

                            Comment

                            • Jorg
                              New Member
                              • Apr 2005
                              • 14
                              • 3.0.7

                              #29
                              For me this will rotate a banner, but you need to use the rotator.php file. You just simply make some banners and put them in a directory together with the rotator.php file. Then you'll link to the rotator.php file for the image, and the file will send everytime a different banner.
                              With the piece of code above I can use different kind of banner rotations for different kind of forums. Works pretty nice and very easy to update! Only upload the banner into the correct directory.
                              Last edited by Jorg; Sat 12 Nov '05, 11:53pm.

                              Comment

                              • Steve_C
                                Senior Member
                                • Aug 2001
                                • 495

                                #30
                                Can you show me an example (or link) on how to do this with a different footer as well so I can put in a right column of ads (open <TD> in header, close it in the footer to get the right column displayed)? (Using 3.5)

                                Comment

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