New ajaxWDwx.js (V2.09) and WD/PHP/AJAX demo package available

Hi Brian! I understand that WD’s own conditions can be set by the language settings in WD. I’m interested in the possible METAR conditions you can emit based on the METAR decode you have built-in to WD. If I can get that list of strings from you, I can set up a possible translation for the ajax part of the clientraw[49] display string.

Thanks!
Ken

Hi Ken and Brian!

It’s better to have the translation of the weather conditions strings inside the AJAX script, because in case that you have a bi-lingual weather page like me (English-Greek) you have only
the current WD language option available!

I’m still trying to make the translation of WD into Greek, but it’s a tough project and I need a lot of free time for this! I hope that it will be ready soon! :roll:
I know that Greek language is a tough language to embed into the binary world! :wink:

Ken, the new AJAX script is up and running on my pages (English-Greek) like a charm! The only items that are not translated, is the current conditions string and the wind
compass images. I have to draw new ones with wind direction letters in Greek…

Thanks!

Thanos

http://www.meteothes.gr/weather/

Very nice, Thanos! Viewing the Greek page shows the updates and mouseovers in Greek too! Just what I had in mind to let folks translate the fixed English to local language. Well done!

Best regards,
Ken

I have installed the latest demo package, the test pages and standalone ones run fine on my site. When I attempt to incorporate the ajax-dashboard.php on my web page I get this error.

Updated: @
Fatal error: Call to undefined function: fixup_time() in /home/content/k/4/r/k4rcb/html/weather/index1.php on line 144

You may view it at http://www.dominion-llc.com/weather/index1.php

Any help would be appreciated. :?

Thanks and Happy New Year,

Rick

I see that your basic ajax-dashboard.php seems to work at http://www.dominion-llc.com/weather/ajax-dashboard.php
and the testpage at http://www.dominion-llc.com/weather/ajax-dashboard-testpage.php is performing normally.

Did you use

<?php include("ajax-dashboard.php"); ?>

where on your page you wanted it to appear, or did you copy the contents of ajax-dashboard.php into your page. If the latter, then you didn’t include the PHP functions needed to operate the page when it was copied in.

I’d recommend you use the

<?php include("ajax-dashboard.php"); ?>

method to include the page rather than embedding the contents of the page itself… makes it much easier to handle future updates :slight_smile:

Best regards,
Ken

Thanks Ken!!

:smiley: :smiley:

You’re welcome Rick!

Since you’re using the carterlake/AJAX template as a base, it’s probably better to do the include within the

section of the page.

Best regards.
Ken

Hi and happy new year

I just discovered a problem with my ajax pages:

http://www.buskelundtoften.dk/vejret/ - works fine
http://buskelundtoften.dk/vejret - dont work

Here is my header:

<head>
	<meta http-equiv="content-type" content="application/xhtml+xml; charset=ISO-8859-1" />
	<meta name="author" content="Vejret p

Hi Henrik!

I think you need to change two settings in your ajaxWDwx.js file from

var clientrawFile = '/vhost/buskelundtoften.dk/httpdocs/vejret/vejrdata/clientraw.txt'; // location of clientraw.txt relative to this page on website
var ajaxLoaderInBody = false; // set to true if you have <body onload="ajaxLoader(..."
var imagedir = 'http://www.buskelundtoften.dk/vejret//scripts/ajax/ajax-images';  // place for wind arrows, rising/falling arrows, etc.

to

var clientrawFile = '/vejret/vejrdata/clientraw.txt'; // location of clientraw.txt relative to this page on website
var ajaxLoaderInBody = false; // set to true if you have <body onload="ajaxLoader(..."
var imagedir = 'http://www.buskelundtoften.dk/vejret/scripts/ajax/ajax-images';  // place for wind arrows, rising/falling arrows, etc.

The clientrawFile variable is the relative or absolute URL path and filename, not the FILE path in the filesystem on your weather hosting website. The JavaScript (since it runs in the client browser) only knows about the URL addresses since it can’t access the filesystem directly (only via the webserver).

I’m not sure about the imagedir setting, but using the full URL of the directory for the AJAX images should work ok… it is an URL address too in the JavaScript.

Hope this helps, and Happy New Year!!

Best regards,
Ken

Hi Ken

Thank you very much for your reply - that did the trick - its working now.

Best regards,

Henrik

Hello all,

a question about adding the testtags.txt, which creates a testags.php…when entered into the Control Panel, Web files/Web page setup, Custom Web Page Setup Screen…According to the Read Me in the new Ajax 1.06 Folder. which says the following info here:

