Sandaysoft

Support forum for Cumulus weather station software
It is currently Mon May 20, 2013 4:12 pm
Please click here before posting. Help me to help you!
Useful Links: Cumulus FAQ • Enhancement requests • Wiki (documentation)
Please put your approximate location into your profile
Add your web site to the Cumulus user map
Vantage Pro2 users with firmware 3.00 should upgrade to fw 3.12 and Cumulus 1.9.4

All times are UTC




Post new topic Reply to topic  [ 145 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next
Author Message
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Tue Dec 13, 2011 11:22 pm 
Offline

Joined: Wed May 06, 2009 6:29 pm
Posts: 1708
Location: Cheadle Hulme, Cheshire, England
Weather Station: Davis VP2 with Daytime FARS
Operating System: Windows XP SP3
It's all a bit beyond me I'm afraid. Hopefully beteljuice will be along to help out. :)

_________________
Cheers,
Ray, Cheshire.

Image


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Tue Dec 13, 2011 11:55 pm 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
I've had one other person report this problem.

It seems to be a permissions thing where the directory won't allow the noaarep.css file to be written.

Copy this lot as noaarep.css and upload it to your site.
Code:
/* default stylesheet for NOAA Style Reports ala beteljuice */
/* overall container */
.noaa_rep_container {
    font-family: courier new, courier, monospace;
    width: 635px;
    margin: 0 auto;
}

.noaa_rep_container a, .noaa_rep_container a:link, .noaa_rep_container a:visited, .noaa_rep_container a:hover, .noaa_rep_container a:active {
    color: #000000;
    text-decoration: none;
    background-color: white;
}


/* container for nav buttons */
.noaa_rep_nav_container {
    font-family: lucida console, courier new, courier, monospace;
    font-size: 8pt;
    font-weight: bold;
    text-align: left;
    line-height: 2.2;
    text-align: center;
}


/* the nav buttons themselves */
.noaa_rep_nav {
    text-align: left;
    border: 1px solid #000000;
    border-radius: 10px 10px 10px 10px; /* NOT IE8 and below */
    padding: 2px 5px 2px 5px;
    color: #808080;   
    background-color: #DDDDDD;
    font-weight: bold;
}

/* modified year button when used with expand - collapse (same as above but 'flattened' left-hand side) */
.noaa_rep_nav_alt {
    text-align: left;
    border: 1px solid #000000;
    border-radius: 0px 10px 10px 0px; /* NOT IE8 and below */
    padding: 2px 5px 2px 5px;
    color: #808080;
    background-color: #DDDDDD;
    font-weight: bold;
}

/* expand - collapse button (single line) */
.noaa_expand {
    color: #000000;
    border-radius: 10px 0px 0px 10px; /* NOT IE8 and below */
    background-color: #DDC81D; /* dirty yellow */
    cursor: pointer;
}

/* expand - collapse button (full menu) */
.noaa_expand_alt {
    color: #808080;
    border-radius: 10px 10px 10px 10px; /* NOT IE8 and below */
    background-color: #DDC81D; /* dirty yellow */
    cursor: pointer;
    visibility: hidden;
}

/* nav button hover color - NOT IE8 and below */
a.noaa_rep_nav:hover {
    box-shadow: 0 0 7px #007EBF;
}

/* nav button hover color - NOT IE8 and below */
a.noaa_rep_nav_alt:hover {
    box-shadow: 0 0 7px #007EBF;
}

/* highlight selected year or month button - NOT IE8 and below */
.noaa_selected {
    box-shadow: 0 0 7px #FF0000; /* red */
}

/* highlight selected year line */
.noaa_selected_line {
    background-color: #FFFF00; /* yellow */
}


/* container for the actual report file */
.noaa_rep_container pre {
    color: #000000;
    font-family: monospace;
    font-size: 9pt;
    font-weight: normal;
    text-align: left;
    border: 1px solid #000000;
    border-radius: 10px 10px 10px 10px; /* NOT IE8 and below */
    padding: 20px 0px 25px 20px;
    background-color: #f9f8EB;
}

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Wed Dec 14, 2011 12:11 am 
Offline
User avatar

Joined: Wed Sep 10, 2008 2:15 pm
Posts: 385
Location: Gilleleje, Denmark
Weather Station: Rosenborg 68700
Operating System: Win7 Ult. 32-bit
Thanks beteljuice.
Your noaarep.css did the trick.
(Suggest you include it in your package - alternatively write a note telling other persons about the problem)

_________________
Ib http://www.ibtest.dk/vejr/


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Wed Dec 14, 2011 12:56 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
It is actually within the script ;) - but for some set ups won't come out to play :lol:

As for the note ........

........ we just wrote it :clap:

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Wed Jan 11, 2012 5:26 pm 
Offline

Joined: Fri Dec 09, 2011 5:16 pm
Posts: 61
Location: East TN, USA
Weather Station: LaCrosse 2315
Operating System: Windows XP SP3
Thank You. That copy did it for me to. Now I can link to them. :)

