Page 2 of 2

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Fri 28 Jan 2011 4:20 pm
by saratogaWX
nitrx wrote:For some reason the graphs are not showing up :cry: still in progress http://www.apeldoorn.tk/weer/wxindex.php :D
I think it's my bad... try changing the code in wxgraphs.php from

Code: Select all

		print "<img src=\"$graphImageDir.$imagename\" alt=\"$alttext\" width=\"$width\" height=\"$height\" />\n";
to

Code: Select all

		print "<img src=\"$graphImageDir$imagename\" alt=\"$alttext\" width=\"$width\" height=\"$height\" />\n";
Best regards,
Ken

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Fri 28 Jan 2011 4:30 pm
by nitrx
Thanks thats the trick,

other issues asked on the wxforum ,

Thanks !
Ron

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Fri 28 Jan 2011 7:01 pm
by saratogaWX
Got some minor corrections that have cropped up based on issues discovered and reported:

You can download a fresh copy of the Base that you used for the install, and then replace the following pages in your installation with copies from the distribution .zip:


top.php
common.php
wxgraphs.php
wxlinks.php
wxastronomy.php


For the Base-USA folks, also replace:

get-nnvl-iod.php

For the Base-Canada folks, also replace:

ec-forecast.php

All those updates address Notice: messages when error_reporting(E_ALL) is enabled.

I also suggest you modify your current Settings.php to replace

Code: Select all

# Automatic Info we might need
############################################################################
$SITE['REMOTE_ADDR']	= $_SERVER['REMOTE_ADDR'];
$SITE['REMOTE_HOST']	= $_SERVER['REMOTE_HOST'];
$SITE['WEBROOT']		= $_SERVER['DOCUMENT_ROOT'];
$SITE['REQURI']			= $_SERVER['REQUEST_URI'];
$SITE['SERVERNAME']		= $_SERVER['SERVER_NAME'];
with

Code: Select all

# Automatic Info we might need
############################################################################
if(isset($_SERVER['REMOTE_ADDR']))   {$SITE['REMOTE_ADDR']	= $_SERVER['REMOTE_ADDR'];}
if(isset($_SERVER['REMOTE_HOST']))   {$SITE['REMOTE_HOST']	= $_SERVER['REMOTE_HOST'];}
if(isset($_SERVER['DOCUMENT_ROOT'])) {$SITE['WEBROOT']		= $_SERVER['DOCUMENT_ROOT'];}
if(isset($_SERVER['REQUEST_URI']))   {$SITE['REQURI']		= $_SERVER['REQUEST_URI'];}
if(isset($_SERVER['SERVER_NAME']))   {$SITE['SERVERNAME']	= $_SERVER['SERVER_NAME'];}
$SITE['PHPversion'] = phpversion();
which addresses some Notice: errata if your particular server doesn't propagate a particular server-side variable.

Best regards,
Ken

BTW.. the main thread for discussing the Beta of the templates is on WXforum.net at http://www.wxforum.net/index.php?topic=10342.new#new

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Fri 28 Jan 2011 7:33 pm
by gemini06720
Ken, I have stayed up late (much later than usual) and I have installed the canadian multilingual version running for the time being under Cumulus.

I have encountered a few script problems that I have corrected - I should have taken notes of the corrections and report them to you... :oops: ...but having work with similar templates before, it was easy to find my way through.

I am still having problems with the Environment Canada radar, but I understand that a modified script has been released - I had already adapted the Weather Display script for Environment Canada to my Cumulus pages and was about to use that script... :)

Just in case you have a few minutes, you could have a look at what I have done so far to the [link removed] pages. Just in case you are somewhat curious, here are my [link removed] pages.

I do not know whom has updated the french translation ... but the translation is quite poor ... english words cannot simply translated to their french equivalent, the context has to be taken into account. I know the french translations were originally made by Brian Ellis (and his wife Catrina Imhoof), and I did quite a bit of updating when I worked on the canadian bilingual templates, but some of the newer textes that have been added must have been translated by someone from the province of Ontario or Quebec... :evil:

OK, now that I have something going, I am going to take a few hour of sleep... :mrgreen:

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Tue 01 Feb 2011 7:53 pm
by n9mfk
Hi all,
I need some help
here the setup xampp on a windows pc
all page work except
wxgraphs.php


Server error.

The website encountered an error while retrieving http://192.168.1.4/wxgraphs.php. It may be down for maintenance or configured incorrectly.

Here are some suggestions:
Reload this web page later.
More information on this error
Below is the original error message

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Code: Select all

<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Canada/World-ML template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
# 	Copyright:	(c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
#	This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once("common.php");
############################################################################
$TITLE= $SITE['organ'] . " - " . langtransstr("Trend Graphs");
$showGizmo = true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>
</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
$graphImageDir = './';
if(isset($SITE['graphImageDir'])) {$graphImageDir = $SITE['graphImageDir']; }
?>

<div id="main-copy">
  
	<h1><?php langtrans('Weather Trend Graphs'); ?></h1>
    <?php if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] <> '') { // have software defined ?> 
    <p><?php print langtrans('Graphs generated by')." ".$SITE['WXsoftwareLongName']." "; ?>
	<?php if(isset($wdversion)) {echo " (".$wdversion.")";} ?></p>
    <?php } else { // software not defined yet ?>
    <p>&nbsp;</p>
    <p>Weather software not specified in configuration.</p>
    <?php } // end software not defined yet ?>
    
<?php if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] == 'WL') { // WeatherLink graph names ?>
    <h2><?php echo langtransstr('Temperature') . ' / ' . langtransstr('Humidity'); ?></h2>
	<?php genImageLink('OutsideTempHistory.gif','Temperature'); ?>
    <?php genImageLink('OutsideHumidityHistory.gif','Humidity'); ?>
    <br />
    <?php genImageLink('DewPointHistory.gif','Dew Point'); ?>
    <?php genImageLink('THWHistory.gif','THW Index'); ?>
    <br />
    <?php genImageLink('WindChillHistory.gif','Wind Chill'); ?>
    <?php genImageLink('HeatIndexHistory.gif','Heat Index'); ?>
    <br />
    <h2><?php echo langtransstr('Wind') . ' / ' . langtransstr('Barometer'); ?></h2>
    <?php genImageLink('WindSpeedHistory.gif','Wind Speed'); ?>
    <?php genImageLink('WindDirectionHistory.gif','Wind Direction'); ?>
    <br />
    <?php genImageLink('HiWindSpeedHistory.gif','High Wind Speed'); ?>
    <?php genImageLink('BarometerHistory.gif','Barometer'); ?>
    <br />
    <h2><?php langtrans('Rain'); ?></h2>
    <?php genImageLink('RainHistory.gif','Rain'); ?>
    <?php genImageLink('RainRateHistory.gif','Rain Rate'); ?>
    <br />
    <?php // figure out to display solar and/or UV based on site settings
	if($SITE['SOLAR'] and $SITE['UV']) { // have both sensors ?>
    <h2><?php echo langtransstr('Solar Radiation') . ' / ' . langtransstr('UV Index'); ?></h2>
    <?php genImageLink('SolarRadHistory.gif','Solar Radiation'); ?>
    <?php genImageLink('UVHistory.gif','UV Index'); ?>
    <? } elseif ($SITE['SOLAR']) { ?>
     <h2><?php echo langtransstr('Solar Radiation'); ?></h2>
    <?php genImageLink('SolarRadHistory.gif','Solar Radiation'); ?>
    <? } elseif ($SITE['UV']) { ?>
     <h2><?php echo langtransstr('UV Index'); ?></h2>
    <?php genImageLink('UVHistory.gif','UV Index'); ?>
    <? } // end solar/uv selection ?>
    
<?php } // end WeatherLink graph names    ?>

<?php if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] == 'VWS') { // VWS graph names ?>
     <h2><?php echo langtransstr('Temperature') . ' / ' . langtransstr('Humidity'); ?></h2>
    <?php genImageLink('vws742.jpg','Temperature'); ?>
    <?php genImageLink('vws740.jpg','Humidity'); ?>
    <br />
    <?php genImageLink('vws757.jpg','Dew Point'); ?>
    <?php genImageLink('vws2811.jpg','THW Index'); ?>
    <br />
    <?php genImageLink('vws754.jpg','Wind Chill'); ?>
    <?php genImageLink('vws756.jpg','Heat Index'); ?>
    <br />
    <h2><?php echo langtransstr('Wind') . ' / ' . langtransstr('Barometer'); ?></h2>
    <?php genImageLink('vws737.jpg','Wind Speed'); ?>
    <?php genImageLink('vws736.jpg','Wind Direction'); ?>
    <br />
    <?php genImageLink('vws1325.jpg','High Wind Speed'); ?>
    <?php genImageLink('vws758.jpg','Barometer'); ?>
    <br />
    <h2><?php langtrans('Rain'); ?></h2>
    <?php genImageLink('vws744.jpg','Rain'); ?>
    <?php genImageLink('vws859.jpg','Rain Rate'); ?>
    <br />
    <?php // figure out to display solar and/or UV based on site settings
	if($SITE['SOLAR'] and $SITE['UV']) { // have both sensors ?>
    <h2><?php echo langtransstr('Solar Radiation') . ' / ' . langtransstr('UV Index'); ?></h2>
    <?php genImageLink('vws753.jpg','Solar Radiation'); ?>
    <?php genImageLink('vws752.jpg','UV Index'); ?>
    <? } elseif ($SITE['SOLAR']) { ?>
     <h2><?php echo langtransstr('Solar Radiation'); ?></h2>
    <?php genImageLink('vws753.jpg','Solar Radiation'); ?>
    <? } elseif ($SITE['UV']) { ?>
     <h2><?php echo langtransstr('UV Index'); ?></h2>
    <?php genImageLink('vws752.jpg','UV Index'); ?>
    <? } // end solar/uv selection ?>
<?php } // end VWS graph names    ?>

