Topics

User Functions

Events

There are no upcoming events

What's New

Stories

1 new Stories in the last 2 weeks

Comments last 2 weeks


Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Sunday, May 26 2013 @ 02:14 AM EDT


 Forum Index > Extensions > PHP Blocks New Topic Post Reply
 NEW Weather Block Released
   
squatty
 08/13/02 06:02AM (Read 2071 times)  
+++++
Full Member

Status: offline


Registered: 01/21/02
Posts: 269
The new block makes use of the Open Source phpweather project as its foundation. All weather feeds or METARs are provided by the NOAA organization.


The new block has all the same functionality as the orginal block with the exception of the 5 day forecast. The 5 day forecast has been replaced with a more detailed view of the current weather conditions for a given location. New features include the follwing:


  • Block view displays a brief description for the most common weather phenomena.

  • Supports proxy servers via a config file.

  • Supports a hiearcy of locations (METARs) by region or country.

  • Improved block and detailed view navigation.

  • Added a cache flush feature to update cached content.

  • Attempts to make use of language files...needs more work.


  • As always, you can view the new block in action at here. The block is availbe for download here.


    Enjoy,


    Danny -- danny@squatty.com


    In a world without walls and fences, who needs Windows and Gates?
     
    Profile Email Website
     Quote
    Anonymous: Anonymous
     08/13/02 01:27PM  



    You the man squatty Smile --Mr.GxBlock

     
     Quote
    Anonymous: Anonymous
     08/13/02 11:03PM  



    Hi Danny, I need some help here. I am getting error installing the block:

    Warning: Failed opening 'phpweather.inc' for inclusion (include_path='') in /home/roughlif/public_html/portal1/public_html/weather/display_weather.php on line 6

    Warning: Failed opening 'locale_en.inc' for inclusion (include_path='') in /home/roughlif/public_html/portal1/public_html/weather/display_weather.php on line 7

    Fatal error: Call to undefined function: get_metar() in /home/roughlif/public_html/portal1/public_html/weather/display_weather.php on line 11


    THis is a new installation. I think I followed all the steps. The only thing I didnot do is Step 2 running the sql script, not exactly sure what it means.
    Thanks.

     
     Quote
    Anonymous: Anonymous
     08/14/02 07:52AM  



    I am having a similar problem. I fixed that paths for the inclusions, but then I just get a blank page.

     
     Quote
    chmouel
     08/15/02 01:31AM  
    +----
    Newbie

    Status: offline


    Registered: 02/05/02
    Posts: 13
    You got to fix also the require('config.inc') to include_once('path/to/geeklog/weather/config.inc') in phpweather.inc also.

     
    Profile Email Website
     Quote
    chmouel
     08/15/02 01:58AM  
    +----
    Newbie

    Status: offline


    Registered: 02/05/02
    Posts: 13
    Humm look great, but the weather_details.php doent work when requesting the cache from phpweather.inc dunno why but why don't you convert everything to the DB_* from geeklog when doing the query (its the query in php who fail since native query does work)....

    Cheers.

     
    Profile Email Website
     Quote
    Anonymous: Anonymous
     08/15/02 06:25AM  



    Thanks, chmouel! That got it working for me.

     
     Quote
    Kybla
     08/16/02 06:28AM  
    +----
    Newbie

    Status: offline


    Registered: 05/15/02
    Posts: 9
    Great block! But when I switch to Celsius, I got "No data".

     
    Profile Email Website
     Quote
    squatty
     08/19/02 05:17AM  
    +++++
    Full Member

    Status: offline


    Registered: 01/21/02
    Posts: 269
    It seems I made an error in judgment regarding the detailed view. The current configuration ONLY looks to the DB. This however presents a problem if a particular city has not been accessed via the front block view or if the front page view content is stale (old). In both cases, the detailed view does not work correctly.

    To fix the problem update the details.inc file as follows:

    Change the following (around line 288):

    Change:
    --- CODE BEGINS ---
    function get_metardata($station, $always_use_cache = 1)
    --- CODE ENDS ---

    To:
    --- CODE BEGINS ---
    function get_metardata($station, $always_use_cache = 0)
    --- CODE ENDS ---

    This fix will make the detailed view look at the timestamp of the METAR in the DB and fetch and updated feed (and cache it) should the timestamp be too old.

    In a world without walls and fences, who needs Windows and Gates?
     
    Profile Email Website
     Quote
    Anonymous: Anonymous
     08/28/02 02:58AM  



    Nice look to the nodule:-))

    I had similiar problems discussed in this thread , however they were rectified by applying the advice given here (thank you).

    One problem remains, when I click more details I get the error message:

    "Warning: Access denied for user: 'username@localhost' (Using password: NO) in /path/to/geeklog/public_html/weather/phpweather.inc on line 19"

    "Unable to connect to MySQL database!"

    The weather details DO appear below the message.

    I've checked the config.inc and all is well with db info there.

    Any suggestions will be appreciated.

    Regards

    GG

     
     Quote
    Anonymous: Anonymous
     09/01/02 08:22AM  



    phpweather.inc
    line 16

    /* Load the default configuration: */
    require('/path/to/geeklog/weather/config.inc');

    This resolved the problem. I tried it in my early attempts to sort this problem out, however a cached page must have mislead me.


     
     Quote
    Content generated in: 1.21 seconds
    New Topic Post Reply

    Normal Topic Normal Topic
    Sticky Topic Sticky Topic
    Locked Topic Locked Topic
    New Post New Post
    Sticky Topic W/ New Post Sticky Topic W/ New Post
    Locked Topic W/ New Post Locked Topic W/ New Post
    View Anonymous Posts 
    Able to post 
    Filtered HTML Allowed 
    Censored Content