One question though. Is there one where all years and months show without having the drop down option to click on? I mean go to the php page and there is everything laid out?


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Wed Jan 11, 2012 5:32 pm 
Offline

Joined: Fri Dec 09, 2011 5:16 pm
Posts: 61
Location: East TN, USA
Weather Station: LaCrosse 2315
Operating System: Windows XP SP3
Nevermind, I found out how to do it. It is an option in the php file of simply changing a false to a true. :)


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Jan 29, 2012 1:54 pm 
Offline

Joined: Fri May 21, 2010 5:47 pm
Posts: 20
Location: Kvistgård Danmark
Weather Station: Davis VP2
Operating System: Windows 7
I get this error report from my server: Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'TZ' - it's not in the allowed list in /home/virtual/kvistgaardvejr.dk/public_html/NOAA-reports.php on line 160. If I comment out line 160 the report disappears and it seems that it´s working allright.

_________________
Kenneth
http://www.kvistgaardvejr.dk/


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Jan 29, 2012 8:47 pm 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
Kenneth, in the PHP script 'NOAA-reports.php', have you entered the appropriate time zone information into the variable '$ourTZ' (line 24)?

Line 160 should have been written differently to make it compatible with both PHP4 and PHP5 - as used in many of Ken True's PHP scripts:
Code:
# Set timezone in PHP5/PHP4 manner
if (!function_exists('date_default_timezone_set')) {
  putenv("TZ=$ourTZ");
} else {
  date_default_timezone_set("$ourTZ");
}
There is also the possibility that you hosting server does not allow you to change the setting of the default time zone... :(


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Mon Jan 30, 2012 12:23 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
From earlier in the thread:
mcrossley wrote:
Oh, and the putenv error? I run in Safe Mode, so
Quote:
In Safe Mode, the user may only alter environment variables whose names begin with the prefixes supplied by this directive. By default, users will only be able to set environment variables that begin with PHP_
http://php.net/manual/en/function.putenv.php
The time / date correction is not actually used by Cumulus so it is 'safe' to comment it out. ;)
Code:
$PHP_SELF = $_SERVER['PHP_SELF'];
// putenv("TZ=$ourTZ");
$now = getdate();

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Mon Jan 30, 2012 6:30 pm 
Offline

Joined: Fri May 21, 2010 5:47 pm
Posts: 20
Location: Kvistgård Danmark
Weather Station: Davis VP2
Operating System: Windows 7
gemini06720 wrote:
Kenneth, in the PHP script 'NOAA-reports.php', have you entered the appropriate time zone information into the variable '$ourTZ' (line 24)?


Yes: 'Europe/Copenhagen', as mentioned in http://php.net/manual/en/timezones.php. Does this mean that the NOAA reports are generated t. minus 1 hour, due to the fact that i live in UTC + 1 timezone?
gemini06720 wrote:
Line 160 should have been written differently to make it compatible with both PHP4 and PHP5 - as used in many of Ken True's PHP scripts:
Code:
# Set timezone in PHP5/PHP4 manner
if (!function_exists('date_default_timezone_set')) {
  putenv("TZ=$ourTZ");
} else {
  date_default_timezone_set("$ourTZ");
}


