Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: Adding a weather report - need help

  1. #21
    Join Date
    Aug 2004

    Default ...but

    the only problem with using wunderground and other METAR based weather stations is that they are only acurate given the location they are placed at... for instance, i live in salida colorado... and the nearest METAR station is at the top of Monarch pass 27 miles away from the actual location of the house. Coincidentally, the mountain is at the top of the continental divide with an altitude 6000 ft. higher.... so when i get a weather reading, the temperature is on average 20 deg. cooler.. and because of the season... also greater wind and cloud coverage.

    and another thought on this... a majority of the METAR readings are taken from airports.. which are almost never located near any urban areas... ..

    after all is said and done, i have been working on trying to include accurate weather reports based on the locations of the houses in OR.. and as you can see on my homepage... the weather that is pulled in is a METAR reading from the top of the pass.. but on each one of the listings, a link below the yahoo maps link was added to accurate weather based on the zip code and not the weather METAR equivelant of that region.

    some more examples of incorrect readings are:

    canon city is read as the same as pueblo colorado... although they are 40 miles apart... the variance in terrain and location (mountains as opposed to the flatlands) affect the weather even in such a smalll amount of separation.

    if anyone would like a list of the METAR codes... check out and do a little searching...

    after all is said and done.. with about 2 months of research.. i'm starting to feel qualified as a meteorologist

    one thing that would be nice to see would be an RSS feed of the weather that adapts to the ListingID and the ZIP!....


  2. #22
    Join Date
    Aug 2004

    Default pudding and proof

    OK everyone who is interested in this idea of adding weather.... do the following if you want a nifty little "" weather doohicky thingumujigger on your listings_view page...

    1. goto weather dot com, more specifically signup for the weather magnet here
    2. fill in all the junk and enter any zipcode you want (and try not to subscribe to any of those fascinating newsletters!!!) and get the code which should look something like this:
    HTML Code:
    <script src=''></script>
    3. open up yout style.php file in the template/vertical-menu/ directory and insert the following code one line after the "// end makeYahooMap" code (somewhere around line 240 or so):
    PHP Code:
    function makeweather($listingID$zip_field)      {          // renders a link to Accuweather on the page            global $conn, $config;          $sql_listingID = make_db_extra_safe($listingID);          $sql_zip_field = make_db_safe($zip_field);          // get zip          $sql = "SELECT " . $config[table_prefix] . "listingsDBElements.field_value, " . $config[table_prefix] . "listingsFormElements.field_type, " . $config[table_prefix] . "listingsFormElements.field_caption FROM " . $config[table_prefix] . "listingsDBElements, " . $config[table_prefix] . "listingsFormElements WHERE ((" . $config[table_prefix] . "listingsDBElements.listing_id = $sql_listingID) AND (" . $config[table_prefix] . "listingsFormElements.field_name = " . $config[table_prefix] . "listingsDBElements.field_name) AND (" . $config[table_prefix] . "listingsDBElements.field_name = $sql_zip_field))";          $recordSet = $conn->Execute($sql);          if ($recordSet === false)          {              log_error($sql);          }          while (!$recordSet->EOF)          {              $weather_address = make_db_unsafe ($recordSet->fields[field_value]);              $recordSet->MoveNext();          } // end while          $weather_string2 = "$weather_address";          echo "<script src='$weather_string2?template=GENXH&par=null&unit=0&key=caa757bd4b670c5af7a4ce8c137afcd5'></script>";      } // end makeweather 
    4. replace everything following $weather_string2:
    HTML Code:
    with all of the corresponding code that was generated for you on
    5. upload your style.php file to the correct directory.. and Voila!... you should have a weather report based on the ZIP location of your property....

    you can see a demo.. and the actual accuracy (well, it is still based on METAR/IACO codes...doh) by going to CMI2004 listing page which, although it says howard colorado and has the zip listed properly.. it still takes it from the top of monarch pass... (heck, its snowing on top of monarch at the moment... but the weather in town feels like 80 deg.!)...

    its nifty, but not complettely accurate.. for more information on how to get a link to accurate weather based on zipcode.... goto how to install accuweather link

    good luck!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts