Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

PHP Web 'viewer' for Cumulus NOAA Style reports

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

Moderator: daj

stewart45
Posts: 14
Joined: Thu 17 Jan 2013 5:13 pm
Weather Station: Davis VP2 wireless Pro
Operating System: win7
Location: skelton-in-cleveland
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by stewart45 » Wed 25 Sep 2013 3:00 pm

Think you might be right there, will have a look at " include"

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Sat 05 Apr 2014 8:55 am

Hi everybody,

I have a some kind of unusually problem here. I manually save my noaa reports as utf 8 and upload it on server. When I open files in mozilla i can not see degree sign and some other signs (š, ž .....) These signs "appears" normally everywhere (on my pc a.g) except from my server.

http://www.vrijemeusibeniku.com/weather ... 2014&mo=02


Any help?

Thanks!
Image

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by steve » Sat 05 Apr 2014 9:29 am

I think the problem is that your 'viewer' page is not UTF-8

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

If you view the files directly, they display OK, e.g. http://www.vrijemeusibeniku.com/weather ... MO0114.txt
Steve

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Sat 05 Apr 2014 9:35 am

Thanks Steve,

I figure out that. Everything seems ok when I changed the mozilla encoding from some western to utf 8, but when I refresh page the western encoding comes back again....
Image

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by beteljuice » Sat 05 Apr 2014 10:19 am

Aha ... an old 'hangover' !

You are using the page as a stand-alone rather than included in a site template and you have 'foreign' characters.

You need to change this line in the code:

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
// should be
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Image
......................Imagine, what you will KNOW tomorrow !

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Sat 05 Apr 2014 10:22 am

...similar problem:
http://forums.mozillazine.org/viewtopic ... 7&t=683425

and also one bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=158285

What should I do now Steve?.....any suggestion?
Image

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Sat 05 Apr 2014 10:31 am

Well done beteljuice!!

It works!

Thanks.............
Image

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Sun 04 May 2014 6:58 pm

Hi!

Have one problem with Noaa reports....
My NOAA reports were working well until the beginning of this month. Now I have the situation that on the Cumulus PC NOAA report for May works ok, also in the annual summary for this month on web server (Internet).... but the monthly file on the server is empty.....?

http://www.vrijemeusibeniku.com/weather ... 2014&mo=05

I did not touch anything....

Somebody, please?
Image

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by steve » Sun 04 May 2014 7:55 pm

This isn't anything to do with the viewer, a new thread would have been better. The file should get uploaded every night, just after midnight. Has it been the same every day this month, or is today the first day that it's been empty? If it's OK on your PC, then presumably there was some kind of ftp error last night. It may get uploaded correctly tonight.
Steve

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Sun 04 May 2014 8:17 pm

I'm not sure but I think this is happening since the beginning of the month ...
I have no idea why this happened. It is difficult to assume that every night occurs the same ftp error .... or not?
Image

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by steve » Sun 04 May 2014 10:12 pm

The only way to find out is to do the same thing as for any possible ftp problem - turn on ftp logging.
Steve

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by mm23 » Mon 05 May 2014 6:26 am

Steve,

It was too late last night for what you suggestion, and now it seems that everything is okay. By the way, what time NOAAH files uploaded? I guess it depends on the Web update interval?
I'll follow it and see how things regarding NOAAH files will develop further.........

Thanks for help....
Image

User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by steve » Mon 05 May 2014 6:39 am

mm23 wrote:By the way, what time NOAAH files uploaded? I guess it depends on the Web update interval?
On the next upload, as it says in the help.
Steve

User avatar
duke
Posts: 840
Joined: Sun 03 Jul 2011 6:23 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 - 64 bit
Location: Eastleigh, Hampshire, UK
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by duke » Sun 07 Dec 2014 11:03 am

@beteljuice

I have changed my NOAA page to show the full menu and it has thrown up the strange black diamond error again even though I added your 'Nasty work_around' (your words not mine) when you suggested way back in 'this post'.

Code: Select all

// Replace following code to prevent degree symbol being replaced with black diamond symbol
//
// if($rpt){
//	echo "<pre>\n";
//	echo preg_replace('|<|Uis','<',$rpt);
//	echo "</pre>\n";
//}
//echo "</div> <!-- END noaa_rep_container -->\n";

if($rpt){

// NASTY work-around, the ONLY way I find black diamond question mark (or deg character)
   $checkIt = explode("(", $rpt);
   $dodgy = substr($checkIt[1],0 , 1);

// the ONLY way I can replace when black diamond (unconditionally) to &deg
   $rpt = str_replace($dodgy,'&deg;',$rpt);
// END nasty work around


   echo "<pre>\n";
   echo preg_replace('|<|Uis','<',$rpt);
   echo "</pre>\n";
}
echo "</div> <!-- END noaa_rep_container -->\n";
What's different this time is that the black diamond only shows for the current year and not past years. You can take a look 'here'

Any suggestions? Note, I am using this in a page declared as html & UTF-8

EDIT: I have just discovered that this only applies to reports generated from September 2013 onward which happens to coincide with Steves release of 'Cumulus 1.9.4 (build 1085) ' which has the option for UTF-8 encoding - which I do. Although I do not see any difference in the reports when viewed in notepad++.
Duke

Nightingale Weather
Eastleigh, Hampshire, UK
------------------------------------------------------
Validate your pages - often!

User avatar
duke
Posts: 840
Joined: Sun 03 Jul 2011 6:23 pm
Weather Station: Davis VP2 Plus - 24hr FARS
Operating System: Windows 10 - 64 bit
Location: Eastleigh, Hampshire, UK
Contact:

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Post by duke » Sun 07 Dec 2014 11:28 am

OK, I put fingers to keyboard too soon. Removing your work-around and saving the older reports as UTF-8 resolves this issue.
Duke

Nightingale Weather
Eastleigh, Hampshire, UK
------------------------------------------------------
Validate your pages - often!

Post Reply