Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

request to add code to the template

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

request to add code to the template

Post by n9mfk »

Hi Ken,

I have some code I wood like to have this code added to the template

1 line in stetting-weather.php

Code: Select all

$SITE['realtimeupdatetime']		= 15;


an 1 line in include-status.php

Code: Select all

if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
	do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),$SITE['realtimefile'],$SITE['realtimeupdatetime'],'file');
  }
Beau
BCJKiwi
Posts: 1259
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: request to add code to the template

Post by BCJKiwi »

Hi,

The "realtimeinterval" is sent by Cumulus in CUtags.php and reflects what is set in cumulus so there should be no need for it to be separately specified within settings-weather.php - this would risk a mismatch.
I have added (if it wasn't there already) to my status page;

Code: Select all

// CU REALTIME   #######################################
   if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
      do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),"15 seconds",$SITE['realtimefile'],15+15,'file');  // Default 15 seconds - change to realtime updates time + a bit for tansmission variances
   }
to my include-status.php ( along with a number of other extra checks).
There is no reason that you should not make these changes yourself if you want.
When making such changes it is best to follow the format that is already used.

If you want to use this information in a lot of scripts then you could add;

Code: Select all

$realtimeinterval = $WX['realtimeinterval'];
to CU-defs.php and then use $realtimeinterval wherever you need to, e.g.;

Code: Select all

// CU REALTIME   #######################################
   if($SITE['WXsoftware'] == 'CU' and isset($SITE['realtimefile'])) {
      do_check($SITE['WXsoftwareLongName']." ".langtransstr("realtime"),"$realtimeinterval seconds",$SITE['realtimefile'],$realtimeinterval+15,'file');  // Default 15 seconds - change to realtime updates time + a bit for tansmission variances
   }
I'm sure Ken looks at what people are doing with their sites when he come to make changes and would include those changes that he thinks would have broad appeal. In the meantime you can change your scripts to suit your own preferences.
Post Reply