Alternative ajaxWDwx.js Script v 9.14

Unfortunately I cannot place the script aboved the error checking simply because the placement of the script is what places the GoogleMap also. If someone knows of a more reliable script where I can place an animated radar image, of similiar or better visual quality I would be happy to utilize it. Unfortunately this script seems outdated and I am constantly receiving errors on it. So I want to replace with a comparable radar image if there is one.

<!-- TOP TABLE ROW - FOR UPDATED HEADER & UOM SWITCHING -->
<?php // get last update time from testtags.php
   $tagsInterval = 5; // testtags.php upload interval in minutes
   $updTime = mktime($time_hour,$time_minute,0,$date_month,$date_day,$date_year);
   $nextUpd = mktime($time_hour,$time_minute+$tagsInterval,0,$date_month,$date_day,$date_year);
?>
<tr align="center">
   <td>
      <div onClick="javascript:ajax_changeUnits();" style="cursor: pointer;" title="Toggle units-of-measure &amp; restart"><b>
         <span id="uomM" style="color: gray;"><?php langtrans('METRIC'); ?></span> |
         <span id="uomE" style="color: blue;"><?php langtrans('IMPERIAL'); ?></span></b>
      </div>
   </td>
   <td class="data1" colspan="3" style="text-align: center">
      <span class="ajax" id="ajaxindicator"><?php langtrans('Updated'); ?>:</span>
      <span class="ajax" id="ajaxdate@">
         <noscript>
            <?php echo date("j/n/Y @ h:ia",$updTime).' - '.langtransstr('next update at').' '.date("h:ia",$nextUpd); ?>
         </noscript>
         <script type="text/javascript"><!--
            document.write("<?php echo $date.' @ '.$time; ?>");
         //--></script>
      </span>
      <span class="ajax" id="ajaxntimess">&nbsp;</span>
      <script type="text/javascript"><!--
         document.write(' <small><i>(<span id="ajaxcounter">0</span>&nbsp;<?php langtrans('sec ago'); ?>)</i></small>');
      //--></script>
   </td>
</tr>

ok, where exactly and what code am I supposed to replace in my ajax-dashboard.php file? I have tried several times and every time I get a blank page after the header and top warning displays. Also, I have my settings file set for E but it is displaying in Metric.

James

It looks like you are using HometownZone’s (Scott) “Alternative Dashboard Script” so you may want to look here for his latest release…Alternative Dashboard Script Released (Ver 5.03 FINAL RELEASE)

Also open up your ajaxWDwx-settings.js and go to line 118 remove one of the first quotes around the word moon (its an error in the downloaded package).

Jack

I just uploaded it and have the same result. If I look at the source, it stops processing at the following:

      <table width="100%" border="0" cellpadding="2" cellspacing="1" style="border:solid; border-color: #CCCCCC;">
<tr align="center">
   <td>
      <div onclick="javascript:ajax_changeUnits();" style="cursor: pointer;" title="Toggle units-of-measure &amp; restart"><b>
         <span id="uomM" style="color: blue;">

??? Update: I am getting the following error; Fatal error: Call to undefined function langtrans() in /home/content/j/j/m/jjmcnelly/html/ajax-dashboard.php on line 370

Your ajaxWDwx.js still has the double quote error…

moonImg.src   = imgDir+""moon/{BG}/{NS}-moon{AGE}.gif";

Ok, thanks. Fixed that, but still Fatal Error.

Fatal error: Call to undefined function langtrans() in /home/content/j/j/m/jjmcnelly/html/ajax-dashboard.php on line 370

Put this code at the end of your ajaxdashboard.php script…

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

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

Just before the “end of functions” statement

You are AWSOME! :smiley: Thanks! :cheers:

You are AWSOME! /

LOL not at all, just made the same mistakes!

Glad you got it working!

Thanks for all the feedback guys … any more suggestions?

I’m adding the option to show YoWindow as an icon.
See here for example: Bronberg Weather

Is anybody interested?

any more suggestions?

GRLevel3 Ajax Update and maybe advforecast2.php also? Radar being the more important as the forecast only updates a few times a day.

Jack

Not sure what I am looking for. I went to the site and it looks to be the same as prior, unless I am blind or just do not know what I am looking for, except I do see a webcam image now. Where is the YoWindow icon located?

Yeak, it look like a webcam … but it’s a Yowindow … give it a click.

Edit:
Maybe press CTRL-F5 to refresh my ajax script as well.

I absoluitely agree with the radar updating. It is a vital part of my site and having it update is important.
I might also just gently nudge you a little on the gen_difference conversion as well.

I see, I see says the blind man! :wink: Pretty cool. Might be something of interest even for the WDL users to incorporate.


Ok, in the next upcoming versions the following:
`

  1. radar image update …tag: ajaxradarimg
  2. sun path graph update …tag: ajaxsunpathimg [color=blue]Sun Path Graph[/color]
  3. sun position graph update …tag: ajaxsunposimg [color=blue]Sun Position Graph[/color]
  4. tide image update …tag: ajaxtideimg
  5. yowindow as an icon …tag: uses current icon tag (sample here: Bronberg Weather)
    `

You can implement the above tags in your ajax-dashboard.php so long and on other pages where needed.
At the same time implement the “convDate” and “convTime” tags for UOM switching to save you time later when upgrading to the new version of ajaxWDwx.js.

Any more requests?

Edit:
I’m working on the “gen_difference()” function.

What’s this: advforecast2.php … I don’t have this script.
Anyone got a page I can have a look at please?

Is there a snowyesterday tag that can be added?

Scott

Attached please see my advforecast2.php script.

Drop the “.txt” extension and there you have it. Was not allowed to upload a .php script.


advforecast2.php.txt (28.9 KB)

OH! opps, forgot to put in the other request… on the NWS forecast, currently it will not convert to Metric when using the convTemp tag. Can you work around this as well?

The advforecast2.php script I attached above may give you enough coding assistance to work this issue out.

And again… you are doing an AWESOME job in improving websites around the world!