Carterlake/AJAX/PHP templates available

Looks like my new template site is just about up …I do have a few issues that I can;t correct…1) the moon’s aren;t showing anyplace…they did the 1st time I uploaded and view the page…2) I can;t get the radar pages to work.

Any help?

I updated like you said but now my stats think they are from 31-Dec-1969 I was not even born yet in 69. What did I do wrong? :slight_smile:

I found the issue… WD uses some 2-digit year dates and some 4-digit year dates…

I think this version V1.03 of the trends-inc.txt file will fix the issue (for both types).

All template users should update from V1.02 to V1.03 (attached) in their c:\wdisplay\webfiles

Sorry for the inconvenience (and the wayback machine :slight_smile: )

Best regards,
Ken


trends-inc.txt (20.9 KB)

Sure Tony,
Just download resize-nexstorm-image.php and configure the script – it will work fine within the templates. Just create a new page from wxnewpage.php and insert

<img src="resize-nexstorm-image.php" alt="NexStorm Display" width="640" height="445" />

where you’d like the NexStorm panel to appear. The resize-wasp2-image.php works similarly.

Best regards,
Ken

Hi Chris, sorry you’re having difficulties with the templates.

I’d suggest you change in Settings.php your code for the ajax-images location to read

$SITE['imagesDir'] = './ajax-images/'; 

the relative FILE addressing (the ‘.’ in the front) and the trailing ‘/’ are both needed to make ajax-dashboard work. In Settings.php, all the addresses should be relative FILE addresses – that is using ./ for the current directory, …/ for one directory above, etc. In the ajaxWDwx.js script, then absolute URL addressing is used (with / meaning the document root).

Your PHP pages are showing the ‘’ unicode marker (which is also screwing up the thermometer image).
Did you upload all the .php, .html, .txt files to your site using FTP ASCII mode? If not, then you should re-FTP them all using ASCII mode.

Hope this helps…
Best regards,
Ken

Ken, thanks for the update. I have updated the trends-inc.txt file, and are still getting funny dates! Cheers.

http://seacliffbridge.com/web/wxtrends.php

Peter,
You need a

$SITE['WDdateMDY'] = false;

in your Settings.php – it’s trying (by default) to read the date as month/day/year and you need it read as day/month/year. :slight_smile:
Also, you’ll need to add (if you haven’t already) two new Settings.php entries for the PHP’ized trends-inc.txt file

$SITE['uomDistance'] = ' miles';  // or ' km' -- used for Wind Run display
$SITE['dateOnlyFormat'] = 'd-M-Y';        // for 31-Mar-2008 or 'd/m/Y' for Euro format

then the wxtrends.php page should be settled (knock on wood).

Looks like you could also use an update to the get-UV-forecast-inc.php script so it will show the correct forecast for OZ and Kiwi websites … http://saratoga-weather.org/get-UV-forecast-inc.php?sce=view for the updated script.

Best regards,
Ken

Thanks again Ken! Ive done the houskeeping and all looks good now thanks to your expertise. I have updated the UV forecast php as instructed. At the moment the UV data on my http://seacliffbridge.com/web/index.php are a bit out of sync with the actual KNMI readings, but the location is right - Sydney -on the KNMI website. I’m assuming an auto correction at some point. Lol.

I know you continue to put so much time in this, fielding all of our questions, but your expertise is totally impressive!! Dedication awesome!! Everyone knows that. This leads me to:

I need to pick your brain just once more lol… How can I code my HOME PAGE HTTP Server Test Page powered by CentOS-WebPanel.com with an update readout/display similar to top update static ticker in the AJAX pages? How can I blend in some nifty AJAX on the HOME PAGE? Now that is really stretching the friendship…

Thanks Ken.

Thats great Peter! Thanks very much for the kind words!! :oops:

The ticker on the pages (other than the wxindex.php page) is provided by 3 things: the ajaxWDwx.js script (for getting conditions from clientraw.txt), the ajaxgizmo.js script (for doing the conditions rotation), and a set of PHP/HTML generated by ajax-gizmo.php from your testtags.php.

Since all this is one level down in your site (in the /web/ directory), you can make copies of
ajaxWDwx.js
Settings.php

into your document root directory.

edit the ajaxWDwx.js in your document root to have

var clientrawFile = '/web/clientraw.txt'; // location of clientraw.txt relative to this page on website
var imagedir = './web/ajax-images';  // place for wind arrows, rising/falling arrows, etc.

Edit the copied Settings.php in your document root to have

$SITE['clientrawfile']	= './web/clientraw.txt';  // relative FILE location of clientraw.txt
$SITE['imagesDir'] = './web/ajax-images/';  // directory for ajax-images with trailing slash

Then on the page you want to use the weather gizmo put this where you want it to appear

<?php
include_once("./web/testtags.php");
include_once("Settings.php");
?>
    <script type="text/javascript" src="ajaxWDwx.js"></script>
    <!-- AJAX updates by Ken True - http://saratoga-weather.org/scripts-WD-AJAX.php 13-Dec-2006 -->
   <script type="text/javascript" src="./web/ajaxgizmo.js"></script>
<?php if (!$SITE['UV']) {  // turn gizmo uv display off ?>
    <script type="text/javascript"> showUV = false; </script>
<?php   }  // end of turn gizmo uv display off ?>
    <!-- AJAX gizmo by Ken True - http://saratoga-weather.org/scripts-WD-AJAX.php 13-Dec-2006 -->
<?php 
include_once("./web/ajax-gizmo.php");
?>

Then you can style the gizmo by using CSS to class=“ajaxgizmo”, otherwise it will inherit the style in force for it’s position on the page.

See… the Carterlake/WD/PHP/AJAX template set is very modular and you can reuse elements, making it easy to repurpose the code in other ways.

Best regards,
Ken

Thanks again Ken - looks like I am back in the here and now 8)

Hi Ken

I have som strange dates on the astronomy page, http://www.toppen-vejr.info/wxastronomy.php, for the moon and sun(31/12/1969 15:59). Do you know where to change that?

Thanks
Gert

Thanks Ken…that did the trick. The thermometer isn’t loading, and I just saw my “Daily Stats” updated yesterday at 5:15PM…I may have turned something of in WD during the changeover but it all looked ok…I think.

Thanks for the information Ken…after checking the Weather Underground site and my settings I found my latitude/longitude settings were incorrect. I was using another program to unload Weather Underground data…so now I’m using Weather Display to upload to Weather Underground…which should correct the latitude/longitude issue.

Thanks,
Ronnie

I’m also seeing a few things not updating on the astronomy page. The moonicon.gif in the Ajax directory isn’t changing to show the relative progression of the moon phases and I noticed that the moon icons are still showing the Februrary dates for the most part. Any ideas on that??

http://www.bigbaywx.com/wxastronomy.php

Thanks,

Doug

Thanks that did it and now it is back to the present. But I belive I have one last question. On my forcast page all the temputers on it have a ≈ in front of them. What is it? and is there any way I can remove it?

Thanks!

Now they are gone again…That is just strange…I am just going to let it alone for a while. Thanks again!

Hi Gert!

Yes, I think it’s caused by WD using Danish for the dates. You’ll need to add similar code to your page that Jozef (pinto) did for Dutch … the Danish month names provided by WD aren’t being recognized by the PHP strtotime(); function.

The first thing you should try is to put (after replacing the Dutch with Danish month names)

<?php
//can't set locale for dates in wxastronomy.php,php installation does not support it
//
$nextnewmoon = str_replace("januari","january",$nextnewmoon);
$nextnewmoon = str_replace("februari","february",$nextnewmoon);
$nextnewmoon = str_replace("maart","march",$nextnewmoon);
$nextnewmoon = str_replace("mei","may",$nextnewmoon);
$nextnewmoon = str_replace("juni","june",$nextnewmoon);
$nextnewmoon = str_replace("juli","july",$nextnewmoon);
$nextnewmoon = str_replace("augustus","august",$nextnewmoon);
//
$firstquarter = str_replace("januari","january",$firstquarter);
$firstquarter = str_replace("februari","february",$firstquarter);
$firstquarter = str_replace("maart","march",$firstquarter);
$firstquarter = str_replace("mei","may",$firstquarter);
$firstquarter = str_replace("juni","june",$firstquarter);
$firstquarter = str_replace("juli","july",$firstquarter);
$firstquarter = str_replace("augustus","august",$firstquarter);
//
$fullmoon = str_replace("januari","january",$fullmoon);
$fullmoon = str_replace("februari","february",$fullmoon);
$fullmoon = str_replace("maart","march",$fullmoon);
$fullmoon = str_replace("mei","may",$fullmoon);
$fullmoon = str_replace("juni","june",$fullmoon);
$fullmoon = str_replace("juli","july",$fullmoon);
$fullmoon = str_replace("augustus","august",$fullmoon);
//
$lastquarter = str_replace("januari","january",$lastquarter);
$lastquarter = str_replace("februari","february",$lastquarter);
$lastquarter = str_replace("maart","march",$lastquarter);
$lastquarter = str_replace("mei","may",$lastquarter);
$lastquarter = str_replace("juni","june",$lastquarter);
$lastquarter = str_replace("juli","july",$lastquarter);
$lastquarter = str_replace("augustus","august",$lastquarter);
//
$marchequinox = str_replace("maart","march",$marchequinox );
$junesolstice = str_replace("juni","june",$junesolstice );
?>

somewhere before the dates are used in the page (near the top).

The downside is that the dates will all be in English now, but it will figure out what the local date/time is.

I’ll need to work on a generalized solution for this…

Best regards,
Ken

Your thermometer.php is still broken because the script wasn’t uploaded using FTP ASCII or there is a space or blank line before the starting <? in the script, or any characters or lines after the ?> in the script.
If you go to http://www.warwickpaweather.net/thermometer.php?t=45.3 you’ll see a PHP message in front of the graphic saying

Warning: Cannot modify header information - headers already sent by (output started at /home/warwickp/public_html/Settings.php:1) in /home/warwickp/public_html/thermometer.php on line 282

which is where the image is about to be returned to the browser. That message is a symptom of one or more of the things I cited above.

It also looks like your testtags.php and trends-inc.html haven’t been uploaded since 5:15pm on 6-Mar-2008 so you should check your WD settings for that…

I do recommend you re-upload ALL of your .php files using ASCII FTP to your site … I still see the unicode marker in your menubar.php and others.

Best regards,
Ken

Hi Doug,
It looks like the March dates are there now ?!?

The moon phase is uploaded by WD through the testtags.php file … have you got the most recent copy? Older ones (from the ajax-dashboard Demo file set) should be replaced with the newer set.

I’ve attached the current version here.

Best regards,
Ken


testtags.txt (15.5 KB)

Hi Ken

Thanks for the fast response.

I just want to use English on the webpage, I’m not interested using danish here. As far as I know, I haven’t configured WD to danish, but maybe I have somewhere.

With that in mind, any solutions?

BTW, I’m still having this problem on my Home Page, also after I have implemented the solution you gave and configured WD to send Next Update:
Notice: strtotime() [function.strtotime]: Called with empty time parameter in /home/toppen3/public_html/test/ajax-dashboard.php on line 719
06/03/2008 17:40 - next update at 00:00 - updated 2 sec ago

Thanks a lot for your great support, I really appreciate that.

Rgds
Gert

I am happy to announce that the Color Theme Switcher Plugin and the Style Editor both are officially launched today.

:smiley: :slight_smile: 8) :lol:

They have their own forum posts for information, questions and support…

Weather Display/PHP/AJAX Website Template - Color Theme Switcher Plugin
http://discourse.weather-watch.com/t/31202

Weather Display/PHP/AJAX Website Template Set - Style Editor
http://discourse.weather-watch.com/t/31211