The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vB Weather Mk. 2 Details »» | |||||||||||||||||||||||||
This is a post of a much-revised hack originally posted (by myself) here. I am posting this as a new hack because MSNBC, who the raw weather data is provided through, has changed their source provider (from AccuWeather to The Weather Channel), which required a retooling of the data parsing code, as well as completely new databases. I have also made obsolete the weather_functions.php file, moving the functions to admin/functions.php, simplifying the ability to show current weather data on any page (if desired). Finally, in what I'm sure will be welcome news to many people who have installed the original, I've completely rewritten the instructions, making them, as far as I can tell, much simpler.
If you are unfamiliar with the original: This hack provides current weather conditions and a five-day forecast to your members. Each member can select from over 34,000 cities, by narrowing down from region (like continents), country, and subdivision (like states). Each member can also select to see temperatures in Fahrenheit or Celsius, as well as metric or standard measurements for the other data. A demo is available on my test board: http://www.jjr512.com/testboard/. I have set up an account for anyone to use to test it out (username: test; pw: test). If you are not logged in, you will see default weather on the home page (default is set to New York City), and cannot change settings (I forget if you can view a detailed forecast, though; you may be able to). If you do log in, you can change the settings for the test account, to see how it works. *** If you have installed any previous version, you should completely uninstall it. Read the instructions and work backwards from there: Delete all templates added, remove changes to any existing templates (I forget if there were any or not), delete all new tables from the database, delete all new files added by the old hack. All have been changed to some extent, some more than others, and it would be easier to work from a clean slate. Especially since some of the template names have changes, so if you don't delete the old ones, they'll just be sitting there doing nothing at all. It is also vitally important to delete (or "drop") the tables--I believe there were six--you added for the original version. The new ones have different data and, for some, a different structure, so do not just empty them. Remove them totally. Good luck! Change Log v1.1a: Current Version: Corrects a small error where an incorrect variable was used in the code to show the local time of the last update. If you already have v1.1, you only need to do the fix described in Post #82 below. v1.1: Changes display of last update time to be the correct time in the user's own local time zone; previously, it was always Eastern Time (GMT-5) (Upgrade instructions are in Post #79 below). Also breaks the weather_city.sql into six smaller pieces (useful only to new installations; existing installations need not worry about this). v1.0a: Adds instructions on how to add location to current weather on forums home page (changes to code added to index.php and forumhome_weather template). v1.0: Original Release Show Your Support
|
Comments |
#152
|
||||
|
||||
That made it 6 hours ahead of me. And the time still has the 40 minutes after it no matter what time I force update it.
Quote:
|
#153
|
||||
|
||||
I think you're confusing something. The update time has nothing to do with when you received a weather update. It is the time that the weather data was actually created or posted by The Weather Channel at MSNBC.com. It's the time that they issued that weather update.
|
#154
|
||||
|
||||
Oh, ok. Then they must be doing it at 40 minutes past the hour all the time? That would explain why it always says that then.
The only problem I have now then is that when a new user logs in, the New York Weather (my default) always says it was updated 12 hours behind the server time (which is GMT), with xenon's added code, that is. Once I regsiter or log in, it says the right time (or close to it) for me which is GMT -6. Other than that (and still not being able to force update), this hack is working great! Quote:
|
#155
|
|||
|
|||
Is it possible to put this in the users cp... like above the box for New Private Messages on the main page of the user cp.
|
#156
|
||||
|
||||
I have to admit that I don't understand the whole time system in vBulletin well enough...server time, user time, etc., and frankly, I think there are certain...let's just say "inconsistencies"...in the way it's all programmed in regards to GMT which never goes on daylight savings time yet the actual time zone that covers GMT does, and a bunch of other things that are all very confusing. Whatever logic there is behind the whole thing is lost on me. Without properly understanding it, I don't think I can really put it to effective use in the hack.
As for the user cp thing...Theoretically it's possible, but I haven't done it yet. The general theory is you take the code the instructions say to put in index.php and put it into whatever file it is that generates the page on the screen. I think the user cp is usercp.php but there may be other files that also generate the user cp page depending on what you're doing (member.php, member2.php, maybe others as well). The general theory is also that you put the code in the file just before the template that is the main part of the page gets called. Then you put the variable that has the weather template in it in the template for the page you want where you want it. |
#157
|
||||
|
||||
Did the time ever get fixed? I installed this last night and it is a great addition to the forum just the time is out of wack a little.
I used eastern time so on the forum at the bottom it says for example 8:12 am the time now but the weather time under the weather box shows 10:12 am. Can this be fixed? |
#158
|
||||
|
||||
Something wrong with this country and city also gif does not showup and all readings are out of wack.
Bukit Timah, Singapore |
#159
|
|||
|
|||
Tonight my weather is wierd, there is no "now" forecast. I can see the 5 day find but now is not available.
Is MSNBC having problems again or did they change something again? |
#160
|
||||
|
||||
Working fine for me still.
|
#161
|
||||
|
||||
My current weather is not showing either and I do have the 5 day forecast showing. MSNBC must be doing something or the current weather is down at the moment. Erwin must have his set to "Magic" weather.
Quote:
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|