(Instructions:

The ‘testtags.txt’ file should be copied to your Weather-Display \webfiles directory,
and you should use the Control Panel, Web files/Web page setup, Custom Web Page Setup Tab

Enter:
testtags.txt in the first open (not used) ‘Local file name’ in the
‘Special file conversion’ box
testtags.php in the ‘Remote file name’ under the ‘Local file name’ box you used

Set the Toggle to ON and press ‘Test’, then OK buttons.

This should create a ‘testtags.php’ file with selected current WD conditions loaded into
PHP variables on your website.

NOTE: this file is required for correct operation of the AJAX demo.)

is this only needed to be done one time Only, for everything to keep working updating?.

after it is uploded the 1 time, do I go back into the custom web page setup screen and turn the toggle to “OFF”

Do I need to enter anything or check any other boxes on ther left side of the CustomWeb Page Setup Screen?

*I included a screen shot picture of my Custom web page setup screen , but havent entered anything in it yet, just wanted to know what other boxes may need to be checked on the left side…if any?

Thanks all…Chris

Chris,
You need to do the setup, and leave it on … the testtags.php will be the way your PHP pages refer to the current weather conditions from your station when the page is first loaded. Afterwards, updates are made via AJAX using clientraw.txt on some (but not all the variables) in the page.

So… do put back the testtags.txt and testtags.php in the Local and Remote file names, and turn the switch to ON (and leave it on) :slight_smile:

Best regards,
Ken


Ken,

Couple questions along the same line. It said in the instructions I believe to set it to load every 5 minutes but there doesn’t seem to be a way on that setup page to enable 5 minute loading if necessary. Also, when I was leaving it on it wanted to upload every file when I hit the test button. If it’s left on with just the testags conversion is it only going to upload the testags and not everything else, and how about the time period??

Right now I have a test page set up but it’s loading some of the variables and not others. http://www.bigbaywx.com/test.php However it’s interesting that if I go to the dashboard testpage that came with the script it always has all the correct updated information. http://www.bigbaywx.com/ajax-dashboard-testpage.php Looking forward to the completion of the new templates using this mode.

Hello Ken…Ok I did as instructed, and will leave toggle ON.

So far I have been able to see my test page’s working for dashboard and sidebar
which are here:

http://www.gateway2capecod.com/ajax-sidebar-testpage.php

http://www.gateway2capecod.com/ajax-dashboard-testpage.php

for some reason the gizmo page is not working…here:

http://www.gateway2capecod.com/ajax-gizmo-testpage.php.

I also have not added the thermometer and Windrose to my server. where do I download the thermometer and windrose?

I too also noticed when I hit the TEST Button it uploaded all my wx files, as bigbaywx mentioned above

Thanks…Chris

Chris try here…PHP for current/min/max thermometer image from clientraw.txt or Ken’s site

Also the testtags.php needs to be “parsed” by WD in the “Internet Create File Creation and uploads” in the control panel. If I remember it is file 29.

Jack

Hello Jack/firewall…Thanks for that link and I will check into it.

as for the (Also the testtags.php needs to be “parsed” by WD in the “Internet Create File Creation and uploads” in the control panel. If I remember it is file 29.)…will check that out also

Update:
I now have the Gizmo page working in real time…seems to be updating.

hopefully I can get this all sorted out, but am sure I may need more help in the process

Here is a real down and dirty way to check that testtags.php is functioning on your site.

<?php include("testtags.php"); ?>

<? echo ($temperature); ?>

Just put that simple code on a page, if you get your temperature it is working!

Jack

Hello Jack…I will try out that testags test you provided above in a few moments…Thanks for that.

I also noticed simething odd. The dashboard test page is working, but the dashboard.php does not seem to be working/updating/ in real time.

working test here:

http://www.gateway2capecod.com/ajax-dashboard-testpage.php

not working/updating here (see clock on top of dashboiard stuck since 6:46pm):

http://www.gateway2capecod.com/ajax-dashboard.php

<script type="text/javascript" src="ajaxWDwx.js"></script>

Is this script on your test page Chris?

Jack

Hello Jack…NO it is not. I am using the Test page…that was included in the ajax 1.06 folder. I have the dashboard test page working, but the dashboard.php (other Test page)…is not updating.

I do not think that my testtags.php is being updated either. it must be something to do with the internet file creation of the file 29, but I am not sure what I need to enter in the internet file create/upload screen…any help appreciatted.

if you could show a screenshot picture of your’s for file create, and file upload…that would be very helpful

thank you…chris

I have managed to get the Thermometer.php uploaded and it works. I also had to make a wind calm.gif, as there was none included in the ajax-images folder. all i did was use one of the others in their, renamed it, and edited it with paint so that it has no arrows showing (Calm). it looks ok for now.