Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

$Sharedir Error in wxgraphs.php

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
acatalano
Posts: 92
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

$Sharedir Error in wxgraphs.php

Post by acatalano »

Yesterday wxgraphs.php was working fine and this evening not at all. I have been adding video files to my website, and pages on which they are viewed. Because there are many, I had been trying to better organize the pages by grouping the php files regarding the animal videos together. This led to a " learning experience " in the definition of file paths in php which was unsuccessful. I did not mess with the $Sharedir variable directly, but somehow in the process I fear I have messed it up so that wxgraphs displays no data, although the menu buttons still display. The specific errors displayed on the page are:

Code: Select all

Notice: Undefined variable: sharedir in /home/www/boulderwx.com/wxgraphs.php on line 133

Warning: include_once(sunhrdata.php): failed to open stream: No such file or directory in /home/www/boulderwx.com/wxgraphs.php on line 133

Warning: include_once(): Failed opening 'sunhrdata.php' for inclusion (include_path='.:/usr/local/php5.6/lib/php') in /home/www/boulderwx.com/wxgraphs.php on line 133
Any ideas as to the problem?
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: $Sharedir Error in wxgraphs.php

Post by saratogaWX »

Your wxgraphs.php is not the stock one from the template set.
I see (via a view-source ) of wxgraphs.php
<!-- <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> -->
<!-- Local JQuery library, do not use if your containing page already pulls in a copy of JQuery -->
<!-- <script src="scripts/jquery-1.8.2.min.js"></script> -->
<script src=<br />
<b>Notice</b>: Undefined variable: sharedir in <b>/home/www/boulderwx.com/wxgraphs.php</b> on line <b>119</b><br />
lib/jquery/jquery-latest.min.js></script>
<script src=<br />
<b>Notice</b>: Undefined variable: sharedir in <b>/home/www/boulderwx.com/wxgraphs.php</b> on line <b>120</b><br />
lib/highstock/js/highstock.js></script>
<script src=<br />
<b>Notice</b>: Undefined variable: sharedir in <b>/home/www/boulderwx.com/wxgraphs.php</b> on line <b>121</b><br />
lib/highstock/js/themes/grid.js></script>
<script src=<br />
<b>Notice</b>: Undefined variable: sharedir in <b>/home/www/boulderwx.com/wxgraphs.php</b> on line <b>122</b><br />
js/cumuluscharts.js></script>
so there's likely a missing

$sharedir = './scripts/';

statement in the PHP of wxgraphs.php that is causing the Notice errata (and the page to fail).
acatalano
Posts: 92
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

Re: $Sharedir Error in wxgraphs.php

Post by acatalano »

Perhaps I'm downloading the wrong version of the Templates. I downloaded them from https://saratoga-weather.org/wxtemplates/install.php just now to check out the wxgraphs.php file using notepad++. A search within the file did not find any $Sharedir or $Sharedir = '/scripts/' in the file whose latest date /Version is:
//Version 1.04 - 16-Feb-2013 - added Cumulus solar/uv graph displays

It seems like I am getting an old wxgraph.php (and probably others as well). Would you please post a link to the latest set?

I did find another wxgraphs.php but that one appears to be intended for Cumulus, not CumulusMX as it is looking for many png files.
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: $Sharedir Error in wxgraphs.php

Post by saratogaWX »

The current Saratoga template plugin for Cumulus only has wxgraphs.php for the Cumulus V1.x, not for CumulusMX.

There is a thread on this forum where Mark Crossley has created scripts for server-based graphs for CumulusMX..
See: https://cumulus.hosiene.co.uk/viewtopic.php?f=27&t=13189

And https://cumulus.hosiene.co.uk/viewtopic.p ... 63#p111210 this thread which seems to have your wxgraphs.php script with $sharedir in it...

I've not included that function in the stock Cumulus plugin as yet... sorry.
acatalano
Posts: 92
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

Re: $Sharedir Error in wxgraphs.php

Post by acatalano »

I found the 1.04 version of wxgraphs and installed it. check fetch times shows wxgraphs is up to date. However going to the page indicates that it is looking for many png files in the ./image directory. I have none of these and thought they were associated with the non-MX version of Cumulus. See below.

Code: Select all

Weather Trend Graphs

Graphs generated by Cumulus (3.0.0-b3043)
Temperature / Humidity
./images/temp.png not found.
./images/hum.png not found.
Wind / Barometer
./images/wind.png not found.
./images/windd.png not found.
./images/press.png not found.
Rain
./images/raint.png not found.
./images/rain.png not found. 
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965
acatalano
Posts: 92
Joined: Tue 16 Jun 2015 2:07 pm
Weather Station: Davis VP2
Operating System: Raspian, Win7 Pro
Location: Boulder, CO
Contact:

Re: $Sharedir Error in wxgraphs.php

Post by acatalano »

Well that explains it! What's odd is I had the graphs displaying 2 days ago and took it for granted it worked with CumulusMX. The website started out with the Cumulus supplied pages, so perhaps that has/had something to do with the appearance of the graphs (briefly).
Best Regards,
Anthony Catalano
Boulder, Colorado, USA
Webcam & Weather at:
http://www.boulderwx.com, http://www.apcat.org, http://www.boulderweather.org
Blitzortung Lightning Detector Station 1965
Post Reply