Author Topic: Date in AJAX Dashboard isn't showing  (Read 3062 times)

0 Members and 1 Guest are viewing this topic.

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Date in AJAX Dashboard isn't showing
« on: September 01, 2012, 03:36:41 AM »
Hi there,

I don't know how I've done this but can somebody help? The actual "date" is not showing in the "Updated:" section.

Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #1 on: September 01, 2012, 11:19:44 AM »
The part of the ajax-dashboard.php that displays the date/time etc is supposed to read
Code: [Select]
          <td class="data1" colspan="4" style="text-align: center">
    <span class="ajax" id="ajaxindicator"><?php langtrans('Updated'); ?>:</span>&nbsp;@
    <span class="ajax" id="ajaxdate">
    <?php echo fixup_date($date) . ' ' fixup_time($time);
  if(isset($timeofnextupdate)) { echo " - " langtransstr('next update at') . " " fixup_time($timeofnextupdate);} ?>

    </span>&nbsp;<span class="ajax" id="ajaxtime"></span>
            <?php if(isset($SITE['ajaxScript'])) { ?>
            <script type="text/javascript">
<!--
document.write('<b> - <?php langtrans('updated'); ?> <span id="ajaxcounter"></span>&nbsp;<?php langtrans('sec ago'); ?></b>');
//-->
            </script>
            <?php // there is a ajaxScript ?>
          </td>

Somehow, you've omitted the closing </span> for the <span class="ajax" id="ajaxdate"> so the code generated by your ajax-dashboard has only
Quote
          <td class="data1" colspan="4" style="text-align: center">
          <span class="ajax" id="ajaxindicator">Updated:</span> @
          <span class="ajax" id="ajaxdate"></span> is missing here
          <span class="ajax" id="ajaxtime"></span>
                        <script type="text/javascript">
<!--
document.write('<b> - updated <span id="ajaxcounter"></span>&nbsp;sec ago</b>');
//-->
            </script>
                      </td>

put the code back as it was in the first code box and your date should show ok again.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #2 on: September 01, 2012, 01:10:43 PM »
Hi Ken,

Sorry, no luck. Done what you have said.

Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #3 on: September 01, 2012, 01:21:11 PM »
Hi Ken,

I have put in the code that you said and now this is stuck
Quote
01/09/2012 18:19 - next update at 18:20
so I don't know what to do now.

Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #4 on: September 01, 2012, 01:48:25 PM »
I suggest starting over with a clean copy of ajax-dashboard .. I"ve attached one below.  Save it as 'ajax-dashboard.php' and upload it to your site.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #5 on: September 01, 2012, 03:18:47 PM »
Hi Ken,

Ah ok, will just have to edit the entries again!

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #6 on: September 01, 2012, 03:21:33 PM »
Hi Ken,

Sorry, but that has not sorted the problem :/

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #7 on: September 01, 2012, 04:40:18 PM »
So, does the stock dashboard without editing work?  If so, then the editing is the problem... :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #8 on: September 02, 2012, 03:26:09 AM »
Hi Ken,

I'm not sure, I just installed a brand new ajax-dashboard.php like you said and it's still stuck.

Thanks

Will
« Last Edit: September 02, 2012, 11:20:02 AM by williamwilbur »
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #9 on: September 02, 2012, 03:34:02 PM »
With JavaScript disabled, your site shows
Quote
Updated: @ 02/09/2012 20:27 - next update at 20:28
which matches what CUtags.php?sce=dump shows
Quote
$WX['date'] = '02/09/2012'; // The current date
$WX['time'] = '20:27 on 02 September 2012'; // The current time and date. Example result: 18:30 on 30 December 2009.

Your wxstatus.php page shows current (except for WXSIM, which you should turn off in Settings.php since I don't think you have WXSIM installed).

Your realtime.txt is updating about every 5 seconds with a new time, so that appears to be working.

Turning on JavaScript in the browser, I see the update flashing and the time changing .. so I at a loss to understand what you're referring to as 'stuck'?

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #10 on: September 02, 2012, 04:00:36 PM »
Hi Ken,

I tried IE8 but still it should the "stuck" thing. I will post a photo of what I mean:

Here's the picture:



Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #11 on: September 02, 2012, 04:11:47 PM »
Ahh, it's working in Firefox, just not in IE-8.

Maybe it's due to the number of HTML errata on the page ( http://validator.w3.org/check?uri=http%3a%2f%2fwww%2enewton%2dpoppleford%2dweather%2eco%2euk%2f ) and that IE and Firefox have different underlying JavaScript and rendering processing engines.  I suggest you get the HTML errata down to none, then see if the stock dashboard (with no mods) behaves as you expect with IE.

BTW.. please lose the <embed> for station.mp3 .. I agree with most folks that sudden appearance of sound is disconcerting at best, and very intrusive (and bandwidth expensive) and doesn't lead to a better website viewing experience.

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #12 on: September 02, 2012, 04:20:52 PM »
Hi Ken,

I actually mainly use Google Chrome just in that instance was checking if I had the same problem in IE8. How do I clean that validator thing down to none?

Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #13 on: September 02, 2012, 04:42:27 PM »
Start with the first error mentioned by the validator.
Fix that one.
revalidate.
Repeat as needed.

It's important to start with the first listed error as that may cause the validator to flag a cascade of errors based on that one.

As shipped, the templates start with valid XHTML 1.0-Transitional so it's likely that changes to the pages have been the source of the errata.

Here's a few hints:
1) the
Code: [Select]
<meta http-equiv="PRAGMA" content="NO-CACHE">
<meta http-equiv="REFRESH" content="300">

is in the <body> section and needs to be in the <head> section.  For XHTML compliance, it also has to have closed tags like
Code: [Select]
<meta http-equiv="PRAGMA" content="NO-CACHE"/>
<meta http-equiv="REFRESH" content="300"/>
2) the
Code: [Select]
Newton Poppleford, Devon, United Kingdom</br> should be
Code: [Select]
Newton Poppleford, Devon, United Kingdom<br/>XHTML has self-closing codes for <meta .../>, <br/>, <img .../>, <hr/>

