PDA

View Full Version : vB Weather Mk. 2


Pages : 1 [2]

350Chevy
12-15-2002, 06:18 PM
We're both in the US, and the no temperature thing happens no matter what country, state, city, ect..ect.. you choose.

I wish it were that simple, but it's not. Something isn't right with the code.

Julio
12-16-2002, 10:59 AM
Wrong! - I have no problems at all with this hack... I always get info (except once) even in my local testboard I get info.

As I told you, I did some tests changing country, city, etc and I have never get some info on some of them... Though Im lucky that I get info for my country.

(Read your PM)

350Chevy
12-16-2002, 06:57 PM
Originally posted by Julio
Wrong! - I have no problems at all with this hack... I always get info (except once) even in my local testboard I get info.

As I told you, I did some tests changing country, city, etc and I have never get some info on some of them... Though Im lucky that I get info for my country.

(Read your PM)

WRONG! lol... Just because it works on your server doesn't mean everyone elses is configured the same or that it works on theirs.

Read your PM...

As I stated before SOME servers run fine with this hack as others do not. There are multple people with this same problem check this very thread. I have 40+ mods installed and not a single problem with one but this one. Actually this one works, it just doesn't show the temperature no matter what city, state, country, continent, ect..ect..ect.. you set it to. There's nothing wrong with the way I've entered the code. PlurPlanet has had this same problem on one of his test servers as well. He's also applied, unapplied, then reapplied the mod to that same server with the same results just as I have and others.

Nick Tofteland
12-16-2002, 08:45 PM
2. Create new tables in your database using the file create_tables.txt. You can copy the entire contents of the file and
paste into the query window in phpMyAdmin, or you could run each query individually through telnet. Please ask in at
vbulletin.org if you need help in this regard.

can somebody please explain this to me so i can understand what i need to do. thanks!

EvilLS1
12-17-2002, 04:37 AM
Originally posted by Nick Tofteland
2. Create new tables in your database using the file create_tables.txt. You can copy the entire contents of the file and
paste into the query window in phpMyAdmin, or you could run each query individually through telnet. Please ask in at
vbulletin.org if you need help in this regard.

can somebody please explain this to me so i can understand what i need to do. thanks!

phpMyAdmin is a database administration tool which lets you run remote queries to create, alter, copy, or drop tables/fields from your MySQL database. You can download it here: http://www.phpmyadmin.net/

Once you've installed phpMyAdmin, you simply copy the query from the hack and paste it into the query window and hit the "go" button.

I believe there's also hacks availible here which allow you to run queries in your ACP. Check the "how to install a hack" thread. Maybe there's more info there.

Julio,
Other people have had the same problem with the missing temps and I'm absolutley positive that I've installed the hack correctly, so I'd have to agree with 350Chevy that its something else.

EvilLS1
12-18-2002, 07:27 AM
I just checked the weather_userdata table in my database and the fields for temp, realfeel, and all the forecasthighs & forecastlows are empty. I looked at the "insert into weather_userdata" code in weather.php to see if I could find any errors, but it looks fine to me. So all I can figure is that it has something to do with how its retrieving the data from the weather site. *shrugs*

Katman
12-19-2002, 01:39 AM
Does anyone know how to turn this into a non-vB add-on? I've been looking for a PHP Weather script for another site of mine but I haven't been able to find one that works like this one.

I can create the database and add the tables and upload the images but it's the vB templates that have me confused. I need to turn the templates into .php files.

Tony DiMera
12-29-2002, 12:23 AM
This is a great hack

jbear6
12-29-2002, 04:21 PM
Originally posted by Tony DiMera
This is a great hack

I agree, and would like to say "Thanks Again", our members love this hack.

Doc203
12-30-2002, 01:20 AM
What a great hack. Installed beautifully and really looks nice.

Tony DiMera
01-08-2003, 03:04 PM
I know it has Midhurst and Barrie, Ontario, Canada with it. I was wondering if and how I can add Midland, Ontario, Canada?

Katman
01-09-2003, 10:32 PM
New problem, just started today!

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home2/www/katanaplanet/forums/index.php on line 621

Warning: fsockopen() [function.fsockopen]: unable to connect to www.msnbc.com:80 in /home2/www/katanaplanet/forums/index.php on line 621

Does this happen because msnbc.com is down or cannot be connected to by my site? Or is there some other explanation?

Katman
01-11-2003, 01:20 AM
I guess no one cares that this hack doesn't work anymore?

lifesourcerec
01-11-2003, 02:55 PM
Originally posted by PsYc



you have to put all .sql files via myphpadmin in the tables you created, only if you have transfered all content in these tables it will work

cities1-5.sql

region.sql

subdiv.sql

etc..

uploaded all files and still get same error

lifesourcerec
01-12-2003, 02:10 AM
Got it work.. but the [forecasticon*] not working. Where would this be located to fix?

Tony DiMera
01-15-2003, 01:50 PM
I am always getting a white box with an X in it for the icon. This is the URL of the icon, http://www.mysite.com/forums/images/weather/.gif As you can see it is always trying to find an image icon that is .gif no matter what the weather is, and I don't have a .gif image icon.

TalkHardRandy
01-16-2003, 09:48 PM
I have a quick question... does anyone have an upgrade procedure from the original to the current version? I was starting to try to figure one out but gave up and decided to see if anyone else had one.

I tried to make the changes suggested way back when to the weather.php, but that didn't work.

BaBa2002
01-17-2003, 08:38 AM
it will not show the images?

how can i fix that

Tony DiMera
01-20-2003, 10:00 PM
*bump*

wild texas
01-22-2003, 04:40 AM
read post #1 in this thread (https://vborg.vbsupport.ru/showthread.php?s=&threadid=41842&perpage=15&display=&pagenumber=1) -- it provides detailed instructions on how to upgrade if you were running the old MSNBC feed, started losing data, etc.

Doesn't help you folks running the latest version, which properly accesses The Weather Channel feed, if you're not getting data for some reason...but it works fine for me (and I was getting data only erratically before I found the upgrade and realized the feed had switched sources.)

Tony DiMera
01-22-2003, 12:15 PM
I forgot to mention, I use Barrie, Ontario, Canada and Midhurst, Ontario, Canada and it does it with both.

mackers8923
01-26-2003, 11:56 PM
Great

I must say it took me a while to get there but now she is going no problem. Thanks for a great hack.

One question though! How do I move the weather information from the top of my forums page to the bottom below the current users online?

Cheers

Rob

mackers8923
01-27-2003, 12:08 AM
Before I go, How would I go about adding a box on my home page: www.sccportal.org.uk to show the same information in a smaller format?

Any help at all would be great

mv540
02-14-2003, 04:34 PM
need some help here, first off this is a sweet hack....installed it with ease...but there is only 1 problem...for example certain areas like barrie Canada doesnt show a gif for the current weather conditions..ive inserted a sample of what i mean....

as you can see the link leads to //.gif....and in the file there is no such picture....is this normal or did i install something wrong...?

indiamike
02-14-2003, 08:37 PM
Originally posted by mv540
.but there is only 1 problem...for example certain areas like barrie Canada doesnt show a gif for the current weather conditions..ive inserted a sample of what i mean....

as you can see the link leads to //.gif....and in the file there is no such picture....is this normal or did i install something wrong...?

