Announcement

Collapse
No announcement yet.

Random Banners

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

  • 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

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

    Comment


    • #3
      *Last Bump*

      So it isn't possible outside in the templates?

      Comment


      • #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


        • #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


          • #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


            • #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


              • #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...
                X