cloudy

Author Topic: Buoy Data Winter  (Read 754 times)

0 Members and 1 Guest are viewing this topic.

Offline bhogsett

  • Posts: 182
  • Cleveland, Ohio, USA
  • OS/Browser:
  • Mac OS X 10.7
  • Firefox 11.0
    • BoatHouse Weather
Buoy Data Winter
« on: March 01, 2012, 06:10:00 PM »
I am starting to put the buoy data php script onto my webpage.

I live in Cleveland, OH and all of the buoys in the Great Lakes have been removed for the winter.

I get errors for each of the buoys that say:

Notice: Undefined offset: 2 in /Users/bhogsett/wd.com/buoy/buoy-data16.php on line 372

The offset number varies depending on which value the script is trying to find.

The script then displays my map and the ID and name of the buoy followed by "No recent reports."

Do I need to modify the script to handle no recent reports?

Oh, if I use a much older version (1.06) of the script I do not get the error message.

Thanks.

Bill



Offline saratogaWX

  • Posts: 5,030
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win XP
  • Firefox 10.0.2
    • Saratoga Weather
Re: Buoy Data Winter
« Reply #1 on: March 02, 2012, 01:45:03 AM »
Wow, Version 1.06 - 22-Feb-2007 is a real oldie.. surprised it still works given that the current release is Version 1.16 - 21-Nov-2010  :)

I'd need an URL to the page on your site showing the problem to help with further diagnosis...

Notice: errata are not harmful in themselves .. they just indicate an uninitialized variable likely caused by missing data in the first place.

Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline bhogsett

  • Posts: 182
  • Cleveland, Ohio, USA
  • OS/Browser:
  • Mac OS X 10.7
  • Firefox 11.0
    • BoatHouse Weather
Re: Buoy Data Winter
« Reply #2 on: March 02, 2012, 12:51:05 PM »
Thanks, I am currently testing on my localhost and will need some time (over the weekend) to set it up on my webserver.


Offline saratogaWX

  • Posts: 5,030
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win XP
  • Firefox 10.0.2
    • Saratoga Weather
Re: Buoy Data Winter
« Reply #3 on: March 02, 2012, 07:50:17 PM »
Ahh.. sorry, I can't help debug that which is not visible via the internet .. my clairvoyance is very low :)
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline bhogsett

  • Posts: 182
  • Cleveland, Ohio, USA
  • OS/Browser:
  • Mac OS X 10.7
  • Firefox 11.0
    • BoatHouse Weather
Re: Buoy Data Winter
« Reply #4 on: March 04, 2012, 11:48:56 AM »
Ahh.. sorry, I can't help debug that which is not visible via the internet .. my clairvoyance is very low :)

I really thought you were clairvoyant.  :D

I have now installed version 1.16 on my server.  AND IT WORKS!

Sorry for the false report of a bug.

Nice program.

Bill

Offline bhogsett

  • Posts: 182
  • Cleveland, Ohio, USA
  • OS/Browser:
  • Mac OS X 10.7
  • Firefox 12.0
    • BoatHouse Weather
Re: Buoy Data Winter
« Reply #5 on: March 30, 2012, 11:22:08 AM »
OK, the record warm winter here in Cleveland is over.  But I bet we still get a big snow.  Opening day is sometimes snowed out here and often darn cold.

The first lake buoy has been inserted and I have one problem.

The rotating updates of data are not displayed on the map next to the buoy, but instead are off the map and below its bottom left corner.

Here is the link:

http://billhogsett.com/wd/wxOpages/wxObuoys.php

Clairvoyance is no longer needed to see the page!  I have left in debugging echoes that I used to try to track down the issue.

Can someone take a look and show me the error of my ways?

Thanks

Bill


Offline saratogaWX

  • Posts: 5,030
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win XP
  • Firefox 11.0
    • Saratoga Weather
Re: Buoy Data Winter
« Reply #6 on: March 30, 2012, 05:25:53 PM »
OK, the record warm winter here in Cleveland is over.  But I bet we still get a big snow.  Opening day is sometimes snowed out here and often darn cold.

The first lake buoy has been inserted and I have one problem.

The rotating updates of data are not displayed on the map next to the buoy, but instead are off the map and below its bottom left corner.

Here is the link:

http://billhogsett.com/wd/wxOpages/wxObuoys.php

Clairvoyance is no longer needed to see the page!  I have left in debugging echoes that I used to try to track down the issue.

Can someone take a look and show me the error of my ways?

Thanks

Bill


It's a tricky business to have a centered buoy map..  you can't use <center>...</center> to do it.. it will cause a map-over-map to appear.

I suggest you use
Code: [Select]
$doPrintBUOY=false;
include_once("buoy-data.php");
print $BUOY_CSS;
?>
</head>
at the start of the page, and
Code: [Select]
<div id="main-content">
 
 <table width="99%">
 <tr><td align="center">
   <table width="100%">
   <tr>
     <td align="center">
      <?php print $BUOY_MAP?>
     </td>
   </tr>
   <tr>
     <td align="left">
       <?php print $BUOY_TABLE ?>
     </td>
   </tr>
   </table>
   </td></tr>
 </table>

</div><!-- end main -->
for the body where you'd like the centered buoy-data information to appear.
Don't forget to comment out your print statements with debugging code.

BTW.. the reason the rotating conditions were not displayed in the right place was due to not having the CSS printed in the <head></head> section of the page.

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline bhogsett

  • Posts: 182
  • Cleveland, Ohio, USA
  • OS/Browser:
  • Mac OS X 10.7
  • Firefox 12.0
    • BoatHouse Weather
Re: Buoy Data Winter
« Reply #7 on: March 30, 2012, 07:14:37 PM »
It's a tricky business to have a centered buoy map..  you can't use <center>...</center> to do it.. it will cause a map-over-map to appear.

...

BTW.. the reason the rotating conditions were not displayed in the right place was due to not having the CSS printed in the <head></head> section of the page.


Thanks Ken, I will look at the centering issue, but I don't understand the comment about the CSS not being in the head.  Sure looks like it is there to me.

Am I missing some part of the CSS?  Doesn't look like it.

Bill

Offline saratogaWX

  • Posts: 5,030
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win XP
  • Firefox 11.0
    • Saratoga Weather
Re: Buoy Data Winter
« Reply #8 on: March 30, 2012, 08:12:26 PM »
Hmmm... the issue seems to be that the generated CSS is missing the position item for id="buoy45005" .. the data is there, but the generated CSS by buoy-data.php should appear in the $BUOY_CSS just after the
Code: [Select]
#BuoyControls a {
      padding: 3px 3px;
  background: #666666;
  color: white;
  border: 1px solid white;
}
as an entry like
Code: [Select]
#buoy45005 {
      top:  75px;
      left: 304px;
}
I don't know why NONE of the positioning CSS entries are generated (there should be one of the #buoy.... entries for each buoy in the configuration  .. maybe something you did adding some debug code to the script?

I suggest trying a fresh download of the script from http://saratoga-weather.org/buoy-data.php?sce=view , doing your customization and see if that fixes the issue.  BTW.. I have no idea where you'd installed the buoy-data.php script, otherwise I'd have looked at its source :(

do change the page to have the two-table method to center the map.. it is the only way I've found that reliably centers the buoy map without artifacts (like a map-shifted-right over a map below).

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline bhogsett

  • Posts: 182
  • Cleveland, Ohio, USA
  • OS/Browser:
  • Mac OS X 10.7
  • Firefox 12.0
    • BoatHouse Weather
Re: Buoy Data Winter
« Reply #9 on: March 31, 2012, 12:27:12 PM »
I finally figured out my problem.

As I have said elsewhere I create pages in a radically different way than you and the other authors intended.  See

http://www.weather-watch.com/smf/index.php/topic,55311.msg444443.html#msg444443

So the problems were of my creation.

I was creating the CSS statically without the buoy id information so the CSS didn't have what was needed.  I have this fixed now.

I had not realized there was an image overlap until you pointed it out and even then it took me awhile to see it.  I have not fixed it yet. Today is basketball and tomorrow is taxes (Ugh!)

Thanks for identifying my error and pointing me to the fix.

Bill

 

cumulus