Author Topic: ajax/web update problem  (Read 1460 times)

0 Members and 1 Guest are viewing this topic.

Offline kolumb

  • Member
  • *
  • Posts: 4
ajax/web update problem
« on: October 01, 2012, 10:08:22 AM »
hello everybody, I'm Mike, it's nice to be a member of the weather enthusiast's forum :)

It's not a good idea to start with complaining, but I have a problem I'm not able to solve.
I created an ajax php site with realitime updates (as all of you). Unfortunately there is a problem with updates from Cumulus.
When I refresh the page, for a short time (two seconds or so) it shows the current conditions, but then
there's something like a 'revert' and the page displays data from yesterday before midnight (always the same time). The information
and the files on the server are up to date. I looked through the php and js files,
xml etc, but can't find what's wrong. Hope somebody knows the answer, I haven't found anything on the forums, doctor Google
seems not to know the solution either.

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: ajax/web update problem
« Reply #1 on: October 01, 2012, 10:26:53 AM »
Hey Mike...welcome,
I am sure someone on here will be able to help, or at least try.
But you should give us your site's URL so we can have a look.  Just post it and/or put it in your profile.

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline kolumb

  • Member
  • *
  • Posts: 4
Re: ajax/web update problem
« Reply #2 on: October 01, 2012, 10:39:52 AM »

Offline ed2kayak

  • Ed
  • Forecaster
  • *****
  • Posts: 613
  • Davis Vantage Pro2 w/12 hr FARS, solar/uv
    • Cumberland Valley Weather
Re: ajax/web update problem
« Reply #3 on: October 01, 2012, 10:59:01 AM »
Your status page may help you, see what isn't updating correctly:.

http://www.s385323554.domenaklienta.pl/pogoda/wxstatus.php
Ed
CoCoRaHS PA-CD-6,  Weather Underground KPAMECHA7, CWOP DW5425

Offline kolumb

  • Member
  • *
  • Posts: 4
Re: ajax/web update problem
« Reply #4 on: October 01, 2012, 11:13:56 AM »
well, I spent quite a few hours looking at various settings in php and js files,
everything seems to be updating fine, I created several links to htm pages
from cumulus realtime web and right below Home in the menu there is a linkt to such a page, which
seems to be up to date, what is more the homepage also updates correctly as the 'right' data is
displayed for a short time and it keeps updating everytime Cumulus sends new data, but then
suddenly something happens that makes the homepage present data from 30/09/12.
When you refresh my homepage, you may notice that there are current conditions displayed
for a  short time (although the date shows as if today was 01/01/1970 - I'll try to solve it later)
and then again yesterday jumps in.

Mike

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ajax/web update problem
« Reply #5 on: October 01, 2012, 12:55:44 PM »
Hi Mike, and welcome to WXForum.net :)

In your Settings-weather.php, you have two entries that are not quite right
Code: [Select]
$SITE['C:\Cumulus']   = './realtime.txt';  // directory and name of Cumulus realtime.txt file

$SITE['C:\Cumulus\web']  = './images/';     // directory location for graph images with trailing /
Those should read as
Code: [Select]
$SITE['realtimefile']   = './realtime.txt';  // directory and name of Cumulus realtime.txt file

$SITE['graphImageDir']  = './images/';     // directory location for graph images with trailing /
for them to work with the rest of the pages/scripts.  The name inside $SITE['...'] should not be changed as it is the 'key' used by other parts of the templates to be configured with the value(s) to the right of the equal sign.

The AJAX update issue is likely caused by ajaxCUwx.js expecting the realtime.txt file to be in the document root of the website.  Since you installed in a subdirectory, I suggest you change ajaxCUwx.js from
Code: [Select]
var realtimeFile = '/realtime.txt'; //  URL location of realtime.txt relative to document root of website
to
Code: [Select]
var realtimeFile = './realtime.txt'; //  URL location of realtime.txt relative to document root of website
so it will read the realtime.txt file from the directory in which the page is located.

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 PaulMy

  • Forecaster
  • *****
  • Posts: 5519
    • KomokaWeather
Re: ajax/web update problem
« Reply #6 on: October 01, 2012, 01:00:53 PM »
Hi Mike, and welcome to the forum from Komoka, Canada

Paul

Offline kolumb

  • Member
  • *
  • Posts: 4
Re: ajax/web update problem
« Reply #7 on: October 01, 2012, 02:04:00 PM »
well, I did what Ken suggested with ajaxCUwx.js and ...it worked :)
I spent half a night changing various things across the website but didn't think about that.

Thank you very much indeed, Ken.

Best regards
Mike

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9296
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ajax/web update problem
« Reply #8 on: October 01, 2012, 02:13:20 PM »
You're very welcome, Mike .. glad to help out.

Let us know if you need other assistance, and when you get your full domain name working, let me know and I'll add you to the list of sites :)

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