Hope this helps...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #14 on: September 02, 2012, 04:51:19 PM »
And... the entire date thing may be caused by a change to ajax-gizmo.php which currently reads
Code: [Select]
                <span class="ajax" id="gizmoindicator">&nbsp;<?php langtrans('Updated'); ?>:
and should read as
Code: [Select]
    <span class="ajax" id="gizmoindicator"><?php langtrans('Updated'); ?></span>:&nbsp;

That missing </span> can cause a cascade effect that may be interpreted differently by FireFox v.s. Google Chrome v.s. IE.

If you don't need a specific change in ajax-gizmo.php, I suggest you replace your copy with a current one from the distribution and that will likely fix the dates issue by itself -- but... do work through the validation errata.  You can only be assured of proper page rendering on pretty much every browser if the HTML is without error, otherwise you rely on the good graces of each browser to try and interpret what you meant by the markup you'd used.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #15 on: September 03, 2012, 02:48:11 AM »
Hi Ken,

Been working on this for ages and my brain has been blown lol! How the? How do you clear all these warnings out before trying to dismantle your website at the same time? Please help!!!

Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline neondesert

  • Forecaster
  • *****
  • Posts: 628
    • http://www.neondesertweather.com
Re: Date in AJAX Dashboard isn't showing
« Reply #16 on: September 03, 2012, 11:53:13 AM »
Been working on this for ages and my brain has been blown lol! How the? How do you clear all these warnings out before trying to dismantle your website at the same time? Please help!!!
You might want to try using Firefox with the HTML Validator plug-in.
It has a "clean-up" option to aid in correcting validation errors.

A couple of things to remember if you use the plug-in. 

- Run it on the source code of the page not the output of the browser.
- When setting up the plug-in choose SGML Parser for the algorithm. (It's the same one use by http://validator.w3.org)
- ALWAYS make sure you have a backup copy of your source just in case the clean-up process doesn't give you the results you want.

Larry
"But it's a DRY Heat!"


Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #17 on: September 03, 2012, 12:22:20 PM »
Hi neondesert,

Tried the cleanup but I don't know if i've done it or not. Either way the problem still stands.

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #18 on: September 03, 2012, 03:15:25 PM »
Hello?

This topic seems to have died a death! Please help!!! :(

Thanks

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #19 on: September 03, 2012, 03:45:15 PM »
The issue is likely in your header.php file where you have
Code: [Select]
        <span class="ajax" id="ajaxdate">
      </div>

The area should read
Code: [Select]
        <span class="ajax" id="ajaxdate"></span>
      </div>

But... you should take out the <span class="ajax" id="ajaxdate"></span> altogether.  The reason is simple.. HTML allows only one instance of a id="ajaxdate" in a page, and that is already used in the ajax-dashboard.php .. when the second instance is found, it is ignored.
So the HTML error+the <span class="ajax" id="ajaxdate"></span> appearing in the header.php causes the one in ajax-dashboard.php to be ignored and thus your date updates are failing.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #20 on: September 03, 2012, 03:58:53 PM »
YES OMG YES THANKYOU OMG THANKYOU SO MUCH KEN!!!!! IF I WAS A GIRL I WOULD KISS YOU YOU'RE THAT AMAZING! THANKYOU! THANKYOU! THANKYOU! :D

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Date in AJAX Dashboard isn't showing
« Reply #21 on: September 03, 2012, 04:01:13 PM »
You're welcome, Will.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline William Grimsley

  • Forecaster
  • *****
  • Posts: 1103
    • Newton Poppleford Weather
Re: Date in AJAX Dashboard isn't showing
« Reply #22 on: September 03, 2012, 04:03:37 PM »
Thanks again! Sorry my response was a bit over the top but it was great i've got it working again! You should be awarded an OBE of "Website Scripting" LOL :D

Thanks so much :)

Will
http://www.newton-poppleford-weather.co.uk
Davis Vantage Vue - Cumulus v1.9.4 (1084)
Weather Underground: IDEVONEX12
Met Office WOW: 717144
PWS Weather: ENG128597