Page 1 of 1

$Sharedir Error in wxgraphs.php

Posted: Thu Jan 11, 2018 11:10 pm
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?

Re: $Sharedir Error in wxgraphs.php

Posted: Fri Jan 12, 2018 12:18 am
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).

Re: $Sharedir Error in wxgraphs.php

Posted: Fri Jan 12, 2018 5:05 am
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.

Re: $Sharedir Error in wxgraphs.php

Posted: Fri Jan 12, 2018 5:31 am
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: viewtopic.php?f=27&t=13189

And viewtopic.php?t=14163#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.

Re: $Sharedir Error in wxgraphs.php

Posted: Fri Jan 12, 2018 5:35 am
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.

Re: $Sharedir Error in wxgraphs.php

Posted: Fri Jan 12, 2018 1:34 pm
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).