This is normal. Just means that the feed has no image applied to it. Unfortunately there is no way to name a gif to just .gif to fill in the blank.

Just the way the feed is....wouldn't worry about it.

Mike

mv540
02-14-2003, 08:43 PM
Thank you for the reply Mike. ;) ill change it to something closer like toronto or something..lol


cheers!

PennylessZ28
02-19-2003, 10:03 PM
Dang you know hwo tricky it was to get this to work with VBindex, whew!

Awesome man!

Erwin
02-20-2003, 08:03 AM
Originally posted by indiamike


This is normal. Just means that the feed has no image applied to it. Unfortunately there is no way to name a gif to just .gif to fill in the blank.



Actually, you CAN name a transparent gif to .gif and upload it. It'll work.

Better yet, use the .gif file I uploaded somewhere in this thread that tells users when the weather server is offline. :)

jjj0923
03-05-2003, 02:22 PM
for those of you who are sick of timeouts from www.msnbc.com - just change the code from www.msnbc.com to their IP address and you won't have any more connection timeouts.

I know if they change their IP address you're SOL, but at least your page doesn't site there waiting for the connection to msnbc to timeout any longer.

since I made the change it works great I have not had a single timeout error.

cirisme
03-18-2003, 09:38 PM
I am just curious if anyone has put this into a cron script?

I want to use this, but I don't want it to slow down my pages while it retrieves the weather.

xug
03-19-2003, 10:41 PM
I just read at vbportal that they have taken away their weather mod due legal reasons.

http://www.vbportal.com/forums/showthread.php?s=&threadid=8138

mcyates
03-21-2003, 08:48 PM
Doesnt work. Has no images and all the temperatures are 0 (-18*c)

mcyates
03-21-2003, 08:49 PM
I checked the weather for Middlesbrough it works on their site (www.msnbc.com) but not on mine?

gopherhockey
03-21-2003, 08:51 PM
Weather not working here either - someone break it over at TWC maybe?

ezdreamer
03-21-2003, 10:57 PM
Looks like the weather got hosed. Not working either over here. Instead of using msnbc is there anyway to use the weather channel directly?

