How would you rotate images?

6 replies
  • WEB DESIGN
  • |
Okay, so this might be a weird question.

But here's what I want to do.


URL: http://cdn.warriorforum.com/images/site_01.gif

You see how the URL is site_01.gif?

How would I be able to keep the same URL and have images rotate on their own. Like... one day it could say Warrior Forum, the next it could say Awesome Forum, the day after it could say Universal Forum, and then back.

I'm just wondering if there is a plugin, tool, or anything that can automatically do it. I know I could just replace the image (I'm talking about if it's hosted on my site btw) but that would be tedious every single day for multiple images I'd like to do it to across the internet.

This could entice people to click something because it changes periodically.
#images #rotate
  • Profile picture of the author taskemann
    I found some javascript code for this: Rotating Image | JavaScriptSource

    Looks like what you're looking for.

    And to link the images I think you can just do like this:

    bannerImg[0]="<a href = 'http://www.url.com/destination.html'><img src='http://www.url.com/banners/banner1.gif' alt='Visit This'></a>";
    bannerImg[1]="<a href = 'http://www.url.com/destination.html'><img src='http://www.url.com/banners/banner2.gif' alt='Visit This'></a>";
    bannerImg[2]="<a href = 'http://www.url.com/destination.html'><img src='http://www.url.com/banners/banner3.gif' alt='Visit This'></a>";
    {{ DiscussionBoard.errors[5999041].message }}
    • Profile picture of the author BlackWar
      Banned
      Originally Posted by taskemann View Post

      I found some javascript code for this: Rotating Image | JavaScriptSource

      Looks like what you're looking for.

      And to link the images I think you can just do like this:

      bannerImg[0]="<a href = 'http://www.url.com/destination.html'><img src='http://www.url.com/banners/banner1.gif' alt='Visit This'></a>";
      bannerImg[1]="<a href = 'http://www.url.com/destination.html'><img src='http://www.url.com/banners/banner2.gif' alt='Visit This'></a>";
      bannerImg[2]="<a href = 'http://www.url.com/destination.html'><img src='http://www.url.com/banners/banner3.gif' alt='Visit This'></a>";
      It works just while you click on it (banner). :confused:
      {{ DiscussionBoard.errors[5999157].message }}
      • Profile picture of the author taskemann
        Originally Posted by BlackWar View Post

        It works just while you click on it (banner). :confused:
        Yeah, it's a rotator that rotates images and when someone click on them, they will be redirected to the url destination of the particular image that the rotator shows.
        {{ DiscussionBoard.errors[5999171].message }}
  • Profile picture of the author WebsiteBegin
    I found these two PHP sources:
    Random Image Script — Matt Mullenweg
    A Better Image Rotator — Matt Mullenweg

    Not sure if they will serve for what you need, but it appears as if they allow you put a time countdown in there, so that might work. I'm not great with PHP, but I know the basics.
    Signature
    WebsiteBegin | Learn to Build and Manage an Amazing Website

    Follow me on Twitter - Joeb3219
    {{ DiscussionBoard.errors[5999183].message }}
  • Profile picture of the author Big Squid
    You can do that easily using php. It would be similar to the video rotation script I talked about here:

    http://www.warriorforum.com/programm...ipt-video.html

    Basically, create 3 files.

    File 1: List all the images in a text file, 1 per line.
    images.txt

    image1.jpg
    image2.png
    image3.gif

    File 2: image_rotate.php
    Use this code to parse the data and rotate the images.
    $images = file_get_contents('images.txt');
    $images = explode("\n", $images);
    $count = count($images);
    $num = rand(0, $count-1);
    $image = $images[$num];


    File 3 input it into the image src code
    <?php require('images.php'); ?>
    <img src="http://www.sitename.com/images/<?php echo $image; ?>" />
    {{ DiscussionBoard.errors[6002416].message }}
  • Profile picture of the author Rbtmarshall
    i'm looking for something similar to OP's question.


    Does anyone know of a wordpress plugin that will rotate images onto a single URL?

    ex: http://cdn.warriorforum.com/images/site_01.gif

    Say if I I had multiple images and wanted to rotate to that same url, so that the forum will rotate or shuffle the header image at different times
    {{ DiscussionBoard.errors[8687920].message }}

Trending Topics