RecentUpload: Difference between revisions

537 bytes added ,  15:45, 2 November 2018
m
Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/"
(Updated Version to Version 1.3, Updated .php Code & 'Ajax' Code)
m (Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/")
 
(10 intermediate revisions by 4 users not shown)
Line 23: Line 23:
// - freq may be "" (will be replaced by 'Unknown')
// - freq may be "" (will be replaced by 'Unknown')
// - file url - valid filepath - COMPULSORY
// - file url - valid filepath - COMPULSORY
$nickname[] = "'Realtime.txt"; $freq[]="30 Seconds"; $file_url[]="./realtime.txt";
$nickname[] = "Homepage"; $freq[]="2mins"; $file_url[]=".index.html";
$nickname[] = "Station Records"; $freq[]="2mins"; $file_url[]="./record.html";
$nickname[] = "Station Trends"; $freq[]="2mins"; $file_url[]="./trends.html";
$nickname[] = "Today's Data Review"; $freq[]="2mins"; $file_url[]="./today.html";
$nickname[] = "Yesterday's Data Review"; $freq[]="2mins"; $file_url[]="./yesterday.html";
// ######### That's it, nothing else to do !
// ######### That's it, nothing else to do !


Line 33: Line 39:
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check
       $when=filemtime($file_url[$i]);
       $when=filemtime($file_url[$i]);
       $this_output .= "<tr><td>" .($nickname[$i] ? $nickname[$i] : $file_url[$i]). "</td><td align=\"center\">" .($freq[$i] ? $freq[$i] : "Unknown"). "<td>" .date("m/d/y H:i:s T", $when). "</td><td align=\"center\">" .timediff($file_url[$i]). "</td></tr>\n";
       $this_output .= "<tr><td>" .($nickname[$i] ? $nickname[$i] : $file_url[$i]). "</td><td>" .($freq[$i] ? $freq[$i] : "Unknown"). "<td>" .date("m/d/y H:i:s T", $when). "</td><td>" .timediff($file_url[$i]). "</td></tr>\n";
   } else { // the file is misnamed or not uploaded
   } else { // the file is misnamed or not uploaded
       $this_output .= "<tr><td><font color=\"#ff0000\" <b>" .$file_url[$i]. "</b></font></td><td align=\"center\">" .($freq[$i] ? $freq[$i] : "Unknown"). "<td align=\"center\"><font color=\"#ff0000\"><b>NO SUCH FILE !</b></font></td><td align=\"center\"><font color=\"#ff0000\"><b>NO SUCH FILE !</b></font></td></tr>\n";
       $this_output .= "<tr><td>" .$file_url[$i]. "</td><td>" .($freq[$i] ? $freq[$i] : "Unknown"). "<td>NO SUCH FILE !</td><td>NO SUCH FILE !</td></tr>\n";
   } // END existence check
   } // END existence check
} // END array loop
} // END array loop
Line 102: Line 108:
|Describe the use of the file.  If you leave this blank it will use the filename as the description
|Describe the use of the file.  If you leave this blank it will use the filename as the description
|"My Realtime data"
|"My Realtime data"
OR ""
|-
|-
|$freq[]
|$freq[]
|How often would you expect the file to be updated.  This is for your information only and is displayed on the page but does not have any affect on the code
|How often would you expect the file to be updated.  This is for your information only and is displayed on the page but does not have any affect on the code, "" = "Unknown"
|"15 seconds"
|"15 seconds"
OR ""
|-
|-
|$file_url[]
|$file_url[]
|the path to where the file is, relative to where this code is running
|the path to where the file is, relative to where this code is running ('''REQUIRED''')
|"./realtime.txt" OR "realtime.txt"
|"./realtime.txt"
OR "realtime.txt"
|}
|}


Line 182: Line 191:
=Example=
=Example=


http://www.weeleyweatherstation.info/betel_ftpstatus.php
[http://www.weeleyweather.co.uk/index.php?page=serverstatus Server Status]


=Download Location=


[[Category:AddOns]]
You can download the latest and previous versions, directly from the forum [https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=1257&start=0 Sandaysoft Cumulus Forum]
 
 
[[Category:WebTools]]