ezdreamer
03-21-2003, 10:58 PM
I have a feeling they put a stop to people with hacks like us from using their weather forecasts. :(

scottct1
03-22-2003, 12:16 AM
Mine is and has been working fine.

You can see it at http://www.dbstalk.com/home.php (you need to be loged in to see it.

Lionel
03-22-2003, 02:27 AM
Today at 09:16 PM scottct1 said this in Post #287 (https://vborg.vbsupport.ru/showthread.php?postid=371069#post371069)
Mine is and has been working fine.

You can see it at http://www.dbstalk.com/home.php (you need to be loged in to see it.


nope it does not.... try to show Miami

gopherhockey
03-22-2003, 01:11 PM
One would think all they did was change a path or a filename or something along those lines.

How was this thing originally built? Seems it has done this a few times in its life but gotten fixed.

Anyone capable of looking into it?

jbear6
03-22-2003, 01:29 PM
Mine is down also, what a shame this is a fantastic hack.

auz1111
03-23-2003, 12:53 AM
mine is down also... I really liked this one. has to be a way around this.. :(

DarkDraco07
03-23-2003, 01:55 AM
interesting, im not the only one. it seems msn has changed their database

lynda
03-23-2003, 04:32 AM
Information can still be reached using the same url construct...

http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=USGA0184

I have no clue what changed though.

scottct1
03-23-2003, 04:38 PM
Weird its still working for my city and other cities around me. I don't know what to say of why its not working for everyone.

lemarsu
03-23-2003, 05:43 PM
Scott ... what is your city ?

gopherhockey
03-23-2003, 08:27 PM
Today at 06:38 PM scottct1 said this in Post #294 (https://vborg.vbsupport.ru/showthread.php?postid=372018#post372018)
Weird its still working for my city and other cities around me. I don't know what to say of why its not working for everyone.


I don't buy it, I think it is completely broken. I tried dozens of various cities and none work. Unless someone can say specifically a city that works, I think we (someone?) need to look at figuring this out.

I think this hack is worth keeping alive. I wish I knew more about this type of thing to help.

scottct1
03-23-2003, 09:57 PM
Still working fine for me, my town is Newington, Connecticut. As a test I randomly selected other cities and all worked fine.

Below is a screen shot I just took of the weather working on my board.

gopherhockey
03-23-2003, 10:00 PM
Hmmm.. maybe we're on to something? I tried your city and it doesn't work for me.

Perhaps you could post your weather.php file to see if there is something different about it?

Or perhaps some of us are being blocked by IP address and others aren't?

Can you set it to Minneapolis, Minnesota and get the weather?

If yours works no matter what, perhaps we can use that to figure out whats broken for others...

scottct1
03-23-2003, 10:01 PM
Ok now while it IS working fine on my front page, the full forecast is NOT working no matter which city I select.

(It looks like as shown in the attachment below)

gopherhockey
03-23-2003, 10:05 PM
Looks like you have played with the look & feel of the script quite a bit from original. I don't even have the images you have showing up (weather is offline, try again later) - I just get the red X for image not available.

For example, the script is trying to use this as the graphic link on my site:

http://www.mtbmn.com/forums/images//weather//.gif

It is obviously not pulling info back from the weather site in order to properly format things.

scottct1
03-23-2003, 10:07 PM
My weather.php is the standard one. In my home.php (or index.php I have modified it as shown below)

// put weather here
// BEGIN WEATHER HACK
// ###################### Get Weather #######################
if ($weatherpage!=1 or !isset($weatherpage)) {

$usersettings = $DB_site->query_first("SELECT * FROM weather_usersettings WHERE userid=$bbuserinfo[userid]");
if (!isset($usersettings[userid])) {
$usersettings[accid] = "USTX1200";
$usersettings[tpc] = "1";
$usersettings[tps] = "1";
$DB_site->query("INSERT INTO weather_usersettings (userid,accid,tpc,tps) VALUES ('$bbuserinfo[userid]','$usersettings[accid]','$usersettings[tpc]','$usersettings[tps]')");
}

$userdata = $DB_site->query_first("SELECT * FROM weather_userdata WHERE userid=$bbuserinfo[userid]");
$datecut = $userdata[time];
if ((time()-3600)>$datecut or $forceupdate=="yes") {
$rawdata = fsockopen("207.46.245.60",80,$num_error,$str_error,30);
if(!$rawdata) {
$weather[error_num] = $num_error;
$weather[error_str] = $str_error;
} else {
fputs($rawdata,"GET /m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

while (!feof($rawdata)) {
$getbit = fgets($rawdata,4096);
$getbit = trim($getbit)."\n";
if (substr($getbit,7,4) == "City") {
$weather[city] = substr($getbit,15,40);
$weather[city] = substr($weather[city],0,strlen($weather[city])-3);
}
if (substr($getbit,7,6) == "SubDiv") {
$weather[subdiv] = substr($getbit,17,20);
$weather[subdiv] = substr($weather[subdiv],0,strlen($weather[subdiv])-3);
}
if (substr($getbit,7,7) == "Country") {
$weather[country] = substr($getbit,18,20);
$weather[country] = substr($weather[country],0,strlen($weather[country])-3);
}
if (substr($getbit,7,5) == "Temp ") {
$weather[temp] = substr($getbit,15,20);
$weather[temp] = substr($weather[temp],0,strlen($weather[temp])-3);
}
if (substr($getbit,7,5) == "CIcon") {
$weather[cicon] = substr($getbit,16,20);
$weather[cicon] = substr($weather[cicon],0,strlen($weather[cicon])-3);
}
if (substr($getbit,7,5) == "WindS") {
$weather[wind_spd] = substr($getbit,16,20);
$weather[wind_spd] = substr($weather[wind_spd],0,strlen($weather[wind_spd])-3);
}
if (substr($getbit,7,5) == "WindD") {
$weather[wind_dir] = substr($getbit,16,20);
$weather[wind_dir] = substr($weather[wind_dir],0,strlen($weather[wind_dir])-3);
}
if (substr($getbit,7,4) == "Baro") {
$weather[barometer] = substr($getbit,15,20);
$weather[barometer] = substr($weather[barometer],0,strlen($weather[barometer])-3);
}
if (substr($getbit,7,5) == "Humid") {
$weather[humidity] = substr($getbit,16,20);
$weather[humidity] = substr($weather[humidity],0,strlen($weather[humidity])-3);
}
if (substr($getbit,7,4) == "Real") {
$weather[realfeel] = substr($getbit,15,20);
$weather[realfeel] = substr($weather[realfeel],0,strlen($weather[realfeel])-3);
}
if (substr($getbit,7,6) == "LastUp") {
$weather[lastup] = substr($getbit,17,25);
$weather[lastup] = substr($weather[lastup],0,strlen($weather[lastup])-3);
}
if (substr($getbit,7,7) == "ConText") {
$weather[context] = substr($getbit,18,25);
$weather[context] = substr($weather[context],0,strlen($weather[context])-3);
}
}

// Location Info
$weatherdata[city] = $weather[city];
$weatherdata[subdiv] = $weather[subdiv];
$weatherdata[country] = $weather[country];

// Current Conditions
$weatherdata[temp] = convert_temp($weather[temp],$usersettings[tpc]);
$weatherdata[cicon] = $weather[cicon];
$weatherdata[wind_dir] = $weather[wind_dir];
$weatherdata[wind_spd] = convert_speed($weather[wind_spd],$usersettings[tps]);
$weatherdata[barometer] = convert_press($weather[barometer],$usersettings[tps]);
$weatherdata[humidity] = $weather[humidity];
$weatherdata[realfeel] = convert_temp($weather[realfeel],$usersettings[tpc]);
$weatherdata[lastup] = $weather[lastup];
$weatherdata[context] = $weather[context];

fclose($rawdata);
}
} else {
$weatherdata = $DB_site->query_first("SELECT city,subdiv,country,temp,cicon,wind_dir,wind_spd,b arometer,humidity,realfeel,lastup,context FROM weather_userdata WHERE userid=$bbuserinfo[userid]");
}

if ($weatherdata[subdiv]) {
$weatherdata[showsubdiv] = "$weatherdata[subdiv], ";
} else {
$weatherdata[showsubdiv] = "";
}

eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";");
}


// END WEATHER HACK

gopherhockey
03-23-2003, 10:17 PM
Hmmm.. code looks identical to mine (other than the default city) - I tried yours, still nothing.

Well... I guess I better just disable this thing until it gets repaired. :cry:

gopherhockey
03-23-2003, 10:22 PM
Yesterday at 11:57 PM scottct1 said this in Post #297 (https://vborg.vbsupport.ru/showthread.php?postid=372261#post372261)
Still working fine for me, my town is Newington, Connecticut. As a test I randomly selected other cities and all worked fine.

Below is a screen shot I just took of the weather working on my board.

Your site worked when I first came online, but the temp doesn't seem to change. I changed my weather city to be another one in Texas (other than your default San Antonio) - that broke your home page, then I changed it back to default and it was still broken. Strange.

scottct1
03-23-2003, 10:49 PM
It's almost like they are limiting connections per internet connection and since the server is always the same IP address it is only allowed one connection every x minutes.

I have been playing with the weather, and sometimes it shows up correctly on my front page, other times it does not.

I am seriously thinking that this is the reason why its not working corrctly anymore.

scottct1
03-23-2003, 10:56 PM
BTW fdor what its worth, the weather is NOT working on MSNBC's site as well, im wondering if they are cutting back the bandwith for weather so more people can get in for War news?

ezdreamer
03-24-2003, 03:28 AM
Here's a thought, not sure if this is possible, but what about getting the feed straight from the weather channel?

lemarsu
03-24-2003, 08:24 AM
Ok,


It wasn't working for me as well but I have been looking around and have found a fix :D

just edit your weather.php from

fputs($rawdata,"GET /m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

To read :

fputs($rawdata,"GET http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

But this is JJR512 baby, and I would like him to have a look at the problem, help us find a better fix.

I hope this helps everyone.

LeMarsu

scottct1
03-24-2003, 12:10 PM
That fix worked for me. :)

Look I even get Minneapolis weather. :D

mbaskett
03-24-2003, 08:05 PM
I added the DNS name, and it worked for a bit, but I still noticed it's not working 100%

Lionel
03-24-2003, 08:45 PM
does not work for me

lemarsu
03-25-2003, 10:24 AM
Lionel, mbaskett,

You will need to edit weather.php and maybe index.php or any other place you have put this code in (ie portal page...):


// ###################### Get Weather #######################
if ($weatherpage!=1 or !isset($weatherpage)) {

$usersettings = $DB_site->query_first("SELECT * FROM weather_usersettings WHERE userid=$bbuserinfo[userid]");
if (!isset($usersettings[userid])) {
$usersettings[accid] = "UKXX0085";
$usersettings[tpc] = "1";
$usersettings[tps] = "1";
$DB_site->query("INSERT INTO weather_usersettings (userid,accid,tpc,tps) VALUES ('$bbuserinfo[userid]','$usersettings[accid]','$usersettings[tpc]','$usersettings[tps]')");
}

$userdata = $DB_site->query_first("SELECT * FROM weather_userdata WHERE userid=$bbuserinfo[userid]");
$datecut = $userdata[time];
if ((time()-7200)>$datecut or $forceupdate=="yes") {
$rawdata = fsockopen("www.msnbc.com",80,$num_error,$str_error,30);
if(!$rawdata) {
$weather[error_num] = $num_error;
$weather[error_str] = $str_error;
} else {
fputs($rawdata,"GET http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

while (!feof($rawdata)) {
etc ...............................
........................
................
...........
etc..

Parker Clack
03-25-2003, 12:54 PM
LeMarsu:

That did the trick.

Thanks,
Parker

JJR512
03-25-2003, 02:26 PM
Thanks, LeMarsu, seems to work for me as well. Still waiting to here from the rest of my membership, though, but it should be good.

Rose
03-25-2003, 02:52 PM
Thanks!! :D Seems to work here.

Jitway
03-25-2003, 05:39 PM
Thanks everyone for the ideas it works like a charm.

jbear6
03-25-2003, 06:37 PM
Works for me also :)
Thanks for the fix lemarsu, and Thanks for the Fantastic Hack JJR512.

Jbear6

Lionel
03-25-2003, 11:50 PM
thank you leMarsu.

Lionel
03-26-2003, 12:18 AM
never mind

Katarn
03-29-2003, 12:56 AM
Works greate at my site... Thanks!

Kars10
03-29-2003, 07:10 AM
LeMarsu?s Fix works for me too.

Thanks LeMarsu :)

al98t
04-01-2003, 06:47 PM
yeah i still see sometimes it works, and sometimes it doesnt.. that kinida sucks.

PennylessZ28
04-02-2003, 12:55 PM
Thank you, I have been scratching my head about this one for well over two weeks now. Lucky me I finally checked the thread out.

The fix worked, good work guys. Great to see everyone helping each other!

lemarsu
04-02-2003, 05:10 PM
Hi,

Is it just me or has it stoped working for every contry except the US?

LeMarsu

lemarsu
04-02-2003, 06:35 PM
:banana: :bunny:

Hey .... it is working now... been looking at it all day at work.. trying to find a work around

But now it is working again !

:banana:
LeMarsu

Katarn
04-02-2003, 08:50 PM
Our members say it works for them, even internationally.

Thanks to lemarsu for the help. FYI for all those out there. You need to apply the fix to both the weather.php and index.php.

If you apply to only to weather.php you will only see the detailed weather work, and the frontpage will only work when you force update.

If you apply to only index.php, the frontpage part will only work....

If you have a portal, you need to change that as well....

Lionel
04-03-2003, 05:45 PM
it stopped working for me

jbear6
04-03-2003, 06:02 PM
It's working fine here, just like when originally installed. It might go down for a few minutes here and there, but that has always happened.

Jbear6

o0stephane0o
04-04-2003, 01:31 AM
Big problem in deed, here is the mail I have sent to JJR512
Read carefully if you have installed the weather hack.
Hi, I really love your hack and I think it´s great but unfortunatly, I cannot make it work with Spain. I tried with the V3.0 and the v 3.01. I also tried with the VBulletin 2.29 and 2.30 but I get the same problem.
I have checked your webiste to see if it was working but it didn´t. So try to put any cities in Spain like Madrid or Barcelona. It just says they aren´t there but when you check your tables, they are all there.
And if you go to the nbc page, it does works there. Any idea of what could be the problem?
I hope you can help me with this problem because if soemone wants to ++++ around, he only has to chose Spain and you will get a SQL Error.
Quite annoying.
Hope you will have the time to answer me. If I can help, do not hesitate in contacting me.
Thanks you.

lemarsu
04-04-2003, 07:59 AM
ok,

I see the problem there is no data for Spain in `weather_city` table...

LeMarsu

lemarsu
04-04-2003, 08:37 AM
ok,

I compiled you some SQL that you will need to run in mySQL, this will populate `weather_city` table with all the cities in Spain and it should all work with no problems.
There are 189 cities from Agreda to Zaragoza.

LeMarsu

o0stephane0o
04-04-2003, 10:35 AM
Wow, you are amazing, I?ll try it right now, Thanks a llot ;)

scottct1
04-04-2003, 12:30 PM
I don't know why but a lot of users are requesting I make the Iraqi weather available, anyone know if this is possible?

My forecast for Iraq is a good chance of bombing tonight, more of the same tommorow. :) Go USA!

lemarsu
04-04-2003, 02:39 PM
Today at 02:30 PM scottct1 said this in Post #332 (https://vborg.vbsupport.ru/showthread.php?postid=377490#post377490)
I don't know why but a lot of users are requesting I make the Iraqi weather available, anyone know if this is possible?

My forecast for Iraq is a good chance of bombing tonight, more of the same tommorow. :) Go USA!

Scott,

The weather for Iraq, should be working, just check you have codes
IZXX0001
IZXX0002
IZXX0003
to
IZXX0012

In your `weather_city`table. They are in my forum.

LeMarsu.


PS: I have lived through a war and I would like to inform you that spending the night wondering if a missile is going to hit your house and kill you and you family or bury you all alive is not something you wish to happen to other people, I hope it doesn?t ever happen to you.
End of this conversation please

o0stephane0o
04-04-2003, 05:10 PM
I m loking for bugs and i have found a new one.
Australia dosenst work either but this time, it looks different.
I think the cities haven´t been created.

lemarsu
04-04-2003, 06:43 PM
The problem is that you need to pick a Country to force the refresh....
so pick New Zealand, the go back to Australia.... and.... et Voila !

It works..

LeMarsu

o0stephane0o
04-04-2003, 10:11 PM
Great work though i have a small error with the spanish stuff.
when executing the sql queries, i get an error message about the following INSERT INTO weather_city VALUES ('SPXX0049', 'L´Hospitalet de Llobregat', 211); but changing it to INSERT INTO weather_city VALUES ('SPXX0049', 'L Hospitalet de Llobregat', 211); it works.
But after that, i get some strange errors. Did you try it? Did it work ?
By the way lemarsu, are you french or belgian?
Thanks for your time..
:banana:

Etcher
04-04-2003, 11:34 PM
is there an easy way to remove the country, cities, and such that will not be used? I am from Canada, and my members are ONLY from Canada, therefor the others will never be used... With them all in there, it is taking a huge amound of database space.

lemarsu
04-04-2003, 11:38 PM
Stephane,

I have edited the sql attachment for Spain... Sorry I was at work and I didn't fully test it out I only ran the first 5 towns.... What a bad tester !!!

I am actually Lebanese (hence the little comment for scottct1), but I had a French education....

LeMarsu

lemarsu
04-04-2003, 11:55 PM
Today at 01:34 AM Etcher said this in Post #337 (https://vborg.vbsupport.ru/showthread.php?postid=377676#post377676)
is there an easy way to remove the country, cities, and such that will not be used? I am from Canada, and my members are ONLY from Canada, therefor the others will never be used... With them all in there, it is taking a huge amound of database space.


Etcher,

To delete everything that is not Canada I suggest you do the following:
As the biggest table is weather_city, just concentrate on that one. You will need to run the delete statement bellow that will get rid of 36721 rows, NOTE THIS WILL GET RID OF EVERY CITY IN THE WORLD APPART FROM CANADA the countries will still be there if you need them in the future.

[b]ps I have not tested the SQL[b]
DELETE FROM `weather_city` WHERE `accid` NOT LIKE 'CAXX%'

o0stephane0o
04-05-2003, 08:37 AM
French education, now I understand where you got your nick from...
I am insisting again about the weather hack but it?s only because I really like it and i cannot make it working fine :(

What do i have to do with spain.sql to make it working?
And what is the following error:
[socketerror] cannot connect to www.msnbc.com.... blblabla 80
Un truc dans le genre...

Thanks for your knowledge.

Etcher
04-06-2003, 03:05 AM
Awsome, thank you...
That is a HUGE DB, that must have taken weeks to make, and less than 2 seconds to delete.... and that worked, and took 900,000+ out of the DB

Fantastic job though, great hack...




Yesterday at 08:55 PM lemarsu said this in Post #339 (https://vborg.vbsupport.ru/showthread.php?postid=377681#post377681)
Etcher,

To delete everything that is not Canada I suggest you do the following:
As the biggest table is weather_city, just concentrate on that one. You will need to run the delete statement bellow that will get rid of 36721 rows, [b]NOTE THIS WILL GET RID OF EVERY CITY IN THE WORLD APPART FROM CANADA the countries will still be there if you need them in the future.

ps I have not tested the SQL[b]
DELETE FROM `weather_city` WHERE `accid` NOT LIKE 'CAXX%'

PennylessZ28
04-07-2003, 02:58 PM
04-04-03 at 09:55 PM lemarsu said this in Post #339 (https://vborg.vbsupport.ru/showthread.php?postid=377681#post377681)
Etcher,

To delete everything that is not Canada I suggest you do the following:
As the biggest table is weather_city, just concentrate on that one. You will need to run the delete statement bellow that will get rid of 36721 rows, [b]NOTE THIS WILL GET RID OF EVERY CITY IN THE WORLD APPART FROM CANADA the countries will still be there if you need them in the future.

ps I have not tested the SQL[b]
DELETE FROM `weather_city` WHERE `accid` NOT LIKE 'CAXX%'


What about everything but America, who cares about Canada! :)

drumsy
04-07-2003, 04:20 PM
How would I add the type "Heavy Rain" to the board? It's coming up as Unknown Type on the board but I see it as Heavy Rain on MSNBC.

BTW, Installed, love it! :) Great fix by the other gentleman! :)

lemarsu
04-07-2003, 05:09 PM
Today at 04:58 PM HR3rdGen said this in Post #342 (https://vborg.vbsupport.ru/showthread.php?postid=378776#post378776)
What about everything but America, who cares about Canada! :)

