Trixology
WeatherCat => WeatherCat Web Templates => Topic started by: saratogaWX on March 25, 2012, 02:19:55 AM
-
With Stu's release of WeatherCat V0.95, Build 152, the AJAX/PHP template set plugin is now available
http://saratoga-weather.org/wxtemplates/install.php to download the WCT-plugin (and Base if you need it).
Users of the V3 template set with (shudder) another software package should also run the updates tool (http://saratoga-weather.org/wxtemplates/updates.php) for their Base to get the 5 files changed there for WeatherCat support.
Best regards,
Ken
-
Hi Ken and WeatherCat fans!
Still trying to dig myself out of my own programming miseries, but definitely want to wish you a big thank you for all this work!! (http://www.macweather.net/images/smilies/thankyou.gif)
Greatly appreciated!! [tup]
Cheers, Edouard [cheers1]
-
Wow! Awesome, thank-you very much.
I still have a little tweaking to do
www.oamaruweather.net.nz (http://www.oamaruweather.net.nz)
Tony
-
Nice work Ken!
Is it OK to link to the template set plugin in the documentation and on our site?
(I'm guessing yes, but I have to ask :) )
Many thanks,
Stu.
-
I'm not sure where is the best place to post. Here or over on the WX Forum?
All went smooth enough, just 2 minor niggles:
When not using a METAR an image placeholder is left in the dashboard
Yesterdays temps have 2 decimal places, today's only have one.
-
Nice work Ken!
Is it OK to link to the template set plugin in the documentation and on our site?
(I'm guessing yes, but I have to ask :) )
Many thanks,
Stu.
Yes, I'd be honored to have the links from your site ;D
Thanks!
I'm not sure where is the best place to post. Here or over on the WX Forum?
All went smooth enough, just 2 minor niggles:
When not using a METAR an image placeholder is left in the dashboard
Yesterdays temps have 2 decimal places, today's only have one.
I'll have to look at using the built-in conditions string to set the icon in lieu of a METAR.
The temps should have only 1 decimal place AFAIK...
Best regards,
Ken
-
I'm not sure where is the best place to post. Here or over on the WX Forum?
All went smooth enough, just 2 minor niggles:
When not using a METAR an image placeholder is left in the dashboard
Yesterdays temps have 2 decimal places, today's only have one.
Did an update to WCT-defs.php (V1.01 - 25-Mar-2012) to use the CC$ text for current conditions (and pick an icon based on that) if no METAR is specified (i.e. the $SITE['conditionsMETAR'] line in Settings-weather.php is commented out).
Use the updates page (http://saratoga-weather.org/wxtemplates/updates.php) to get the update (25-Mar-2012).
Thanks for the suggestion .. WeatherCat is one of the few weather software programs to provide this independently.. glad I could use the CC$ field for folks far-away from a METAR station. :)
Best regards,
Ken
-
Thanks for the quick work, the update works fine. My site is now showing the my CC$ tag as a current condition icon. [woohoo]
Tony
-
Thank you Ken, I've made this topic a sticky.
-
I been working steadily to migrate from my html pages to the php pages from the Saratoga templates.
One thing I have not been able to figure out is how to have the title of each page contain the current temperature and time of last update like I have on my html site (http://nowaitweather.com).
I had several of my daily users check out the new php pages and each noted that they really missed the title having this information in it. It is important to them because - if you minimize your browser window, you can still see the current conditions without bringing the full page up again. Its like having a mini outdoor thermometer on your task bar. I'd like to do the same using the php pages from the Saratoga templates. Any ideas on how to do this?
nowait
-
It's possible to do that :)
Edit your top.php to change if( isset ($TITLE) ) {
echo " <title>" . $TITLE . "</title>\n";
} else {
echo " <title>" . langtransstr($SITE['organ']) . "</title>\n";
}
to $dispTUOM = '°'.strtoupper(preg_replace('|[^CF]+|i','',$uomtemp));
if( isset ($TITLE) ) {
echo " <title>$temperature$dispTUOM -" . $TITLE . "</title>\n";
} else {
echo " <title>$temperature$dispTUOM -" . langtransstr($SITE['organ']) . "</title>\n";
}
and the current temperature will appear as the first thing in the title of each page on the site.
Best regards,
Ken
BTW.. that's the beauty of a modular site design with common code chunks used on each page.. change in one place and it's changed everywhere on the website :)
-
Thats Awesome! Exactly what I wanted.
Love the templates. Thanks for all the help.
nowait
-
I'd like to add a few more WX Records to my site but I can't seem to find them in the list when I do a Dump on my site:
http://www.nowaitweather.com/WCTtags.php?sce=dump
I'm looking for wx records for Lowest windchill of all time, highest Heatindex of all time, and a few wxrecent table entries yesterday's values.
Is there a way for me to add these values to the tags so I can use them in my web pages?
Thanks
Nowait
-
Yes, there is an easy way to add those tags.
With the distribution WCT-plugin.zip came two files:
WeatherCat-webtags.txt
gen-WCTtags.php
You can add tags to the WeatherCat-webtags.txt using an ASCII text editor and this format with one tag per line:
wvar<tab><WeatherCat tag><tab><optional comment>
<tab> is the Tab character which is used as a field delimiter in the Weather-Cat-webtags.txt file.
You can add something like wvar STAT$WINDCHILL:MIN:ALLTIME$ Lowest wind chill alltime
wvar STAT$WINDCHILL:MIN:ALLTIME:TIME$ Time of lowest wind chill alltime
and repeat for the other variables you'd like to add.
Save and upload the WeatherCat-webtags.txt to your website.
Then view gen-WCTtags.php?comments=y on your website to generate a WCTtags template file. Save the file over your current WCTtags template.
Then you can refer to the values as
$WX['STAT:WINDCHILL:MIN:ALLTIME'] and
$WX['STAT:WINDCHILL:MIN:ALLTIME:TIME']
in your PHP code.
Hope this helps...
Best regards,
Ken
-
Are there some additional includes that aren't in the newsamplepage.php?
I can't seem to print out any of the new variables or the existing ones?
I also tried adding the additional variables using the station records page?. and get nothing but the $STRECORDS contents?
I'm missing something (probably something basic) :)
-
Sorry for the difficulties.. would you mind copying the contents of your wxnewpage in a post (the area bounded by <div id="main-copy'> ... </div><!-- end main-copy -->) and I'll take a look.
Additional include()s are not needed .. all the data comes from the WCTtags.php into the global $WX[] array.
The WCT-defs.php is automatically included to map SOME of the $WX[] values to $wdvariablenames used in the template, but you can always refer to the $WX[] entries directly in any wx....php page that is based on a copy of wxnewpage.php.
Use http://www.nowaitweather.com/WCTtags.php?sce=dump to see all the $WX[] values available for use.
Best regards,
Ken
-
My rough test page is http://nowaiitweather.com/wxnewpage_test.php
<div id="main-copy">
<?php
include_once($SITE['WXtags']);
echo($WX['STAT:TEMPERATURE:CURRENT']);
echo($WX['STAT:WINDCHILL:CURRENT']);
echo($WX['STAT:HEATINDEX:24HRSAGO']);
echo($WX['STAT:EXTHUMIDITY:DELTA24']);
echo($WX['STAT:WINDCHILL:MIN:ALLTIME']);
echo($WX['STAT:WINDCHILL:MIN:ALLTIME:TIME']);
?>
<h1><?php langtrans('Sample Blank Page'); ?></h1>
<p>This is a sample page</p>
<p>Copy it to a new name and use as the base for a new page on your site.</p>
<?php
echo($WX['STAT:TEMPERATURE:CURRENT']);
echo($WX['STAT:WINDCHILL:CURRENT']);
echo($WX['STAT:HEATINDEX:24HRSAGO']);
echo($WX['STAT:EXTHUMIDITY:CURRENT']);
echo($WX['STAT:WINDCHILL:MIN:ALLTIME']);
echo($WX['STAT:WINDCHILL:MIN:ALLTIME:TIME']);
?>
</div><!-- end main-copy -->
-
That's the right idea and it is working.. just not printing out in a way to allow you to diagnose what might be having a problem.
I used a modification of your code <?php
include_once($SITE['WXtags']);
echo "Current Temperature: ".$WX['STAT:TEMPERATURE:CURRENT']."<br/>\n";
echo "Current WindChill: ".$WX['STAT:WINDCHILL:CURRENT']."<br/>\n";
echo "Current HeatIndex: ".$WX['STAT:HEATINDEX:24HRSAGO']."<br/>\n";
echo "EXTHUMIDITY:DELTA24: ".$WX['STAT:EXTHUMIDITY:DELTA24']."<br/>\n";
echo "WINDCHILL:MIN:ALLTIME: ".$WX['STAT:WINDCHILL:MIN:ALLTIME']."<br/>\n";
echo "WINDCHILL:MIN:ALLTIME:TIME: ".$WX['STAT:WINDCHILL:MIN:ALLTIME:TIME']."<br/>\n";
?>
which shows each variable (labeled on a separate line) and got this output Current Temperature: 62.9
Current WindChill: 62.9
Current HeatIndex: 64.5
EXTHUMIDITY:DELTA24: 10
Notice: Undefined index: STAT:WINDCHILL:MIN:ALLTIME in /homepages/9/d141952417/htdocs/wx/wxtemplates/Test/wxnowaitwx.php on line 63
WINDCHILL:MIN:ALLTIME:
Notice: Undefined index: STAT:WINDCHILL:MIN:ALLTIME:TIME in /homepages/9/d141952417/htdocs/wx/wxtemplates/Test/wxnowaitwx.php on line 64
WINDCHILL:MIN:ALLTIME:TIME:
I got the two Notice error messages because in my test setup, I have the error_reporting() set for everything.
So the issue is that two values are not present in my WCTtags.php so they cause the Notice: Undefined index messages (and therefore print nothing because there is no value for them).
When you do a http://www.nowaitweather.com/WCTtags.php?sce=dump , you can use any of the $WX['...'] names in your own page .. picking one that is not listed will not work :)
Best regards,
Ken
-
That makes sense to not print anything is it doesn't exist.
In Reply #13 of this thread, I must have missed something when you were helping me add variables (link windchill and heatindex of all time) to the list of variables...
I'll have to go back through the steps and check again.
-
Yep. Wrong WCTtags.php file on my weather cat server. It works much better when the server updates the correct file and uploads it to the website. Now the "new" values I added to the WCTtags.php are available!
Is there a function that will parse the date and time out of this?
WINDCHILL:MIN:ALLTIME:TIME: "2010-12-11T22:09:00" to "2010 DEC 11 at 22:09:00"?
See http://nowaitweather.com/wxnewpage_test.php
Thanks for all your help. I'm learning a lot!
-
For a time format like that ( "2010-12-11T22:09:00" ), you can use strtotime() to get it into a time format useable by date()
to create 2010 DEC 11 at 22:09:00
For your specific one, something like <?php
$utime = strtotime($WX['WINDCHILL:MIN:ALLTIME:TIME']);
$pdate = date("Y M d",$utime) . ' at ' . date("H:i:s",$utime);
echo $pdate;
?>
-
That helps but the time converted looks like the beginning of computer time (epoc)...
1969 Dec 31 at 18:00:00
http://nowaitweather.com/wxstationrecords.php
-
Looks like you fixed it
http://nowaitweather.com/wxstationrecords.php
is now showing valid date/times Lowest Recorded Wind Chill: -27.4 on 2010 Dec 11 at 21:09:00
Highest Recorded Heat Index: 118.9 on 2011 Aug 01 at 15:09:00
The 'yyyy-mm-ddThh:mm:ss' format (ISO) is one that should be processed correctly by PHP strtotime() function.
Best regards,
Ken
-
Yes its correct now. I needed to add "STAT" to the variable name in your example.
Thanks for all your help. Slowly but surely, I'm getting things figured out!
-
hi
for information :
all datas uploaded from weathercat are in : /meteo-jf2/
all files for Saratoga Templates are on http://www.jf-i2r.com/meteo-jf2/saratoga/
i need your help :
why " NaN " for some datas :
(http://img163.imageshack.us/img163/1549/capturedcran20130329105.jpg) (http://imageshack.us/photo/my-images/163/capturedcran20130329105.jpg/)
(http://img96.imageshack.us/img96/2216/capturedcran20130329110.jpg) (http://imageshack.us/photo/my-images/96/capturedcran20130329110.jpg/)
http://www.jf-i2r.com/meteo-jf2/saratoga/wxindex.php
i send you my WCTags.php and WCT_realtime.txt from my server
thanks
jean frederic
-
Hi Jean,
The problem is with the data in /meteo-jf2/WCT_realtime.txt
29/03/13|17:19:20|11,7|92|10,4|6|5|237|0,0|4,8|1000,4|OSO|-|Knots|°C|mb|mm|111,47|
The numbers inside must use a period as the decimal point and not the European convention of using a comma as a decimal point. The JavaScript
is unable to process the numbers with commas as decimal points and so show NaN (meaning Not a Number) instead. Have WeatherCat emit the WCT_realtime.txt file using periods as decimal point and the AJAX script should work properly.
Best regards,
Ken
-
thanks Ken
is it possible to me to setup weathercat to use periods as décimal ?
or Stu can do it ?
cheers
jean frederic
-
Unfortunately there's no quick fix for this one as the decimal separator is provided by the OS (from settings made in the Language & Text System Preferences). It'll probably need a tag to override the OS settings to turn it off for that particular file whilst it's being processed.
-
I think I found a quick fix for you to try...
Change ajaxWCTwx.js code var realtime = x.responseText.split('|');
to var rttext = x.responseText;
if(decimalComma) {
rttext = rttext.replace(/(\d)\,(\d)/g,"$1.$2");
}
var realtime = rttext.split('|');
That should find all the numbers with comma decimal points and replace the comma with a period so normal math can be done by JavaScript.
The script already had a mechanism to convert from decimal points to comma decimals built-in, just not a mechanism to do the reverse.
Best regards,
Ken
-
Hi
i setup that in ajaxWCTwx.js
var decimalComma = true; // =false for '.' as decimal point, =true for ',' (comma) as decimal point
and it's seem ok http://www.jf-i2r.com/meteo-jf2/saratoga/index.php
**** but i've another problem with date and update , Saratoga template don't find the WCT_realtime.txt i think ; have you an idea? i'm lost
in http://www.jf-i2r.com/meteo-jf2/saratoga/wxstatus.php
WeatherCat weather data NOT Current 379070:25:12 > 0:05:15
01/01/1970 01:00
(http://img24.imageshack.us/img24/5103/capturedcran20130330152.jpg) (http://imageshack.us/photo/my-images/24/capturedcran20130330152.jpg/)
can you verify my ajaxWCTwx.js and settings files ?
all datas uploaded from weathercat are in : /meteo-jf2/
all files for Saratoga Templates are on http://www.jf-i2r.com/meteo-jf2/saratoga/
http://www.jf-i2r.com/meteo-jf2/saratoga/index.php
(http://img594.imageshack.us/img594/9112/capturedcran20130330150.jpg) (http://imageshack.us/photo/my-images/594/capturedcran20130330150.jpg/)
(http://img833.imageshack.us/img833/9619/capturedcran20130330104.jpg) (http://imageshack.us/photo/my-images/833/capturedcran20130330104.jpg/)
thanks
jean frederic
-
Try changing Settings.php from
$SITE['WDdateMDY'] = false; // for weather software date format of month/day/year. =false for day/month/year
to $SITE['WDdateMDY'] = true; // for weather software date format of month/day/year. =false for day/month/year
-
hi
[tup] ok for date
last question : where i can setup the update page ? every 15s for example because if i reload with my browser the data for wind don't change so the WCT_realtime.txt is updating with wheather cat every 10S
for information i've make change in ajax-images for example the wr-fr-NW.png for wr-fr-NO .png all "W" to "O"
thanks
jean frederic
-
Hi Jean Frederic,
Your WeatherCat is reporting the wind direction using the French abbreviations (N E S O) for cardinal directions instead of the expected English direction (N E S W). As it says in the How Multilingual works page (http://saratoga-weather.org/wxtemplates/multilanguage.php) Multilanguage support requires weather software to run in English
Be advised that the translation provided by the template set is FROM ENGLISH ONLY. If you run your your weather software using a language other than English, it is very likely that some of the multi-language support won't work on some features as there is currently no provision to convert from <language> to English so the English to <language> translation is not possible.
So.. in order to have your site work in all languages, the language used by WeatherCat must be in English .. sorry.
Best regards,
Ken
-
hi ken
sorry i've not read the How Multilingual works page ; and my English is very low and not understand all ; so that the reason i 've so many questions !
and for update page ? every 15s for example because if i reload with my browser the data for wind don't change so the WCT_realtime.txt is updating with wheather cat every 10S
(http://img208.imageshack.us/img208/2112/capturedcran20130331122.jpg) (http://imageshack.us/photo/my-images/208/capturedcran20130331122.jpg/)
i'm sure that my saratoga web site don't use ajaxWCTwx.js
if i rename ajaxWCTwx.js to ajaxWCTwxA.js i see the same home web site nothing change
all datas uploaded from weathercat are in : /meteo-jf2/
all files for Saratoga Templates are on http://www.jf-i2r.com/meteo-jf2/saratoga/
http://www.jf-i2r.com/meteo-jf2/WCTtags.php?sce=view
http://www.jf-i2r.com/meteo-jf2/WCT_realtime.txt
attachment ajaxWCTwx.js
I'm progressing slowly :)
thanks for your help and your patience
cheers
jean frederic
-
hi Ken and Weathercat team
with a friend we have made some patches in ajaxWCTwx.js ; now your template is ok (comma,date, update, gust etc.. ) when using weathercat fr , kts : http://www.jf-i2r.com
we use Dreamweaver => cmd+f BugsDenis
// BugsDenis patches here
var value = new String(inValue);
if(decimalComma) value = value.replace(/(\d)\.(\d)/,"$1,$2");
// convert input wind to knots if need be
if(rawwind == '-') {rawwind = 0.0;} // Patch BugsDenis
// BugsDenis patches here
if (useKnots) { return new Number((rawwind * 1.0).toFixed(dpWind)); } //force usage of knots for speed
// BugsDenis patches here in order to see received datas
//Wind gust
// BugsDenis patches here (on JF directives)
// var gust = convertWind(realtime[40]);
var gust = convertWind(realtime[6]);
// BugsDenis patches here in order to identify errors
console.log(e);
console.log(rttext);
if you want you can integrate my saratoga web site on your website templates :)
cheers
jean frederic
-
Hello
I am brand new to this and i wander were to put the forcast icons, and is it any .php file i need to edit to get this icons operative
Best regards
Tore Olsen :D
-
Hi Tore,
There are two different sets of forecast icons for use with the template sets. The default set (called carterlake-icons) are .jpg format and an optional set (called meteotriviglio-icons) are animated .gif images.
Either (or both) sets are installed in ./forecast/images/ directory on your site. Using the meteotriviglio-icons does require one change to the template set in Settings.php to specify that .gif icons are to be used.
Both sets are downloadable from the install page (http://saratoga-weather.org/wxtemplates/install.php)
Best regards,
Ken
-
hi Ken
is possible to integrate in a futur release the tide times ? in the almanac in the home page panel
cheers
jean frédéric
-
Few of the weather software packages include tags that have tide information in them so the templates did not include it either, sorry.
-
Hi Jean Frederic, Ken and WeatherCat fans,
is possible to integrate in a futur release the tide times ? in the almanac in the home page panel
I have no idea how you could get this data onto your website, but you might take a look at this shareware program: Mr. Tides
http://www.mrtides.com/ (http://www.mrtides.com/)
Perhaps it at least has the tidal information you need. If you've got that, perhaps you can find a way to put it on your website.
Cheers, Edouard [cheers1]
-
hi Edouard
in my old web site i use that:
http://horloge.maree.frbateaux.net
<iframe src="http://horloge.maree.frbateaux.net/ws126" width="226" height="217" frameborder="0" scrolling="no"><a href="http://maree.info/" target="_top" rel="dofollow">Calendrier des marées - horaire, hauteur, coefficient de marée</a></iframe>
(http://img834.imageshack.us/img834/1252/capturedcran20130430095.jpg) (http://imageshack.us/photo/my-images/834/capturedcran20130430095.jpg/)
but now i use Saratoga template and integrate this in the template I am not satisfied
my site is viewed mainly by sailors
may be integrating tides into saratoga template as WU is integrated
cheers
jean frederic
-
Hi Jean Frederic
in my old web site i use that:
http://horloge.maree.frbateaux.net
I'm sure that there are ways to grab data from one website and incorporate it into another using something like PHP. Alas, I don't know how to do that and honestly, I'm still stuck with yet another detail in restoring . . . . . (http://www.canebas.org/Automotive/V8_Buick/Misc/Biquette_V8_Buick_signature.gif)
Maybe someone else can help you out with this one or perhaps searching the Internet will come up with others also trying to incorporate tide data into their website.
Cheers, Edouard [cheers1]
-
Hi Edouard
it is not very important to have the tide times but I think this may be an interesting option ;)
hope Ken should integrate this option in the futur
good luck for your restoration work :)
cheers
jean frederic
-
Jean Fredric
You should be able to integrate the data you need from http://www.surf-forecast.com/pages/configure_feed (http://www.surf-forecast.com/pages/configure_feed) or a similar site quite easily.
JC
-
HI
i've updated the WU-forecast.php for new WU webpage design but it's not good i've a message in my home web site page : Warning: Division by zero in /home/jfi2r/www/WU-forecast.php on line 1171
did i ve to update another file ?
for 2014 my english stay bad like 2013 :)
thanks
jean frédéric
-
Hi,
the issue is caused by your PHP 5.2.13-pl1-gentoo -- PHP versions before 5.3.x had issues with the built-in json_decode() PHP function and are unable to handle the large JSON stream (>100Kb) from the new WU pages.
You will have to upgrade the PHP to 5.3.x, 5.4.x or 5.5.x to have the script work correctly.
Best regards,
Ken
-
Hi Ken
thanks , i update to php5.3 ( more récent in OVH release) and it's ok for WU
but now i've this message : Notice: Undefined offset: 1 in /home/jfi2r/www/get-USNO-sunmoon.php on line 158
i don't know why …..
thanks
jean frédéric
-
Hi again :)
PHP 5.3 changed some defaults in the error_reporting so that E_STRICT, E_NOTICE and E_DEPRECATED errors are now enabled by default. I suggest you turn them off in your php.ini for the website by using
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
Also, using check-fetch-times.php?show=versions indicates you have some scripts that could use updating .. you should run that query on your site, the use the recommended date/base/plugin in the query at http://saratoga-weather.org/wxtemplates/updates.php to get a customized set of scripts needing updates to bring your site to current levels :)
Best regards,
Ken
-
hi Ken
for test i put this line in my index.php : if (version_compare(PHP_VERSION, '5.3.0') >= 0) error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
it's ok
but the problem stay ( http://www.jf-i2r.com/wxastronomy.php)
(http://www.heberger-image.fr/data/vignettes/11650_Capture_dc_cran_2014_04_21_10.39.26.jpg) (http://www.heberger-image.fr/images/11650_Capture_dc_cran_2014_04_21_10.39.26.jpg.html)
i don't see any update for wxastronomy.php or get-USNO-sunmoon.php
i think my site is in current level
sorry Ken for all questions but i try to understand :)
thanks
best regards [cheers1]
jean frédéric
-
You can put the line
if (version_compare(PHP_VERSION, '5.3.0') >= 0) error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
in your Settings.php and it will apply to all the pages on your site.
-
hi Ken
it's ok [cheers1]
but it not be better to correct the error traces rather than disable error traces ?
thanks
jean frederic
-
Hello everybody! :)
Is there any change to get davis vp forecast to my native language (Finnish)?
-
Davis provides a lot of forecast text variations (400+ as I remember) which is not suitable for the langtrans() type function to support.. you would have to enter them 1-by-1 as langlookup entries in the language-fi.txt
So... unless Davis provides Suomi as a console language option, it is unlikely to have a translation any time soon. Sorry...
Ken
-
They are in Finnish language in davis console and with weather display I can use finnish texts.
But it's enough if they can translated with langlookup file. :)
Have to tryit.
Thx!
-
Hmmm...
I tryet to put sone of them to language-fi.txt, but they dont translate... What should I try out next?...
-
Hi Ken
another problem with forecast, i,ve not the days
(http://www.heberger-image.fr/data/images/78806_Capture_dc_cran_2014_06_30_09.23.52.jpg) (http://www.heberger-image.fr)
(http://www.heberger-image.fr/data/images/21958_Capture_dc_cran_2014_06_30_09.23.39.jpg) (http://www.heberger-image.fr)
thanks
jean frédéric
-
Hi, J F,
You are running WU-forecast.php Version 2.04 -- that issue was fixed in V2.05, so please update the script :)
You can run check-fetch-times.php?show=versions on your site to show scripts that have updates and get directions on
how to easily get the updates using my updates tool.
Best regards,
Ken
P.S. we have recently found that sites hosted on altervista.org will not be able to fix the problem (this doesn't apply to you, J F). See: http://www.wxforum.net/index.php?topic=22905.msg220929#msg220929 for more info. The root cause was that altervista.org has a security policy that forces all scripts to use HTTP/1.0 (even if HTTP/1.1 protocol is requested), and WeatherUnderground servers respond to HTTP/1.0 requests with a page omitting the JSON data and also lacking the day-names in the raw HTML. Sites based on altervista.org hosting must remain on V2.04 to have any WU forecast visible, but that forecast will lack the day-names. V2.05 will not work on altervista.org sites and the problem is not fixable (except by moving the site to hosting other than by altervista.org). Unfortunately, altervista.org hosting (free) is quite popular for Europeans, especially Italian websites so I expect that many personal weather websites may have to find new (paid) hosting to fix the issue longer term.
-
Hi Ken
thanks , i update the script and now all is ok [cheers1]
i look for the check-fetch-times.php
(http://www.heberger-image.fr/data/images/67502_Capture_dc_cran_2014_06_30_16.19.50.jpg) (http://www.heberger-image.fr)
cheers
jean frederic
-
hi Ken
since the update for WU-forecast.php i've this message : Warning: Division by zero in /home/jfi2r/www/WU-forecast.php on line 790
my check-fetch-times.php : all is update http://www.jf-i2r.com/check-fetch-times.php?show=versions
is it a problem with WU ?
thks
jean fred
-
hi Ken
since the update for WU-forecast.php i've this message : Warning: Division by zero in /home/jfi2r/www/WU-forecast.php on line 790
my check-fetch-times.php : all is update http://www.jf-i2r.com/check-fetch-times.php?show=versions
is it a problem with WU ?
thks
jean fred
There has been another change in the WU pages and Ken is rewriting the scripts.
Discussions on
http://www.weather-watch.com/smf/index.php/topic,61907
http://www.wxforum.net/index.php?topic=24217
Wim
-
hi Ken
since the update for WU-forecast.php i've this message : Warning: Division by zero in /home/jfi2r/www/WU-forecast.php on line 790
my check-fetch-times.php : all is update http://www.jf-i2r.com/check-fetch-times.php?show=versions
is it a problem with WU ?
thks
jean fred
There has been another change in the WU pages and Ken is rewriting the scripts.
Discussions on
http://www.weather-watch.com/smf/index.php/topic,61907
http://www.wxforum.net/index.php?topic=24217
Wim
thanks Wim [tup]
-
hi
update script WU-forecast.php (ML) Version 3.00 - 31-Oct-2014
i create a ID key
i modify the settings.php
add to Settings.php a line with:
// $SITE['WUAPIkey'] = 'your-api-key-here';
i think all is ok [tup]
// Settings ---------------------------------------------------------------
//REQUIRED: a WU API KEY.. sign up at http://www.wunderground.com/weather/api/
$WUAPIkey = '1xxxxxxxxxxxxxx1'; // use this only for standalone / non-template use
// NOTE: if using the Saratoga template, add to Settings.php a line with:
// $SITE['WUAPIkey'] = 'your-api-key-here';
// and that will enable the script to operate correctly in your template
//
$iconDir ='./forecast/images/'; // directory for carterlake icons './forecast/images/'
$iconType = '.jpg'; // default type='.jpg'
// use '.gif' for animated icons from http://www.meteotreviglio.com/
//$iconDir =''; // set to '' to use the Wunderground icons instead
//
//
$WU_URL = 'http://www.wunderground.com/cgi-bin/findweather/getForecast?query=46.15261459,-1.33283246&sp=IPOITOUC29';
//
// The optional multi-city forecast .. make sure the first entry is for the $WU_URL location
// The contents will be replaced by $SITE['WUforecasts'] if specified in your Settings.php
/*
$WUforecasts = )
// Location|forecast-URL (separated by | characters)
'Saratoga|http://www.wunderground.com/cgi-bin/findweather/getForecast?query=95070',
thanks Ken [cheers1]
jean fred
-
hi
update script WU-forecast.php (ML) Version 3.00 - 31-Oct-2014
i create a ID key
i modify the settings.php
add to Settings.php a line with:
// $SITE['WUAPIkey'] = 'your-api-key-here';
i'm not sure if the forecast use my WU account
it uses your ID, otherwise nothing should be shown
and the forecast is only in english ,
Your forecast is in any language you want
Spanish: http://www.jf-i2r.com/wxforecast.php?lang=es
French: http://www.jf-i2r.com/wxforecast.php?lang=fr
idon't find to setup in french .... if you've an idea :)
. . . shortened . . .
thanks
jean fred
There is a separate thread for this new script on this forum:
http://athena.trixology.com/index.php?topic=1451.msg12216;topicseen#msg12216
Wim
-
thanks Wim all is ok now [tup]
-
Somethink is wrong on my website, the moon times not update in wxastronomy page...
Any suggest, what to do?
http://kauttua.net/wxastronomy.php (http://kauttua.net/wxastronomy.php)
-
Somethink is wrong on my website, the moon times not update in wxastronomy page...
Any suggest, what to do?
http://kauttua.net/wxastronomy.php (http://kauttua.net/wxastronomy.php)
For one reason or another the script thinks you are using Weatherdisplay, not WeahterCat.
Your setting $SITE['WXsoftware'] = 'WCT'; in Settings-weather.php is correct, that is not the problem.
But runnnig the script with debug: http://kauttua.net/wxastronomy.php?debug=y displays a lot of errors. Those errors in line 77, 79 and so on come from the piece of code in the script which is specific for WeatherDisplay.
Maybe an unintentional change somewhere?
At least check line 74 in wxastronomy.php it should read:
if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] == 'WD') {
Succes, Wim
-
Somethink is wrong on my website, the moon times not update in wxastronomy page...
Any suggest, what to do?
http://kauttua.net/wxastronomy.php (http://kauttua.net/wxastronomy.php)
For one reason or another the script thinks you are using Weatherdisplay, not WeahterCat.
Your setting $SITE['WXsoftware'] = 'WCT'; in Settings-weather.php is correct, that is not the problem.
But runnnig the script with debug: http://kauttua.net/wxastronomy.php?debug=y displays a lot of errors. Those errors in line 77, 79 and so on come from the piece of code in the script which is specific for WeatherDisplay.
Maybe an unintentional change somewhere?
At least check line 74 in wxastronomy.php it should read:
if(isset($SITE['WXsoftware']) and $SITE['WXsoftware'] == 'WD') {
Succes, Wim
Hi Wim,
Super THX to U Wim! That change corrected the times! [cheers1] [tup]
-
Hello everyone,
i notice this problem when clicking in the status link of main pages of saratoga template (take a look at the attached file)
what can i do to solve the issue??
-
This is usually caused by a mismatch in the date format inside the tags file (created by WeatherCat) and the Settings.php $SITE['WDdateMDY'] setting.
The templates expect dates in either of two formats:
$SITE['WDdateMDY'] = true; for dates like mm/dd/yyyy format
$SITE['WDdateMDY'] = false: for dates like dd/mm/yyyy format
Note that the dates MUST be in one or the other format, and that yyyy-mm-dd or mm.dd.yyyy formats are not currently supported.
It would help to have the URL to your website showing the issue .. add it to a post, or better yet, put it in your forum profile so future questions could be addressed better.
-
Hi Ken,
Here is the link to the status page:
http://www.urbaniameteo.it/saratoga/wxstatus.php
Thanks for your help...
Bye
Marzio
-
The $date field (used to check the 'current/not current' status) is derived from WCTtags.php
$WX['da'] = '01/15/15'; // Date in the format of month/day/year
and processed in WCT-defs.php by $date = $WX['da'];
The entry in your Settings.php $SITE['WDdateMDY'] = false; // for weather software date format of month/day/year. =false for day/month/year
is not set correctly -- that expects the date to be in d/m/y format.
Change Settings.php to $SITE['WDdateMDY'] = true; // for weather software date format of month/day/year. =false for day/month/year
and the issue should be resolved.
-
Thanks so much ken!!!!
your help let me solve the issue!!!
now it works as expected!!!
Thanks again!!!
Marzio
-
Hello everyone,
I have a problem withe the date_month and the date_year shown in the NOOA report, it's always 01/1970
i notice that the file that shows the report is wxthismonth.php and in this file, among the others, there are the following lines:
$stitle = trim($lines[0]) . " " . langtransstr('Summary for'). " $date_month/$date_year";
print "<p style=\"text-align: center\"><strong>$stitle</strong></p>\n";
i think that the first one generates the title and the second print it to on the browser ... but in my case the report shows: 01/1970 as u can see in the attached file...
how can i set up the right month and year?? .... which file is responsabile for the two variable: 1) $date_month and 2) $date_year ??
(now we are on 05/2015 so i need this date to be displayed and not 01/1970)...
Thanks for your help!!!
Marzio
-
What app do you use for editing the php/html/xml/etc. files? You should be able to search for those two string variables in it.
However, with my very limited and primitive "knowledge" of what appears to be php, I'd suggest editing that line a bit and see what happens. It appears to me that there are some missing quotation marks in the first line you posted; the one that constructs what is ultimately sent to the html server.$stitle = trim($lines[0]) . " " . langtransstr('Summary for'). " $date_month/$date_year";
Try the red changes:
$stitle = trim($lines[0]) . " " . langtransstr('Summary for') . " " . $date_month . " /" . $date_year; (remove the " between $date_year and ;
"01/1970" is generally a beginning of time (as far as a computer is concerned, you may remember that the world of computers was supposed to end at 12:59:59pm, 1999 [computer] ) date. [banghead] It's basically an "erer" message trying to say "I don't understand the exact date you want, but I'm hoping this bogus one will get your attention". [rolleyes2] [lol]
-
Hello,
Thanks for your replay, but unfortunately it doesn't work, i tried to change the line u told me with this one:
$stitle = trim($lines[0]) . " " . langtransstr('Summary for')." ".$date_month."/".$date_year;
but the NOOA report shows 01/1970, it seems like if in the variable $date_month is stored 01 and in the variable $date_year is stored 1970
i have been using BBEdit for editing the file of template (XML,HTML, JS and of course PHP too) i think it's a good web editor...
i try to search for those two variables in other script (i.e.:Common.php, Setting.php...etc.. ) but with no success i did not find those variables ...
i only need someone tell me where and how this to variable are set-up ... and maybe i can find the issue in my configuration...
anyway thanks again.....
Marzio
-
Hello,
Thanks for your replay, but unfortunately it doesn't work, i tried to change the line u told me with this one:
$stitle = trim($lines[0]) . " " . langtransstr('Summary for')." ".$date_month."/".$date_year;
but the NOOA report shows 01/1970, it seems like if in the variable $date_month is stored 01 and in the variable $date_year is stored 1970
i have been using BBEdit for editing the file of template (XML,HTML, JS and of course PHP too) i think it's a good web editor...
i try to search for those two variables in other script (i.e.:Common.php, Setting.php...etc.. ) but with no success i did not find those variables ...
i only need someone tell me where and how this to variable are set-up ... and maybe i can find the issue in my configuration...
anyway thanks again.....
Marzio
If you use BBEDIT there is a search function for all files at once.
Menu "Search" , second in dropdown "Multi Search . . "
If you have a backup of your website at your local Mac you could set the search for the topfolder and BBEDIT will scan all files at once.
Wim
-
Oops! My slow, two-finger "typing" allowed Wim to get the Multi-File Search suggestion in ahead of me. [blush]
Sorry that didn't help. [banghead] Although I still think my edits are correct (I may not be right, but I am very stubborn! [blush] )
Have you tried using the Multi-File Search...function (shift-command-f, or in the "Search" menu)? It may take a while, depending on how many files are in the template, but it could be in a completely different file than the one you are looking in. That search will find it in every file, so you may have to look at each one, even then. BTW, you will usually need to specify what files to search, hopefully, they will be in one directory.
-
The variables are created in WCT-defs.php by
# generate the separate date/time variables by dissection of input date/time and format
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= WCT_setDateTimes($date,$time,true);
With $date, $time set by $time = $WX['t12'];
$date = $WX['de'];
earlier in the same script.
The values from WCTtags.php?sce=dump shows $WX['t12'] = '09:18 PM'; // Time (12 hour clock)
$WX['de'] = '24/05/15'; // Date in the format of day/month/year
so the WCT_setDateTimes() function should be expecting the date in dd/mm/yy format.
In your Settings.php you have $SITE['WDdateMDY'] = false; // for weather software date format of month/day/year. =false for day/month/year
which means the date is expected in dd/mm/yy format.
The problem seems to be in your copy of WCT-defs.php
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= WCT_setDateTimes($date,$time,true);
Change that to
list($date_year,$date_month,$date_day,$time_hour,$time_minute,$monthname,$dayname)
= WCT_setDateTimes($date,$time,$SITE['WDdateMDY']);
and that should fix the 1970/etc. issue.
Best regards,
Ken
-
Thanks a lot KEN!!!
with your suggest i solved the issue!!!
THANKS AGAIN!!!!
MARZIO
-
Any idea why my page is not auto updating? My realtimegaugesWC.txt is uploading. I have to manually refresh the page to get it to update.
www.kq5s.com/weather/index.php (http://www.kq5s.com/weather/index.php)
Thanks,
Tom
-
Any idea why my page is not auto updating? My realtimegaugesWC.txt is uploading. I have to manually refresh the page to get it to update.
www.kq5s.com/weather/index.php (http://www.kq5s.com/weather/index.php)
Thanks,
Tom
These are the errors generated:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /WCT_realtime.txt was not found on this server.</p>
<hr>
<address>Apache/2.4.16 (Unix) OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 mod_fcgid/2.3.9 Server at www.kq5s.com Port 80</address>
</body></html>
The file http://www.kq5s.com/WCT_realtime.txt
is not found as it should be
http://www.kq5s.com/weather/WCT_realtime.txt?1453388855561
Solution: ajaxWCTwx.js line 59 change from
var realtimeFile = '/WCT_realtime.txt'; // URL location of realtime.txt relative to document root of website
to
var realtimeFile = '/weather/WCT_realtime.txt'; // URL location of realtime.txt relative to document root of website
Warning: There can be new pieces of missing data, such as a blank thermometer. Check line 73:
var thermometer = './thermometer.php'; // script for dynamic thermometer PNG image (optional)
Or missing images line 61
var imagedir = './ajax-images'; // place for wind arrows, rising/falling arrows, etc.
Success, Wim
-
Thanks a lot Wim. I don't know how many times I looked at that path. [banghead] I looked at thermometer.php and noticed I had WD selected as the weather software. I changed it to WC. The thermometer was showing the correct temperature before the change so perhaps thermometer.php gets the software variable elsewhere.
I am moving over from WD and have another site that I am trying to keep going using WD and an alternate dashboard. I find myself getting the two sites confused.
The alternate site using WD is weather.kq5s.com (http://weather.kq5s.com). I wish the alternate dashboard supported WCT.
Thanks again.
Tom
-
Hmm. wxjournal.php page is showing somekind of error. Without of knowledge of php, I cannot correct it. Maybe Ken can help?
Error can see here: https://kauttua.net/wxjournal.php
Site using php 7.3.2 and newest template files.
-
Hmm. wxjournal.php page is showing somekind of error. Without of knowledge of php, I cannot correct it. Maybe Ken can help?
Error can see here: https://kauttua.net/wxjournal.php
Site using php 7.3.2 and newest template files.
Sorry, my wife and I are on a cruise, so I have limited diagnostic tools available on the ship. I'll take a look when we return home.
-
Have a great cruise! :)
And thank you if you can check it out someday!!
-
Make the following change to your wxjournal.php file:
Replace:
$jrnl = preg_replace('|<BR><B>(.*)</B><BR>|eUs',
With:
$jrnl = str_replace('|<BR><B>(.*)</B><BR>|eUs',
-
Make the following change to your wxjournal.php file:
Replace:
$jrnl = preg_replace('|<BR><B>(.*)</B><BR>|eUs',
With:
$jrnl = str_replace('|<BR><B>(.*)</B><BR>|eUs',
Actually the line was:
$jrnl = preg_replace_callback('|<BR><B>(.*)</B><BR>|eUs',
and I replaced that with:
$jrnl = str_replace('|<BR><B>(.*)</B><BR>|eUs',
That was easy! Thank you very much!! ThU32:-)