Announcement

Collapse
No announcement yet.

How do i rotate my banners?

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

  • Saar
    replied
    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.

    Leave a comment:


  • 0ptima
    replied
    Had this installed on my 3.5, 3.6 forums and it works with 3.7 too.

    Leave a comment:


  • zach1288
    replied
    How do you add a third banner?

    Leave a comment:


  • Floris
    replied
    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.

    Leave a comment:


  • zach1288
    replied
    Is there a way to set it to rotate every 60 seconds?

    Leave a comment:


  • zach1288
    replied
    Thanks everyone, it works

    Leave a comment:


  • harmor
    replied
    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.

    Leave a comment:


  • zach1288
    replied
    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

    Leave a comment:


  • harmor
    replied
    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

    Leave a comment:


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

    Leave a comment:


  • zach1288
    started a topic How do i rotate my banners?

    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.
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X