1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Change text in website on autopilot?

Discussion in 'PHP & Perl' started by MicGrez, Jan 2, 2012.

  1. MicGrez

    MicGrez Regular Member

    Joined:
    Aug 11, 2011
    Messages:
    333
    Likes Received:
    103
    So I got a text on my website like:

    Last Rewards Given: 45 Minutes ago

    Any chance I can make the number "45" increase by X for each 10 hours or so?

    Thanks in advance
     
  2. shubhamm

    shubhamm Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    107
    Likes Received:
    25
    Occupation:
    Developer
    Location:
    BHW
    its a reward site i think so the value will be in Config.php or in Sql DB

    change it there
     
  3. BlueZero

    BlueZero Power Member

    Joined:
    Jul 6, 2011
    Messages:
    500
    Likes Received:
    257
    Occupation:
    Webdeveloper, Project Manager
    Location:
    Byte in the Net
    Home Page:
    Here you go ;-)

    Code:
    $iStartValue = 45;
    $iStartTime = strtotime('2011-01-03');
    $iIncrementValue = 5;
    $iIncrementHours = 10;
    
    $iActualValue = floor( (time() - $iStartTime) / 3600 ) * $iIncrementValue + $iStartValue;
    
    echo 'Last Rewards Given: '.$iActualValue.' Minutes ago';
    
    
     
    • Thanks Thanks x 1
  4. wulfgen

    wulfgen Newbie

    Joined:
    Jan 26, 2012
    Messages:
    3
    Likes Received:
    0
    Would .25 change the time to 1/4 of an hour change?