Jump to content

vidar

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by vidar

  1. Thanks... it helped alot. I also got one script like this: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] $age = filemtime("../gallery/pictures/Photos/Weather/1overlay2.jpg") + 3600; if (time() < $age) { print ("Fresh"); } else{ print("Old"); }[/quote] This one is the one i'll be using... pretty much like this i guess.
  2. [!--quoteo(post=378400:date=May 30 2006, 05:28 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 30 2006, 05:28 PM) [snapback]378400[/snapback][/div][div class=\'quotemain\'][!--quotec--] I don't know what "if" you are talking about... [/quote] I'll try again... the situateion is like this.... I got a script, it generate 2 pictures. But it takes maybe 1.5 sec to run. To make the script be faaster i was thinking that if the files that is generated is newer then 1 hour, then don't run the generatting part. So i win 1.5 sec to pass that part. So my "if" would be like... [i]if, file.jpg is older then 1 hour, run script, if not, [!--coloro:#009900--][span style=\"color:#009900\"][!--/coloro--]header("Location: ../gallery/index.php?twg_noborder=true")[!--colorc--][/span][!--/colorc--][/i] Hope this clear out a little (i know the "if" i made here have nothing to do with programing, it's just to explain) The Green text is the final part of my script and shold be like that... (bouth cases should end with that) thanks again for the time
  3. [!--quoteo(post=378372:date=May 30 2006, 03:59 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 30 2006, 03:59 PM) [snapback]378372[/snapback][/div][div class=\'quotemain\'][!--quotec--] This function might help: filemtime -- Gets file modification time [a href=\"http://www.php.net/filemtime\" target=\"_blank\"]http://www.php.net/filemtime[/a] [/quote] Yeah, i have been there and made it to work, but how to do the rest... then i got a problem. I probably could set a time using this timesystem, but f.ex take - 1 hour... how would that be? And also in case i get it to work. Will i place the if with all the rest of my code in one of the cases? Thanks for the reply
  4. I have made me a script to generate a picture from many different pictures, also with text on. This script does make two different pictures, but that's not importaint. What i had in mind was to check that age of the generated file before it run the script that i have now. By using the filemtime, i get the last modification time... i managed that. But it is in an exact time. How would i have to make the codes to do this: - mod-time - 1 hour. In other words i want to do this: - if mod-time is older then 1 hour, continiue with script, or else, do to ../gallery/photos..... If i get this to work i'll splitt it later, because this two different pictures had different rate of refreshing. Thanks for the time to read this.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.