Announcement

Collapse
No announcement yet.

How do i rotate my banners?

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

  • How do i rotate my banners?

    If you look on my website http://www.jeepsource.org/forum you will see 2 banners at the top of the page. I want to rotate them like every xx minutes or each time the page is refreshed. I am a not good with coding so can you help me.

  • #2
    Maybe this helps:
    http://www.vbulletin.com/forum/showthread.php?t=170826

    Comment


    • #3
      I had a similiar way.

      Add a new plugin.
      Product: vbulletin
      Hook Location: global_start
      Title: Image Rotator
      Plugin PHP Code:
      PHP Code:
      $rand rand(12);

      if(
      $rand == 1)
      {
         
      $display_image "<a href='http://www.offroadoverstock.com'> <img 
      src='http://www.jeepsource.org/images/offroadoverstock468x60.jpg' border=0>"
      ;
      }
      else
      {
        
      $display_image "<a href='http://www.raingler.com'> <img src='http://www.jeepsource.org/images/raingler1.gif' border=0>
      </a>"
      ;

      Plugin is Active: Yes.

      Open the template where you placed the two banners.
      Delete them and replace with $display_image

      Comment


      • #4
        Originally posted by harmor
        I had a similiar way.

        Add a new plugin.
        Product: vbulletin
        Hook Location: global_start
        Title: Image Rotator
        Plugin PHP Code:
        PHP Code:
        $rand rand(12);

        if(
        $rand == 1)
        {
           
        $display_image "<a href='http://www.offroadoverstock.com'> <img 
        src='http://www.jeepsource.org/images/offroadoverstock468x60.jpg' border=0>"
        ;
        }
        else
        {
        $display_image "<a href='http://www.raingler.com'> <img src='http://www.jeepsource.org/images/raingler1.gif' border=0>
        </a>"
        ;

        Plugin is Active: Yes.

        Open the template where you placed the two banners.
        Delete them and replace with $display_image
        Sorry im new to vbulletin and i have no idea how to do this

        Comment


        • #5
          Go into your Admin CP.

          On the left frame near the bottom open the exapnd "Plugin System".
          In that box should be "Add New Plugin", click on that.

          Refer to my post above and enter all the details.

          Comment


          • #6
            Thanks everyone, it works

            Comment


            • #7
              Is there a way to set it to rotate every 60 seconds?

              Comment


              • #8
                With more complex javascript. Maybe some hacker on vborg could rip the code that online.php uses and make it available for global use to call .. in your plugins. But this goes outside vb support... check on vborg.

                Comment


                • #9
                  How do you add a third banner?

                  Comment


                  • #10
                    Had this installed on my 3.5, 3.6 forums and it works with 3.7 too.

                    Comment


                    • #11
                      PHP Code:
                      <?php
                      $files 
                      = array(); 
                      $folder './rotation/'//folder with rotation graphics
                      $handle opendir($folder);
                      $exts explode(' ','jpg jpeg png gif');
                      while (
                      false !== ($file readdir($handle))) {
                      foreach(
                      $exts as $ext) { // for each extension check the extension
                      if (preg_match('/\.'.$ext.'$/i'$file$test)) { // faster than ereg, case insensitive
                      $files[] = $file// it's good
                      }
                      }
                      }
                      closedir($handle); // We're not using it anymore
                      $rand array_rand($files);
                      header('Location: '.$folder.$files[$rand]); // Voila!
                      ?>
                      HTML Code:
                      <div align="center"><img src="rotation.php" alt="" height="131" width="500" border="0" align="center" /></div>
                      I hope this helps.

                      Comment

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