/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Change picture every few days

Wondering if anyone had a script to do it, I see a lot for
changing/rotating every day, but none to do it every five
or so days. Thanks ahead.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiApr 06.2010 — It would be pretty trivial to write something like this yourself. For example you might:

  • 1. Scan a directory for images, pick one at random and write its filename to a text file.

  • 2. On subsequent loads you check the modification time of the text file.
  • - if it less than x days ago use the filename contained within it

  • - otherwise start again from 1, making sure to select a file other than the first.
  • Copy linkTweet thisAlerts:
    @ehimeauthorApr 06.2010 — It was I was just trying to save a minute ?

    I did this btw

    [code=php]$wk_no = date("W"); // Get the Week
    $count = count($curr, 0); // Count the current valids in my array
    $nbr = $wk_no%$count; // Modulus op tells us the remainder

    // Echo it out so we can watch it
    echo "r<!-- Count: {$count} Week: {$wk_no} Select: {$nbr} -->r";

    // Combine our stuff, $nbr is now the switch
    $pro = '<form action='http://omnisistem.com/php/page.php?'
    .$curr[$nbr][1].chr(43).$noko[$nbr][1].''" method="post">'."n";

    $pro .= '<input type="image" src="http://omnisistem.com/images/fshot/'.$curr[$nbr][0].'" />'."n";

    $path = str_replace('/', '|', $path); # Protect Directories
    $pro .=( "<p><input type="hidden" value="".$curr[$nbr][1]."" name="sct" /></p>"."n" );
    $pro .=( "<p><input type="hidden" value="".$curr[$nbr][2]."" name="encode" /></p>"."n" );
    $pro .=( "<p><input type="hidden" value="".$curr[$nbr][3]."" name="path" /></p>"."n" );
    $pro .=( "</form>" );

    echo $pro;
    [/code]
    ×

    Success!

    Help @ehime spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...