Ray: do you mean that by changing line 160 to the code above it should work?
gemini06720 wrote:
There is also the possibility that you hosting server does not allow you to change the setting of the default time zone... :(


Sad but true :(

_________________
Kenneth
http://www.kvistgaardvejr.dk/


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sat Feb 04, 2012 10:25 pm 
Offline

Joined: Sun Jan 15, 2012 10:27 pm
Posts: 6
Location: Oklahoma USA
Weather Station: WA1080PC
Operating System: Windows XP SP3
I have downloaded the file and made these changes:

if ($Naming == 'WL') {
$NOAAdir = 'http://littlerockfreewillbaptistchurch.com/Weather/noaa/'; // point to your NOAA file sub-directry
$ThisYearFile = "http://littlerockfreewillbaptistchurch.com/Weather/noaa/NOAAYR2012.txt"; // point to your current NOAA yearly file
$ThisMonthFile= "http://littlerockfreewillbaptistchurch.com/Weather/noaa/NOAAMO0212.txt"; // point to your current NOAA monthly file
// $LastYearFile = "http://littlerockfreewillbaptistchurch.com/Weather/noaa/NOAAPRYR.txt"; // point to your prior NOAA yearly file
$LastMonthFile= "http://littlerockfreewillbaptistchurch.com/Weather/noaa/NOAAMO0112.txt"; // point to your prior NOAA monthly file
}
if ($Naming == 'VWS') {
$NOAAdir = 'http://littlerockfreewillbaptistchurch.com/Weather/noaa/'; // point to your NOAA file sub-directry
$ThisYearFile = "$NOAAdir/NOAAYR2012.txt"; // point to your current NOAA yearly file
$ThisMonthFile= "$NOAAdir/NOAAMO0212.txt"; // point to your current NOAA monthly file
}
if ($Naming == 'CU') {
$NOAAdir = 'http://littlerockfreewillbaptistchurch.com/Weather/noaa/'; // point to your NOAA file sub-directry

I get he page header NOAA-Style Reports but that is all I get.........can you tell me what I am doing wrong? I commented out the Pryor year as I do not have any yet.

Thanks

_________________
Slim
Woodland Junction East of Locust Grove, Oklahoma USA
http://littlerockfreewillbaptistchurch.com/Weather/index.htm


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sat Feb 04, 2012 10:38 pm 
Offline

Joined: Mon Aug 10, 2009 10:16 pm
Posts: 1797
Location: World...
Weather Station: No weather station
Operating System: No operating system
Slim, you might want to change the following link from:
Code:
http://littlerockfreewillbaptistchurch.com/Weather/noaa/
to
Code:
./noaa
-- the code is not designed to read the data from a URL but from a local directory. ;)


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sat Feb 04, 2012 11:28 pm 
Offline

Joined: Sun Jan 15, 2012 10:27 pm
Posts: 6
Location: Oklahoma USA
Weather Station: WA1080PC
Operating System: Windows XP SP3
I made the changes and still get the same thing.

My php file is being run from: http://littlerockfreewillbaptistchurch. ... eports.php

The data files are in: http://littlerockfreewillbaptistchurch. ... ther/noaa/

I made the change to ./noaa/ as suggested and still just get the Page header.

_________________
Slim
Woodland Junction East of Locust Grove, Oklahoma USA
http://littlerockfreewillbaptistchurch.com/Weather/index.htm


Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Feb 05, 2012 1:10 am 
Offline
User avatar

Joined: Tue Dec 09, 2008 1:37 pm
Posts: 1846
Location: Dudley, West Midlands, UK
Weather Station: None !
Operating System: XP SP3
Your code:
Code:
if ($Naming == 'WL') {
  $NOAAdir = './noaa/'; // point to your NOAA file sub-directry
  $ThisYearFile = "./noaa/NOAAYR2012.txt"; // point to your current NOAA yearly file
  $ThisMonthFile= "./noaa/NOAAMO0212.txt"; // point to your current NOAA monthly file
//  $LastYearFile = "./noaa/NOAAPRYR.txt"; // point to your prior NOAA yearly file
  $LastMonthFile= "./noaa/NOAAMO0112.txt"; // point to your prior NOAA monthly file
}
if ($Naming == 'VWS') {
  $NOAAdir = './noaa/';      // point to your NOAA file sub-directry
  $ThisYearFile = "$NOAAdir/NOAAYR2012.txt"; // point to your current NOAA yearly file
  $ThisMonthFile= "$NOAAdir/NOAAMO0212.txt"; // point to your current NOAA monthly file
}
if ($Naming == 'CU') {
  $NOAAdir = './noaa/';      // point to your NOAA file sub-directry
//  NO current NOAA month or yearly files
}
You have changed the format and 'hard coded' the names of files for options you are not using (WL and VWS)
... but your problem is the trailing / to your reports directory. (Which is NOT what Ray put above)

So the code should be:
Code:
// *** Change below if your reports directory is different to the 'type' default ******************

if ($Naming == 'WL') {
  $NOAAdir = './NOAA-reports'; // point to your NOAA file sub-directry
  $ThisYearFile = "./NOAAYR.TXT"; // point to your current NOAA yearly file
  $ThisMonthFile= "./NOAAMO.TXT"; // point to your current NOAA monthly file
  $LastYearFile = "./NOAAPRYR.TXT"; // point to your prior NOAA yearly file
  $LastMonthFile= "./NOAAPRMO.TXT"; // point to your prior NOAA monthly file
}
if ($Naming == 'VWS') {
  $NOAAdir = './noaa';      // point to your NOAA file sub-directry
  $ThisYearFile = "$NOAAdir/noaayr.txt"; // point to your current NOAA yearly file
  $ThisMonthFile= "$NOAAdir/noaamo.txt"; // point to your current NOAA monthly file
}
if ($Naming == 'CU') {
  $NOAAdir = './noaa';      // point to your NOAA file sub-directry
//  NO current NOAA month or yearly files
}


Actually you've found a hiccough in the original script :)
If no suitable files are found an advisory is returned, but if the directory doesn't exist ......

_________________
Image
......................Imagine, what you will KNOW tomorrow !


Last edited by beteljuice on Sun Feb 05, 2012 12:53 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: PHP Web 'viewer' for Cumulus NOAA Style reports
PostPosted: Sun Feb 05, 2012 3:59 am 
Offline

Joined: Sun Jan 15, 2012 10:27 pm
Posts: 6
Location: Oklahoma USA
Weather Station: WA1080PC
Operating System: Windows XP SP3
Got it Thank you :D

_________________
Slim
Woodland Junction East of Locust Grove, Oklahoma USA
http://littlerockfreewillbaptistchurch.com/Weather/index.htm


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 145 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group