Author Topic: Ajax Website Not Updating  (Read 17589 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #25 on: December 16, 2007, 12:26:10 AM »
2.8 degrees.. brrrrrr.  :shock:  Glad I live in California (snow only every 15 years or so, then only a dusting).

But.. to get the two day forecast with icons on your homepage, you'll need to change wxlocal.html in your \wdisplay\webfiles directory from
Code: [Select]
<h3>FORECAST</h3>
<p><b><span style="text-transform: uppercase">%5dayforecastdayday1%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday1%</span></p>

<p><b><span style="text-transform: uppercase">%5dayforecastdayday2%</span></b>
<br /><span style="text-transform: capitalize">%5dayforecastday2%</span></p>

<span style="font-size: 10px;"><a href="wx2.html" title="5-day Forecast">Click for extended</a></span>
to
Code: [Select]
<?php
$doPrintNWS 
false;
require(
"advforecast2.php"); ?>


<table>
<tr valign="top">
<?php print "<td align=\"center\">$forecasticons[0]<br />$forecasttemp[0]</td>\n"?>
<?php print "<td align=\"left\" valign=\"middle\">$forecasttext[0]</td>\n"?>
</tr>
<tr valign="top">
<?php print "<td align=\"center\">$forecasticons[1]<br />$forecasttemp[1]</td>\n"?>
<?php print "<td align=\"left\" valign=\"middle\">$forecasttext[1]</td>\n"?>
</tr>
</table>
<span style="font-size: 10px;"><a href="wx2.php" title="5-day Forecast">Click for extended</a></span>

Which will put two icons+conditions+temps and text forecast there.

You'll also need to use the internet file settings to upload wxlocal.html as index.php (instead of index.html) to make it work.

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 Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #26 on: December 16, 2007, 05:34:34 AM »
I did the above and ended up with a index.html and and index.php in the root directory.  As long as index.html is in there this is what the website is displaying.  I renamed index.html to index.txt thinking that this would force the website to load up the index.php and now I'm getting a 403 forbidden error??  The file permissions for index.php is 644 just like all the other local pages.  How do I make it take the index.php file and use it in place of index.html??  Seems to be a conflict.

Thank you,

Doug

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #27 on: December 16, 2007, 10:10:09 AM »
I've learned that to switch from index.html to index.php that I have to have a .htaccess file in the root directory of the public_html.  I open up a blank file naming it .htaccess and from what I have read I need to put "DirectoryIndex index.php" into the file which I did.  The "DirectoryIndex index.php" is the only thing in the file.  After doing this and attempting to go to the website url I'm getting.........

Quote
Forbidden

You don't have permission to access / on this server.

www.bigbaywx.com

The permissions for the .htaccess & index.php in the control panel are both "644".  Where to go from here??

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #28 on: December 16, 2007, 12:11:48 PM »
Disregard...It's working now

I pulled a support ticket and now it's up and running correctly.  Not sure if the hosting company changed things or if it took an hour or so for the new .htaccess file to be recognized.

Thanks to Ken and everyone else for their help!!

Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 255
    • Branford Weather
Re: Ajax Website Not Updating
« Reply #29 on: December 16, 2007, 01:28:40 PM »
Nice work Doug....looks great!

Jack

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: Ajax Website Not Updating
« Reply #30 on: December 16, 2007, 07:02:57 PM »
Fun when you get it all squared away, isnt it? Looks Good!!
Tony




Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #31 on: December 16, 2007, 07:37:31 PM »
You jinxed me CNY!!   #-o

Now my astronomy page is broken.  http://www.bigbaywx.com/wx7.html  The icons are showing up all right but the sunrise, sunset and phase percentages are not showing up.  The WX7 is uploading via ftp on an hourly basis.  The solar and lunar coordinates are squared away in the control panel with the right lat/long and the data is appearing in the control window...

Quote
Date: 12/16/2007
Sunrise at:
8:29:11 AM

Sunset at:
5:03:04 PM

Moonrise at:
12:37:52 PM 12/16/07

Moonset at:
11:12:03 PM 12/15/07

First Quarter  17 December 2007
Full moon  24 December 2007
Last Quarter31 December 2007
New moon 8 January 2008
Moon age: 6 days,3 hours,14 minutes,46%
Hours of possible daylight today was 8:34:00

When I hit the update times to the web site in the control panel the ftp manager opens but it says there is nothing to upload.

Quote
*******list of files uploaded********

*******actual messages from upload session********
***Start Time/date***:7:34:34 PM 12/16/2007
miz005.txt
miz005.txt
Permanent connection selected
Permanent connection, will do ftp now
Internet sharing...
Finshed email agenda
Finished email agenda, no FTP items to do...
Doing abort procedure/program close...


I do appreciate the hand holding folks.  Any more ideas??

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #32 on: December 17, 2007, 02:29:49 PM »
bump....

Astronomy still messed up.  Any ideas from anyone??

Thanks in advance....

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #33 on: December 17, 2007, 04:19:43 PM »
Actually, it looks like wxlocal6.html ... wxlocal10.html aren't being uploaded as wx6.html ... wx10.html (not just your wxlocal7.html -> wx7.html).  It's just not as visible on those pages as the AJAX update ovewrites the date/time tags on those pages too.

Something is amiss in your ftp setup.  You do have wxlocal6.html ... wxlocal10.html in your c:\wdisplay\webfiles directory don't you?  Are there updated wx7.html ... wx10.html files in the same directory?  If so, it's likely an FTP setup issue.. please attach a recent ftp log.

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 Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #34 on: December 17, 2007, 06:09:18 PM »
I'm not surprised that wx10 isn't updating as I don't have that turned on.  I don't upload 9 or 10 because they don't change.  However both wx6 & wx7 are scheduled for every 30 minutes.  However according to the log....

 
Quote
*******Files to upload********
Local files: C:\Program Files\wdisplay\webfiles\wx.html
Local files: C:\Program Files\wdisplay\webfiles\wx2.html
Local files: C:\Program Files\wdisplay\webfiles\wx3.html
Local files: C:\Program Files\wdisplay\webfiles\wx5.html
Local files: C:\Program Files\wdisplay\webfiles\clientraw.txt
Local files: C:\Program Files\wdisplay\webfiles\clientrawextra.txt
Local files: C:\Program Files\wdisplay\webfiles\clientrawdaily.txt
Local files: C:\Program Files\wdisplay\webfiles\clientrawhour.txt
Remote files:  index.php
Remote files: wx2.php
Remote files: wx3.html
Remote files: wx5.html
Remote files: clientraw.txt
Remote files: clientrawextra.txt
Remote files: clientrawdaily.txt
Remote files: clientrawhour.txt

They were not being uploaded so I went into the control panel and cancelled the uploads for 6 & 7 and set them up all over again and forced an upload on each.  The graphs on 6 are showing just fine although the WD version tag on the bottom of the page is still showing %wdversion%.  After the forced upload of #7 the astronomy times are now showing but I will have to wait until the next scheduled upload to make sure it's automatic.  It was set right in the CP but for some reason it wasn't doing it.  Just for grins I attached a screen shot of a partial listing of my webfiles window and it's showing all the files in there.  Thanks for your help....something still a little funky though.

Doug




Offline BfdWx

  • WxElement panel
  • Senior Contributor
  • *****
  • Posts: 255
    • Branford Weather
Re: Ajax Website Not Updating
« Reply #35 on: December 18, 2007, 11:55:48 AM »
Doug,

Looks good now, wdversion is showing properly and it seems to be updating. Check the daylight tag though, something is strange with that.

Jack

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #36 on: December 18, 2007, 02:29:30 PM »
Yeah, I see that too.  Something up with that tag.  I think it's set up right as I didn't change anything. 


<td width="50%" align="center">Sunrise: %sunrise%<br />Sunset: %sunset%<br />Daylight: %hoursofpossibledaylight%</td>


Something up with that hours of possible daylight for sure.  Taking a look at the page source show this...

 
<td width="50%" align="center">Sunrise: 8:30am<br />Sunset: 5:03pm<br />Daylight: 0-15:0-34</td>


I'm just glad it's working as well as it is right now!!  LOL

I'll wait a few days before I start with some new scripts and changing the colors around.  Gotta walk before you can run.   ](*,)

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #37 on: December 21, 2007, 06:51:55 PM »
NWS has issued a winter storm watch and wx4 has the advisory with the map data but the advisory itself isn't appearing on the home page as it has in the past.  About the only thing that has changed since the last storm watch was going to the direct NWS forecast and icons on the main page and wx2 but I didn't change any of the advisory scripting on the main page.  Can someone take a looksee??  www.bigbaywx.com  Thanks again in advance.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #38 on: December 21, 2007, 08:49:26 PM »
With the current coding on your index.php, it uses JavaScript to examine %NOAAevents% WD tag to pop up a warning or not.  Your index.php would need to be uploaded regularly through WD to ensure that the %NOAAevents% variable is substituted for.  You're not seeing the alert on your homepage because wxlocal.html is not being processed by WD into index.php.

If you want to stick with the current coding on the page, just enable WD to upload wxlocal.html as index.php and all will be well with the warnings.

If you want to continue to NOT have the index.php page uploaded by WD, you'll need to switch to a PHP script to get the info.   You could use the rss-top-warning.php script and change
Code: [Select]
    <div id="main-copy">

<script type="text/javascript">
<!-- Javascript advisory message only appears when there is an advisory -->
<!--
var warning = "%NOAAEvent%".toUpperCase();
var link = "wx4.html";
if (warning != "NO CURRENT ADVISORIES" && warning != "SHORT TERM FORECAST" && warning != "SPECIAL WEATHER STATEMENT") {
if (warning.indexOf("WATCH") > 0) {
       document.write('<div class="watchBox"><a href="' + link + '" style="color: #FFFFFF;"><b><span style="text-transform: uppercase;">%NOAAEvent%</span></b> IN EFFECT ... [Click here for more]</a></div><br />');
}
else if (warning.indexOf("WARNING") > 0) {
       document.write('<div class="warningBox"><a href="' + link + '" style="color: #FFFFFF;"><b><span style="text-transform: uppercase;">%NOAAEvent%</span></b> IN EFFECT ... [Click here for more]</a></div><br />');
}
else {
       document.write('<div class="advisoryBox"><a href="' + link + '" style="color: #FFFFFF;"><b><span style="text-transform: uppercase;">%NOAAEvent%</span></b> IN EFFECT ... [Click here for more]</a></div><br />');
}
}
//-->
</script>
on index.php to be
Code: [Select]
    <div id="main-copy">

<?php  include("rss-top-warning.php"); ?>
and change rss-top-warning.php from
Code: [Select]
// settings ----------------------------------------------------------
$DefaultZone = 'CAZ513'; // <== change this to your zone
$hurlURL = "rss-advisory-test-c.php?zone=ZZZZZ"; // <=== change this default to webpage
to
Code: [Select]
// settings ----------------------------------------------------------
$DefaultZone = 'MIZ005'; // <== change this to your zone
$hurlURL = "wx4.html"; // <=== change this default to webpage

and you should be back in business.

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 Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #39 on: December 21, 2007, 09:39:40 PM »
Thanks again Ken!!

I'm at work so I'll look into that when I get home.  I could swear though that the wxlocal file is being uploaded every 5 minutes.  I don't think that I changed that at all when I went to the .php from the .html format on the index page.  But, so far your scripts have not been too hard to implement with a little hand holding so I'll probably do that with this as well.  10" or more of heavy wet snow on the way followed by lake effect and really cold.  Gotta love it!!  Was nice to have at least a few days up into the 30's.  Found out today that the rain gauge actually works.  The snow melted that was on top of it.  LOL.  Now we'll be back to the deep freeze again.


@2322hrs
Updated to the new script per instructions and it's working fine!!  Thanks a million. 
« Last Edit: December 21, 2007, 11:23:22 PM by Hfcomms »

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: Ajax Website Not Updating
« Reply #40 on: December 22, 2007, 07:56:07 AM »
The site has come a long way pretty quick. Looks good. Can I offer just 1 suggestion?
Get another radar image for your front page. The static one couls use a little help.

tony
Tony




Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #41 on: December 22, 2007, 08:49:38 AM »
Tony,

I'm all for it.  I see that carterlake has some radar scripts.   I would certainly like a source that has more of the U.P. highlighted but I know if I put a different size plot in I'm going to screw up the rest of the page so any pointers would be helpful.

Thanks,
Doug
« Last Edit: December 22, 2007, 08:57:37 AM by Hfcomms »

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2295
    • CNYWeather
Re: Ajax Website Not Updating
« Reply #42 on: December 22, 2007, 10:07:46 AM »
I'll play later at work if I have a chance and do some searching for you.

If you ever wanna try .php, lemme know. It's kinda fun actually LOL
Tony




Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #43 on: December 22, 2007, 11:17:34 AM »
Thanks Tony;

I found the larger version of the default radar and set that to wx3 instead of the national radar.  (http://www.bigbaywx.com/wx3.html)  I also found an accuweather animated .gif that I like and was thinking of using that one on the main page.  http://sirocco.accuweather.com/sat_mosaic_400x300_public/rs/isarMI_.gif  The only problem with that one is it kind of truncates the U.P. of Michigan which of course is my area of interest.  Don't know too much about the level 3 radar package...might be interested in that if it isn't too terribly expensive.  Have also considered changing everything over to .php but that's still almost as new to me as .html though.  The main page and wx2 are both php to run the scripts at this point. 

Yep, if you get a chance to research anything or to point me in the right direction it's appreciated but with the holidays and everything I'm certainly not in a hurry.  First things first...not going anywhere here!!   :-P  I sure do like some of the things you have done with your site.  (licking the chops here..)

Thanks for everything.

Doug

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax Website Not Updating
« Reply #44 on: December 22, 2007, 11:30:28 AM »
Doug,
As you shop for graphics to include on your site, keep aware of the Terms of Service regarding images/data on the source site.  Generally, anything on NOAA sites is free to use.  Wunderground graphics are ok if you are a Wunderground member and you credit the source of the graphic.

Weather.com, AccuWeather.com, IntelliWeather.com all have much more stringent reuse (or no-reuse, even with attribution) requirements  -- be careful that you don't violate their copyrights.

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 Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #45 on: December 22, 2007, 12:44:22 PM »
Ken,

Thanks for the info.  I don't want to violate someone else's images as I sure want to do it right.  Was looking at your page and you have the weather underground radar display using carterlake's scripts.  I might try to set that one up for my radar page.  Looking at his scrips he wants you to pull down the graphics from his site, i.e. "http://www.carterlake.org/radar1.gif" ect.  Question would be do I need another folder in the public_html to put these .gif's??  Or can I dump them in an existing image folder or something.  (updated later...found the answer to that one.  Put them in the home directory) Also are there any helps for selecting all the multiple sourcing information in the script.  My home radar would be KMQT or just MQT. So in the default script would I just have to remove the "OAX" radar identifier in each spot and insert "MQT" or is there more to it?? (updated later...everywhere I found the OAX identifier I put in MQT)

I understand like the other .php scripts that the script itself would go in the home directory.  Using the wx3 page what .php code would need to be put into that page for it to work??  I'm guessing that the " <img src="http://icons.wunderground.com/data/640x480/2xradara4.gif" alt="Radar" width="640" height="480"></img>" would have to come out and the appropriate php code inserted at that point.  Also guessing that wx3 would have to be uploaded as wx3.php as well.  Thanks for all the assistance guys.  Just want to make it better.


   
« Last Edit: December 22, 2007, 04:27:42 PM by Hfcomms »

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #46 on: December 22, 2007, 04:19:36 PM »
Additional questions.....

I have it partially running.  I'm currently accessing under www.bigbaywx.com/radartest.php

The first question and I know I'll add to it is how to set the lat/long in the .php for the location.  It's still defaulting to "carter lake" location of course even though I have replaced some of the tags with "big bay".  The existing script has the following for the carter lake location as an example.  I'm taking this from the code for the radar 1 map as a partial line.......

"<span style="position: relative; left: 0px; top: 0px"><img src="http://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?station=MQT&brand=wui<?php echo $AnText; ?>&type=N1R&frame=0&scale=0.125&noclutter=0&t=1120003015&lat=0&lon=0<?php echo $TrText;"

I'm not sure if the code before the lat/long has anything to do with the static location.  The rough location for my station is 46.44.38N by 87.39.05W

Offline Hfcomms

  • Senior Member
  • **
  • Posts: 83
    • Big Bay, Mi - Local Weather
Re: Ajax Website Not Updating
« Reply #47 on: December 22, 2007, 10:21:44 PM »
Well,

Making a lot of progress here and answering a lot of my own questions with trial and error.  Figured out how to plot my locations on the various maps.  What a pain in the tail!!!  I'm going to save this script in a couple of different places.  I think I hate plotting pixels.  LOLOLOL    ](*,)

O.K.
Still have some questions that I will need help on.  First of all I will still need the php code that I have to insert into the wx3local.html in order to change it to wx3.php and load the radartest script.

Secondly there is a mapping problem that I cant figure out how to fix.  Look at this location as a shortcut.  That radar map has to shift way to the left and up.  Marquette or preferably Big Bay needs to be centered in the radar display.    http://www.bigbaywx.com/radartest.php?mode=1&animated=0&track=0&advisories=0&lightning=0


The existing script for this radar has this partial line as a default  "0&t=1120003015&lat=46.7438&lon=-87.6513<?php echo $TrText; ?>&map.x=400&map.y=240&centerx=150&centery=203&transx=-227&transy=-37"  I'm not quite sure what to change on that without messing it up.  I didn't have to change the default mapping on any of the others.

Making progress!!

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Ajax Website Not Updating
« Reply #48 on: December 23, 2007, 08:18:32 AM »
For getting the map you want, what I did was go to wunderground and center on my location.  When you have what you want, right click on the image and select properties.  The url there is what you want to place in your code.  Do this for the different zoom levels that you desire and you'll be all set.

As for the .php extension, that is changed in the upload portion of Internet File Creation & Uploads.

Good luck.  - Jim

Forum Search and Google Can be Your Best Friends