1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Looking for a special Image Rotator Script...Help me out, for GREEN REP

Discussion in 'PHP' started by DidierE, Jul 30, 2007.

  1. #1
    Okay i'm looking for a standalone script like this site offers: http://www.imagerotation(dot)com

    Basically what I wanna do is put an image on my site that randomly changes to another image after each week

    I searched hotscripts and others but can't really find what i'm looking for.
    Most of the scripts i found display random images on page refresh or refresh the images every x-seconds when browser window is still open, but it's not what i'm looking for.

    So I want some script that changes the image weekly without the user having to keep his browser window open for a week.

    Maybe something with mysql and weekly cron job?

    Let me know if you have a solution for my problem
    Will give Green rep if you can help me! ;)
     
    DidierE, Jul 30, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Well, the easiest way would be this:

    You name your images by the number of each week. Eg: 32.jpg (This would be the image for week number 32), and then you do:

    
    <img src="/path/to/images/<?php date('W'); ?>.jpg" />
    
    Code (markup):
     
    nico_swd, Jul 30, 2007 IP
    DidierE likes this.
  3. DidierE

    DidierE Well-Known Member

    Messages:
    1,815
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    145
    #3
    Thanks Nico!
    I can't believe it was going to be that simple.

    Green rep added!

    Thanks a million, you saved me hours of searching time ;)
     
    DidierE, Jul 30, 2007 IP
  4. VimF

    VimF Well-Known Member

    Messages:
    307
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    118
    #4
    I just want to add that you also need (at least) 52 images for it to work correctly.
     
    VimF, Jul 30, 2007 IP
    DidierE likes this.
  5. DidierE

    DidierE Well-Known Member

    Messages:
    1,815
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    145
    #5
    Yep, I made 55 just to make sure :D
     
    DidierE, Jul 30, 2007 IP
  6. nagasharmi

    nagasharmi Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    better you will try this following

    First you have stored that Whatever images needed.
    whenever it change note it current date and give change date
    when you change date will come means automatically get from database.



    try it i am sure
     
    nagasharmi, Jul 30, 2007 IP