- Drupal 5.2
- OSX, MAMP, PHP 5

1. module installed
2. weather block activated
3. change yahoo location from default to "AUXX0037"
4. save changes

no change saved!!!

Comments

csc4’s picture

Same problem here - the block doesn't seem to save the variable to the database at all.

There is also the problem that the code doesn't seem to use any variable in any case! as the value appears to be hardcoded to BEXX0003 / antwerpen

function  get_q_weather_data($locationcode = 'NLXX0002', $unit="c") {

//$xml = file_get_contents("http://xml.weather.yahoo.com/forecastrss?p=NLXX0002&u=c"); //amsterdam
$xml = file_get_contents("http://xml.weather.yahoo.com/forecastrss?p=BEXX0003&u=c"); //antwerpen
kilimanjaro’s picture

Same problem. Everytime I saved it to my area code, it always go back to "NLXX0002".

Plus, the block doesn't show anything. Not even the Amsterdam weather forecast.

kilimanjaro’s picture

BTW, I did insert the PHP code " return block_assign_show('q_weather', '0'); " and it still doesn't show anything up

rp_praveen’s picture

Changing the location code dose not get saved.

oschuetze’s picture

Priority: Normal » Critical
Status: Active » Needs review

Hi,

the problem is that the location code is not stored to the database.
Add the following lines to the function "q_weather_block":

elseif ($op == 'save') {
    variable_set('q_weather_units', $edit['q_weather_units']);
    variable_set('q_weather_location', $edit['q_weather_location']);
}

Additionally, the line with the hardcoded location in the function
"get_q_weather_data" has to be replaced by:

  $xml = file_get_contents("http://weather.yahooapis.com/forecastrss?p=".$locationcode."&u=".$unit);

As you can see, I have also updated the URL of the weather feed.

Regards,
Oliver

keesje’s picture

Duplicate

keesje’s picture

Hi every body,

This seems to be the first module I released that actualy gets used, so please have some patiencs.
I'm in a process of testing a far more advanced Yahoo weather module, provided by Aaron Fulton, that will replace this one. It will have much more features. It's based on the Weather module by Tobias Toedter.

If someone has problems with that, and like to see this simple, one-block only module to be fixed, please send me a message telling so.

Regards,

Kees

najibx’s picture

would be a great addition when ready for use.

keesje’s picture

Since I haven't heard of Aaron since, and people seem to like the module as is, I want to maintain it.
Your code changes have been applied in CVS/dev version.

Thanks for posting!

Please test and share experiences, so I can mark this fixed.

Regards,

Kees

keesje’s picture

Assigned: Unassigned » keesje
Priority: Critical » Normal

Waiting for community feedback

keesje’s picture

Status: Needs review » Closed (fixed)

Closed, no feedback in 5 months.