like So :
DELETE FROM `weather_city` WHERE `accid` NOT LIKE 'US%'

drumsy
04-07-2003, 06:28 PM
Ok, now all of a sudden the "H O N D A - A C U R A . N E T Weather is provided by The Weather Channel and MSNBC " table is blacked out. It was fine before. I've changed nothing! What could have done this?

auz1111
04-08-2003, 05:25 PM
lemarsu! lemarsu! you helped a lot. thanks!

drumsy
04-14-2003, 02:41 PM
04-07-03 at 03:22 PM drumsy said this in Post #345 (https://vborg.vbsupport.ru/showthread.php?postid=378863#post378863)
Ok, now all of a sudden the "H O N D A - A C U R A . N E T Weather is provided by The Weather Channel and MSNBC " table is blacked out. It was fine before. I've changed nothing! What could have done this?


Anyone?

drumsy
04-16-2003, 10:27 PM
04-14-03 at 10:41 AM drumsy said this in Post #347 (https://vborg.vbsupport.ru/showthread.php?postid=382033#post382033)
Anyone?


Help, and also it seems the weather data just took a vacation! :(

o0stephane0o
04-17-2003, 12:37 AM
i´ve checked several sites and all of them are working, must be your server. That hack is very fussy and needs a server with a specific config, lok for another one or use your pc as a server. I use easyphp and it works perfect...

lemarsu
04-17-2003, 06:58 AM
04-07-03 at 07:28 PM drumsy said this in Post #345 (https://vborg.vbsupport.ru/showthread.php?postid=378863#post378863)
Ok, now all of a sudden the "H O N D A - A C U R A . N E T Weather is provided by The Weather Channel and MSNBC " table is blacked out. It was fine before. I've changed nothing! What could have done this?


just had a look at : http://www.honda-acura.net/forums

Look like all is well can you give us more info ?
Like the country/town it is not working for ?

LeMarsu

Jakor Sevel
04-21-2003, 03:34 AM
it's not showing up, for every city and state it says 0 degrees and all that, no pics are showing up and I installed everything right. Is something wrong or is my server just being a punk?

drumsy
05-02-2003, 06:40 PM
04-17-03 at 03:58 AM lemarsu said this in Post #350 (https://vborg.vbsupport.ru/showthread.php?postid=383256#post383256)
just had a look at : http://www.honda-acura.net/forums

Look like all is well can you give us more info ?
Like the country/town it is not working for ?

LeMarsu


Actually, jump into the Detailed Forcast and look at the bottom.

Username: test
Password: test

Take a look at "H O N D A - A C U R A . N E T Weather is provided by The Weather Channel and MSNBC" and you'll see that it's not showing the correct background color. If you go into User CP, Edit Options, and change style to worksafe, then go to the same page, it's totally blacked out this time.

drumsy
05-02-2003, 06:40 PM
This is the same problem in my worksafe style..

drumsy
05-06-2003, 03:57 PM
Anyone?

Zach
05-15-2003, 10:46 AM
04-20-03 at 09:34 PM Jakor Sevel said this in Post #351 (https://vborg.vbsupport.ru/showthread.php?postid=384981#post384981)
it's not showing up, for every city and state it says 0 degrees and all that, no pics are showing up and I installed everything right. Is something wrong or is my server just being a punk?


Naw, its not working, the data exists but its not getting broken up in there.

Zach
05-15-2003, 11:16 AM
<?xml version="1.0" ?>
- <Weather>
- <Error Type="0">
<Text />
</Error>
- <SWA>
- <A ID="">
<T />
<L />
</A>
</SWA>
- <CC>
<T>56</T>
<FL>56</FL>
<Cond>Fair</Cond>
<I>34</I>
<Ud>5/15/03 7:51 AM EDT as reported at Central Park, NY</Ud>
<DN>New York, NY</DN>
- <Pr>
<R>30.15</R>
<D>rising</D>
</Pr>
- <W EI="From the Northwest at 6">
<S>6</S>
<D>NW</D>
</W>
</CC>
- <F>
- <Day D="0" Dt="May 15">
<PC>10</PC>
<H>67</H>
<Lo>50</Lo>
<Hi>64</Hi>
<Aftr2>F</Aftr2>
<TomLo />
<TomHi />
<Ss>8:06 PM</Ss>
<Sr>5:39 AM</Sr>
- <HF Order="1" twcH="9">
<T>57</T>
<FL>57</FL>
<I>30</I>
</HF>
- <HF Order="2" twcH="10">
<T>59</T>
<FL>59</FL>
<I>30</I>
</HF>
- <HF Order="3" twcH="11">
<T>61</T>
<FL>N/A</FL>
<I>30</I>
</HF>
- <HF Order="4" twcH="12">
<T>62</T>
<FL>N/A</FL>
<I>30</I>
</HF>
- <HF Order="5" twcH="13">
<T>63</T>
<FL>N/A</FL>
<I>28</I>
</HF>
- <HF Order="6" twcH="14">
<T>63</T>
<FL>N/A</FL>
<I>28</I>
</HF>
- <HF Order="7" twcH="15">
<T>62</T>
<FL>N/A</FL>
<I>28</I>
</HF>
- <HF Order="8" twcH="16">
<T>61</T>
<FL>N/A</FL>
<I>28</I>
</HF>
- <HF Order="9" twcH="17">
<T>60</T>
<FL>58</FL>
<I>28</I>
</HF>
- <HF Order="10" twcH="18">
<T>59</T>
<FL>57</FL>
<I>28</I>
</HF>
- <HF Order="11" twcH="19">
<T>58</T>
<FL>55</FL>
<I>28</I>
</HF>
- <HF Order="12" twcH="20">
<T>57</T>
<FL>54</FL>
<I>26</I>
</HF>
</Day>
</F>
- <wx.com>
<V>210</V>
<UB />
<CR>Copyright 1995-2002, The Weather Channel Enterprises, Inc.</CR>
</wx.com>
</Weather>






Somehow that seems like the start of the right approach

DonLKSAB
05-20-2003, 10:01 AM
Exelent hack.

Quick question.

Any way to have the :
Winds:
WSW 40 km/h

Showing im m/s ( meter / second )

/DonLKSAB

ogden2k
06-04-2003, 10:08 PM
Cool hack!

How do I hide this feature to guests?

ogden2k
06-05-2003, 07:50 PM
Yesterday at 07:08 PM ogden2k said this in Post #358 (https://vborg.vbsupport.ru/showthread.php?postid=404517#post404517)
Cool hack!

How do I hide this feature to guests?

Bump

tomsch
06-06-2003, 12:05 AM
ok what did i do wrong i installed this hack on 2.3.0

i get the current weather coming up for the default nyc but when i click detailed forcast or change settings i get an error

no input file specified in weather.php.

ok got that prob fixed.(and no i don't know what the prob was)

the only problem i have now ithe the last update time is wrong

any ideas on that one??

gmarik
06-06-2003, 05:48 AM
Will it work with weather in Scandinavia too?

DonLKSAB
07-04-2003, 10:13 PM
Hmm.

I got a wierd problem.

most of the time it take realy long time for my index page to load.
And when it does the weather is all messed up.
No pic and the temperature is way off.
I have to reload to make it work.
Sometimes it takes around a minute to load.
And i have to reload several times to make the weather work.

Its a grate hack but the load times are annoying.

/DonLKSAB

Heffe2000
07-24-2003, 01:11 AM
I'm having the exact same problem as the Don, terribly slow loading, if it loads at all... I've turned it off until I can figure out the malfunction :(.

craig hughes
07-28-2003, 12:20 AM
I have the same problem..at first I didn't know what it was...then narrowed it down to the weather hack server speed.

Had to take it out of index.php too because merely taking it our of the forumhome template wasn't good enough...shame too was a good hack for a while but not woth the headache with the slow load speeds

cirisme
07-28-2003, 03:58 PM
Question:

The code that is put into the index doesn't update the weather settings. You grab the weather from the server, display it, then it just goes away. It's not cached into the database. Why?

Wouldn't it be more efficient if it grabs the weather, displays it, inserts/updates the weatherdata then exits?

mbaskett
07-28-2003, 05:39 PM
I've seen teh same performance issues recently as well. COuldn't figure it out, as the pages would oad fine some of the time, then for no apparent reason, it'd take 50+ seconds of PHP processing for the page to load. Finally noticed that the pages that loaded slowly all showed no info for the weather.

Disabled the weather features and now the site sings again...

Sad to see it go, but for a performance hit like that, I cannot justify the hack :(

I did like it, though... as do many of my site's members.

BiZ
08-08-2003, 09:37 PM
just a note to you guys. I had a weather system installed on my board just liek this one..not sure if this is it. its a great informational tool, but DO NOT install it on the main forum home page....it stalls the loading of the forum..I lost half my visitors because of it....it took forever to load the main forum page because of that hack....make a link on the main forum page for it..but if its displayed live on the main forum page good luck trying to load your forum..its ridiculous...its sucks because I love the idea of this hack..

wild texas
08-10-2003, 05:17 PM
I've been having excessively long load times to get to the main page of my forum, and it hadn't occurred to me to disable the weather hack and check. Through my installation of another hack today, I inadvertantly killed the weather display from my forum index. The page FLIES again. I won't be re-enabling the weather on my forum index any more. I'll just find somewhere to integrate it into my site, either via a link or button to "Your Weather" (http://yourdomain.com/yourforum/weather.php).

PhoenixBB
08-12-2003, 06:16 PM
Oh bugger! So that's why my vbhome portal was loading so slowly. Never occured it could be the weather.

Why is it suddenly doing this now? Never used to be a problem. Is there nothing can be done to pep it up again. I love this hack! *cry*

Attrox
08-12-2003, 06:51 PM
I've always had that problem with the hack, actually. Ever since I installed it, which was months ago... so what I did, was make it optional, where you could turn it on or off in the User CP. That way users stopped complaining about the slow loading time...

Dark_Wizard
08-12-2003, 08:18 PM
Works fine for me...check it out here (http://www.dpclan.com). I can tell you what I did to make it work ;)

PhoenixBB
08-12-2003, 08:23 PM
It always ran fine for me until a few weeks ago, but I didn't realise it was this causing the slow loading. I've just put links to the weather now. Doesn't look as nice but my Portal is already nippier.

Dark_Wizard
08-12-2003, 08:42 PM
Ok...here is what I see as causing the problem...they are having router issues the hop before you get to them, hence the slow response.

BiZ
08-13-2003, 04:49 PM
Yesterday at 10:18 PM Dark_Wizard said this in Post #371 (https://vborg.vbsupport.ru/showthread.php?postid=425508#post425508)
Works fine for me...check it out here (http://www.dpclan.com). I can tell you what I did to make it work ;)


doesnt look like you did anything. its slow to load. The problem isnt consistent, whereas its slow every time you visit the board. if you try to access your main forum page on a daily bases, your going to see that there is lag time...and find yourself having to click links/buttons to your board more then once for it to load.

i tried you link..it had the same problems I had.

ANT.menmusic
08-17-2003, 03:37 PM
i had alot of problems when i first installed this, but it was late last night after a few beers.
this morning, i woke up, deleted all the tables from mySQL (the ones pertaining to this hack), removed all the templates, followed this thread (actually read every post), changed the php pages back to what they were and started from scratch again and boom! it worked!
it's for a client so i think they will be very happy.

ANT.menmusic
08-17-2003, 08:59 PM
okay, i changed the forumhome_weather template to:

<!-- Weather -->
<br>
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E" width="95%" align="center"><tr><td>
<table cellpadding="4" cellspacing="1" border="0" width="100%">
<tr id="cat">
<td bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" colspan="5"><a href="weather.php?s=$session[sessionhash]&action=getdata"><normalfont color="#000000"><b>Check the Weather</b></normalfont></a></td>
</tr>
<tr id="cat">
<td bgcolor="#1D6AA0" width="100%" align="left" colspan="5"><smallfont color="#EEEEFF">Time of last weather update: $weather[updatedate] at $weather[updatetime]</smallfont></td>
</table>
</td></tr></table>
<!-- /Weather -->


now my index.php loads quickly and only registered users can check the weather, since they have to click on "Check the Weather" category (which brings them to the weather.php.. etc.)

Dodger
08-18-2003, 12:56 PM
This script is very cool, but i'am tired of w8ing loading forum home. I have an idea of sollution of this problem. Couse i'am lame in php can smb. write a peace of code - a link wich will popup window with an a detail forcast? So this link everybody can put in forumhome instead of $currentweather
THX

Addon:
Oh, I see ANT.menmusic done smth like this... THX to him!

ANT.menmusic
08-18-2003, 01:45 PM
yeah, basically, the template that way only shows you a link to check your weather and the last time update (you could even remove the update time):
look here (www.nulifeentertainment.com/viproom) (i opened the board last night at 12AM).

ANT.menmusic
08-18-2003, 05:42 PM
oh, here are the two files you can upload so that your visitors/users don't get a red-X when the weather server is down.
-ant

this one is named ".gif" (without the quotes, obviously)

ANT.menmusic
08-18-2003, 05:43 PM
and this one is named "0.gif"
same image, but now all you have to do is upload it to your
yourdomain/forums/images/weather folder

-ant

Dodger
08-18-2003, 09:59 PM
ANT.menmusic
you could even remove the update time
I did it allready, couse even this update time load the page hard.

-nice forum
-THX 4 try again image!

Dodger
08-18-2003, 09:59 PM
ANT.menmusic
you could even remove the update time
I did it allready, couse even this update time load the page hard.

-nice forum
-THX 4 try again image!

Dodger
08-18-2003, 09:59 PM
ANT.menmusic
you could even remove the update time
I did it allready, couse even this update time load the page hard.

-nice forum
-THX 4 try again image!

ANT.menmusic
08-19-2003, 02:50 AM
yeah - i think i'm gonna do that... just realized that any fetching of date is gonna slow my index page if the weather server is not responding. thanks for that.

oh, and np about the image.
-ant

MaDCaT75
08-19-2003, 04:03 AM
I dunno what it is but my forum main page loads super slow now! :cry:

ANT.menmusic
08-19-2003, 06:19 AM
Yesterday at 06:59 PM Dodger said this in Post #383 (https://vborg.vbsupport.ru/showthread.php?postid=426908#post426908)
ANT.menmusic
you could even remove the update time
I did it allready, couse even this update time load the page hard.

-nice forum
-THX 4 try again image!


think i need to change the call to the weather server codes on the index - since it still calls the msnbc server apparently the page still loads slow at times.

ANT.menmusic
08-19-2003, 06:43 AM
i changed:

// ###################### Get Weather #######################
if ($weatherpage!=1 or !isset($weatherpage)) {

$usersettings = $DB_site->query_first("SELECT * FROM weather_usersettings WHERE userid=$bbuserinfo[userid]");
if (!isset($usersettings[userid])) {
$usersettings[accid] = "USNY0996";
$usersettings[tpc] = "1";
$usersettings[tps] = "1";
$DB_site->query("INSERT INTO weather_usersettings (userid,accid,tpc,tps) VALUES ('$bbuserinfo[userid]','$usersettings[accid]','$usersettings[tpc]','$usersettings[tps]')");
}

$userdata = $DB_site->query_first("SELECT * FROM weather_userdata WHERE userid=$bbuserinfo[userid]");
$datecut = $userdata[time];
if ((time()-3600)>$datecut or $forceupdate=="yes") {
$rawdata = fsockopen("www.msnbc.com",80,$num_error,$str_error,30);
if(!$rawdata) {
$weather[error_num] = $num_error;
$weather[error_str] = $str_error;
} else {
fputs($rawdata,"GET http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

while (!feof($rawdata)) {
$getbit = fgets($rawdata,4096);
$getbit = trim($getbit)."\n";
if (substr($getbit,7,4) == "City") {
$weather[city] = substr($getbit,15,40);
$weather[city] = substr($weather[city],0,strlen($weather[city])-3);
}
if (substr($getbit,7,6) == "SubDiv") {
$weather[subdiv] = substr($getbit,17,20);
$weather[subdiv] = substr($weather[subdiv],0,strlen($weather[subdiv])-3);
}
if (substr($getbit,7,7) == "Country") {
$weather[country] = substr($getbit,18,20);
$weather[country] = substr($weather[country],0,strlen($weather[country])-3);
}
if (substr($getbit,7,5) == "Temp ") {
$weather[temp] = substr($getbit,15,20);
$weather[temp] = substr($weather[temp],0,strlen($weather[temp])-3);
}
if (substr($getbit,7,5) == "CIcon") {
$weather[cicon] = substr($getbit,16,20);
$weather[cicon] = substr($weather[cicon],0,strlen($weather[cicon])-3);
}
if (substr($getbit,7,5) == "WindS") {
$weather[wind_spd] = substr($getbit,16,20);
$weather[wind_spd] = substr($weather[wind_spd],0,strlen($weather[wind_spd])-3);
}
if (substr($getbit,7,5) == "WindD") {
$weather[wind_dir] = substr($getbit,16,20);
$weather[wind_dir] = substr($weather[wind_dir],0,strlen($weather[wind_dir])-3);
}
if (substr($getbit,7,4) == "Baro") {
$weather[barometer] = substr($getbit,15,20);
$weather[barometer] = substr($weather[barometer],0,strlen($weather[barometer])-3);
}
if (substr($getbit,7,5) == "Humid") {
$weather[humidity] = substr($getbit,16,20);
$weather[humidity] = substr($weather[humidity],0,strlen($weather[humidity])-3);
}
if (substr($getbit,7,4) == "Real") {
$weather[realfeel] = substr($getbit,15,20);
$weather[realfeel] = substr($weather[realfeel],0,strlen($weather[realfeel])-3);
}
if (substr($getbit,7,6) == "LastUp") {
$weather[lastup] = substr($getbit,17,25);
$weather[lastup] = substr($weather[lastup],0,strlen($weather[lastup])-3);
}
if (substr($getbit,7,7) == "ConText") {
$weather[context] = substr($getbit,18,25);
$weather[context] = substr($weather[context],0,strlen($weather[context])-3);
}
}

// Location Info
$weatherdata[city] = $weather[city];
$weatherdata[subdiv] = $weather[subdiv];
$weatherdata[country] = $weather[country];

// Current Conditions
$weatherdata[temp] = convert_temp($weather[temp],$usersettings[tpc]);
$weatherdata[cicon] = $weather[cicon];
$weatherdata[wind_dir] = $weather[wind_dir];
$weatherdata[wind_spd] = convert_speed($weather[wind_spd],$usersettings[tps]);
$weatherdata[barometer] = convert_press($weather[barometer],$usersettings[tps]);
$weatherdata[humidity] = $weather[humidity];
$weatherdata[realfeel] = convert_temp($weather[realfeel],$usersettings[tpc]);
$weatherdata[lastup] = $weather[lastup];
$weatherdata[context] = $weather[context];

fclose($rawdata);
}
} else {
$weatherdata = $DB_site->query_first("SELECT city,subdiv,country,temp,cicon,wind_dir,wind_spd,b arometer,humidity,realfeel,lastup,context FROM weather_userdata WHERE userid=$bbuserinfo[userid]");
}

if ($weatherdata[subdiv]) {
$weatherdata[showsubdiv] = "$weatherdata[subdiv], ";
} else {
$weatherdata[showsubdiv] = "";
}

$time_lastup = strtotime($weatherdata[lastup]);
$weather[updatedate] = vbdate($dateformat,$time_lastup);
$weather[updatetime] = vbdate($timeformat,$time_lastup);

eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";");
}


to


// ###################### Get Weather #######################
if ($weatherpage!=1 or !isset($weatherpage)) {

$usersettings = $DB_site->query_first("SELECT * FROM weather_usersettings WHERE userid=$bbuserinfo[userid]");
if (!isset($usersettings[userid])) {
$usersettings[accid] = "USNY0996";
$usersettings[tpc] = "1";
$usersettings[tps] = "1";
$DB_site->query("INSERT INTO weather_usersettings (userid,accid,tpc,tps) VALUES ('$bbuserinfo[userid]','$usersettings[accid]','$usersettings[tpc]','$usersettings[tps]')");
}

eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";");
}

and now i'm good - the only thing it does is if it's a new user it inserts the NYC default info into the database under the new username...
i think - either way, the index.php loads quick as heck now.

i dont know much about hacking - i can follow directions pretty well, and i apologize if i have murdered your weather hack - it's just that i love the idea so much and this is the only compromise i could find... at least until msnbc gets a faster/better server.
-ant.

MaDCaT75
08-19-2003, 08:57 PM
Today at 06:03 AM MaDCaT75 said this in Post #385 (https://vborg.vbsupport.ru/showthread.php?postid=426976#post426976)
I dunno what it is but my forum main page loads super slow now! :cry:

MaDCaT75
08-21-2003, 02:25 AM
Any updates on this yet?

dvdweb
08-27-2003, 03:50 PM
I don't suppose there is another weather server to pull the data off is there, because I love the idea of this feature, the only problem at the moment is that it is only working once every so often.

dvdweb
08-29-2003, 10:17 AM
I've just noticed that whenever you change your settings it always works, but after that it just falls over again

MaDCaT75
09-05-2003, 08:51 AM
This hack is pretty good

translucent
09-06-2003, 10:53 AM
While it worked intermittently before, I'm suddenly getting the following error:

Warning: fsockopen(): php_hostconnect: connect failed in /home/u1/translucent/html/board/weather.php on line 32

Warning: fsockopen(): unable to connect to www.msnbc.com:80 in /home/u1/translucent/html/board/weather.php on line 32

MaDCaT75
09-06-2003, 10:52 PM
That usually happens to me but only once in a while

patriciafrankie
09-26-2003, 03:21 AM
Could someone help me with the create_table part, please?

Thanks,
Patricia

joeydood
10-27-2003, 06:20 PM
hate to beat my own drum here but i guess i can, what the heck...

i think this is a lotta trouble to go thru. i wanted and needed weather for my motorcycle riding members so here's what i did:

1. changed the description of the 'location' user field to let them know that it was also used for their weather.

2. jacked yahoo's form for weather

3. threw a button on the top of my forum that yanks the member's 'location' field and passes it to the yahoo form.

bam you have member-specific weather. when they open the forum there's a button on the top called YOUR WEATHER with their location written in the form in the html already for them.

and yes, if some dumbass puts 'playboy mansion' or 'third ring of saturn' for their location, it will return the yahoo weather home page.

and yes, you could use the weather form from any site like www.noaa.com so long as they don't check the originating ip in their server-side script.

mlevenson
12-18-2003, 02:34 AM
well as much as I like this hack I can't deal with the delay of the index.php file being loaded. I think I'm going to take Joey's idea with what he did with his weather. Since he and I have the same needs

CtrlAltDel
12-22-2003, 04:13 AM
this hack fails terribly most of the time

the weather.php page just hangs like crazy, rarely loads at all. the integrated version with the portal does the same thing...no error messages, it just sits at about half loaded and never works. i can go to the page page in the source manually, but i feel that the method that its being opened is the wrong way to go about it. i'll have to check into other ways of pulling the data because the current way just doesnt work enough of the time.

AutomatikStudio
01-02-2004, 07:05 AM
I'm gonna go with the last few posts and say that this hack is usless to me as index.php and weather.php just hang for about 5 min. and then time out.

MaDCaT75
01-02-2004, 08:01 AM
oh well he tried

replicon
01-08-2004, 04:44 PM
Wow. I didn't think there were so many people having problems with this. I have a fix for pretty much everything that's mentioned in this thread, lag, weather not working, blank page... :). Here's the technical description of what happened and why.

I stumbled upon the lag issue on the main page a few months back. It was fairly rare, approx. 5% of the hits to the main page which had the weather it would basically hang php completely affecting all the PHP pages on the server anytime someone checked the weather or hit the main page. It progressively got worse and worse. Like most of you guys, I took out the weather from the main page as a quick fix.

I pulled up a network sniffer to see what was going on between PHP and msnbc (which hosts the weather component). I noticed that sometimes it'd hit an IIS5 server, and sometimes, it'd hit an IIS6 server, which would hang the page. Looks like they were slowly rolling out Windows 2003 servers to their msnbc web server clusters, and whenver PHP requests the weather from the component and it (randomly) went to an upgraded IIS6/Win2K3 server, it'd hang.

Used my browser (IE) to hit the weather component page, and sniffed those packets. Works fine on IIS5 and IIS6. Compared the packets and noticed the difference. The vbWeather script was terminiating the request with 2 LF's (\n). IE terminated the requests with 2 CRLF's (\r\n). The HTTP standard defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body. Meaning there was a bug in the weather.php code, which was allowed in IIS5, but because IIS6 is much stricter in RFC compliance, it sat there waiting for a proper end of line, which it never receives, so it just hangs there and does nothing.

OK there's the geeky tech description. Here's the fix.

In all your php files that access the weather, replace the line:
fputs($rawdata,"GET /m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

with:
fputs($rawdata,"GET /m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\r\n\r\n");

And your weather will be back up and running.

Here's the link to my site. Click F5 to refresh as much as you want, it'll never hang :).

Beyond Car Forums (http://forums.beyond.ca)

Enjoy.

indiamike
01-08-2004, 05:39 PM
Most excellent!!!!!


Thanks for the fix. :)

Zhin Jio
01-14-2004, 08:09 PM
Instantaneous fix. Thank you so so much for posting that info. I don't have to ditch this very cool hack now.

- ZJ

White Knight
01-21-2004, 12:24 AM
Wow. I didn't think there were so many people having problems with this. I have a fix for pretty much everything that's mentioned in this thread, lag, weather not working, blank page... :). Here's the technical description of what happened and why.

I stumbled upon the lag issue on the main page a few months back. It was fairly rare, approx. 5% of the hits to the main page which had the weather it would basically hang php completely affecting all the PHP pages on the server anytime someone checked the weather or hit the main page. It progressively got worse and worse. Like most of you guys, I took out the weather from the main page as a quick fix.

I pulled up a network sniffer to see what was going on between PHP and msnbc (which hosts the weather component). I noticed that sometimes it'd hit an IIS5 server, and sometimes, it'd hit an IIS6 server, which would hang the page. Looks like they were slowly rolling out Windows 2003 servers to their msnbc web server clusters, and whenver PHP requests the weather from the component and it (randomly) went to an upgraded IIS6/Win2K3 server, it'd hang.

Used my browser (IE) to hit the weather component page, and sniffed those packets. Works fine on IIS5 and IIS6. Compared the packets and noticed the difference. The vbWeather script was terminiating the request with 2 LF's (\n). IE terminated the requests with 2 CRLF's (\r\n). The HTTP standard defines the sequence CR LF as the end-of-line marker for all protocol elements except the entity-body. Meaning there was a bug in the weather.php code, which was allowed in IIS5, but because IIS6 is much stricter in RFC compliance, it sat there waiting for a proper end of line, which it never receives, so it just hangs there and does nothing.

OK there's the geeky tech description. Here's the fix.

In all your php files that access the weather, replace the line:
fputs($rawdata,"GET /m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\n\n");

with:
fputs($rawdata,"GET /m/chnk/d/weather_d_src.asp?acid=$usersettings[accid] HTTP/1.0\r\n\r\n");

And your weather will be back up and running.

Here's the link to my site. Click F5 to refresh as much as you want, it'll never hang :).

Beyond Car Forums (http://forums.beyond.ca)

Enjoy.

Great Job! Works very well!