<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.cumuluswiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Beteljuice</id>
	<title>Cumulus Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.cumuluswiki.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Beteljuice"/>
	<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/a/Special:Contributions/Beteljuice"/>
	<updated>2026-05-02T11:23:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=Category_talk:Other_Languages&amp;diff=324</id>
		<title>Category talk:Other Languages</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=Category_talk:Other_Languages&amp;diff=324"/>
		<updated>2009-09-04T11:35:45Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: Created page with &amp;#039;About the language NAMES, they are all ordered in &amp;#039;&amp;#039;&amp;#039;Englsh&amp;#039;&amp;#039;&amp;#039; ! Perhaps we should at least put the &amp;#039;native name / alphabet in brackets following ?  eg. German (Deutsch)&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;About the language NAMES, they are all ordered in &#039;&#039;&#039;Englsh&#039;&#039;&#039; !&lt;br /&gt;
Perhaps we should at least put the &#039;native name / alphabet in brackets following ?&lt;br /&gt;
&lt;br /&gt;
eg. German (Deutsch)&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=Forecast_webtag&amp;diff=237</id>
		<title>Forecast webtag</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=Forecast_webtag&amp;diff=237"/>
		<updated>2009-08-30T01:15:40Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: /* Possible values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The forecast [[webtag]] attempts to predict a weather forecast for the coming 12 hours.  It uses a tried and tested algorithm based on the pressure and trend, wind speed, the month and your hemisphere.  The initial formula was developed in the early 1900&#039;s and was based on years of observations and testing and proved to be around 91% accurate.  It is said to have been extensively tested by NATO in the most extreme weather conditions.  It has been demonstrated that the most accurate forecasts are based on readings taken at 9am however it continues to give reliable results throughout the day.&lt;br /&gt;
&lt;br /&gt;
The findings have since been coded and included in Cumulus.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ScreenshotEnableForecast.png|right|thumb|50px]]In order for the forecast webtag to be populated you must enable forecasting for your station.  In Cumulus click the Configuration menu then Station and tick the box to the bottom right of the screen &amp;quot;Cumulus forecast&amp;quot;. Note that if your weather station produces forecasts itself in a form that can be read by Cumulus (the Davis range, for example), and you want Cumulus to use the station-generated forecast, you should leave the box unticked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The forecasting option was added in [[Version 1.8.3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Possible values=&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;#forecast&amp;gt; webtag will return one of the following values, when the &#039;Cumulus Forecast&#039; option is chosen. Otherwise, either a string supplied by your weather station will be returned, if it is able to supply one, or if not, &#039;Not available&#039; will be returned:&lt;br /&gt;
&lt;br /&gt;
*Exceptional Weather, Settled fine (outside of your &#039;normal&#039; range)&lt;br /&gt;
*Settled fine&lt;br /&gt;
*Fine weather&lt;br /&gt;
*Becoming fine&lt;br /&gt;
*Fine, becoming less settled&lt;br /&gt;
*Fine, possible showers&lt;br /&gt;
*Fairly fine, improving&lt;br /&gt;
*Fairly fine, possible showers early&lt;br /&gt;
*Fairly fine, showery later&lt;br /&gt;
*Showery early, improving&lt;br /&gt;
*Changeable, mending&lt;br /&gt;
*Fairly fine, showers likely&lt;br /&gt;
*Rather unsettled clearing later&lt;br /&gt;
*Unsettled, probably improving&lt;br /&gt;
*Showery, bright intervals&lt;br /&gt;
*Showery, becoming less settled&lt;br /&gt;
*Changeable, some precipitation&lt;br /&gt;
*Unsettled, short fine intervals&lt;br /&gt;
*Unsettled, precipitation later&lt;br /&gt;
*Unsettled, some precipitation&lt;br /&gt;
*Mostly very unsettled&lt;br /&gt;
*Occasional precipitation, worsening&lt;br /&gt;
*Precipitation at times, very unsettled&lt;br /&gt;
*Precipitation at frequent intervals&lt;br /&gt;
*Precipitation, very unsettled&lt;br /&gt;
*Stormy, may improve&lt;br /&gt;
*Stormy, much precipitation&lt;br /&gt;
*Exceptional Weather, Stormy, much precipitation (outside of your &#039;normal&#039; range)&lt;br /&gt;
&lt;br /&gt;
[[Category:Webtags]]&lt;br /&gt;
&lt;br /&gt;
=Credit=&lt;br /&gt;
&lt;br /&gt;
The original formula was converted into a Javascript algorithm by &#039;Beteljuice&#039; and kindly supplied to the Cumulus project for conversion into it&#039;s codestream.&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=157</id>
		<title>RecentUpload</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=157"/>
		<updated>2009-08-25T10:57:28Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOnBanner|name=RecentUpload|type=HTML &amp;amp; PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=23rd Aug 2009|version=1.3}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;RecentUpload&amp;lt;/big&amp;gt; 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!&lt;br /&gt;
&lt;br /&gt;
Unlike usual file &amp;quot;sniffers&amp;quot;, this will tell you when a declared file is missing (eg. a file has been deleted but new upload has failed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script relies on [http://www.php.net/ PHP] so your webserver must support it (The majority of hosted servers do.  If you are running  your own webserver you many need to install and configure it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
Copy the following code into an existing web page, or create a new page.  All this code should appear within the &amp;lt;nowiki&amp;gt;&amp;lt;body&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
As this is PHP code, the webpage filename must ended in &amp;quot;.php&amp;quot;.  For example, &amp;lt;tt&amp;gt;recentupdate.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//config - define variables to match the files you are interested in&lt;br /&gt;
// format: &amp;quot;file nickname&amp;quot;, &amp;quot;update frequency&amp;quot;, &amp;quot;file url&amp;quot;&lt;br /&gt;
// - nickname may be &amp;quot;&amp;quot; (will be replaced by url)&lt;br /&gt;
// - freq may be &amp;quot;&amp;quot; (will be replaced by &#039;Unknown&#039;)&lt;br /&gt;
// - file url - valid filepath - COMPULSORY&lt;br /&gt;
$nickname[] = &amp;quot;&#039;Realtime.txt&amp;quot;; $freq[]=&amp;quot;30 Seconds&amp;quot;; $file_url[]=&amp;quot;./realtime.txt&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Homepage&amp;quot;; $freq[]=&amp;quot;2mins&amp;quot;; $file_url[]=&amp;quot;.index.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Records&amp;quot;; $freq[]=&amp;quot;2mins&amp;quot;; $file_url[]=&amp;quot;./record.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Trends&amp;quot;; $freq[]=&amp;quot;2mins&amp;quot;; $file_url[]=&amp;quot;./trends.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Today&#039;s Data Review&amp;quot;; $freq[]=&amp;quot;2mins&amp;quot;; $file_url[]=&amp;quot;./today.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Yesterday&#039;s Data Review&amp;quot;; $freq[]=&amp;quot;2mins&amp;quot;; $file_url[]=&amp;quot;./yesterday.html&amp;quot;;&lt;br /&gt;
// ######### That&#039;s it, nothing else to do !&lt;br /&gt;
&lt;br /&gt;
$this_output = &amp;quot;&lt;br /&gt;
The current data and time is: &amp;quot;.date(&amp;quot;m/d/y H:i:s T&amp;quot;).&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Uploaded File&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Upload Frequency&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Last Upload&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Time Since Last Upload&amp;lt;/th&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
for ($i=0; ($i&amp;lt;count($file_url)); $i++) {&lt;br /&gt;
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check&lt;br /&gt;
      $when=filemtime($file_url[$i]);&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($nickname[$i] ? $nickname[$i] : $file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($freq[$i] ? $freq[$i] : &amp;quot;Unknown&amp;quot;). &amp;quot;&amp;lt;td&amp;gt;&amp;quot; .date(&amp;quot;m/d/y H:i:s T&amp;quot;, $when). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .timediff($file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } else { // the file is misnamed or not uploaded&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$file_url[$i]. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($freq[$i] ? $freq[$i] : &amp;quot;Unknown&amp;quot;). &amp;quot;&amp;lt;td&amp;gt;NO SUCH FILE !&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;NO SUCH FILE !&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } // END existence check&lt;br /&gt;
} // END array loop&lt;br /&gt;
&lt;br /&gt;
$this_output .= &amp;quot;&amp;lt;/table&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
echo $this_output;&lt;br /&gt;
&lt;br /&gt;
//==========================================================================&lt;br /&gt;
//  Function timediff - Jason Duncombe - Weeley Weather Station UK&lt;br /&gt;
//  //  version: 1.2 - 19/08/09 - Public Released version&lt;br /&gt;
//  Description: This function calculates the number of seconds, minutes,&lt;br /&gt;
//  hours, or days since the file&#039;s timestamp has been written. This works&lt;br /&gt;
//  well for files uploaded to your website via FTP, since the timestamp&lt;br /&gt;
//  reflects when the file was last written to the server with your FTP client.&lt;br /&gt;
//==========================================================================&lt;br /&gt;
function timediff ($filepath) {&lt;br /&gt;
   //Get time stamp of file&lt;br /&gt;
   $t = date(&amp;quot;mdyHis&amp;quot;, filemtime($filepath));&lt;br /&gt;
   //Split $t into month, day, and year values&lt;br /&gt;
   $m = substr($t, 0, 2);&lt;br /&gt;
   $d = substr($t, 2, 2);&lt;br /&gt;
   $y = substr($t, 4, 2);&lt;br /&gt;
   $h = substr($t, 6, 2);&lt;br /&gt;
   $min = substr($t, 8, 2);&lt;br /&gt;
   $s = substr($t, 10, 2);&lt;br /&gt;
   $timestamp = mktime($h, $min, $s, $m, $d, $y);&lt;br /&gt;
   $tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.&lt;br /&gt;
   //Determin how to display by size of timediff&lt;br /&gt;
   if ($tdiff &amp;lt; 60) { &lt;br /&gt;
      //Timediff is less then 1 minute, so must be seconds&lt;br /&gt;
      $tdiff=number_format($tdiff);&lt;br /&gt;
      return $tdiff.&amp;quot; sec&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 3600) { &lt;br /&gt;
      //timediff is less then 1 hour, so must be minutes&lt;br /&gt;
      $tdiff=$tdiff/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; min&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 216000) { &lt;br /&gt;
      //timediff is less then 1 day, so must be hours.&lt;br /&gt;
      $tdiff=($tdiff/60)/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; hr&amp;quot;;&lt;br /&gt;
   } else { &lt;br /&gt;
      //timediff is greater then 1 day, so must be days.&lt;br /&gt;
      $tdiff=(($tdiff/60)/60)/24;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; days&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top of this code are a set of variables, three for each file to be checked:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width:90px&amp;quot; | Variable&lt;br /&gt;
!style=&amp;quot;width:400px&amp;quot; | Description&lt;br /&gt;
!style=&amp;quot;width:150px&amp;quot; | Example&lt;br /&gt;
|-&lt;br /&gt;
|$nickname[]&lt;br /&gt;
|Describe the use of the file.  If you leave this blank it will use the filename as the description&lt;br /&gt;
|&amp;quot;My Realtime data&amp;quot;&lt;br /&gt;
OR &amp;quot;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$freq[]&lt;br /&gt;
|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, &amp;quot;&amp;quot; = &amp;quot;Unknown&amp;quot;&lt;br /&gt;
|&amp;quot;15 seconds&amp;quot; &lt;br /&gt;
OR &amp;quot;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$file_url[]&lt;br /&gt;
|the path to where the file is, relative to where this code is running (&#039;&#039;&#039;REQUIRED&#039;&#039;&#039;)&lt;br /&gt;
|&amp;quot;./realtime.txt&amp;quot;&lt;br /&gt;
OR &amp;quot;realtime.txt&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A complete set of three variables is required for each file to be checked.  Repeat as necessary; in the above example we are checking four files.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
Save the file (remember the .php at the end) and upload to your webserver.  Now &#039;&#039;surf&#039;&#039; to the page using your website address and location of the php file.  Example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;www.myserver.com/recentupload.php&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.  If all goes well you should see a table with your filenames and when they were last updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tip=&lt;br /&gt;
&lt;br /&gt;
Rather than add all this code to your existing page, create a new file with all the code, save it (let&#039;s call it &amp;lt;tt&amp;gt;recentupload.php&amp;lt;/tt&amp;gt;).  Now in your actual website page, insert the following line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP include(&amp;quot;recentupload.php&amp;quot;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: your &#039;actual&#039; website page must now also have .php at the end of the filename and not .html for this to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further Enhancement=&lt;br /&gt;
&lt;br /&gt;
Why not have the page refresh automatically?   (&#039;&#039;This works for either html or php file types&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;lt;head&amp;gt; tag (or if you wish in the &amp;lt;body&amp;gt;) place the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var phpdatFile = &#039;recentupload.php&#039;; // URL location of PHP file&lt;br /&gt;
 &lt;br /&gt;
function file_data(phpurl) {&lt;br /&gt;
  if (document.getElementById) {&lt;br /&gt;
    var xx = (window.ActiveXObject) ? new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;) : new XMLHttpRequest(phpurl);&lt;br /&gt;
  }&lt;br /&gt;
  if (xx) { // got something back&lt;br /&gt;
    xx.onreadystatechange = function() {&lt;br /&gt;
    try { if (xx.readyState == 4 &amp;amp;&amp;amp; xx.status == 200) { &lt;br /&gt;
 &lt;br /&gt;
         document.getElementById(&#039;the_content&#039;).innerHTML=xx.responseText;&lt;br /&gt;
 &lt;br /&gt;
	 } // END if (xx.readyState == 4 &amp;amp;&amp;amp; x.status == 200)&lt;br /&gt;
 &lt;br /&gt;
    } // END try&lt;br /&gt;
 &lt;br /&gt;
   	catch(e){}  // Mike Challis added fix to fix random error: NS_ERROR_NOT_AVAILABLE&lt;br /&gt;
 &lt;br /&gt;
    } // END xx.onreadystatechange = function() {&lt;br /&gt;
    xx.open(&amp;quot;GET&amp;quot;, phpurl, true);&lt;br /&gt;
    xx.send(null);&lt;br /&gt;
 &lt;br /&gt;
      setTimeout(&amp;quot;file_data(phpdatFile + &#039;?&#039; + new Date().getTime())&amp;quot;, 1000); // get new data &lt;br /&gt;
  }&lt;br /&gt;
} // end file_data function&lt;br /&gt;
 &lt;br /&gt;
// initial call&lt;br /&gt;
file_data(phpdatFile + &#039;?&#039; + new Date().getTime());&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the top of this code....&amp;lt;tt&amp;gt;var phpdatFile = &#039;recentupload.php&#039;;&amp;lt;/tt&amp;gt; with the filename you used earlier (in the Tips section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in the &amp;lt;body&amp;gt; of your html page insert the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div id=&amp;quot;the_content&amp;quot;&amp;gt;Any Second Now......&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your page will now refresh the data every one second.&lt;br /&gt;
&lt;br /&gt;
To change the refresh rate adjust the figure 1000 in the setTimeout(&amp;quot; ... code above.  This is the time in milliseconds.  So to refresh every 30 seconds it would be 30000&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
http://www.weeleyweatherstation.info/betel_ftpstatus.php&lt;br /&gt;
&lt;br /&gt;
=Download Location=&lt;br /&gt;
&lt;br /&gt;
You can download the latest and previous versions, directly from the forum[http://http://sandaysoft.com/forum/viewtopic.php?f=14&amp;amp;t=1257 Sandaysoft Cumulus Forum]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:AddOns]]&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=108</id>
		<title>RecentUpload</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=108"/>
		<updated>2009-08-22T11:53:17Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOnBanner|name=RecentUpload|type=HTML &amp;amp; PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=20 Aug 2009|version=1.2}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;RecentUpload&amp;lt;/big&amp;gt; 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!&lt;br /&gt;
&lt;br /&gt;
Unlike usual file &amp;quot;sniffers&amp;quot;, this will tell you when a declared file is missing (eg. a file has been deleted but new upload has failed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script relies on [http://www.php.net/ PHP] so your webserver must support it (The majority of hosted servers do.  If you are running  your own webserver you many need to install and configure it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
Copy the following code into an existing web page, or create a new page.  All this code should appear within the &amp;lt;nowiki&amp;gt;&amp;lt;body&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
As this is PHP code, the webpage filename must ended in &amp;quot;.php&amp;quot;.  For example, &amp;lt;tt&amp;gt;recentupdate.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//config - define variables to match the files you are interested in&lt;br /&gt;
// format: &amp;quot;file nickname&amp;quot;, &amp;quot;update frequency&amp;quot;, &amp;quot;file url&amp;quot;&lt;br /&gt;
// - nickname may be &amp;quot;&amp;quot; (will be replaced by url)&lt;br /&gt;
&lt;br /&gt;
$nickname[] = &amp;quot;Realtime.txt&amp;quot;; $freq[]=&amp;quot;30 Seconds&amp;quot;; $file_url[]=&amp;quot;./realtime.txt&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Homepage&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./index.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Records&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./record.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Trends&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./trends.html&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// ######### That&#039;s it, nothing else to do !&lt;br /&gt;
&lt;br /&gt;
$this_output = &amp;quot;&lt;br /&gt;
The current data and time is: &amp;quot;.date(&amp;quot;m/d/y H:i:s T&amp;quot;).&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Uploaded File&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Upload Frequency&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Last Upload&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Time Since Last Upload&amp;lt;/th&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
for ($i=0; ($i&amp;lt;count($file_url)); $i++) {&lt;br /&gt;
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check&lt;br /&gt;
      $when=filemtime($file_url[$i]);&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($nickname[$i] ? $nickname[$i] : $file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;quot; .date(&amp;quot;m/d/y H:i:s T&amp;quot;, $when). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .timediff($file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } else { // the file is misnamed or not uploaded&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$file_url[$i]. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } // END existence check&lt;br /&gt;
} // END array loop&lt;br /&gt;
&lt;br /&gt;
$this_output .= &amp;quot;&amp;lt;/table&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
echo $this_output;&lt;br /&gt;
&lt;br /&gt;
//==========================================================================&lt;br /&gt;
//  Function timediff - Jason Duncombe - Weeley Weather Station UK&lt;br /&gt;
//  //  version: 1.2 - 19/08/09 - Public Released version&lt;br /&gt;
//  Description: This function calculates the number of seconds, minutes,&lt;br /&gt;
//  hours, or days since the file&#039;s timestamp has been written. This works&lt;br /&gt;
//  well for files uploaded to your website via FTP, since the timestamp&lt;br /&gt;
//  reflects when the file was last written to the server with your FTP client.&lt;br /&gt;
//==========================================================================&lt;br /&gt;
function timediff ($filepath) {&lt;br /&gt;
   //Get time stamp of file&lt;br /&gt;
   $t = date(&amp;quot;mdyHis&amp;quot;, filemtime($filepath));&lt;br /&gt;
   //Split $t into month, day, and year values&lt;br /&gt;
   $m = substr($t, 0, 2);&lt;br /&gt;
   $d = substr($t, 2, 2);&lt;br /&gt;
   $y = substr($t, 4, 2);&lt;br /&gt;
   $h = substr($t, 6, 2);&lt;br /&gt;
   $min = substr($t, 8, 2);&lt;br /&gt;
   $s = substr($t, 10, 2);&lt;br /&gt;
   $timestamp = mktime($h, $min, $s, $m, $d, $y);&lt;br /&gt;
   $tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.&lt;br /&gt;
   //Determin how to display by size of timediff&lt;br /&gt;
   if ($tdiff &amp;lt; 60) { &lt;br /&gt;
      //Timediff is less then 1 minute, so must be seconds&lt;br /&gt;
      $tdiff=number_format($tdiff);&lt;br /&gt;
      return $tdiff.&amp;quot; sec&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 3600) { &lt;br /&gt;
      //timediff is less then 1 hour, so must be minutes&lt;br /&gt;
      $tdiff=$tdiff/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; min&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 216000) { &lt;br /&gt;
      //timediff is less then 1 day, so must be hours.&lt;br /&gt;
      $tdiff=($tdiff/60)/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; hr&amp;quot;;&lt;br /&gt;
   } else { &lt;br /&gt;
      //timediff is greater then 1 day, so must be days.&lt;br /&gt;
      $tdiff=(($tdiff/60)/60)/24;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; days&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top of this code are a set of variables, three for each file to be checked:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width:90px&amp;quot; | Variable&lt;br /&gt;
!style=&amp;quot;width:400px&amp;quot; | Description&lt;br /&gt;
!style=&amp;quot;width:150px&amp;quot; | Example&lt;br /&gt;
|-&lt;br /&gt;
|$nickname[]&lt;br /&gt;
|Describe the use of the file.  If you leave this blank it will use the filename as the description&lt;br /&gt;
|&amp;quot;My Realtime data&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$freq[]&lt;br /&gt;
|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&lt;br /&gt;
|&amp;quot;15 seconds&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$file_url[]&lt;br /&gt;
|the path to where the file is, relative to where this code is running&lt;br /&gt;
|&amp;quot;./realtime.txt&amp;quot; OR &amp;quot;realtime.txt&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A complete set of three variables is required for each file to be checked.  Repeat as necessary; in the above example we are checking four files.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
Save the file (remember the .php at the end) and upload to your webserver.  Now &#039;&#039;surf&#039;&#039; to the page using your website address and location of the php file.  Example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;www.myserver.com/recentupload.php&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.  If all goes well you should see a table with your filenames and when they were last updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tip=&lt;br /&gt;
&lt;br /&gt;
Rather than add all this code to your existing page, create a new file with all the code, save it (let&#039;s call it &amp;lt;tt&amp;gt;recentupload.php&amp;lt;/tt&amp;gt;).  Now in your actual website page, insert the following line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP include(&amp;quot;recentupload.php&amp;quot;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: your &#039;actual&#039; website page must now also have .php at the end of the filename and not .html for this to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further Enhancement=&lt;br /&gt;
&lt;br /&gt;
Why not have the page refresh automatically?   (&#039;&#039;This works for either html or php file types&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;lt;head&amp;gt; tag (or if you wish in the &amp;lt;body&amp;gt;) place the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var phpdatFile = &#039;recentupload.php&#039;; // URL location of PHP file&lt;br /&gt;
 &lt;br /&gt;
function file_data(phpurl) {&lt;br /&gt;
  if (document.getElementById) {&lt;br /&gt;
    var xx = (window.ActiveXObject) ? new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;) : new XMLHttpRequest(phpurl);&lt;br /&gt;
  }&lt;br /&gt;
  if (xx) { // got something back&lt;br /&gt;
    xx.onreadystatechange = function() {&lt;br /&gt;
    try { if (xx.readyState == 4 &amp;amp;&amp;amp; xx.status == 200) { &lt;br /&gt;
 &lt;br /&gt;
         document.getElementById(&#039;the_content&#039;).innerHTML=xx.responseText;&lt;br /&gt;
 &lt;br /&gt;
	 } // END if (xx.readyState == 4 &amp;amp;&amp;amp; x.status == 200)&lt;br /&gt;
 &lt;br /&gt;
    } // END try&lt;br /&gt;
 &lt;br /&gt;
   	catch(e){}  // Mike Challis added fix to fix random error: NS_ERROR_NOT_AVAILABLE&lt;br /&gt;
 &lt;br /&gt;
    } // END xx.onreadystatechange = function() {&lt;br /&gt;
    xx.open(&amp;quot;GET&amp;quot;, phpurl, true);&lt;br /&gt;
    xx.send(null);&lt;br /&gt;
 &lt;br /&gt;
      setTimeout(&amp;quot;file_data(phpdatFile + &#039;?&#039; + new Date().getTime())&amp;quot;, 1000); // get new data &lt;br /&gt;
  }&lt;br /&gt;
} // end file_data function&lt;br /&gt;
 &lt;br /&gt;
// initial call&lt;br /&gt;
file_data(phpdatFile + &#039;?&#039; + new Date().getTime());&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the top of this code....&amp;lt;tt&amp;gt;var phpdatFile = &#039;recentupload.php&#039;;&amp;lt;/tt&amp;gt; with the filename you used earlier (in the Tips section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in the &amp;lt;body&amp;gt; of your html page insert the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div id=&amp;quot;the_content&amp;quot;&amp;gt;Any Second Now......&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your page will now refresh the data every one second.&lt;br /&gt;
&lt;br /&gt;
To change the refresh rate adjust the figure 1000 in the setTimeout(&amp;quot; ... code above.  This is the time in milliseconds.  So to refresh every 30 seconds it would be 30000&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
http://www.weeleyweatherstation.info/betel_ftpstatus.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:AddOns]]&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=107</id>
		<title>RecentUpload</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=107"/>
		<updated>2009-08-22T11:49:07Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: /* Further Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOnBanner|name=RecentUpload|type=HTML &amp;amp; PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=20 Aug 2009|version=1.2}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;RecentUpload&amp;lt;/big&amp;gt; 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!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script relies on [http://www.php.net/ PHP] so your webserver must support it (The majority of hosted servers do.  If you are running  your own webserver you many need to install and configure it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
Copy the following code into an existing web page, or create a new page.  All this code should appear within the &amp;lt;nowiki&amp;gt;&amp;lt;body&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
As this is PHP code, the webpage filename must ended in &amp;quot;.php&amp;quot;.  For example, &amp;lt;tt&amp;gt;recentupdate.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//config - define variables to match the files you are interested in&lt;br /&gt;
// format: &amp;quot;file nickname&amp;quot;, &amp;quot;update frequency&amp;quot;, &amp;quot;file url&amp;quot;&lt;br /&gt;
// - nickname may be &amp;quot;&amp;quot; (will be replaced by url)&lt;br /&gt;
&lt;br /&gt;
$nickname[] = &amp;quot;Realtime.txt&amp;quot;; $freq[]=&amp;quot;30 Seconds&amp;quot;; $file_url[]=&amp;quot;./realtime.txt&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Homepage&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./index.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Records&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./record.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Trends&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./trends.html&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// ######### That&#039;s it, nothing else to do !&lt;br /&gt;
&lt;br /&gt;
$this_output = &amp;quot;&lt;br /&gt;
The current data and time is: &amp;quot;.date(&amp;quot;m/d/y H:i:s T&amp;quot;).&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Uploaded File&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Upload Frequency&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Last Upload&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Time Since Last Upload&amp;lt;/th&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
for ($i=0; ($i&amp;lt;count($file_url)); $i++) {&lt;br /&gt;
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check&lt;br /&gt;
      $when=filemtime($file_url[$i]);&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($nickname[$i] ? $nickname[$i] : $file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;quot; .date(&amp;quot;m/d/y H:i:s T&amp;quot;, $when). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .timediff($file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } else { // the file is misnamed or not uploaded&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$file_url[$i]. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } // END existence check&lt;br /&gt;
} // END array loop&lt;br /&gt;
&lt;br /&gt;
$this_output .= &amp;quot;&amp;lt;/table&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
echo $this_output;&lt;br /&gt;
&lt;br /&gt;
//==========================================================================&lt;br /&gt;
//  Function timediff - Jason Duncombe - Weeley Weather Station UK&lt;br /&gt;
//  //  version: 1.2 - 19/08/09 - Public Released version&lt;br /&gt;
//  Description: This function calculates the number of seconds, minutes,&lt;br /&gt;
//  hours, or days since the file&#039;s timestamp has been written. This works&lt;br /&gt;
//  well for files uploaded to your website via FTP, since the timestamp&lt;br /&gt;
//  reflects when the file was last written to the server with your FTP client.&lt;br /&gt;
//==========================================================================&lt;br /&gt;
function timediff ($filepath) {&lt;br /&gt;
   //Get time stamp of file&lt;br /&gt;
   $t = date(&amp;quot;mdyHis&amp;quot;, filemtime($filepath));&lt;br /&gt;
   //Split $t into month, day, and year values&lt;br /&gt;
   $m = substr($t, 0, 2);&lt;br /&gt;
   $d = substr($t, 2, 2);&lt;br /&gt;
   $y = substr($t, 4, 2);&lt;br /&gt;
   $h = substr($t, 6, 2);&lt;br /&gt;
   $min = substr($t, 8, 2);&lt;br /&gt;
   $s = substr($t, 10, 2);&lt;br /&gt;
   $timestamp = mktime($h, $min, $s, $m, $d, $y);&lt;br /&gt;
   $tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.&lt;br /&gt;
   //Determin how to display by size of timediff&lt;br /&gt;
   if ($tdiff &amp;lt; 60) { &lt;br /&gt;
      //Timediff is less then 1 minute, so must be seconds&lt;br /&gt;
      $tdiff=number_format($tdiff);&lt;br /&gt;
      return $tdiff.&amp;quot; sec&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 3600) { &lt;br /&gt;
      //timediff is less then 1 hour, so must be minutes&lt;br /&gt;
      $tdiff=$tdiff/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; min&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 216000) { &lt;br /&gt;
      //timediff is less then 1 day, so must be hours.&lt;br /&gt;
      $tdiff=($tdiff/60)/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; hr&amp;quot;;&lt;br /&gt;
   } else { &lt;br /&gt;
      //timediff is greater then 1 day, so must be days.&lt;br /&gt;
      $tdiff=(($tdiff/60)/60)/24;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; days&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top of this code are a set of variables, three for each file to be checked:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width:90px&amp;quot; | Variable&lt;br /&gt;
!style=&amp;quot;width:400px&amp;quot; | Description&lt;br /&gt;
!style=&amp;quot;width:150px&amp;quot; | Example&lt;br /&gt;
|-&lt;br /&gt;
|$nickname[]&lt;br /&gt;
|Describe the use of the file.  If you leave this blank it will use the filename as the description&lt;br /&gt;
|&amp;quot;My Realtime data&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$freq[]&lt;br /&gt;
|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&lt;br /&gt;
|&amp;quot;15 seconds&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$file_url[]&lt;br /&gt;
|the path to where the file is, relative to where this code is running&lt;br /&gt;
|&amp;quot;./realtime.txt&amp;quot; OR &amp;quot;realtime.txt&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A complete set of three variables is required for each file to be checked.  Repeat as necessary; in the above example we are checking four files.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
Save the file (remember the .php at the end) and upload to your webserver.  Now &#039;&#039;surf&#039;&#039; to the page using your website address and location of the php file.  Example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;www.myserver.com/recentupload.php&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.  If all goes well you should see a table with your filenames and when they were last updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tip=&lt;br /&gt;
&lt;br /&gt;
Rather than add all this code to your existing page, create a new file with all the code, save it (let&#039;s call it &amp;lt;tt&amp;gt;recentupload.php&amp;lt;/tt&amp;gt;).  Now in your actual website page, insert the following line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP include(&amp;quot;recentupload.php&amp;quot;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: your &#039;actual&#039; website page must now also have .php at the end of the filename and not .html for this to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further Enhancement=&lt;br /&gt;
&lt;br /&gt;
Why not have the page refresh automatically?   (&#039;&#039;This works for either html or php file types&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;lt;head&amp;gt; tag (or if you wish in the &amp;lt;body&amp;gt;) place the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var phpdatFile = &#039;recentupload.php&#039;; // URL location of PHP file&lt;br /&gt;
 &lt;br /&gt;
function file_data(phpurl) {&lt;br /&gt;
  if (document.getElementById) {&lt;br /&gt;
    var xx = (window.ActiveXObject) ? new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;) : new XMLHttpRequest(phpurl);&lt;br /&gt;
  }&lt;br /&gt;
  if (xx) { // got something back&lt;br /&gt;
    xx.onreadystatechange = function() {&lt;br /&gt;
    try { if (xx.readyState == 4 &amp;amp;&amp;amp; xx.status == 200) { &lt;br /&gt;
 &lt;br /&gt;
         document.getElementById(&#039;the_content&#039;).innerHTML=xx.responseText;&lt;br /&gt;
 &lt;br /&gt;
	 } // END if (xx.readyState == 4 &amp;amp;&amp;amp; x.status == 200)&lt;br /&gt;
 &lt;br /&gt;
    } // END try&lt;br /&gt;
 &lt;br /&gt;
   	catch(e){}  // Mike Challis added fix to fix random error: NS_ERROR_NOT_AVAILABLE&lt;br /&gt;
 &lt;br /&gt;
    } // END xx.onreadystatechange = function() {&lt;br /&gt;
    xx.open(&amp;quot;GET&amp;quot;, phpurl, true);&lt;br /&gt;
    xx.send(null);&lt;br /&gt;
 &lt;br /&gt;
      setTimeout(&amp;quot;file_data(phpdatFile + &#039;?&#039; + new Date().getTime())&amp;quot;, 1000); // get new data &lt;br /&gt;
  }&lt;br /&gt;
} // end file_data function&lt;br /&gt;
 &lt;br /&gt;
// initial call&lt;br /&gt;
file_data(phpdatFile + &#039;?&#039; + new Date().getTime());&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the top of this code....&amp;lt;tt&amp;gt;var phpdatFile = &#039;recentupload.php&#039;;&amp;lt;/tt&amp;gt; with the filename you used earlier (in the Tips section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in the &amp;lt;body&amp;gt; of your html page insert the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div id=&amp;quot;the_content&amp;quot;&amp;gt;Any Second Now......&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your page will now refresh the data every one second.&lt;br /&gt;
&lt;br /&gt;
To change the refresh rate adjust the figure 1000 in the setTimeout(&amp;quot; ... code above.  This is the time in milliseconds.  So to refresh every 30 seconds it would be 30000&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
http://www.weeleyweatherstation.info/betel_ftpstatus.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:AddOns]]&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=106</id>
		<title>RecentUpload</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=106"/>
		<updated>2009-08-22T11:47:05Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: /* Further Enhancement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOnBanner|name=RecentUpload|type=HTML &amp;amp; PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=20 Aug 2009|version=1.2}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;RecentUpload&amp;lt;/big&amp;gt; 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!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script relies on [http://www.php.net/ PHP] so your webserver must support it (The majority of hosted servers do.  If you are running  your own webserver you many need to install and configure it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
Copy the following code into an existing web page, or create a new page.  All this code should appear within the &amp;lt;nowiki&amp;gt;&amp;lt;body&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
As this is PHP code, the webpage filename must ended in &amp;quot;.php&amp;quot;.  For example, &amp;lt;tt&amp;gt;recentupdate.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//config - define variables to match the files you are interested in&lt;br /&gt;
// format: &amp;quot;file nickname&amp;quot;, &amp;quot;update frequency&amp;quot;, &amp;quot;file url&amp;quot;&lt;br /&gt;
// - nickname may be &amp;quot;&amp;quot; (will be replaced by url)&lt;br /&gt;
&lt;br /&gt;
$nickname[] = &amp;quot;Realtime.txt&amp;quot;; $freq[]=&amp;quot;30 Seconds&amp;quot;; $file_url[]=&amp;quot;./realtime.txt&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Homepage&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./index.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Records&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./record.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Trends&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./trends.html&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// ######### That&#039;s it, nothing else to do !&lt;br /&gt;
&lt;br /&gt;
$this_output = &amp;quot;&lt;br /&gt;
The current data and time is: &amp;quot;.date(&amp;quot;m/d/y H:i:s T&amp;quot;).&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Uploaded File&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Upload Frequency&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Last Upload&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Time Since Last Upload&amp;lt;/th&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
for ($i=0; ($i&amp;lt;count($file_url)); $i++) {&lt;br /&gt;
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check&lt;br /&gt;
      $when=filemtime($file_url[$i]);&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($nickname[$i] ? $nickname[$i] : $file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;quot; .date(&amp;quot;m/d/y H:i:s T&amp;quot;, $when). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .timediff($file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } else { // the file is misnamed or not uploaded&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$file_url[$i]. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } // END existence check&lt;br /&gt;
} // END array loop&lt;br /&gt;
&lt;br /&gt;
$this_output .= &amp;quot;&amp;lt;/table&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
echo $this_output;&lt;br /&gt;
&lt;br /&gt;
//==========================================================================&lt;br /&gt;
//  Function timediff - Jason Duncombe - Weeley Weather Station UK&lt;br /&gt;
//  //  version: 1.2 - 19/08/09 - Public Released version&lt;br /&gt;
//  Description: This function calculates the number of seconds, minutes,&lt;br /&gt;
//  hours, or days since the file&#039;s timestamp has been written. This works&lt;br /&gt;
//  well for files uploaded to your website via FTP, since the timestamp&lt;br /&gt;
//  reflects when the file was last written to the server with your FTP client.&lt;br /&gt;
//==========================================================================&lt;br /&gt;
function timediff ($filepath) {&lt;br /&gt;
   //Get time stamp of file&lt;br /&gt;
   $t = date(&amp;quot;mdyHis&amp;quot;, filemtime($filepath));&lt;br /&gt;
   //Split $t into month, day, and year values&lt;br /&gt;
   $m = substr($t, 0, 2);&lt;br /&gt;
   $d = substr($t, 2, 2);&lt;br /&gt;
   $y = substr($t, 4, 2);&lt;br /&gt;
   $h = substr($t, 6, 2);&lt;br /&gt;
   $min = substr($t, 8, 2);&lt;br /&gt;
   $s = substr($t, 10, 2);&lt;br /&gt;
   $timestamp = mktime($h, $min, $s, $m, $d, $y);&lt;br /&gt;
   $tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.&lt;br /&gt;
   //Determin how to display by size of timediff&lt;br /&gt;
   if ($tdiff &amp;lt; 60) { &lt;br /&gt;
      //Timediff is less then 1 minute, so must be seconds&lt;br /&gt;
      $tdiff=number_format($tdiff);&lt;br /&gt;
      return $tdiff.&amp;quot; sec&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 3600) { &lt;br /&gt;
      //timediff is less then 1 hour, so must be minutes&lt;br /&gt;
      $tdiff=$tdiff/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; min&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 216000) { &lt;br /&gt;
      //timediff is less then 1 day, so must be hours.&lt;br /&gt;
      $tdiff=($tdiff/60)/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; hr&amp;quot;;&lt;br /&gt;
   } else { &lt;br /&gt;
      //timediff is greater then 1 day, so must be days.&lt;br /&gt;
      $tdiff=(($tdiff/60)/60)/24;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; days&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top of this code are a set of variables, three for each file to be checked:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width:90px&amp;quot; | Variable&lt;br /&gt;
!style=&amp;quot;width:400px&amp;quot; | Description&lt;br /&gt;
!style=&amp;quot;width:150px&amp;quot; | Example&lt;br /&gt;
|-&lt;br /&gt;
|$nickname[]&lt;br /&gt;
|Describe the use of the file.  If you leave this blank it will use the filename as the description&lt;br /&gt;
|&amp;quot;My Realtime data&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$freq[]&lt;br /&gt;
|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&lt;br /&gt;
|&amp;quot;15 seconds&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$file_url[]&lt;br /&gt;
|the path to where the file is, relative to where this code is running&lt;br /&gt;
|&amp;quot;./realtime.txt&amp;quot; OR &amp;quot;realtime.txt&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A complete set of three variables is required for each file to be checked.  Repeat as necessary; in the above example we are checking four files.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
Save the file (remember the .php at the end) and upload to your webserver.  Now &#039;&#039;surf&#039;&#039; to the page using your website address and location of the php file.  Example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;www.myserver.com/recentupload.php&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.  If all goes well you should see a table with your filenames and when they were last updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tip=&lt;br /&gt;
&lt;br /&gt;
Rather than add all this code to your existing page, create a new file with all the code, save it (let&#039;s call it &amp;lt;tt&amp;gt;recentupload.php&amp;lt;/tt&amp;gt;).  Now in your actual website page, insert the following line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP include(&amp;quot;recentupload.php&amp;quot;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: your &#039;actual&#039; website page must now also have .php at the end of the filename and not .html for this to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further Enhancement=&lt;br /&gt;
&lt;br /&gt;
Why not have the page refresh automatically?   (&#039;&#039;This works for either html or php file types&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;lt;head&amp;gt; tag (or if you wish in the &amp;lt;body&amp;gt;) place the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var phpdatFile = &#039;recentupload.php&#039;; // URL location of PHP file&lt;br /&gt;
 &lt;br /&gt;
function file_data(phpurl) {&lt;br /&gt;
  if (document.getElementById) {&lt;br /&gt;
    var xx = (window.ActiveXObject) ? new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;) : new XMLHttpRequest(phpurl);&lt;br /&gt;
  }&lt;br /&gt;
  if (xx) { // got something back&lt;br /&gt;
    xx.onreadystatechange = function() {&lt;br /&gt;
    try { if (xx.readyState == 4 &amp;amp;&amp;amp; xx.status == 200) { &lt;br /&gt;
 &lt;br /&gt;
         document.getElementById(&#039;the_content&#039;).innerHTML=xx.responseText;&lt;br /&gt;
 &lt;br /&gt;
	 } // END if (xx.readyState == 4 &amp;amp;&amp;amp; x.status == 200)&lt;br /&gt;
 &lt;br /&gt;
    } // END try&lt;br /&gt;
 &lt;br /&gt;
   	catch(e){}  // Mike Challis added fix to fix random error: NS_ERROR_NOT_AVAILABLE&lt;br /&gt;
 &lt;br /&gt;
    } // END xx.onreadystatechange = function() {&lt;br /&gt;
    xx.open(&amp;quot;GET&amp;quot;, phpurl, true);&lt;br /&gt;
    xx.send(null);&lt;br /&gt;
 &lt;br /&gt;
      setTimeout(&amp;quot;file_data(phpdatFile + &#039;?&#039; + new Date().getTime())&amp;quot;, 1000); // get new data &lt;br /&gt;
  }&lt;br /&gt;
} // end file_data function&lt;br /&gt;
 &lt;br /&gt;
// initial call&lt;br /&gt;
file_data(phpdatFile + &#039;?&#039; + new Date().getTime());&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the top of this code....&amp;lt;tt&amp;gt;var phpdatFile = &#039;recentupload.php&#039;;&amp;lt;/tt&amp;gt; with the filename you used earlier (in the Tips section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in the &amp;lt;body&amp;gt; of your html page insert the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div id=&amp;quot;the_content&amp;quot;&amp;gt;Any Second Now......&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your page will now refresh the data every one second.&lt;br /&gt;
&lt;br /&gt;
To change the refresh rate adjust the figure 1000 in the code above.  This is the time in milliseconds.  So to refresh every 30 seconds it would be 30000&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
http://www.weeleyweatherstation.info/betel_ftpstatus.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:AddOns]]&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=105</id>
		<title>RecentUpload</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=105"/>
		<updated>2009-08-22T11:44:00Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: /* Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOnBanner|name=RecentUpload|type=HTML &amp;amp; PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=20 Aug 2009|version=1.2}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;RecentUpload&amp;lt;/big&amp;gt; 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!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script relies on [http://www.php.net/ PHP] so your webserver must support it (The majority of hosted servers do.  If you are running  your own webserver you many need to install and configure it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
Copy the following code into an existing web page, or create a new page.  All this code should appear within the &amp;lt;nowiki&amp;gt;&amp;lt;body&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
As this is PHP code, the webpage filename must ended in &amp;quot;.php&amp;quot;.  For example, &amp;lt;tt&amp;gt;recentupdate.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//config - define variables to match the files you are interested in&lt;br /&gt;
// format: &amp;quot;file nickname&amp;quot;, &amp;quot;update frequency&amp;quot;, &amp;quot;file url&amp;quot;&lt;br /&gt;
// - nickname may be &amp;quot;&amp;quot; (will be replaced by url)&lt;br /&gt;
&lt;br /&gt;
$nickname[] = &amp;quot;Realtime.txt&amp;quot;; $freq[]=&amp;quot;30 Seconds&amp;quot;; $file_url[]=&amp;quot;./realtime.txt&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Homepage&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./index.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Records&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./record.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Trends&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./trends.html&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// ######### That&#039;s it, nothing else to do !&lt;br /&gt;
&lt;br /&gt;
$this_output = &amp;quot;&lt;br /&gt;
The current data and time is: &amp;quot;.date(&amp;quot;m/d/y H:i:s T&amp;quot;).&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Uploaded File&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Upload Frequency&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Last Upload&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Time Since Last Upload&amp;lt;/th&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
for ($i=0; ($i&amp;lt;count($file_url)); $i++) {&lt;br /&gt;
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check&lt;br /&gt;
      $when=filemtime($file_url[$i]);&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($nickname[$i] ? $nickname[$i] : $file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;quot; .date(&amp;quot;m/d/y H:i:s T&amp;quot;, $when). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .timediff($file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } else { // the file is misnamed or not uploaded&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$file_url[$i]. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } // END existence check&lt;br /&gt;
} // END array loop&lt;br /&gt;
&lt;br /&gt;
$this_output .= &amp;quot;&amp;lt;/table&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
echo $this_output;&lt;br /&gt;
&lt;br /&gt;
//==========================================================================&lt;br /&gt;
//  Function timediff - Jason Duncombe - Weeley Weather Station UK&lt;br /&gt;
//  //  version: 1.2 - 19/08/09 - Public Released version&lt;br /&gt;
//  Description: This function calculates the number of seconds, minutes,&lt;br /&gt;
//  hours, or days since the file&#039;s timestamp has been written. This works&lt;br /&gt;
//  well for files uploaded to your website via FTP, since the timestamp&lt;br /&gt;
//  reflects when the file was last written to the server with your FTP client.&lt;br /&gt;
//==========================================================================&lt;br /&gt;
function timediff ($filepath) {&lt;br /&gt;
   //Get time stamp of file&lt;br /&gt;
   $t = date(&amp;quot;mdyHis&amp;quot;, filemtime($filepath));&lt;br /&gt;
   //Split $t into month, day, and year values&lt;br /&gt;
   $m = substr($t, 0, 2);&lt;br /&gt;
   $d = substr($t, 2, 2);&lt;br /&gt;
   $y = substr($t, 4, 2);&lt;br /&gt;
   $h = substr($t, 6, 2);&lt;br /&gt;
   $min = substr($t, 8, 2);&lt;br /&gt;
   $s = substr($t, 10, 2);&lt;br /&gt;
   $timestamp = mktime($h, $min, $s, $m, $d, $y);&lt;br /&gt;
   $tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.&lt;br /&gt;
   //Determin how to display by size of timediff&lt;br /&gt;
   if ($tdiff &amp;lt; 60) { &lt;br /&gt;
      //Timediff is less then 1 minute, so must be seconds&lt;br /&gt;
      $tdiff=number_format($tdiff);&lt;br /&gt;
      return $tdiff.&amp;quot; sec&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 3600) { &lt;br /&gt;
      //timediff is less then 1 hour, so must be minutes&lt;br /&gt;
      $tdiff=$tdiff/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; min&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 216000) { &lt;br /&gt;
      //timediff is less then 1 day, so must be hours.&lt;br /&gt;
      $tdiff=($tdiff/60)/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; hr&amp;quot;;&lt;br /&gt;
   } else { &lt;br /&gt;
      //timediff is greater then 1 day, so must be days.&lt;br /&gt;
      $tdiff=(($tdiff/60)/60)/24;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; days&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top of this code are a set of variables, three for each file to be checked:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width:90px&amp;quot; | Variable&lt;br /&gt;
!style=&amp;quot;width:400px&amp;quot; | Description&lt;br /&gt;
!style=&amp;quot;width:150px&amp;quot; | Example&lt;br /&gt;
|-&lt;br /&gt;
|$nickname[]&lt;br /&gt;
|Describe the use of the file.  If you leave this blank it will use the filename as the description&lt;br /&gt;
|&amp;quot;My Realtime data&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$freq[]&lt;br /&gt;
|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&lt;br /&gt;
|&amp;quot;15 seconds&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|$file_url[]&lt;br /&gt;
|the path to where the file is, relative to where this code is running&lt;br /&gt;
|&amp;quot;./realtime.txt&amp;quot; OR &amp;quot;realtime.txt&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A complete set of three variables is required for each file to be checked.  Repeat as necessary; in the above example we are checking four files.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
Save the file (remember the .php at the end) and upload to your webserver.  Now &#039;&#039;surf&#039;&#039; to the page using your website address and location of the php file.  Example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;www.myserver.com/recentupload.php&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.  If all goes well you should see a table with your filenames and when they were last updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tip=&lt;br /&gt;
&lt;br /&gt;
Rather than add all this code to your existing page, create a new file with all the code, save it (let&#039;s call it &amp;lt;tt&amp;gt;recentupload.php&amp;lt;/tt&amp;gt;).  Now in your actual website page, insert the following line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP include(&amp;quot;recentupload.php&amp;quot;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: your &#039;actual&#039; website page must now also have .php at the end of the filename and not .html for this to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further Enhancement=&lt;br /&gt;
&lt;br /&gt;
Why not have the page refresh automatically?   (&#039;&#039;This works for either html or php file types&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;lt;head&amp;gt; tag (or if you wish in the &amp;lt;body&amp;gt;) place the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var phpdatFile = &#039;recentupload.php&#039;; // URL location of PHP file&lt;br /&gt;
 &lt;br /&gt;
function file_data(phpurl) {&lt;br /&gt;
  if (document.getElementById) {&lt;br /&gt;
    var xx = (window.ActiveXObject) ? new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;) : new XMLHttpRequest(phpurl);&lt;br /&gt;
  }&lt;br /&gt;
  if (xx) { // got something back&lt;br /&gt;
    xx.onreadystatechange = function() {&lt;br /&gt;
    try { if (xx.readyState == 4 &amp;amp;&amp;amp; xx.status == 200) { &lt;br /&gt;
 &lt;br /&gt;
//    var currdat = x.responseText.replace(/\r\n/g, &amp;quot;&amp;quot;);	// this gets rid of any line ending&lt;br /&gt;
//   	var currdat = currdat.split(&#039; &#039;);	// populate the array&lt;br /&gt;
 &lt;br /&gt;
document.getElementById(&#039;the_content&#039;).innerHTML=xx.responseText;&lt;br /&gt;
 &lt;br /&gt;
	 } // END if (xx.readyState == 4 &amp;amp;&amp;amp; x.status == 200)&lt;br /&gt;
 &lt;br /&gt;
    } // END try&lt;br /&gt;
 &lt;br /&gt;
   	catch(e){}  // Mike Challis added fix to fix random error: NS_ERROR_NOT_AVAILABLE&lt;br /&gt;
 &lt;br /&gt;
    } // END xx.onreadystatechange = function() {&lt;br /&gt;
    xx.open(&amp;quot;GET&amp;quot;, phpurl, true);&lt;br /&gt;
    xx.send(null);&lt;br /&gt;
 &lt;br /&gt;
      setTimeout(&amp;quot;file_data(phpdatFile + &#039;?&#039; + new Date().getTime())&amp;quot;, 1000); // get new data &lt;br /&gt;
//    }&lt;br /&gt;
  }&lt;br /&gt;
} // end file_data function&lt;br /&gt;
 &lt;br /&gt;
// initial call&lt;br /&gt;
file_data(phpdatFile + &#039;?&#039; + new Date().getTime());&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the top of this code....&amp;lt;tt&amp;gt;var phpdatFile = &#039;recentupload.php&#039;;&amp;lt;/tt&amp;gt; with the filename you used earlier (in the Tips section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in the &amp;lt;body&amp;gt; of your html page insert the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div id=&amp;quot;the_content&amp;quot;&amp;gt;Any Second Now......&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your page will now refresh the data every one second.&lt;br /&gt;
&lt;br /&gt;
To change the refresh rate adjust the figure 1000 in the code above.  This is the time in milliseconds.  So to refresh every 30 seconds it would be 30000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
http://www.weeleyweatherstation.info/betel_ftpstatus.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:AddOns]]&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
	<entry>
		<id>https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=104</id>
		<title>RecentUpload</title>
		<link rel="alternate" type="text/html" href="https://www.cumuluswiki.org/index.php?title=RecentUpload&amp;diff=104"/>
		<updated>2009-08-22T11:36:36Z</updated>

		<summary type="html">&lt;p&gt;Beteljuice: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{AddOnBanner|name=RecentUpload|type=HTML &amp;amp; PHP|author=Jason Duncombe|contact=6719jason via Forum|updated=20 Aug 2009|version=1.2}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;RecentUpload&amp;lt;/big&amp;gt; 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!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This script relies on [http://www.php.net/ PHP] so your webserver must support it (The majority of hosted servers do.  If you are running  your own webserver you many need to install and configure it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&lt;br /&gt;
Copy the following code into an existing web page, or create a new page.  All this code should appear within the &amp;lt;nowiki&amp;gt;&amp;lt;body&amp;gt; &amp;lt;/body&amp;gt;&amp;lt;/nowiki&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
As this is PHP code, the webpage filename must ended in &amp;quot;.php&amp;quot;.  For example, &amp;lt;tt&amp;gt;recentupdate.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
//config - define variables to match the files you are interested in&lt;br /&gt;
// format: &amp;quot;file nickname&amp;quot;, &amp;quot;update frequency&amp;quot;, &amp;quot;file url&amp;quot;&lt;br /&gt;
// - nickname may be &amp;quot;&amp;quot; (will be replaced by url)&lt;br /&gt;
&lt;br /&gt;
$nickname[] = &amp;quot;Realtime.txt&amp;quot;; $freq[]=&amp;quot;30 Seconds&amp;quot;; $file_url[]=&amp;quot;./realtime.txt&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Homepage&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./index.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Records&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./record.html&amp;quot;;&lt;br /&gt;
$nickname[] = &amp;quot;Station Trends&amp;quot;; $freq[]=&amp;quot;5mins&amp;quot;; $file_url[]=&amp;quot;./trends.html&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// ######### That&#039;s it, nothing else to do !&lt;br /&gt;
&lt;br /&gt;
$this_output = &amp;quot;&lt;br /&gt;
The current data and time is: &amp;quot;.date(&amp;quot;m/d/y H:i:s T&amp;quot;).&amp;quot;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Uploaded File&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Upload Frequency&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Last Upload&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Time Since Last Upload&amp;lt;/th&amp;gt;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
for ($i=0; ($i&amp;lt;count($file_url)); $i++) {&lt;br /&gt;
   if(file_exists($file_url[$i])) { // cheap and cheerful existence check&lt;br /&gt;
      $when=filemtime($file_url[$i]);&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .($nickname[$i] ? $nickname[$i] : $file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;quot; .date(&amp;quot;m/d/y H:i:s T&amp;quot;, $when). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .timediff($file_url[$i]). &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } else { // the file is misnamed or not uploaded&lt;br /&gt;
      $this_output .= &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$file_url[$i]. &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;quot; .$freq[$i]. &amp;quot;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;b&amp;gt;NO SUCH FILE !&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
   } // END existence check&lt;br /&gt;
} // END array loop&lt;br /&gt;
&lt;br /&gt;
$this_output .= &amp;quot;&amp;lt;/table&amp;gt;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
echo $this_output;&lt;br /&gt;
&lt;br /&gt;
//==========================================================================&lt;br /&gt;
//  Function timediff - Jason Duncombe - Weeley Weather Station UK&lt;br /&gt;
//  //  version: 1.2 - 19/08/09 - Public Released version&lt;br /&gt;
//  Description: This function calculates the number of seconds, minutes,&lt;br /&gt;
//  hours, or days since the file&#039;s timestamp has been written. This works&lt;br /&gt;
//  well for files uploaded to your website via FTP, since the timestamp&lt;br /&gt;
//  reflects when the file was last written to the server with your FTP client.&lt;br /&gt;
//==========================================================================&lt;br /&gt;
function timediff ($filepath) {&lt;br /&gt;
   //Get time stamp of file&lt;br /&gt;
   $t = date(&amp;quot;mdyHis&amp;quot;, filemtime($filepath));&lt;br /&gt;
   //Split $t into month, day, and year values&lt;br /&gt;
   $m = substr($t, 0, 2);&lt;br /&gt;
   $d = substr($t, 2, 2);&lt;br /&gt;
   $y = substr($t, 4, 2);&lt;br /&gt;
   $h = substr($t, 6, 2);&lt;br /&gt;
   $min = substr($t, 8, 2);&lt;br /&gt;
   $s = substr($t, 10, 2);&lt;br /&gt;
   $timestamp = mktime($h, $min, $s, $m, $d, $y);&lt;br /&gt;
   $tdiff = mktime() - $timestamp; //Subtrack $timestamp from now, give us diff in seconds.&lt;br /&gt;
   //Determin how to display by size of timediff&lt;br /&gt;
   if ($tdiff &amp;lt; 60) { &lt;br /&gt;
      //Timediff is less then 1 minute, so must be seconds&lt;br /&gt;
      $tdiff=number_format($tdiff);&lt;br /&gt;
      return $tdiff.&amp;quot; sec&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 3600) { &lt;br /&gt;
      //timediff is less then 1 hour, so must be minutes&lt;br /&gt;
      $tdiff=$tdiff/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; min&amp;quot;;&lt;br /&gt;
   } elseif ($tdiff &amp;lt; 216000) { &lt;br /&gt;
      //timediff is less then 1 day, so must be hours.&lt;br /&gt;
      $tdiff=($tdiff/60)/60;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; hr&amp;quot;;&lt;br /&gt;
   } else { &lt;br /&gt;
      //timediff is greater then 1 day, so must be days.&lt;br /&gt;
      $tdiff=(($tdiff/60)/60)/24;&lt;br /&gt;
      $tdiff=number_format($tdiff, 1, &#039;.&#039;, &#039;&#039;);&lt;br /&gt;
      return $tdiff.&amp;quot; days&amp;quot;;&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Configuration=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At the top of this code are a set of variables, three for each file to be checked:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width:80px&amp;quot; | Variable&lt;br /&gt;
!style=&amp;quot;width:400px&amp;quot; | Description&lt;br /&gt;
!style=&amp;quot;width:150px&amp;quot; | Example&lt;br /&gt;
|-&lt;br /&gt;
|$nickname[]&lt;br /&gt;
|Describe the use of the file.  If you leave this blank it will use the filename as the description&lt;br /&gt;
|Realtime data&lt;br /&gt;
|-&lt;br /&gt;
|$freq[]&lt;br /&gt;
|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&lt;br /&gt;
|15 seconds&lt;br /&gt;
|-&lt;br /&gt;
|$file_url[]&lt;br /&gt;
|the path to where the file is, relative to where this code is running&lt;br /&gt;
|./realtime.txt&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A complete set of three variables is required for each file to be checked.  Repeat as necessary; in the above example we are checking four files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
Save the file (remember the .php at the end) and upload to your webserver.  Now &#039;&#039;surf&#039;&#039; to the page using your website address and location of the php file.  Example &amp;lt;tt&amp;gt;&amp;lt;nowiki&amp;gt;www.myserver.com/recentupload.php&amp;lt;/nowiki&amp;gt;&amp;lt;/tt&amp;gt;.  If all goes well you should see a table with your filenames and when they were last updated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Tip=&lt;br /&gt;
&lt;br /&gt;
Rather than add all this code to your existing page, create a new file with all the code, save it (let&#039;s call it &amp;lt;tt&amp;gt;recentupload.php&amp;lt;/tt&amp;gt;).  Now in your actual website page, insert the following line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP include(&amp;quot;recentupload.php&amp;quot;);?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: your &#039;actual&#039; website page must now also have .php at the end of the filename and not .html for this to work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Further Enhancement=&lt;br /&gt;
&lt;br /&gt;
Why not have the page refresh automatically?   (&#039;&#039;This works for either html or php file types&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Somewhere in the &amp;lt;head&amp;gt; tag (or if you wish in the &amp;lt;body&amp;gt;) place the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script language=&amp;quot;javascript&amp;quot;&amp;gt; &lt;br /&gt;
var phpdatFile = &#039;recentupload.php&#039;; // URL location of PHP file&lt;br /&gt;
 &lt;br /&gt;
function file_data(phpurl) {&lt;br /&gt;
  if (document.getElementById) {&lt;br /&gt;
    var xx = (window.ActiveXObject) ? new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;) : new XMLHttpRequest(phpurl);&lt;br /&gt;
  }&lt;br /&gt;
  if (xx) { // got something back&lt;br /&gt;
    xx.onreadystatechange = function() {&lt;br /&gt;
    try { if (xx.readyState == 4 &amp;amp;&amp;amp; xx.status == 200) { &lt;br /&gt;
 &lt;br /&gt;
//    var currdat = x.responseText.replace(/\r\n/g, &amp;quot;&amp;quot;);	// this gets rid of any line ending&lt;br /&gt;
//   	var currdat = currdat.split(&#039; &#039;);	// populate the array&lt;br /&gt;
 &lt;br /&gt;
document.getElementById(&#039;the_content&#039;).innerHTML=xx.responseText;&lt;br /&gt;
 &lt;br /&gt;
	 } // END if (xx.readyState == 4 &amp;amp;&amp;amp; x.status == 200)&lt;br /&gt;
 &lt;br /&gt;
    } // END try&lt;br /&gt;
 &lt;br /&gt;
   	catch(e){}  // Mike Challis added fix to fix random error: NS_ERROR_NOT_AVAILABLE&lt;br /&gt;
 &lt;br /&gt;
    } // END xx.onreadystatechange = function() {&lt;br /&gt;
    xx.open(&amp;quot;GET&amp;quot;, phpurl, true);&lt;br /&gt;
    xx.send(null);&lt;br /&gt;
 &lt;br /&gt;
      setTimeout(&amp;quot;file_data(phpdatFile + &#039;?&#039; + new Date().getTime())&amp;quot;, 1000); // get new data &lt;br /&gt;
//    }&lt;br /&gt;
  }&lt;br /&gt;
} // end file_data function&lt;br /&gt;
 &lt;br /&gt;
// initial call&lt;br /&gt;
file_data(phpdatFile + &#039;?&#039; + new Date().getTime());&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update the top of this code....&amp;lt;tt&amp;gt;var phpdatFile = &#039;recentupload.php&#039;;&amp;lt;/tt&amp;gt; with the filename you used earlier (in the Tips section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, somewhere in the &amp;lt;body&amp;gt; of your html page insert the line&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;div id=&amp;quot;the_content&amp;quot;&amp;gt;Any Second Now......&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your page will now refresh the data every one second.&lt;br /&gt;
&lt;br /&gt;
To change the refresh rate adjust the figure 1000 in the code above.  This is the time in milliseconds.  So to refresh every 30 seconds it would be 30000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
http://www.weeleyweatherstation.info/betel_ftpstatus.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:AddOns]]&lt;/div&gt;</summary>
		<author><name>Beteljuice</name></author>
	</entry>
</feed>