Random Banners

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheComputerMutt
    New Member
    • May 2004
    • 24
    • 3.0.3

    Random Banners

    Hi. I've designed 8 banners for my site, (http://www.MySiteHere.com/boards/images/misc/banners/[1 to 8].png) and I'd like to have it randomly select one whenever I go to a page. I know I can do this in PHP, but I don't know if it's possible to do just by editing my "Header" template, which would be simpler. If it's a stupid question, sorry.

    Thanks in advance,

    TCM
  • TheComputerMutt
    New Member
    • May 2004
    • 24
    • 3.0.3

    #2
    Uh... anyone? Even if this isn't possible, I'd like to know. ^^"

    Comment

    • TheComputerMutt
      New Member
      • May 2004
      • 24
      • 3.0.3

      #3
      *Last Bump*

      So it isn't possible outside in the templates?

      Comment

      • Steve Machol
        Former Customer Support Manager
        • Jul 2000
        • 154488

        #4
        There is no built-in function to do this. You will have to find and add some code to either the templates or files.
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment

        • hdtvoice
          Member
          • Jun 2003
          • 60

          #5
          i would recommend highly a free program i run called PHPadsnew

          on the top of my page at http://hdtvoice.com - those banners up top are being rotated by this program. It is an eleet program though so you have to spend some time with it, but once you figure it out, its the best.....

          it does so much stuff its mindblowing..

          http://phpadsnew.com is the site

          Comment

          • mojo_lounge
            New Member
            • Dec 2004
            • 1

            #6
            php image rotation

            Just toss this into a php page and use it as the header include along with whatever else you want in there. Just change the #of images in the top line and the path to the images. To add more - just add more else if statements.

            <?

            $imagevar=rand(1, 4);
            if($imagevar==1)
            {
            print "<img src='images/1.jpg'>";
            }
            else if($imagevar==2)
            {
            print "<img src='images/2.jpg'>";
            }
            else if($imagevar==3)
            {
            print "<img src='images/3.jpg'>";
            }

            else if($imagevar==4)
            {
            print "<img src='images/4.jpg'>";
            }

            ?>

            Comment

            • TheComputerMutt
              New Member
              • May 2004
              • 24
              • 3.0.3

              #7
              Originally posted by mojo_lounge
              Just toss this into a php page and use it as the header include along with whatever else you want in there. Just change the #of images in the top line and the path to the images. To add more - just add more else if statements.

              <?

              $imagevar=rand(1, 4);
              if($imagevar==1)
              {
              print "<img src='images/1.jpg'>";
              }
              else if($imagevar==2)
              {
              print "<img src='images/2.jpg'>";
              }
              else if($imagevar==3)
              {
              print "<img src='images/3.jpg'>";
              }

              else if($imagevar==4)
              {
              print "<img src='images/4.jpg'>";
              }

              ?>
              Thanks, but I already know how to do this. The problem with this is that, in the past, Firefox has cached it, so that the image is only randomized once, and never changes again. =P

              Comment

              • Andy Huang
                Senior Member
                • Feb 2004
                • 4602

                #8
                Try turning on the no cache header in ACP; that should fix the firefox problem. However, I personally like phpAdsNew quite a bit as well, you should really consider looking into it
                Best Regards,
                Andy Huang

                Comment

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