<?php if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] == 'CU') { // Cumulus graph names ?>
   <h2><?php echo langtransstr('Temperature') . ' / ' . langtransstr('Humidity'); ?></h2>
  <?php genImageLink('temp.png','Temperature',620,248); ?>
  <br />
  <?php genImageLink('hum.png','Humidity',620,248); ?>
  <br />
  <h2><?php echo langtransstr('Wind') . ' / ' . langtransstr('Barometer'); ?></h2>
  <?php genImageLink('wind.png','Wind Speed',620,248); ?>
  <br />
  <?php genImageLink('windd.png','Wind Direction',620,248); ?>
  <br />
  <?php genImageLink('press.png','Barometer',620,248); ?>
  <br />
  <h2><?php langtrans('Rain'); ?></h2>
  <?php genImageLink('raint.png','Rain',620,248); ?>
  <br />
  <?php genImageLink('rain.png','Rain Rate',620,248); ?>
  <br />
<?php } // end VWS graph names    ?>

<?php if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] == 'WD') { // Weather-Display graph names ?>
	<h1><?php langtrans('Last 24 Hours'); ?></h1> 
		<?php genImageLink('curr24hourgraph.gif','Last 24 hours',469,555); ?>
	<br /><br />
	<h1><?php langtrans('Last 72 Hours'); ?></h1> 
		<?php genImageLink('curr72hourgraph.gif','Last 72 hours',469,555); ?>
	<br /><br />
	<h1><?php langtrans('Month to Date'); ?></h1> 
		<?php genImageLink('monthtodate.gif','Month to Date',469,555); ?>
<?php } // end WD graph names    ?>

</div><!-- end main-copy -->

<?php
#--------------------------------------------------------------------------
# function genImageLink
#--------------------------------------------------------------------------

function genImageLink ( $imagename, $alttext, $width=310, $height=200) {
	global $graphImageDir;
	
	if(!file_exists($graphImageDir.$imagename)) {
		print "$graphImageDir$imagename not found.";
	} else {
		print "<img src=\"$graphImageDir$imagename\" alt=\"$alttext\" width=\"$width\" height=\"$height\" />\n";
	}

}
#--------------------------------------------------------------------------
# end genImageLink function
#--------------------------------------------------------------------------

############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>
how can i fix this Beau

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Tue 01 Feb 2011 8:18 pm
by saratogaWX
There's nothing the page that directly indicates a Error 500 would result, and regrettably, it's not possible for us to help debug it since your site is not being published to the internet where we could view and check settings/configurations.

An Error 500 can result from a page doing recursive includes of scripts, or exceeding the memory allotted for PHP, or exceeding the number of process threads allotted to PHP.

Have you unpacked (from the distribution .zip) a copy of the page and ASCII uploaded it (unmodified) to the document root?

Does the error still occur after that?

Have you set (in Settings-weather.php) the $SITE['graphImageDir'] = './images/'; and are the Cumulus image files
located in the ./images directory under your website document root directory?

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Tue 01 Feb 2011 9:12 pm
by n9mfk
Hi Ken I reloaded it
no luck are there any setting any setting i can look at in php.ini

Code: Select all

$SITE['WXtags'] 	= 'c:/n9mfk/CUTags.php';
$SITE['ajaxScript']     = 'ajaxCUwx.js';   // for AJAX enabled display
$SITE['realtimefile'] = 'realtime.txt';
$SITE['graphImageDir']  ='c:/n9mfk/images/';     // directory location for graph images with trailing 

also tried $SITE['graphImageDir']  ='./images/';
thanks Beau

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Wed 02 Feb 2011 2:14 am
by saratogaWX
Beau,
I'd not recommend you use absolute Windows paths in the settings (things like $SITE['WXtags'] = 'c:/n9mfk/CUTags.php';) as they aren't directly mappable to the XAMPP htdocs directory where all your webpages are served from. Your weather data file CUtags.php (not CUTags.php if you used the recommended name) should appear in your xampp htdocs directory, and the images in htdocs/images to make the template work as with other webservers.

I suggest you check the XAMPP apache/logs/error.log and see what PHP is griping about, and pursue your debugging from there.

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Wed 02 Feb 2011 1:59 pm
by n9mfk
Hi Ken,
I known for Linux server it ./
what is it for windows ?
thanks Beau

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Wed 02 Feb 2011 5:39 pm
by saratogaWX
I'm sorry, Beau, but I don't understand your question. Would you mind restating it with additional information?

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Wed 02 Feb 2011 6:18 pm
by n9mfk
Hi Ken
by the info i looked at ./ does not work on windows
but im not sure yo use in it place
Beau

Re: Are you interested in a AJAX/PHP template set for Cumulu

Posted: Wed 02 Feb 2011 11:50 pm
by beteljuice
I think beau might be refering to path delimiter / on real computers, \ on Windoze ;)