Page 2 of 4
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 11:07 am
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.
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 11:22 am
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
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 12:08 pm
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...

Re: Error in testtags.php
Posted: Sat 08 Oct 2011 12:20 pm
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...
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 12:25 pm
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

Re: Error in testtags.php
Posted: Sat 08 Oct 2011 12:28 pm
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)
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 12:38 pm
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...
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:08 pm
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.
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:10 pm
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

Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:19 pm
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

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?
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:25 pm
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.
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:34 pm
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:|:

Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:42 pm
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

Re: Error in testtags.php
Posted: Sat 08 Oct 2011 1:57 pm
by WX_Frank
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:
Re: Error in testtags.php
Posted: Sat 08 Oct 2011 6:19 pm
by WX_Frank
Just found
this site who got similar errors like mine, but with correct date & year
http://www.tiempoensevilla.es/index.php?sce=view
I will study some more, but really hope anyone got some new ideas?