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

Error in testtags.php

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

WX_Frank
Posts: 82
Joined: Sun 24 Jul 2011 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Win7
Location: Torrevieja/Spain
Contact:

Re: Error in testtags.php

Post by WX_Frank »

nitrx wrote:I'm not sure but in your ajaxCUwx.js the

Code: Select all

var decimalComma = false;    // =false for '.' as decimal point, =true for ',' (comma) as decimal point
is set to false maybe you have to set this to true because youre decimalseparator is a comma ?

I've set this to true (this setting isn't documented :? )
Hi Ron, and glad to see you're back :)

I tried with '=true', in the 'ajaxCUwx.js' but no luck....and regarding the 'wxindex.php' errors ..I really need help, because I can't figure this out :(
I notice on the guide http://saratoga-weather.org/wxtemplates ... -World.php for the 'settings.php' (# Sitewide configuration - Station location, identity and date/time info) it says:

Code: Select all

$SITE['timeFormat'] = 'd/m/Y H:i';       // Euro format 31/03/2006 14:03
// $SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03

// $SITE['timeOnlyFormat'] = 'g:ia';          // USA format h:mm[am|pm\
$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'd/m/Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
..here it used dashes on 'd/m/y', but in my settings.php' it got 'd-m-y'

Code: Select all

$SITE['timeFormat'] = 'd-m-Y H:i';       // Euro format 31/03/2006 14:03
// $SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03

// $SITE['timeOnlyFormat'] = 'g:ia';          // USA format h:mm[am|pm\
$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'd-m-Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format 
...and what's the; 'j/n/Y' for Euro format??

I'm really stuck right now, and been up all night trying to solve this :|

Cheers,
Frank.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Error in testtags.php

Post by nitrx »

Hmmz I really don't know (I saw the dayname lorstag is used on your site that's danish for saturday but this should have no influence maybe you can try my settings for the time and date,

Code: Select all

$SITE['tz'] 			= 'Europe/Brussels'; //NOTE: this *MUST* be set correctly to
// translate UTC times to your LOCAL time for the displays.
//  http://us.php.net/manual/en/timezones.php  has the list of timezone names
//  pick the one that is closest to your location and put in $SITE['tz'] like:
//    $SITE['tz'] = 'America/Los_Angeles';  // or
//    $SITE['tz'] = 'Europe/Brussels';
// note: date format used for PHP parts only.  Weather software dates are not processed
// except on the astronomy page
// $SITE['timeFormat'] = 'D, d-M-Y g:ia T';  // Day, 31-Mar-2006 6:35pm Tz  (USA Style)
// $SITE['timeFormat'] = 'm/d/Y g:ia';      // USA  format 03/31/2006 14:03
$SITE['timeFormat'] = 'd-m-Y H:i';       // Euro format 31/03/2006 14:03
// $SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03

// $SITE['timeOnlyFormat'] = 'g:ia';          // USA format h:mm[am|pm\
$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'd-m-Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
Thats the last thing I can do for you otherwise you have to ask in the other sticky thread made by Ken https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=4561 because I'm not sure he is reading all in this forum
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Error in testtags.php

Post by gemini06720 »

Frank, you do not have to remove the file uploaded by Cumulus until you are ready.

What I would have suggested (before you started installing the 'PHP/AJAX Website Template Set') would have been to create a new directory, such as 'weather' for example, and install all the files from the 'World Template .ZIP' file and from the 'cumulus.ZIP' file into that new directory - although many will tell you that it is OK to install all your files into the 'root' directory of a hosting server, many users (in other forums) have received threatening messages from their hosting providers requesting they reduce the number of files into the 'root' directory of their server...

Installing files into a sub-directory of the 'root' directory (such as the 'weather' sub-directory mentioned above) causes no problem for the server nor for the hosting provider.

Having all your files into a sub-directory allows you to work on your new web pages (edit/change/modify) without causing any problem to the 'default' pages (such as accidently deleting a required file) and without service interruption - your user will be able to access the 'default' pages until you are satisfied with the new pages.

As you wrote, you should make no change to Cumulus until you are ready to change-over to the new pages. Could you post a list of the files Cumulus is producing - a 'limited size' screenshot of the tab where files-to-be-uploaded are entered ==> on the Cumulus main screen, click on the 'Configuration' pull-down menu and select the 'Internet' option; on the newly opened 'Internet Settings' window, click on the 'Files' tab; a screenshot of that window would be useful.

Now to the date problem... What date format are you using on your computer (example please).

