View Full Version : vB Weather: Give your members current weather and forecasts!
JJR512
02-25-2002, 10:00 PM
After seeing a weather feature at the vbPortal website, and finding out that I couldn't get it for free, I determined to create it for myself, and give it away to everyone for FREE. :)
So here it is. It's based in part upon the original MyWeather add-on module for PHP-Nuke, which as I understand was also the basis for the add-on module for vbPortal. Anyway, I basically used the part of the PHP-Nuke module that gets the raw data and parses it into a usable format, although I reworked it some and corrected a few bugs. I wrote on my own the rest of the code which handles and displays the data, along with letting the user select his/her location (to localize the weather), number formats (like ?F or C, winds in mph or kmph, etc.), and various other little bits.
I've done as much testing on it as I can on my own, and have had it running on my own production forums for about a day now. Several people have commented that they really love the feature, that it's almost getting to the point where they don't have to go anywhere else on the Internet. :D I haven't heard of any complaints or problems yet, though, so I'm reasonably certain it's fit for a full release.
You can demo the hack on my message board: JJR512.com (http://forums.jjr512.com/). The first part you should look at is the box that appears in the column of boxes on the left side of the home page. This box displays basic current weather info. There are two links in that box, one to see the forecast, and the other to change settings. I forget if you need to be logged in to see the forecast--it may just show you a forecast for the default location, which is Central Park, New York City, NY, USA--but you definitely need to be logged in to change settings. For the purpose of seeing this hack in action, you can login as Test User using the password testuser. Feel free to change the settings and save them, do whatever. :)
Installing this hack is in some ways easy, in other ways not so easy. There will only be one file modification. However, there are no specific instructions as to which file to edit or how to edit it. If you want the small weather box to show up on your forums home page, you need to edit the associated file (index.php). If you want it to show up somewhere else, then you need to edit whatever file generates the page where you want it. There is a text file in the ZIP that contains all the code, and only the code, that you need to insert into whatever file. If you prefer, you can turn that text file into a .php file (by adding <?php at the beginning and ?> at the end and renaming it to .php) and simply including it in whatever file you need it in.
You will also most likely need to edit the template that makes the weather box. It's formatted to basically make a box as it appears on my site, which is in the middle of some other boxes in a column. If you want to reformat it to appear as a long thing across the top of the page, like the various stuff at the top of the forums home page here at vbulletin.org, that's up to you. You edit the templates to match your own site.
BTW, I would appreciate it if someone better at PHP coding than myself would take a look over this and tell me if I've done everything right or not. I believe the code works and does what I want it to do, but it seems like it might be a little more complex than it needs to or should be. I guess I'm just wondering if there may have been a more efficient way to do some of the things I did. If you have any tips or advice for me, or even want to rewrite the code to show me, I'd really appreciate it. :)
OK, so without further ado, here's the hack in the attachment. Whatever problems you have, please post them here, and I'll try to help as best I can, but make no guarantees that I can help at all. Please remember that I write my hacks for my own site first and foremost, so they do what I need them to do, not what I think somebody else might want. I choose to release them here in case anybody else can benefit from them, but you may need some part of it to work slightly differently. If I know how to do it I will try to tell you how to do it, but I won't update the hack with every little feature variation that people ask for. In general, I only update my hacks to fix bugs and to add new features that I want or need for my site. :)
// Change Log]
03b: Includes necessary database change instructions.
03a: Forgot to update 03 ZIP with new templates; fixed.
03: Changed code for new icon system, added code for forecasted weather type (new part of raw data)
02: Adjusted code for new format of weather forecast raw data
01b: Fixed two missing lines from weather_include.txt
01a: Added missing template; updated instructions regarding missing template; fixed $templatesused variable in weather.php; added text file explaining how to add more cities; updated instructions regarding where to get the icons used for this hack
01: Original release
Mark Hewitt
02-26-2002, 08:28 AM
Looks great.
The list of cities which are included with the hack. Are they the only ones which are available, or can more be added?
Newcastle (where I live) is a major city and it's not on the list. Neither are Edinburgh or Cardiff, captials of Scotland and Wales respectively, Glasgow is there though, strange.
ps Love the way you've organised your front page :up:
DjSap
02-26-2002, 09:15 AM
heh i was about to start coding a weather thingy today, but now i dont have to, thanks for the hack.
DjSap
02-26-2002, 10:14 AM
and you can add more cities if you like to, i dont know exactly how to do it but it shouldnt be that hard since all the weather info is taken from msnbc
Mark Hewitt
02-26-2002, 10:22 AM
Just looked at the msnbc site (popup hell!!). And it does have the majority of places in :up:
Does this hack mean your server has to connect to msnbc every time the front page loads?
TheComputerGuy
02-26-2002, 12:22 PM
I like it, I will try to install it sometime tonight :)
JJ, I have "boxes" down the side of my forums to, and they are there all througout the forums, on every page. They are produced by the header template.
Should the code go into index.php? Because I can't get it to show when I put $weather in the header template.
DjSap
02-26-2002, 01:27 PM
if you are gonna show it on every page then i think yo uhave to put it in global
Just tried that.
No dice.
Gamingforce
02-26-2002, 02:05 PM
Awesome hack JJR512, but where can we get the iconsets for /images/weather ?
JJR512
02-26-2002, 02:53 PM
If you want it on every page, I believe the easiest way to do that is to make the weather_include.txt file into a PHP file, by adding <?php at the beginning and ?> at the end, renaming the extension, then include that file in the phpinclude template, then you should be able to use $weather anywhere. (This is in theory, not tested by me.)
You can easily add more cities. This hack comes with over 1500 cities that are made available, but there are a lot, lot more. Probably just about any town that is covered by an ISP would be available, or if not then the town next to it. I have attached a text file to this post that explains how to add more cities. I have also put this file into the weather01.zip and updated the attachment in the first post; note that if you have already downloaded it, it is NOT necessary to download it again. Just download the file from the attachment in this post, because nothing else in the ZIP has changed at all.
BTW, the cities Newcastle, Newcastle On Clun, Newcastle Wea Cntr, and Newcastle Wx Centre are all available, as are Cardiff and Edinburgh.
Mark Hewitt, no, it the front page won't try to connect to MSNBC every time someone loads it. A user's weather data is stored in the database and is usable for up to two hours after it was put there; after it is more than two hours old, the hack will connect to get new data. This should minimize the amount your site has to connect to MSNBC, plus the hack itself will not have to go through the steps of parsing the raw data, etc. I have personally observed on my home computer a difference of a few seconds between when the front page uses cached data and when I force it to get new data. If you want to change how long the cached data is considered "fresh", look for this line in weather.php:
if ((time()-7200)>$datecut or $forceupdate=="yes") {
Change the number 7200 to some other number, where it is the number of seconds. (There are 3600 seconds in one hour, thus for two hours, it is 7200.) Now this hack will display, on either the box on the forums home page or on the weather forecast page, the time the data was last updated by AccuWeather. This is the time the original raw data was updated, NOT when the data was stored in your database. You can try to pay attention to that time to see how often the actual raw data is updated (I have not had time to do that yet, and I just picked two hours as a seemingly good amount of time), and adjust the number accordingly. Meaning, if the raw data is only updated every three hours, make the cached data fresh for three hours; however, you run the risk that someone will cache some data just before an update, then the raw data changes, meanwhile the user is sees old data for the next three hours.
JJR512
02-26-2002, 03:07 PM
Gamingforce: D'oh! I forgot to include those. The ZIP with all the graphics is too big to attach, at 273kB, so I uploaded it to my own webserver where you can download it: <link removed by JJR512; the ZIP is now attached to Post #55 in this thread (https://vborg.vbsupport.ru/showthread.php?postid=271634#post271634)>. There will be four folders in the ZIP: iconset1, iconset2, etc. Please create a folder in your forums/images folder called "weather", and upload the four folders (including each folder's contents) there. (If you really want to put them somewhere else, you will need to edit the paths in the templates.)
I have updated the instructions.txt file for this hack to include the URL to download the images ZIP file. That is the only change; if you have already downloaded the weather01.zip, you do NOT need to download it again, because I just told you how to get the ZIP. :)
Note that each iconset has two additional graphics, forecast.gif and current_cond.gif, which are just graphics that say "Forecast" and "Current Conditions". I did not use these on my website, so they are not used in the templates, but they are there for you to use if you want to.
Lesane
02-26-2002, 03:15 PM
Fantastic Hack JJR512. Install this one later. Well done, thanks.
Martz
02-26-2002, 04:56 PM
looks good, nice work :)
JJR512
02-26-2002, 05:18 PM
I have updated the ZIP file to include another text file, redirect_weather_updatethanks.txt, which is used for another template. I forgot about it originally. I updated the instructions to include a reference to that file. I updated the weather.php file to fill in the template names for the $templatesused variable at the top.
If you have already downloaded this hack, please download the new ZIP, upload the new weather.php file, and add a new template for redirect_weather_updatethanks. Sorry! :o
We need to redo all the sql queries??
Fatal error: Cannot redeclare convert_temp() in /home/racing-f/public_html/bbs/weather_functions.php on line 4
Getting that when cliking on Change Settings and Detailed Forecast
JJR512
02-26-2002, 08:10 PM
Originally posted by qwaz
We need to redo all the sql queries??
No, just upload the new weather.php file, and add a new template for redirect_weather_updatethanks.
JJR512
02-26-2002, 08:16 PM
Originally posted by qwaz
Fatal error: Cannot redeclare convert_temp() in /home/racing-f/public_html/bbs/weather_functions.php on line 4
Getting that when cliking on Change Settings and Detailed Forecast
It sounds like for some reason, the weather_functions.php file is being included/required twice. Did you turn the weather_include.txt file into a PHP file and include it in your phpinclude template? If so, the problem is probably that both the weather.php file and the weather_include.php file would try to include weather_functions.php. Try removing the line in weather.php that requires weather_functions.php and see if it works like that.
Also, in Post #11 above, I incorrectly stated to change weather_include.txt into a PHP file and include it in the headinclude template. I should have said to include it in the phpinclude template, which is at the top of the styles area.
Originally posted by JJR512
It sounds like for some reason, the weather_functions.php file is being included/required twice. Did you turn the weather_include.txt file into a PHP file and include it in your phpinclude template? If so, the problem is probably that both the weather.php file and the weather_include.php file would try to include weather_functions.php. Try removing the line in weather.php that requires weather_functions.php and see if it works like that.
Ok, that's fixed, but when refreshing a page I get the below result.
I have another question...would I be possible to make it display weather for only a single city that I set it to? And not allow users to change it?
JJR512
02-26-2002, 09:50 PM
qwaz, I guess I don't know how to help you to get it to show up on every page. Maybe someone else knows the secret.
As far as only displaying one city, first set the settings for yourself to the city you want, then find this part in weather.php:
if (!isset($action) or $action=="getdata") {
$userdata = $DB_site->query_first("SELECT * FROM weather_userdata WHERE userid=$bbuserinfo[userid]");
Change $bbuserinfo[userid] to your own userid number. You can probably take out all the code from the Modify and Update Settings sections.
HiroshiNanami
02-27-2002, 05:14 PM
Great hack JJR. I just got a question. Would putting weather_include in phpinclude be such a good idea since you would be accessing the db on each and every page load? Wouldn't it slow down processing and hog resources in a large forum?
Has anyone tried using phpinclude to display the weather in every page in a busy forum?
JJR512
02-27-2002, 06:46 PM
I don't know what kind of impact it would have. Obviously, the database is being accessed on every page load anyway. If someone wanted the weather data on every page, there would need to be additional related calls to the database for every page, also, regardless of how or where the code was put. If it's too much of an impact, then that board won't be able to have it on every page.
Personally, I do not believe it's necessary or important to have the weather on every page. Even if you had a standarized set of boxes of stuff that appear in a column on the side of the forums, I think there is certain stuff that doesn't need to be there on every single forums page, maybe just the home page.
The directions were great and it was a very easy install. thanks for making the templates and the tables individual files. it make importing them very easy.
I plan on customizing it but for now I just wanted to get it working.
have it running here
http://www.ccdv.com/forum/homeindex.php
JJR512 - the diections forgot to mention the redirect template. it's in the zip, but it wasn't in the template section of the directions. just wanted to let you know so you could update the zip. Once again, great job :)
Lucky
02-28-2002, 03:36 AM
Great work my friend.
Very simple to install.
Just wondering though, I am using vb2.2.2 along with vbportal and I want to have the weather box on the index page (not http://www.mysite.com/forums/index.php but rather http://www.mysite.com/index.php) like you have. Where should I place the weather_includes.php file? and what else do I have to do?
TIA :)
JJR512
02-28-2002, 05:18 AM
If it is just the index.php file you want it on, you should put a require statement for that file in index.php, probably at the top under the statement for global.php. Edit the templates to how you want them, then put $weather in the forumhome template where you want the weather box to be.
When I'm editing the template of something that's going to get used in another template, as is the situation here, what I do is go to the page that's made by the main template first--in this case, index.php--then save the page as a plain text or HTML-only file (not as Web page, complete). Then I open that file in a browser as well as a text editor, and manually write into the file the basic HTML that would make the new feature show up. This gives me the framework of the template that will be included on the main template, which in this case the template getting included is homeindex_left_weather. Then I copy that HTML framework to a new blank text file, copy the variables from the sample template (the one I provided in the ZIP called homeindex_left_weather.txt) to the places they should go in the framework, and that gives me my template. All that's left is to create the new template in the admin cp, name it the right name, and copy the contents from the text editor.
Lucky
02-28-2002, 09:57 AM
I'm not sure if I made myself clear or maybe I'm just tired, but are you replying to me? And if so, you know that I have vbportal, and I want to have it on my index.php page for vbportal. I have tried what you stated and I have got nowhere. On your site you are running vbportal right? Cause I would like this on my front page, not the forum at all.
TIA :)
JJR512
02-28-2002, 02:58 PM
No, I am not running vbPortal.
I misunderstood you to say you wanted this hack to appear on a page that was separate from your vbPortal system. If you want it on a vbPortal page...there is an add-on moduled called MyWeather for vbPortal, you can download it from their website in their downloads area. That is specifically written to work with vbPortal, whereas my hack is only written to integrate with vBulletin. I have no idea how you would integrate my hack into vbPortal.
JJR512
02-28-2002, 07:28 PM
There is a small mistake in the file called weather_include.txt that's in this hack's ZIP file. Some of you may have put this text inside another PHP file, or made the file into a PHP file and included it from another PHP file. The mistake was the ommission of two lines, one of which causes the date and time of the weather data update (the time AccuWeather released the data) to not show up for the weather feature box or section that you put on another page (using the homeindex_left_weather template), and the other missing line causes the text of the weather type (like partly sunny or rain) to show up under the icon.
The ZIP file will be updated with the correceted file and re-posted above. However, if you already have weather01a.zip, you do not need to redownload it.
Just find this in the code from that file:
$weatherdata[humidity] = $weather[humidity];
$weatherdata[realfeel] = convert_temp($weather[realfeel],$usersettings[tpc]);
fclose($rawdata);
Change it to this:
$weatherdata[humidity] = $weather[humidity];
$weatherdata[realfeel] = convert_temp($weather[realfeel],$usersettings[tpc]);
$weatherdata[lastup] = $weather[lastup];
$weatherdata[context] = $weather[context];
fclose($rawdata);
Do NOT make this change to weather.php as it already has the missing line.
Lionel
03-01-2002, 02:51 AM
this is a great hack. I wish someone post an alternate template idea for frontpage.
Lionel
03-01-2002, 04:15 AM
I managed to place it nicely under the avatar. How can I default it to iconset 2 the ones without the borders?
JJR512
03-01-2002, 04:22 AM
If you want to make that the default, but still keep the other choices available, I guess the easiest way would probably be to switch the names of the iconset1 and iconset2 folders (rename iconset2 to iconset, rename iconset1 to iconset2, then rename iconset to iconset1).
Lionel
03-01-2002, 05:26 AM
this is really cool. I placed it on my homepage, all the way to the top. I have been looking for something like that for ages.
Lionel
03-01-2002, 02:32 PM
For no reasons, I have that:
Database error in vBulletin 2.2.1:
Invalid SQL: SELECT * FROM weather_usersettings WHERE userid=4
mysql error:
mysql error number:
JJR512
03-02-2002, 10:09 PM
What are you doing when that error shows up? Does the weather_usersettings table exist in the database? Is there a row in there for userid 4?
HiroshiNanami
03-04-2002, 10:14 PM
My weather is not displaying at all. The city and the image is not showing up, and the temp. and humidity, etc. are all zeros.
I went to check the database and there's nothing under city, subdiv, country, region and many other columns for all my members. What gives?
Lionel
03-04-2002, 10:19 PM
today, MSNBC is down
HiroshiNanami
03-04-2002, 10:21 PM
Ok, after I click 'force update', all the columns are filled with the correct data for that user. What could have caused the invalid data initially in the database? Is it a bug or does it have something to do with the MSNBC server?
HiroshiNanami
03-04-2002, 10:21 PM
Originally posted by Lionel
today, MSNBC is down
ahh....that explains it.
Lionel
03-04-2002, 10:23 PM
Originally posted by JJR512
What are you doing when that error shows up? Does the weather_usersettings table exist in the database? Is there a row in there for userid 4?
I think it happened because I logged in as another user... When I looked at the databse, the settings that I placed for user 1 were displaying for user 2. And user 2 was not able to update. I changed manually in the DB and since then so far so good. Great hack.
Lionel
03-18-2002, 06:34 PM
This hack has been working beautifully well. But now, I just got an email:
Database error in vBulletin 2.2.1:
Invalid SQL: SELECT * FROM weather_usersettings WHERE userid=0
mysql error:
I must add that I was getting the same error for another hack but that was fixed.
The sql looks good to me and the error, which just occured for the first time, happened after one week of no changes.
Do not know if I shoud blame vbulletin or what. The other observation: the error occured when I had 6 simultaneous registrations.
Zombie
03-20-2002, 09:07 AM
I downloaded this hack awhile ago and just now put it on my site.
Thanks for the hack JJR512.
Just hope msnbc doesn't go down very often. :)
Mohamed
03-20-2002, 09:47 PM
how I can make it in box on forum home like PM box
the ( $weather ) it doesn't work wiht me :(
thank's
skyline2002
03-22-2002, 07:07 AM
thx man, it 's the most powerful function that i installed!!
wild texas
03-25-2002, 10:07 AM
I recently added the weather hack to my vBulletin and what I'd like to do is save the weather box it generates to a text file for inclusion on other (non-vB) pages of my site.
I managed to get vB Weather to output the contents of the weather include file, after vB Weather has populated the weather data but just before vBulletin parses its template, to a text file. However, since the vB Weather template includes some standard vB template variables (for table background colors and such), those get saved out to the text file as the variable name, instead of being parsed and thus replaced with the proper font colors.
There's a line in vB Weather that reads:
eval("\$weather = \"".gettemplate("homeindex_left_weather")."\";");
I thought this would give me the parsed template, but it does not.
I tried using output buffering (http://www.phpbuilder.com/forum/archives/1/2001/1/2/108337) but did not have any luck. I'm fairly new to PHP coding, though I've been tweaking stuff for awhile now.
Any guidance would be appreciated.
You can view the weather box I'm wanting to export to a text file after it's populated with data and parsed by vB for template variables by going to my forums (http://wildtexas.com/talk/index.php) (see left nav, towards the bottom).
Thanks!
BigJohnson
03-26-2002, 04:28 PM
can someone make a vbhacker file for this plz
Okiewan
04-02-2002, 07:41 PM
Tremendous hack! Being a dirtbike site.. weather is important!
Thought you might like a screen of my implementation.
I made it a js pop-up, linked as "[username]'s Weather / Forecast" in the welcome panel, and as a top link "weather" (which I use text for).
Modified so it takes advantge of the style hack as well.
Very cool, thanks for the hard work!!
www.tourc.ca
04-23-2002, 12:56 PM
thanks... this is great.... worked like a charm, easy to install, and excellent documentation!
I also implemented this on my home page a little differently than was posted, and made the weather.php a javapopup, and changed the redirect to my home page but otherwise is the same as posted!
you can test it out on my site www.tourc.ca . You can log in as 'testuser' and use the same password 'testuser' to see the weather column on my home page on the left column...
Note: the weather on my site is on my site's home page not the forums home page, so click 'home'
-dave
AnkisethGallant
05-05-2002, 04:38 AM
I just installed this, it's pretty cool. It took some time editing the template, but now I have it convienently docked under my welcome panel.
wastegate
05-10-2002, 07:13 AM
Hi great hack! Nice work, but just one thing seems to giving me alittle greif, I hope someone can help.
1st problem is in the weather.php setings where you select your City, if the city is the first one in the region for Country it doesn't seem to goto that straight away, you have to select a different State/Country/City before it will show up.
Say for example I put in Australia/New Zealand as the region, Australia pops up as the default Country but doesn't list a subdevision/state or any citys in the city pull down, you have to then Select New Zealand then change it back to Australia for the Subdevision/State then select a different State for the Citys to show up. Little bit of an annoyance..
2nd is that I seem to be getting a database error sometimes from it. The error is as follows:
Database error in vBulletin 2.2.3:
Invalid SQL: SELECT accid,city_title FROM weather_city WHERE subdiv_id= ORDER BY city_title
mysql error: You have an error in your SQL syntax near 'ORDER BY city_title' at line 1
mysql error number: 1064
Date: Friday 10th of May 2002 04:00:26 PM
Script: http://board.performanceforums.com/forums/forums/weather.php?s=&action=modifysettings
Referer: http://board.performanceforums.com/forums/weather.php?s=&action=getdata&forceupdate=yes
Anyways I hope someone can help.
scottct1
07-10-2002, 02:22 PM
Silly question...
I host my site remotely at venturesonline.com and I was wondering how do I go about importing the 6 sql files?
Can anyone help?
(geesh I have been doing this a long time but never really fool with the SQL stuff - I feel like a newbie.)
Boofo
07-10-2002, 02:54 PM
Does anyone have the image files for this hack? I have tried to download them from the link provided but it keeps timing out. Any help will be greatly appreciated. :)
DestyNova
07-10-2002, 03:50 PM
Originally posted by Boofo
Does anyone have the image files for this hack? I have tried to download them from the link provided but it keeps timing out. Any help will be greatly appreciated. :)
Me too, I want to install this hack but I have to wait until I get these images (it kept time out) is it possible for anyone who have these images to attach it at here? thanks
btw JJR512, cool hack
scottct1
07-11-2002, 03:51 PM
Can someone please give me a clue on how to import the SQL files?
Thanks!
JJR512
07-11-2002, 04:30 PM
The image ZIP is attached to this post.
To import the SQL, you would need to use a program such as phpMyAdmin, which would be installed on the server, which lets you do things with the database directly. Check with your host if they have that, or if they can install it. If you can't use that, I don't know how else to do it, and someone else would have to help.
To do this with phpMyAdmin, click on the database name in the left pane, so that you see all the tables in the right. In the right pane, below the list of tables, is a text field labelled, "Or Location of the textfile :", with a Browse... and Go button. Use the browse button to find the SQL file, then hit Go to run it, and the instructions in the SQL file will be executed, which puts the data into the database.
IllNation
07-11-2002, 05:15 PM
I installed it, great hack JJ!!
Bush Music
07-11-2002, 05:37 PM
Hi,
I'm a newbe. I have downloaded the code for this hack and don't know what to do with it. Could someone be so kind as to advise me?
Thanks in advance!
bush music
Chris Blount
07-12-2002, 02:11 AM
Is there a way to change the default city from New York to something else? Thanks!
DestyNova
07-12-2002, 02:27 AM
JJR512
Thanks for zip, appreciate it lots
DestyNova
07-12-2002, 02:31 AM
Originally posted by Bush Music
Hi,
I'm a newbe. I have downloaded the code for this hack and don't know what to do with it. Could someone be so kind as to advise me?
Thanks in advance!
bush music
use any kind of text editor (Notepad, Ultraedit, whatever) to open vbulletin .php (e.x. index.php, user.php) to edit and copy/paste these codes following JJR512's instruction in attachment .zip
then upload or overwrite files at local computer
scottct1
07-12-2002, 01:04 PM
Is there a way to change the default city from New York to something else? Thanks!
Dang Chris, I was just gonna ask the same thing. :)
JJR512
07-15-2002, 01:18 AM
Yes, you can change the default setting of New York City.
The default settings are the settings for the userid of 0 in the weather_usersettings table. If you have a tool such as phpMyAdmin, and can browse that table, you would see that for userid=0, the accid field is NYC. You would change that field (the accid field) to the city code of whatever city you want as the default.
To find the city code, look in the weather_city table, find the city name (city_title), and remember the city code (accid). Then change the code for userid 0 in the weather_usersettings table.
Another way to find the city code, and this is probably easier, is to set your own settings to the city you want as the default, then look it up in your record in the weather_usersettings table (find your userid there and remember the accid value by it), then change the code for userid=0.
If you don't have phpMyAdmin, but can run queries on the database, here's another way to do it. Set your own settings to the city you want as the default. After saving your settings, go to modify them, but view the source code for the page, and search for the name of the city you selected. When you find it in the source code, look a little bit before the city name, and you should see something like, "<option value="xxxx" selected>your city name here". Note what it says inside the quotes for value (where I put xxxx in the example). Then, run this query on the database: UPDATE weather_usersettings SET accid='xxxx' WHERE userid=0; (where xxxx is the value from before).
If you can't run queries directly on the database, this should work. Get the accid for the city you want using the method I described in the previous paragraph. Then, create a new file like this:
<?php
error_reporting(7);
require("./global.php");
$DB_site->query("UPDATE weather_usersettings SET accid='xxxx' WHERE userid=0");
?>
Again, where xxxx is the accid you found. Save that file as updatedefault.php and upload it to your forums/admin directory and run it. Delete it immediately after that.
I'm sure I've managed to make this as confusing as possible, so I hope you can understand it. :)
Chris Blount
07-15-2002, 01:40 AM
I have PHPMYADMIN and was able to change the setting. Worked like a charm! Took 2 seconds. Thanks a bunch!
JJR512
07-15-2002, 03:28 AM
Just out of curiosity, what did you make as your new default, and how did you choose it?
The only reason I selected New York City was that, with a worldwide membership, and no membership- or website-related reason I could conceive to pick a particular city, I just had a patriotic inspiration and went with NYC. :)
Robert Basil
07-18-2002, 06:14 AM
I'm still looking for a way to put this on a non-forumhome page.
I tried the include method and commented the duplicate call to the "weather_functions.php" file in "weather.php" with no luck.
I see others are now running this on different pages. Care to share your secrets?
Thanks!
Robert Basil
07-19-2002, 01:36 AM
Someone? Anyone?
Boofo
07-21-2002, 08:47 AM
Ok, I messed with it some and I've narrowed it down to this. If I let the weather update itself on it's own, it shows up fine on the forumhome. If I try to force an update or modify my settings, it will show all zeros again and also not show the icon for the current weather (but the 5 day forcast is fine). Then, when it automatically updates again 2 hours later, it shows it fine. Can anyone please help me to get this sorted out?
Boofo
07-22-2002, 04:29 AM
Is this hack being supported anymore or is it just another one gone by the wayside? If it is being supported, will someone please answer our questions so that we can get it running? Thank you.
JJR512
07-22-2002, 04:44 AM
I don't really know how to solve that problem, since I never had it.
Boofo
07-22-2002, 04:55 AM
Ok, then can you please tell me EXACTlY how you have it set up on your site so I can make sure I ddin't misinterpret something or do something in the wrong place somehow? The thread was kindof confusing in a few spots. Could it have anything to do with me running PHP 4.2.1?
Originally posted by JJR512
I don't really know how to solve that problem, since I never had it.
JJR512
07-22-2002, 05:03 AM
I don't know about the PHP version, but as for how I have it set up, I have it set up just like the directions say. I wrote the directions based on how I have it set up for my own board.
Boofo
07-22-2002, 05:08 AM
In one part of the instructions, you say to make a php file out of weather_include and add the include weather_include to the phpinclude template. But yet, other people have had a problem with the error where it is trying to call that twice. That is the part that is most confusing. The rest is very well written and easy to understand. :)
Originally posted by JJR512
I don't know about the PHP version, but as for how I have it set up, I have it set up just like the directions say. I wrote the directions based on how I have it set up for my own board.
DestyNova
07-27-2002, 03:43 AM
Originally posted by Boofo
In one part of the instructions, you say to make a php file out of weather_include and add the include weather_include to the phpinclude template. But yet, other people have had a problem with the error where it is trying to call that twice. That is the part that is most confusing. The rest is very well written and easy to understand. :)
I second his post, I have problem with that "confusing" instruction but not only that, I install vbweather at my local server without any problem but when I upload and install at my net server and kept getting blank page. I was puzzled by that and I been spend hours on debuggin this hack out but no luck so far.
Help us pls?
Lionel
07-27-2002, 03:48 AM
do not know if this applies to you, but everytime that I install a hack and get a blank page, 99,99% it has to do with the templates, perhaps a mistake in the name, a blank space in it?
DestyNova
07-27-2002, 03:55 AM
Umm perhaps but I got it work at my local server but it is not easy to do that either, I have to modify more than several times. Then my computer claim to decide to give me the ugly blue screen after I install new program and eventually lost everything on it.
I have to do it all over again but I didnt do it yet until now, someone PM me so I decide to work it out right now to see how I do that.
Kars10
07-29-2002, 11:13 AM
This is one of the best Hacks ive ever see!!! :) :)
Klicked installed. Installation was very easy!!
Boofo
07-29-2002, 11:25 AM
Did you get it to work right? If so, can you tell us what you did to get it to work? No one else is willing to say anything. :) We followed the instructions (as confusing as they were in this thread) but cannot get it to force update without everything showing up zeros.
Erwin
07-30-2002, 02:57 AM
This is a great hack! Thanks a lot! Works like a charm!
:)
Thanks for sharing it.
Boofo
07-31-2002, 02:27 AM
I finally got this hack installed and working. Great Hack! The only problem I am having is when I try to force update, it goes to a blank page with the word "Done" in the staus bar but the last update time is the same as it was before I tried to force update. The numbers are there and the icons show up fine. Any ideas on how to get it to be able to force update? :)
Boofo
07-31-2002, 06:07 AM
Can someone please explain to me why the 5-day forecast shows up as in the attached gif? It seems we are missing some icon images for the weather and the temperature calculations might be a bit off. :) Any way to get the needed images and temperatures set right? I don't think I've ever seen a forecast that says 4 degrees farenheit is supposed to be HOT. :)
JJR512
07-31-2002, 07:08 AM
I've been looking into this myself. It seems that Accuweather has changed their icon setup. I'm working on getting all the new icons, and this will probably require some slight code modifications.
Boofo
07-31-2002, 07:12 AM
Thank you for the quick reply. :)
Is there any way to fix the temperature problem? I think it might be reading 104 or something like that but only show 4 degrees. I guess if you get cold enough, it would seem really hot, huh? :)
Originally posted by JJR512
I've been looking into this myself. It seems that Accuweather has changed their icon setup. I'm working on getting all the new icons, and this will probably require some slight code modifications.
JJR512
07-31-2002, 08:12 AM
I've updated the attachment in the original post. It contains a new weather.php file which has been adjusted for the new forecast raw data format output from MSNBC.
As for the icons, I'm still working on that issue.
Boofo
07-31-2002, 08:28 AM
Now it's your turn. You are the man!!! :)
All, I need to do is replace the weather.php file, right? Nothing else, right now? Do you know if this will take care of the blank page I get when I force update? That is the only real problem (besides the icons you are working on) that I am having with it. :)
Originally posted by JJR512
I've updated the attachment in the original post. It contains a new weather.php file which has been adjusted for the new forecast raw data format output from MSNBC.
As for the icons, I'm still working on that issue.
Boofo
07-31-2002, 08:36 AM
Here is a new pic of the weather after uploading the new weather.php. The temps look right now. :) Still getting the blank page on force update, but the rest is starting to look good now. Great job, sir! ;)
Edit: Looks like the visibility and UV might be off a bit. :)
JJR512
07-31-2002, 08:50 AM
Visibility and UV are fine. Right now, for Des Moines, MSNBC does not have visibility data, and the UV index is, aparently, 0 (or else not available, either).
You can always verify that what you see with this hack is correct by viewing what MSNBC's website says. Go here: http://www.msnbc.com/news/WEA_Front.asp?0dm=C---W Now this is important: Do NOT put in your zip code! That way gets you a different format of output that is not as easily compared to this hack. Instead, use the method under "Choose a region", it's just like picking your city from the hack.
If you do that and go to Des Moines, Iowa, you should see that (at this moment) it says -na- for visibility and 0 Minimal for UV.
As for your other questions...Yes, just upload the new weather.php (I think you already did that), and as far as I'm aware, that shouldn't fix whatever problem you're having with the forece update. I don't know what that problem is, since I'm not having it...
Boofo
07-31-2002, 08:54 AM
Ok, thanks. I just thought there might be something else they changed on you so that is why I let you know. :)
As far as the force update goes, no, that didn't make a difference. The wierd thing is, the very first time I used force update after installing it this time, it worked. But it hasn't worked since. :) But if I do a Modify Settings and just hit the submit button, it will update then just fine.
Originally posted by JJR512
Visibility and UV are fine. Right now, for Des Moines, MSNBC does not have visibility data, and the UV index is, aparently, 0 (or else not available, either).
You can always verify that what you see with this hack is correct by viewing what MSNBC's website says. Go here: http://www.msnbc.com/news/WEA_Front.asp?0dm=C---W Now this is important: Do NOT put in your zip code! That way gets you a different format of output that is not as easily compared to this hack. Instead, use the method under "Choose a region", it's just like picking your city from the hack.
If you do that and go to Des Moines, Iowa, you should see that (at this moment) it says -na- for visibility and 0 Minimal for UV.
As for your other questions...Yes, just upload the new weather.php (I think you already did that), and as far as I'm aware, that shouldn't fix whatever problem you're having with the forece update. I don't know what that problem is, since I'm not having it...
JJR512
07-31-2002, 11:45 AM
I have updated the ZIP in the original post again. This time it does include some bigger changes, necessitate by the new icon system.
Both PHP files, weather.php and weather_functions.php, have been changed. A ZIP file named iconset5.zip has been added; this contains all the new icons. Note there is no 2.gif; I got a 404 while trying to get it, so I don't know if it doesn't exist or what. You should unzip it and get a folder named iconset5, then upload that folder to the same place as the other four iconset folders. As of now, iconset5 is the only usable set, because the icon meanings have changed, so you can delete the earlier four iconset folders if you want. Also, the template weather_main was changed so that iconset5 is hard-coded, and the new forecasted weather descriptions will appear under the icons; weather_select was changed to remove the icon selection part; and homeindex_left_weather was changed also to hard-code iconset5. If you have customized the templates at all, just look at the differences and you'll figure out what to do.
scottct1
07-31-2002, 12:47 PM
Thanks for the quick fix! :) It is ALMOST all fixed but there appears to be a small problem.
Can you see whats wrong?
http://www.dbstalk.com/images/delete/huh2.jpg
and
http://www.dbstalk.com/images/delete/huh1.jpg
It's saying Flurries / Wind when its already close to 80 degrees here and there is almost no wind.
This happening to anyone else?
Boofo
07-31-2002, 01:16 PM
It seems to be almost working. If I go to Modify Settings and hit submit, all of the icons show up for the 5-day forecast. When I go to the main page, the Current Weather shows up fine. When I go back to Detailed Forecast, I get the picture attached below (no icons). If I go back to Modify Settings and just hit submit, they show up again until I get out of it and come back in. Anyone else having this happen to them? (Still can't get Force Update to work without going to a blank page.) :)
scottct1
07-31-2002, 01:29 PM
Boofo this is happening to me too, hit update and the icons are back go back in again and the icons are all broken.
JJR512
07-31-2002, 01:29 PM
scottc1, the problem appears to be with the data itself. I checked the raw data feed for Hartford, and it does indeed say "Flurries/ Wind". The current weather type is present in the data as plain text, and, for display, is just pulled out as plain text and stuck in the template. There's no processing going on, so whatever it says there, is what the raw data says. So, somebody at The Weather Channel screwed up, I guess! (Oh, BTW, the weather is now provided by The Weather Channel through MSNBC, no longer is it AccuWeather through MSNBC...another detail change I'll have to make later, it still says AccuWeather in the templates).
However, this plain-text current weather type may have been deprecated...As I was studying the raw data feed to figure out the new icon system, I noticed that the current weather type as displayed on MSNBC's site did not always match what the feed had in it. But there was a correlation between the current weather type and the icon itself. I believe they are now using a new system of using the icon as a reference to look up a weather type to display; in other words, if the raw data feed says to use icon 12 for the current weather icon, then the type should say "cloudy", which it figures out using a lookup table. There are a few discrepencies with this theory, but it seems to be more accurate than using the old way. I'll be studying that more.
scottct1
07-31-2002, 01:43 PM
Thanks Justin for looking into that.
It's so hot here today, I wish it would snow. :)
Boofo
07-31-2002, 01:56 PM
It's been known to do that, at least here it has in the past. :)
Originally posted by scottct1
It's so hot here today, I wish it would snow. :)
JJR512
07-31-2002, 02:06 PM
OK, the issue with the icons not showing up (after going to the main page then back to detailed weather) should be fixed now. When you go to the detailed view, there's a routine that checks the cache (weather info stored in the database with your userid), and if the info there is less than two hours old, it just re-uses it. In the last update, I changed some things but did not change what gets stored in the cache, so the cache did not have the correct data in it to show you if you came back to see it.
I've uploaded another ZIP file, 03b, that has a new weather.php file that is necessary, and also a new file called "databasechanges.txt". You need to execute each of the six queries in that file. Those six queries get the weather_userdata table ready for the new weather.php to cache data into it.
Boofo
07-31-2002, 02:35 PM
Great job on the fix, as usual. The icons are there to stay now. :) Thanks for all of the hard work and dedication to a very well put together hack. :)
Boofo
07-31-2002, 03:01 PM
Shouldn't it auto default to New York when a new user logs on or before they are registered? This is what I get for new users. Did I miss something? :)
Boofo
07-31-2002, 07:12 PM
This just isn't my day. :) My 5-day Forecast is not showing icons anymore and shows all zeros now. Even on auto-update this is happening (check the attached picture). Is anyone else having this problem?
scottct1
07-31-2002, 07:14 PM
Same here this just started happening about a half hour ago, everything is running but no 5 day forecast.
I think JJR is on overtime now. :)
Lionel
07-31-2002, 07:16 PM
that has to do with MSNBC I think
Boofo
07-31-2002, 07:22 PM
Is the same thing happening to you, Lionel?
Lionel
07-31-2002, 07:26 PM
just now... zero all over
Erwin
07-31-2002, 07:31 PM
The weather is truly not working anymore, even with the updates in version 3b. No icons, no information, nothing.
Like Lionel, it is possible that MSNBC has figured out that we are using their data, and have modified things to prevent other sites from using their weather information.
Boofo
07-31-2002, 07:43 PM
My current weather is still working, but the rest is gone. At least now I know it isn't just me. :)
JJR512
07-31-2002, 08:40 PM
Boofo, I switched mine to Des Moines, IA, and am seeing a 5-day forecast.
But I did notice a lot of other cities that don't have anything at all...London, UK; Delhi, India; and more (a random selection).
This could be a temporary server thing. Or it could have something to do with something I noticed as I was doing my earlier research, which is that the city codes they're using now do not match what I have put in the database; they changed format, too. They may be making the old-format city codes not work. If this is true, it's going to be one big gigantic pain in the ass to fix, because that means changing the code for 3500 cities or however many are in there, I forget.
Boofo
07-31-2002, 08:44 PM
I was just about to jump on here and tell you that it started showing everything about 10 minutes ago. :) It must have been a fluke thing for a little while. Do you think they are changing everything to try and put a wrench into your weather hack? That would really suck. I just got it to where it was working half way right for me now. :)
Originally posted by JJR512
Boofo, I switched mine to Des Moines, IA, and am seeing a 5-day forecast.
But I did notice a lot of other cities that don't have anything at all...London, UK; Delhi, India; and more (a random selection).
This could be a temporary server thing. Or it could have something to do with something I noticed as I was doing my earlier research, which is that the city codes they're using now do not match what I have put in the database; they changed format, too. They may be making the old-format city codes not work. If this is true, it's going to be one big gigantic pain in the ass to fix, because that means changing the code for 3500 cities or however many are in there, I forget.
JJR512
07-31-2002, 09:02 PM
Speaking of "halfway", I don't understand why you're having a problem with the force update. A blank white page sounds like a missing template. But the force update doesn't use any new unique template.
Boofo
07-31-2002, 09:09 PM
I didn't mean to sound negative when I said "halfway", that's not what I meant. Sorry if it sounded like that. :)
That's what has me puzzled. It worked the very first time I installed this hack, but never since. It will update if I do the modify and submit, so I know it can do a force update somehow. I have the weather_include contents in the index.php at the very bottom right before it calls the forum_home template. Everything else seems to be working great on it. :)
Originally posted by JJR512
Speaking of "halfway", I don't understand why you're having a problem with the force update. A blank white page sounds like a missing template. But the force update doesn't use any new unique template.
scottct1
07-31-2002, 09:18 PM
Mine is working again! And plus IT STOPPED SNOWING! :D
MSNBC must be doing some work on things.
I am sure in a day or two the more cities instructions will need to be rewritten.
Thanks JJR for all your hard work!
JJR512
07-31-2002, 09:35 PM
Originally posted by Boofo
I didn't mean to sound negative when I said "halfway", that's not what I meant. Sorry if it sounded like that. :)
That's what has me puzzled. It worked the very first time I installed this hack, but never since. It will update if I do the modify and submit, so I know it can do a force update somehow. I have the weather_include contents in the index.php at the very bottom right before it calls the forum_home template. Everything else seems to be working great on it. :)
Don't worry, it didn't sound negative at all, I didn't think that. :)
It just has me puzzled. The index.php and anything on it shouldn't have anything to do with it...the force update link is on a page generated by weather.php, the action related to the link is handled by weather.php, and the results are displayed by weather.php.
But tell me again exactly what happens. Tell me what you do in the order you do it and what you see after you do it.
Erwin
07-31-2002, 09:35 PM
Mine's still not working, even after upgrading to 3b. Any ideas?
Erwin
07-31-2002, 09:38 PM
I see no weather data, no icons.
Boofo
07-31-2002, 10:09 PM
Ok, if I click on the link to Force Update, it just goes to a blank page with the word "Done" in the Staus bar at the bottom of the window and just sits there. I have to manually put the path to the board in again to get out of it.
If I go into Modify settings, and just click on the submit button (without changing anything), it will give me the thank you for updating message and then update, and take me back to the screen with the 5-day forcast on it and everything is updated (8 out of 10 times, anyway). I have also noticed that the last time updated is usually off by about 45 minutes (ahead) of whatever my time is on the board. (That might be MSNBC on that though.)
Also, when a new user logs on, there is no icon, no region or city and just zeros for numbers. It does not default to NYC for unregistered or new users. Did I forget to do something?
Originally posted by JJR512
But tell me again exactly what happens. Tell me what you do in the order you do it and what you see after you do it.
Erwin
07-31-2002, 10:18 PM
So it's working for you Boofo... ? If it's working for you or anyone else, is that with the update 3b or with the original 1b?
Boofo
07-31-2002, 10:26 PM
Yes, finally. :) You telling me to put it in the index.php right before calling the forum_home template did the trick for me. Thank you for that. :) When you installed this latest version, did you replace the 3 templates with the new ones? And add the database queries that he added to this version? Oh, and upload the new icon5 set? That is the only set he is using now and the templates are hardcoded for that. That and uploading the new php files to replace the old ones should do the trick. That's all I did and it started working. :)
Edit: I'm using the latest version. 3b :)
Originally posted by Erwin
So it's working for you Boofo... ?
Erwin
07-31-2002, 10:27 PM
Oh bugger - 3 new templates... his update instructions didn't mention that the templates are changed... will do it now.
Boofo
07-31-2002, 10:30 PM
The instructions in the file haven't been updated yet as we were fixing things as they came up. He explained it in the messages as we were going along. Kindof hit and miss type stuff. But he got it working. :)
Originally posted by Erwin
Oh bugger - 3 new templates... his update instructions didn't mention that the templates are changed... will do it now.
Erwin
07-31-2002, 10:34 PM
I updated the 3 new templates - no change. No icons, no data - for some reason it no longer works for me. I have updated the db changes, and uploaded the iconset5.
Erwin
07-31-2002, 10:37 PM
I also did upload the new php files. The only thing I haven't done is reinsert the original sql files.
JJR512
07-31-2002, 10:39 PM
Well, it took me about a half hour to make a new set of queries for all the cities in Alaska...at this rate, I should be done in about...oh...a very very long time from now, if my arms don't fall off first!
Boofo
07-31-2002, 10:43 PM
JJR512,
I just updated post 113 with another problem I am having witrh the new user city not drefaulting to NYC. There is nothing there for new users. No icons and all zeros.
Erwin
07-31-2002, 10:58 PM
Originally posted by JJR512
Well, it took me about a half hour to make a new set of queries for all the cities in Alaska...at this rate, I should be done in about...oh...a very very long time from now, if my arms don't fall off first!
Let's see... 30 minutes for Alaska. There are at least 200 regions... well, you'll be done by Christmas 2003! ;)
Thanks for the effort. Look, if you can't finish it, we understand. Don't push yourself too hard here. Isn't there a quicker way to change the id's of places?
Also, are you sure MSNBC is not going to keep changing their system? We don't want you to spend ours recoding your hack, to find that they have changed the system again.
Erwin
07-31-2002, 11:04 PM
Boofo,
What you can do is upload the following image file named .gif into your iconset5 folder - this will give you an icon that says that "Weather currently offline - try again later" when the weather is not working - at least this way you won't get a broken image. I made the icon for my site - you can use it too.
JJR512
07-31-2002, 11:16 PM
Thanks for the effort. Look, if you can't finish it, we understand. Don't push yourself too hard here. Isn't there a quicker way to change the id's of places?
Yeah: Get a bunch of people to help me! ;)
Erwin
07-31-2002, 11:23 PM
If you contacted MSNBC Accuweather, do you think they would help you?
JJR512
08-01-2002, 01:46 AM
Well, I've managed to streamline the process a great deal, and am now up to Montana. If I can keep this pace up, I should be done the rest of the US in an hour or two. Then, on to the rest of the world. :)
Erwin
08-01-2002, 09:58 AM
Around the world in 80 hours hey? Well done!
Kars10
08-01-2002, 01:22 PM
@ JJR, i updatet to your new version, and some citys worked, some not. How can i add more cities in the database. Or fix the broke code?
Ive looked, but the MSNBC-Guys took away there "accid="
scottct1
08-01-2002, 06:04 PM
Most of New York is not working (including the default Central Park) Other areas, most things work but some cities are gone.
JJR512 deserves a beer or something when he is done updating things. :)
JJR512
08-01-2002, 06:17 PM
I have all ~30,000 US cities done, and all countries added, and all subdivisions added; now I just need to do the cities for the rest of the world. I don't know how many there are, but there's probably at least as many as for the US, but even if it was the same number, it's going to take longer to do, because they're not as concentrated.
Kars10
08-01-2002, 06:31 PM
When youre done, will you release the querys here??
And how can i import the new settings in my Database? Delete the older tables and import the new??
Please JJR, tell me how to add the new codes in the DB...
@ ScottCT1, i think he deserves more than one beer!! :p
JJR512
08-01-2002, 06:34 PM
Don't worry, I'm not doing this just for me! :)
The old weather_ tables (city, subdiv, country, region) will have to be deleted. There are some structural and data-type changes involved. When the time comes, full instructions will be provided.
JJR512
08-01-2002, 06:49 PM
MSNBC seems to be having some trouble with the weather right now. I'm trying to see the cities in some African countries but it's not displaying them. It's doing this for several regions, but not always the same.
DrkFusion
08-01-2002, 06:51 PM
*Deleted
DrkFusion
08-01-2002, 06:51 PM
I am having probs isntalling this on 2.2.6
Unknown column 'forecasticon1' in 'field list'
JJR512
08-02-2002, 02:37 AM
Well, I'm done compiling the database...I think...and it has 37,341 cities! :eek:
Boofo
08-02-2002, 02:51 AM
When you release this, can you include instructions on deleting the old tables and adding the new without phpmyadmin? I do not have access to that right now, and may not for a while, because of the server my board is on. :)
Kars10
08-02-2002, 06:29 AM
@ Boofo, why you didn?t install phpmyadmin??
Its very very easy, and you can do such a lot things more ... :)
Boofo
08-02-2002, 06:39 AM
I had this installed on the server, but the guy that I've got my site with just did a major rebuild of the server and hasn't has it put on yet. We are supposed to have this, but I don't know how soon. The reason I asked for that was because there are a lot of people out there that either don't have phpmyadmin, or wouldn't know what to do with it if they had it. :)
Originally posted by Minifreunde
@ Boofo, why you didn?t install phpmyadmin??
Its very very easy, and you can do such a lot things more ... :)
scottct1
08-02-2002, 06:44 PM
Very cool JJR! Hopefully you tell us how to update the databases to include the new cities and remove the dead wood ones.
I thank you for all the work you put into this!
I expect that this will be the last time for a long time you will have to change all this info, I don't think MSNBC will be changing weather providers again anytime soon.
I wonder if the weather channel will provide any visability readings soon? (Still says 0 and MSNBC say's N/A)
Anyways great job!
JJR512
08-03-2002, 02:18 AM
I'd like to declare this hack "DEAD" and let this thread die. I ask for someone with the appropriate power to please close this thread. I ask that before that happens, that nobody else reply to this thread, please, thank you.
I have completed a new version of the vB Weather hack and, due to the extensiveness of the changes, have posted it as a new hack. Because so much has changed, I wanted it to get a fresh start, so that any problems with the older version do not confuse anyone looking for help with it.
The new hack, vB Weather Mk. 2, is posted here: https://vborg.vbsupport.ru/showthread.php?s=&threadid=41842
The end. :)
beemer
08-15-2002, 06:03 AM
I am having a proplem when my system calls weather.php
I am getting the follow database error:
Database error in vBulletin 2.2.6:
Invalid SQL:
INSERT INTO weather_userdata
(userid,time,city,subdiv,country,region,temp,cicon ,wind_spd,wind_dir,barometer,h umidity,realfeel,uv,vis,lastup,context,forecastday 1,forecastday2,forecastday3,fo recastday4,forecastday5,forecasticon1,forecasticon 2,forecasticon3,forecasticon4, forecasticon5,forecasttype1,forecasttype2,forecast type3,forecasttype4,forecastty pe5,forecasthigh1,forecasthigh2,forecasthigh3,fore casthigh4,forecasthigh5,foreca stlow1,forecastlow2,forecastlow3,forecastlow4,fore castlow5)
VALUES
('1','1029394185','','','','','0°F','','0 mph','','0 inHg','','0°F','','0 mi','','','Saturday','Saturday','Saturday','Saturd ay','Saturday','','','','','', 'Unknown Type','Unknown Type','Unknown Type','Unknown Type','Unknown Type','0°F','0°F','0°F','0°F','0°F','0°F','0°F','0&d eg;F','0°F','0°F')
mysql error: Unknown column 'forecasticon1' in 'field list'
mysql error number: 1054
As you can see, weather.php is calling for colums that don't exist. The sql file for this does not create these colums in the table either. Is this a bug, or have I done something wrong. Also, where are people putting the $weather insert? I don't understand how this works as there isn't a template called weather, just weather_main.
beemer
08-15-2002, 06:03 AM
I am having a proplem when my system calls weather.php
I am getting the follow database error:
Database error in vBulletin 2.2.6:
Invalid SQL:
INSERT INTO weather_userdata
(userid,time,city,subdiv,country,region,temp,cicon ,wind_spd,wind_dir,barometer,h umidity,realfeel,uv,vis,lastup,context,forecastday 1,forecastday2,forecastday3,fo recastday4,forecastday5,forecasticon1,forecasticon 2,forecasticon3,forecasticon4, forecasticon5,forecasttype1,forecasttype2,forecast type3,forecasttype4,forecastty pe5,forecasthigh1,forecasthigh2,forecasthigh3,fore casthigh4,forecasthigh5,foreca stlow1,forecastlow2,forecastlow3,forecastlow4,fore castlow5)
VALUES
('1','1029394185','','','','','0°F','','0 mph','','0 inHg','','0°F','','0 mi','','','Saturday','Saturday','Saturday','Saturd ay','Saturday','','','','','', 'Unknown Type','Unknown Type','Unknown Type','Unknown Type','Unknown Type','0°F','0°F','0°F','0°F','0°F','0°F','0°F','0&d eg;F','0°F','0°F')
mysql error: Unknown column 'forecasticon1' in 'field list'
mysql error number: 1054
As you can see, weather.php is calling for colums that don't exist. The sql file for this does not create these colums in the table either. Is this a bug, or have I done something wrong. Also, where are people putting the $weather insert? I don't understand how this works as there isn't a template called weather, just weather_main.
JJR512
08-15-2002, 07:12 PM
Please read Post #141. This hack is dead and no longer being supported. Please completely remove it, go to the new thread, download the new version, install it, and if you have problems with the new version, let me know in that thread. Thanks!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.