Alternative ajaxWDwx.js Script v 9.14

Hi Rainer,
Please, could you tell me how my ajaxWdwx.js/ajaxWdxx-settings.js doesn’t overwrite the alternative ajax-dashboard settings.

@Scott

I have an error in my ajax-dasboard on line 336. (about langtransstr function)
Here il the link: http://www.meteocarmignano.it/ajax-dashboard.php
Coul you give me an eye please?
Many thanks,

Alessandro

Lets assume the wind is blowing from the “WSW”:

ajaxWDwx.js:[color=brown] {src : imgDir+"wr-#DIR#.png" [color=blue]......equals "/ajax-images/wr-WSW.png"[/color] ,xlate: false [/color]
This one is correct and your windrose shows.

ajaxWDwx-settings.js:[color=brown] wrImg.src = imgDir+"Wind#1#wr-#DIR#.gif"; [color=blue]......equals "/ajax-images/Wind#1#wr-WSW.gif"[/color] wrImg.xlate = true; [/color]
Your image name is incorrect and does not exist.
You need to take out the #1# i.e. “Wind1wr-#DIR#.gif” is equal to “./ajax-images/Wind1wr-WSW.gif”

The #DIR# gets replaced with eg. “WSW”
The #LANG# gets replaced with eg. “-it”

If you dont want the #LANG# because you only have one windrose for all
the languages then you need to set:

wrImg.xlate = false; // translate wind direction for icon names (multilingual system)

The #1# does not exist and can not be translated into anything.

What you need in ajaxWDwx-settings.js is this:[color=brown] wrImg.src = imgDir+"wr-#LANG##DIR#.png"; wrImg.xlate = false; [/color]

PS: When you upload a new settings file to your server you need to press CTRL-F5 for the Browser to re-fetch the javascript files.
They get cached in your Browser for a looooooong time :lol:

How might one seperate out the “new” from the “original” settings so should this be implemented it will not totally bring down the site?

Hi Rainer,
thanks for your answer.
Please, could you tell me how to install your moon, almanc and uv index images??
Which parameters should i editin ajaxWdwx-settings.js?
Thanks again,

Alessandro

3 options:
A: ignore it, like Rainer says
B: remove the @, but I guess you want Date @ Time
C: replace the @ with at, and also change it in ajaxWDwx.js

id=“ajaxdate@” >> id=“ajaxdateat”

  set_ajax_obs("ajaxdate@"   , WDdt.date(uom.dateFmt) + ' @ '); // 6/4/2009 @
 set_ajax_obs("ajaxdateat"   , WDdt.date(uom.dateFmt) + ' @ '); // 6/4/2009 @

My way:
Make sure you do not overwrite files with the same name.

use ajax-dashboard-testpage.php (included with the distribution from Ken)

step 1:

replace

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

with

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

and replace

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

with

    <?php @include("ajax-dashboardxx.php") ?>

step 2:
make a copy off your original ajax-dashboard, and rename the copy to ajax-dashboardxx.php

Now upload the files;

ajax-dashboard-testpage.php
ajaxWDwx.js
ajaxWDwx-settings.js
ajax-dashboardxx.php

Here is your setup for ajaxWDwx-settings.js:


// ajaxWDwx.js setup for K3JAE Weather Station: www.k3jae.com
function loadSettings () {
//---------------------------
   useUOM = 'E';
   update.maxupdates = 0;
   flash.color = '#11B191';
//---------------------------
}; // end loadSettings
gotSettings = true;

That’s all you need to change or setup.
The rest is still the old default settings and have not changed.

You need to make the changes in ajax-dashboard.php for that.
Have a look at my source code here: http://www.bashewa.com/ajax-dashboard.php?sce=view

Hi Rainer,

Thanks to your


    <span class="conv........

see my trends-page, dates and times are not converted as I try to use the international format defined by ISO (ISO 8601) on my website.

Jozef

Hi Rainer,
i have last question for you.
If i need to make the changes in ajax-dashboard.php to show moon, uv index and almanac icons, what they be these settings in ajaxWdwx-settings.js?

uvImg.src     = imgDir+"uv#INDEX#.gif";
uvImg.width   = 34;
uvImg.height  = 65;
//uvImg.hspace  = 0;
//uvImg.vspace  = 0;
//uvImg.border  = 0;
//uvImg.style   = "";
//uvImg.align   = "";
uvImg.useTag  = "ajaxuvimg";


moonImg.src   = imgDir+"moon/#BG#/#NS#-moon#AGE#.gif";
moonImg.bg    = "w"; // #BG# = [ w | b ]
moonImg.width = 50;
moonImg.height= 50;
//moonImg.hspace= 0;
//moonImg.vspace= 0;
//moonImg.border= 0;
//moonImg.style = "";
//moonImg.align = "";
moonImg.useTag= "ajaxmoonimg";

Many thanks for your support,

Alessandro

I know … I still have to make a “convTime” function.

Alessandro, you have to change nothing … just see that the icons are in the proper folder on your server.

:?

I don’t manage to understand…
Which files should i change? Ajax-dashboard or AjaxWdwx-settings.js?
The icons are in the proper folder on my server.
Excuse me and thanks again,

Alessandro

Have you added the code for it into your ajax-dashboard.php yet?
You don’t have to do anything in ajaxWdwx-settings.js but lots of additions to ajax-dashboard.php.
See what I’ve done in my ajax-dashboard.php file here: http://www.bashewa.com/ajax-dashboard.php?sce=view

PS: If you don’t have any PHP knowledge I think you’re going to have a hard time.
It’s best Scott adds it to the dashboard.

Ok Rainer,

I’ll do it into my ajax-dashboard.
But why are there these code into the ajaxWDwx-settings.js if, to works correctly, should it be changed in ajax-dashboard? :wink:

No need to do it

in Settings.php I have


$SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03
$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'Y-m-d';        // ISO format

and in ajaxWDwx-settings.js


// ENGLISH UOM ---------------

imperialUOM.dateFmt = "Y-m-d";
imperialUOM.timeFmt = "H:i:s";
imperialUOM.timeHM  = "H:i";


// METRIC UOM --------------

metricUOM.dateFmt = "Y-m-d";

:slight_smile:

I’m working on version 5 of my alternative Dashboard now that will use this new script. I still have several things to work out yet but the work in process is up on my site now.

Scott

Scott
Am I a good guess that your version 5 unfortunately it is not multilingual version?

andretti

Hi Scott,
please, could you give me an eye with this error: http://www.meteocarmignano.it/ajax-dashboard.php
Many thanks,

Alessandro

Edit:

Andretti and Scott,

you could catch mine, i’ve had a hard job to make the alternative ajax-dashboard in multilanguage version.

Put this at the end of your ajax-dashboard.php script…

function langtransstr($word) {
   return $word;
}

function langtrans($word) {
   echo $word;
}

See if that fixes your error.