I have looked at some files on your host server (such as 'realtime.txt' and 'CUtags.php') and I now know the 'dot' (such as dd.mm.yyyy) is being used as a separator for the dates produced by Cumulus ... not familiar... :(

I looked into the the 'ajax-dashboard.php' script (which is used to display much of the weather data on the main page) and I could not find any 'translation' function for the 'dot' date format (as used in your files) - it seems the script was designed to use either the 'slash' (such as dd/mm/yyyy) or the 'dash' (such as dd-mm-yyyy) as the date separator and NOT the 'dot' format (such as dd.mm.yyyy).

After much searching, I found a location into one of the script that seems to accept the date with the 'dot' as a separator but when I modify my 'CUtags.php' file and replace my date format (08/10/2011) with your date format (08.10.2011) I end up with the wrong date on the main page... Two Cumulus tags (date and update) are produced by Cumulus with the 'dot' as a separator but are not converted by the PHP script ... so, it seems there might be (is) a problem with one of the date functions inside the script... :evil:
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Error in testtags.php

Post by gemini06720 »

Ron, the 'decimalComma' (to replace a comma with a decimal point) was one of the first thing I checked, but that only applies to values such as temperatures, etc.

The 'decimalComma' could not be used for the date...
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Error in testtags.php

Post by nitrx »

Ray why does somebody thanks Ken for solving the problem of the date poblem with the points https://cumulus.hosiene.co.uk/viewtopic.p ... &start=460 ? But I also can't find any code handling this :roll:
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Error in testtags.php

Post by nitrx »

gemini06720 wrote:Ron, the 'decimalComma' (to replace a comma with a decimal point) was one of the first thing I checked, but that only applies to values such as temperatures, etc.

The 'decimalComma' could not be used for the date...
Yes you are right but I had the same problems as Frank has when I set up my site at first the year stuck on 1999 and the month on december (12)
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Error in testtags.php

Post by gemini06720 »

OK, I think I have 'isolated' the problem... As I mentioned in a previous message, it appears that only two tag (or variables) are not being processed by the script, the '$date/$WX['date']' and the '$update/$WX['update']' as they are expected to be using either the 'slash' or the 'dash' as separators...

Ron, if you had the same problem as Frank is encountering, how did you correct it - I have been editing the script in many ways and I cannot correct the date error ... as long as I use the 'dot' as a separator, the update date is wrong...
WX_Frank
Posts: 82
Joined: Sun 24 Jul 2011 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Win7
Location: Torrevieja/Spain
Contact:

Re: Error in testtags.php

Post by WX_Frank »

nitrx wrote:Hmmz I really don't know (I saw the dayname lorstag is used on your site that's danish for saturday but this should have no influence maybe you can try my settings for the time and date,

Code: Select all

$SITE['tz'] 			= 'Europe/Brussels'; //NOTE: this *MUST* be set correctly to
// translate UTC times to your LOCAL time for the displays.
//  http://us.php.net/manual/en/timezones.php  has the list of timezone names
//  pick the one that is closest to your location and put in $SITE['tz'] like:
//    $SITE['tz'] = 'America/Los_Angeles';  // or
//    $SITE['tz'] = 'Europe/Brussels';
// note: date format used for PHP parts only.  Weather software dates are not processed
// except on the astronomy page
// $SITE['timeFormat'] = 'D, d-M-Y g:ia T';  // Day, 31-Mar-2006 6:35pm Tz  (USA Style)
// $SITE['timeFormat'] = 'm/d/Y g:ia';      // USA  format 03/31/2006 14:03
$SITE['timeFormat'] = 'd-m-Y H:i';       // Euro format 31/03/2006 14:03
// $SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03

// $SITE['timeOnlyFormat'] = 'g:ia';          // USA format h:mm[am|pm\
$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'd-m-Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format
Thats the last thing I can do for you otherwise you have to ask in the other sticky thread made by Ken https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=4561 because I'm not sure he is reading all in this forum
Tried this Ron, but still no luck.
Curious like Ray how you fixed the same problem, Ron?

Frank.
Last edited by WX_Frank on Sat 08 Oct 2011 1:11 pm, edited 1 time in total.
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Error in testtags.php

Post by nitrx »

Well I can't remember :| but there is some date formatting in the ajaxCUwx.js

Code: Select all

// current date and time of observation in realtime.txt
		var ajaxtimeformat = realtime[1];
		var ajaxdateraw = realtime[0]; // comes in dd/mm/yyyy format
		var tdate = ajaxdateraw.split("/");
		if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
		var ajaxdateformat = tdate[1]+"/"+tdate[0]+"/"+tdate[2];
        if(!showDateMDY) { ajaxdateformat = tdate[0]+"/"+tdate[1]+"/"+tdate[2];  }
		set_ajax_obs("ajaxdatetime",ajaxdateformat + " " +ajaxtimeformat);
		set_ajax_obs("ajaxdate",ajaxdateformat);
		set_ajax_obs("ajaxtime",ajaxtimeformat);
		set_ajax_obs("gizmodate",ajaxdateformat);
		set_ajax_obs("gizmotime",ajaxtimeformat);
maybe

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
should be changed in

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("."); }
but I'm a noob in this script :D
WX_Frank
Posts: 82
Joined: Sun 24 Jul 2011 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Win7
Location: Torrevieja/Spain
Contact:

Re: Error in testtags.php

Post by WX_Frank »

nitrx wrote:Well I can't remember :| but there is some date formatting in the ajaxCUwx.js

Code: Select all

// current date and time of observation in realtime.txt
		var ajaxtimeformat = realtime[1];
		var ajaxdateraw = realtime[0]; // comes in dd/mm/yyyy format
		var tdate = ajaxdateraw.split("/");
		if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
		var ajaxdateformat = tdate[1]+"/"+tdate[0]+"/"+tdate[2];
        if(!showDateMDY) { ajaxdateformat = tdate[0]+"/"+tdate[1]+"/"+tdate[2];  }
		set_ajax_obs("ajaxdatetime",ajaxdateformat + " " +ajaxtimeformat);
		set_ajax_obs("ajaxdate",ajaxdateformat);
		set_ajax_obs("ajaxtime",ajaxtimeformat);
		set_ajax_obs("gizmodate",ajaxdateformat);
		set_ajax_obs("gizmotime",ajaxtimeformat);
maybe

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("-"); }
should be changed in

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("."); }
but I'm a noob in this script :D
I tried to change to

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("."); }
..as you had done, but no joy :(
But with these changes, shouldn't changes be done in other places to make it right/work?
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Error in testtags.php

Post by nitrx »


I tried to change to

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("."); }
..as you had done, but no joy :(
But with these changes, shouldn't changes be done in other places to make it right/work?
I just looked up this page http://www.okroglovreme.com/ ad viewed the source of the ajaxsript and it definitely uses the code as I mentioned I've an older javascript bit you couldt try to look at the source of te script and copy it I think this station has the same settings as yours.
WX_Frank
Posts: 82
Joined: Sun 24 Jul 2011 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Win7
Location: Torrevieja/Spain
Contact:

Re: Error in testtags.php

Post by WX_Frank »

nitrx wrote:

I tried to change to

Code: Select all

if(typeof(tdate[2])=='undefined') {tdate = ajaxdateraw.split("."); }
..as you had done, but no joy :(
But with these changes, shouldn't changes be done in other places to make it right/work?
I just looked up this page http://www.okroglovreme.com/ ad viewed the source of the ajaxsript and it definitely uses the code as I mentioned I've an older javascript bit you couldt try to look at the source of te script and copy it I think this station has the same settings as yours.
OK, thanks Ron..I'll check it out and do some testing.
In the 'CUtags.php' it says:

Code: Select all

$rawdatalines = <<<END_OF_RAW_DATA_LINES
date|1/27/2011|// The current date:|:
time|09:15 on 27 January 2011|// The current time and date. Example result: 18:30 on 30 December 2009.  If you simply wish the time, use a combination of the day, month, year tags (below):|:
Here it shows the mm/dd/yy (date|1/27/2011|// The current date:|:)
Is this right for my settings?
I was thinking like: date|27/1/2011|// The current date:|:
:?
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: Error in testtags.php

Post by nitrx »

no i don't think so your cutags show the 'right' output on te server http://www.torrevieja-weather.net/CUtags.php?sce=dump if the former solution won't work you have to wait untill Ken wakes up :bash:
WX_Frank
Posts: 82
Joined: Sun 24 Jul 2011 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Win7
Location: Torrevieja/Spain
Contact:

Re: Error in testtags.php

Post by WX_Frank »

nitrx wrote:no i don't think so your cutags show the 'right' output on te server http://www.torrevieja-weather.net/CUtags.php?sce=dump if the former solution won't work you have to wait untill Ken wakes up :bash:
OK...I put my orginal 'CUtags' back on my server, and hope Ken can figure this out...phu :?

Ray: here is a couple of screen dump you ask for:
You do not have the required permissions to view the files attached to this post.
WX_Frank
Posts: 82
Joined: Sun 24 Jul 2011 9:12 am
Weather Station: Davis Vantage Vue
Operating System: Win7
Location: Torrevieja/Spain
Contact:

Re: Error in testtags.php

Post by WX_Frank »

Just found this site who got similar errors like mine, but with correct date & year :roll:
http://www.tiempoensevilla.es/index.php?sce=view

I will study some more, but really hope anyone got some new ideas?
Post Reply