1
hmagoo
MS_Weather - Few questions
  • 2004/8/19 10:15

  • hmagoo

  • Just popping in

  • Posts: 15

  • Since: 2004/7/31


Hi,

This is a neat module, I'm really enjoying it! A few of things I need a little help with though.

1) Background color for the Current Conditions - Very dark and all one color.. this isn't the case in IE, but in Firefox it is dark grey. Maybe firefox needs '#' for bgcolors or something, I don't know. This is the same on qmel.com where I got the module.
edit:
edit: the problem is coming from the Doctype declared with XOOPS. Yahoo probably doesn't even decalre one. Firefox listens and won't post the colors if they don't have #'s, IE does though. so that is why the #'s don't matter on yahoos page but they do in xoops. solution: see end of post....

2) If I search for a US Postal Zip Code I get results with Fahrenheit, which is what is desired for me. If I search for city name I get Celsius. Any way to fix this behavior? edit: I just noticed that if you search for "us zip code" or "city, state, usa" it shows up in fahrenheit. if you search for "city, state" or "city" the result is in Celsius.

3) When you click on "Other Cities" in the block it defaults to Montpelier. Anyway to change that?
edit: found... changed a line with Montpelier in class.msweather.php to end like this:
&citycode=USNY0996&cityname=New York&unit=1">"._MSW_B_MORECITY."</a></center><br>";



I looked through some of the files for possibilities to change some of these things, but I didn't see anything pop up for me, I don't know PHP. The config file for the colors is very nice, I just wish there were a few more attributes in there.

you can see my setup Here
edit: enabled public viewing for the module. sorry.
Thanks!!

edit: found a way to fix the formatting on this module allowing colors in Mozilla and better font size and colors as well.

for the main ms_weathher index view. find this section in the class.msweather.php :
/* function get_msw_getmoduledata()

several lines down, before this line:
$MSWModule .= "<center>".$all]."</center><br><br>";

add this:
$all] = preg_replace("/bgcolor=(?!#)/""bgcolor=#"$all[1]);
$all] = str_replace"td width="25%"""td width="33%""$all]);
$all] = str_replace"<font face=Arial size=3>Currently:""<font color="#000" face=Arial size=3>Currently:", $all[ 1 ] ); 
$all] = str_replace"<font size="5"""<font size="5" color="#000"", $all[ 1 ] ); 
$all] = str_replace"High:""</font><font face=Arial color="#000" size=3>High:", $all[ 1 ] ); 
$all] = str_replace"Low:""</font><font face=Arial color="#000" size=3>Low:", $all[ 1 ] ); 
$all] = str_replace"td align=left width="50%"><font face=Arial size=3><b>""td align=left width="50%"><font face=Arial size=3 color="#000"><b>", $all[ 1 ] );

this will add the missing # to allow Mozilla browsers to use colors in the tables. Since XOOPS declares a higher XHTML or HTML 4.01 Doctype and Yahoo declares none, this is necessary to make the page look like it does on Yahoo. This will also do some better text formatting and colors as well. In retrospect you could just use a few replaces and add a class and use that in your CSS, but this is working. This also fixes one of the table widths to match the others, so it looks better.

for the blocks view, I am working on that, almost have it tweaked now. edit later.

maybe some of these problems are with international versions of Yahoo? I don't know, but it looks ok for me now.

2
hmagoo
Re: MS_Weather - Few questions
  • 2004/8/19 17:29

  • hmagoo

  • Just popping in

  • Posts: 15

  • Since: 2004/7/31


ok, for the blocks view, the strings seem to affect eachother. so, I had to compromise and set them both with the same settings. you can tweak the colors how you want, but they seem to bleed over between the block and the main module view. maybe this only happens when they are on the same page, and you could use different settings if you didn't have the block on the main module page, but with caching going crazy on my site I decided to just do it this way. after I change the settings for the block, I first need to delete the dat cache file for the city, in the cache directory and then go into XOOPS admin general settings -> preferences and hit go, to flush the cache and reflect the changes.
in class.msweather.php find this section:
/* function msw_settempcolors( )                      */

and comment the existing replace strings out with // and add all of these:
$rf str_replace"<font face=Arial size=3>Currently:""<br /><font face=Arial size=3 color="#000">Currently:", $rf );  
$rf str_replace"<font size="5"""<font size="5" color="#000"", $rf ); 
$rf preg_replace("/bgcolor=(?!#)/""bgcolor=#"$rf );
$rf str_replace"High:""</font><font face=Arial color="#000" size=3>High:", $rf ); 
$rf str_replace"Low:""</font><font face=Arial color="#000" size=3>Low:", $rf ); 
$rf str_replace"td align=left width="50%"><font face=Arial size=3><b>""td align=left width="50%"><font face=Arial size=3 color="#000"><b>", $rf );

edit: ok, I ended up tweaking the script endlessly to my liking.
snakes posted a fix for the color problem Here

I have a lot of things working better for me. Search by zip code, and then show the Yahoo location for that area, and I was able to add some sort of categorization to the drop-down list with some minimal ill effects. tweaked the formatting a little better as well.

check it out on my site if you like. I'm trying to fix the 100+ html errors that I introduced by all my tweaking. ;) and some yahoo errors.

3
snakes
Re: MS_Weather - Few questions
  • 2004/9/13 9:24

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


hi,

I will apply the color fix to the package on Qmel.com ASAP.
I will see for some thing for the Montpellier default.

What is XP-Weather ? The new name for MS_Weather ?

4
rossi
Re: MS_Weather - Few questions
  • 2004/9/13 10:09

  • rossi

  • Just popping in

  • Posts: 26

  • Since: 2004/3/24


Please read this thread before using MS_weather
https://xoops.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=23991&forum=4


Cheers!

5
snakes
Re: MS_Weather - Few questions
  • 2004/9/30 15:13

  • snakes

  • Just popping in

  • Posts: 69

  • Since: 2004/8/8 0


I've made a new module: SnX-Weather that retreives informations from weather.com

Demo on:
http://www.qmel.com/modules/snx_weather/

Download at:
http://www.qmel.com/modules/mydownloads/viewcat.php?cid=2


Login

Who's Online

188 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 188


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits