Shape 5

Joomla Free Extensions => Weather Module - Free => : claude55 March 05, 2009, 07:29:02 AM



: cant get my location working
: claude55 March 05, 2009, 07:29:02 AM
Hy, i tried to try this

For those of you living outside the US, please complete the following steps :

1. Drill down to your location on Yahoo Maps http://weather.yahoo.com/
2. Look at the address bar (If you live in Melbourne, Australia it looks like this: http://ther.yahoo.com/Melbourne-Australia/ASXX0075/forecast.html?unit=c)
3. Copy the region/area code found in the above URL (ASXX0075)
4. Next open up the weather.class.php file (../modules/mod_s5_weather) and search for the the word: 'location' (there are two instances) and replace with the code that you have just copied from Yahoo, save and close.
5. In the Admin area of the weather module simply paste the Yahoo region code into the zip code box (in this scenario: ASXX0075)


but, in the file, theres to many instance of location, could it be possible to see a full string example, also, my mod5weather is in extension, not module ??? i use  joomla 1.5.9

thak you


: Re: cant get my location working
: jonahh March 10, 2009, 10:14:10 PM
There are only 2 instances of this you just need to replace them with your region code


: Re: cant get my location working
: claude55 March 13, 2009, 03:21:16 PM
yea, where and paste me the lines, cause i find much more then two ....

thank you


: Re: cant get my location working
: jonahh March 16, 2009, 06:32:01 PM
It should only be those 2 that you have found.


: Re: cant get my location working
: theflyingdutchman March 27, 2009, 03:42:12 PM
Hy, i tried to try this

For those of you living outside the US, please complete the following steps :

1. Drill down to your location on Yahoo Maps http://weather.yahoo.com/
2. Look at the address bar (If you live in Melbourne, Australia it looks like this: http://ther.yahoo.com/Melbourne-Australia/ASXX0075/forecast.html?unit=c)
3. Copy the region/area code found in the above URL (ASXX0075)
4. Next open up the weather.class.php file (../modules/mod_s5_weather) and search for the the word: 'location' (there are two instances) and replace with the code that you have just copied from Yahoo, save and close.
5. In the Admin area of the weather module simply paste the Yahoo region code into the zip code box (in this scenario: ASXX0075)


but, in the file, theres to many instance of location, could it be possible to see a full string example, also, my mod5weather is in extension, not module ??? i use  joomla 1.5.9

thak you

hi

first of all i got 3 entries and after replacing the area code found on the website my site turns white :(
what is going wrong?

cheers


: Re: cant get my location working
: jonahh April 01, 2009, 12:37:40 PM
Be sure you replaced only what you need to, if you removed a "/" or ";" it can throw the code out of whack.  I would start with a fresh copy and be very careful updating it.


: Re: cant get my location working
: blechler April 15, 2009, 02:21:25 PM
I am experiencing exactly the same thing...

//$pos = strpos($data, 'yweather:location');
$pos = strpos($data, 'yweather:CAXX0664');
$attr = explode('"', substr($data, $pos, strpos($data, '/>', $pos)-$pos));
//$ret[0]['location'] = $attr[1].', '.$attr[3].', '.$attr[5];
$ret[0]['CAXX0664'] = $attr[1].', '.$attr[3].', '.$attr[5];

In the admin interface I enter "CAXX0664" (without quotes) where I would have otherwise entered the zip code.  I have left the temperature scale at Farenheit, and I have changed it to Celcius with the same results; those being a blank page with the following source code:

<script type="text/javascript">//<![CDATA[
    document.write('<link href="http://joomsnap.localhost//modules/mod_s5_weather/s5_weather/style.css" rel="stylesheet" type="text/css" media="screen" />');
//]]></script>   

So I conclude that this has repercussions into mod_s5_weather.php.  The domain printed above is a site I have set up on my machine for testing purposes.  I went ahead and removed the extra slash that was getting into the href attribute in mod_s5_weather.php.  I didn't really think that would solve the problem, but I hoped...

My pessimistic side once again proved to be correct.

So now I'm here typing this message to implore anyone for any insight they might offer to the rest of the world.  Like those savage Canadians to the north.


: Re: cant get my location working
: blechler April 16, 2009, 10:22:17 AM
OK Peepz, after a night of sleep followed by a cup of Timmy-Ho's coffee I discovered that I had inserted the weather widget twice.  I removed the extra entry, and changed the mod_s5_weather.php file so that the line that read:
   include('weather.class.php');
to:
   require_once('weather.class.php');

Should I want to display the weather several times I can now do so.

At the same time I made sure that the web server was able to write to the mod_s5_weather folder.  While not being able to write to the folder should not cause any problems, it helps if you can.

There is one line in the file:

$ret = weather($zipcode,  ($_GET['u'] = 'c'));

$_GET['u'] = 'c' is an assignment, not a comparison.  The lines:

-----------------------------------
if ($s5_tempscale == "f") {

$ret = weather($zipcode,  ($_GET['u'] == 'f'));
}

if ($s5_tempscale == "c") {

$ret = weather($zipcode,  ($_GET['u'] = 'c'));
}
-----------------------------------
can be replaced with:

$ismetric = ($s5_tempscale == "c") ? true:false;
$ret = weather($zipcode,  $ismetric);

it just seems more succinct to me.

All-in-all it's working for me now.  Thanks for a great Module!