WordPress.org

Ready to get started?Download WordPress

Forums

Weather and Weather Forecast Widget
FIXES for Weather and Weather Forecast Widget (3 posts)

  1. webheadllc
    Member
    Posted 1 year ago #

    This plugins has the nicest weather visuals that I can find. I was disappointed when it didn't work. The author has since ceased development. I made some modifications on my local copy to get it to work.

    I got an API key from World Weather Online since it allows for commercial use. World Weather Online has since changed their api url. So first, do a search and replace for all urls:
    http://free.worldweatheronline.com/feed/
    change it to:
    http://api.worldweatheronline.com/free/v1/

    See if it works. Make sure your api key is in "active" status first.

    If it doesn't work like mine, also change the GG_funx_get_content function to just use curl. in gg_funx_.php line 37. replace the GG_funx_get_content with the following:

    function GG_funx_get_content($term_in,$timeout)
    {
        $ch = curl_init();
        curl_setopt ($ch, CURLOPT_URL, $term_in);
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($ch, CURLOPT_TIMEOUT, $timeout);
        $term_out = @curl_exec($ch);
        curl_close($ch);
        return $term_out;
    }

    do the same in weather_widget.php line 1342.

    function GG_func_get_content($term_in,$timeout)
    {
        if($timeout==0 or !$timeout){$timeout=2;}
          $ch = curl_init();
          curl_setopt ($ch, CURLOPT_URL, $term_in);
          curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_setopt ($ch, CURLOPT_TIMEOUT, $timeout);
          $term_out = @curl_exec($ch);
          curl_close($ch);    
    
        return $term_out;
    }

    After that it worked for me.

    http://wordpress.org/extend/plugins/weather-and-weather-forecast-widget/

  2. Urbannature
    Member
    Posted 1 year ago #

    Do you have de source files for me.

    Im working hours and get an error.

    Thx

  3. umairrockx
    Member
    Posted 1 year ago #

    This method isn't working.. Can you please give your source files?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic