237
edits
Beteljuice (talk | contribs) mNo edit summary |
SaratogaWX (talk | contribs) m (Text replacement - "http://sandaysoft.com/forum/" to "https://cumulus.hosiene.co.uk/") |
||
| (11 intermediate revisions by 4 users not shown) | |||
|
{{AddOnBanner|name=RecentUpload|type=HTML & PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=
<big>RecentUpload</big> shows a list of files on your webserver and the date and time of their last update. This is predominately useful for a system admin/website owner as a quick and convenient way to check that Cumulus has been able to upload the necessary data files and webpages to your site. It is not specific to Cumulus files so you could check other files on your webserver!
// format: "file nickname", "update frequency", "file url"
// - nickname may be "" (will be replaced by url)
// - freq may be "" (will be replaced by 'Unknown')
// - file url - valid filepath - COMPULSORY
$nickname[] = "Realtime.txt"; $freq[]="30 Seconds"; $file_url[]="./realtime.txt";▼
$nickname[] = "
$nickname[] = "
$nickname[] = "Station
▲$nickname[] = "
$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 !
if(file_exists($file_url[$i])) { // cheap and cheerful existence check
$when=filemtime($file_url[$i]);
$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
$this_output .= "<tr><td>" .$file_url[$i]. "</td><td>" .($freq[$i] ? $freq[$i] : "Unknown"). "<td
} // END existence check
} // END array loop
|Describe the use of the file. If you leave this blank it will use the filename as the description
|"My Realtime data"
OR ""
|-
|$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, "" = "Unknown"
|"15 seconds"
OR ""
|-
|$file_url[]
|the path to where the file is, relative to where this code is running ('''REQUIRED''')
|"./
OR "realtime.txt"
|}
=Example=
[http://www.weeleyweather.co.uk/index.php?page=serverstatus Server Status]
=Download Location=
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:
| |||