vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vB Weather Mk. 2 (https://vborg.vbsupport.ru/showthread.php?t=41842)

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. 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

Quote:

Yesterday at 10:18 PM Dark_Wizard said this in Post #371
Works fine for me...check it out here. 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:
Code:

<!-- 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 (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

Quote:

Yesterday at 06:59 PM Dodger said this in Post #383
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:
Code:

// ###################### 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,barometer,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

Code:

// ###################### 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

Quote:

Today at 06:03 AM MaDCaT75 said this in Post #385
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


All times are GMT. The time now is 11:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01740 seconds
  • Memory Usage 1,845KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete