View Full Version : vB Weather Mk. 2
JJR512
08-02-2002, 10:00 PM
This is a post of a much-revised hack originally posted (by myself) here (https://vborg.vbsupport.ru/showthread.php?s=&threadid=35458). 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 (https://vborg.vbsupport.ru/showthread.php?postid=281874#post281874) 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 (https://vborg.vbsupport.ru/showthread.php?postid=281852#post281852) 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
Boofo
08-03-2002, 02:24 AM
Thank you, sir. I will get it up and test it. There is no Des Moines, Iowa listed now. Did you forget the capital of Iowa? :)
And is there any easy way to drop the tables with just a query or two?
JJR512
08-03-2002, 02:54 AM
Des Moines is there. It's between Derby and Dewar. :)
You can drop a table with a query. I believe the syntax is: DROP TABLE tablename;.
Erwin
08-03-2002, 03:04 AM
Hi, jj, your instructions state in the beginning:
INSTRUCTIONS
1. Upload weather.php to your forums directory.
I cannot find weather.php in your zipped file anywhere.
dood, this has gotta be one of the SICKEST hacks in recent days!!
ooooooooooh, I cannot WAIT to install it!
YOU EVEN HAVE New Westminster as a location in Canada!!
JJR512 sick man, SICK! :)
Erwin
08-03-2002, 03:33 AM
Is it me, or is weather.php in the zip, but I cannot see it? :) I assume we can't use the old weather.php from version 3b.
thats what im going to try :D
JJR512 would it be too much trouble to make say.. 3 preset weather locals (ie. Vancouver, Seattle, Toronto) and even if the user hasnt selected any of them for their own use, they could click a link to take them to that places weather?
Erwin
08-03-2002, 03:41 AM
JJ stated that he has changed all the variables, so I doubt that the old weather.php file works, since it's used for the 5-day forecast. But let me know if it does work. :)
Zombie
08-03-2002, 04:33 AM
This hack is useless until he adds the new weather.php file to the zip file
nope, guess we have to wait..
grrrr all that work and now its just sitting there. :(
Erwin
08-03-2002, 05:51 AM
He's busy this weekend, but will be back. :)
It's a great hack, and is well worth the wait.
Zombie
08-03-2002, 05:58 AM
I think the hack is great and I can wait a few days for it.
heh, I dont plan to be around the computer much this weekend at all... PARTY-sat >> aftersketch-sun :D
Kars10
08-03-2002, 10:37 AM
*cry* has somebody tests the installation with the weather.php from the 3b - version? :confused:
Erwin
08-03-2002, 10:56 AM
Originally posted by Minifreunde
*cry* has somebody tests the installation with the weather.php from the 3b - version? :confused:
The old weather.php is not going to work, as JJ had to change most of the variables with the new weather server.
bluecat
08-03-2002, 12:55 PM
This is awsome! I will install it as soon as I can tonight. :)
Kars10
08-03-2002, 02:03 PM
@ Bluecat, you can?t install because the weather.php is missing!! ;)
nemesis01
08-03-2002, 02:12 PM
Looks very good, will install it on my test board for sure (once said weather.php is included:D)and if I like it will suggest it to my members on my main board.
FlyingDutchman
08-03-2002, 05:08 PM
w00t h0t hack man!
thx, i'll install it in a bit...
can i see a list of all the weather locations (the city's...)?
BigJohnson
08-03-2002, 07:44 PM
I can't wait for the weather.php file i want it and need it so badly.
Erwin
08-04-2002, 03:04 AM
Originally posted by BigJohnson
I can't wait for the weather.php file i want it and need it so badly.
Yeah... its tragic that JJ forgot to include the weather.php. :) Easy mistake to make...
gahhhhhh I need this hack :D But no weather.php :(
JJR512
08-04-2002, 11:03 PM
How many times can I put :o in one message? :D
So sorry! :o
I've uploaded a new .ZIP with the weather.php file.
DestyNova
08-04-2002, 11:06 PM
=D Alright, I m goin to download it and save it until I m at home, I cant wait to try it out!
It is no problem as Erwin stated, "Easy mistake to make" so no harm ;) /me exciting
DestyNova
08-04-2002, 11:11 PM
aw, I m stuck with cache, I wonder if can you post new attachment? I download and get old zip
JJR512
08-04-2002, 11:14 PM
I did post a new attachment. It even has a different name!
DestyNova
08-04-2002, 11:19 PM
No, I m still stuck with cache but I use Net Vampire to download it for me so I get it =)
Many thanks
Erwin
08-04-2002, 11:22 PM
Finally!!! :D
Will install it now, and let you know how it goes...
I'm having trouble putting weather_city.sql in the database... Looks like it's timeing out, how do I split the file?
Thanks in advanced! :banana:
JJR512
08-04-2002, 11:48 PM
Ian, open the file up...you can use Notepad (or any plain-text editor)...Just copy a bunch of lines, paste into a new file, name it 1.sql (or whatever). I'd try splitting it into thirds at first. Each line starts with INSERT INTO and ends in );
For the record, anyone installing it now and not getting current weather info...this is a problem from the source, not the hack (just saw my own city was like this, checked a few random other US cities and saw the same thing).
Is there a quicker way? It takes forever to highlight all those lines(there must be a shortcut)
JJR512
08-04-2002, 11:52 PM
Put the cursor at the beginning of the file. Scroll down (with the scroll bar) about a third of the way down. Hold down the Shift key, then click at the beginning of a line there. That will highlight everything between where the cursor was and where you put it.
Itworx4me
08-04-2002, 11:59 PM
Hi all,
I hope JJR512 doesn't mine. I added this to his hack. This will tell you what city,state, and country right after Your Current Weather. This will show on your forum home page. Your Current Weather For (City),(state),(country).
Find in forumhome_weather template
Your Current Weather
Then Add this right after Weather
For $weatherdata[city], $weatherdata[subdiv], $weatherdata[country]
Thanks for a wonderful hack JJR512
Boofo
08-05-2002, 12:18 AM
Ok, I got everything installed and it works good except that I only have the 5-day forecast now and no current weather. There is no icon and all there are zeros for the current weather but the 5-day forecast works great! :) Also, the force update still doesn't work for me. Could it be that my ISP is using PHP version 4.2.2 on the server, as to why the force update doesn't work? (JJR512, I notice your server uses version 4.1.2.)
Erwin
08-05-2002, 12:28 AM
Works great, JJ. The only problem is that the default NY, USA weather for guests doesn't work - there is the "Offline" icon, and no numbers. Any ideas?
Erwin
08-05-2002, 12:33 AM
I see... the NY, NY, USA weather results are not showing for CURRENT weather, but the 5-day forecast is showing... weird.
Other cities seem okay.
Boofo
08-05-2002, 12:36 AM
Erwin,
Can you check Des Moines, Iowa, USA and see if it shows the current weather for you, please? :)
Originally posted by Erwin
I see... the NY, NY, USA weather results are not showing for CURRENT weather, but the 5-day forecast is showing... weird.
Other cities seem okay.
Erwin
08-05-2002, 12:37 AM
Other cities are working, though. For example, Melbourne Australia works great... it's unfortunate that the default city is not working... Any ideas?
Boofo
08-05-2002, 12:40 AM
Try it now, Erwin. It just kicked in for some reason. All is working well. :)
Erwin
08-05-2002, 12:43 AM
Okay, it was probably a temporary weather server problem - everything is working perfectly now! :)
Thanks for your great work JJ!!!
JJR512
08-05-2002, 12:44 AM
If someone just tried to contact me via AIM in regards to this hack, please try again. The message "Do you wish to accept a message from this person" popped up right as I was in the middle of typing something, right as I was about to hit the space bar, and I guess the space bar dismisses that message. I didn't even get to see who it was, but this hack is the only reason I can think of why anyone I don't already have on my list would want to contact me now...so whoever you are, I apologize, I did not mean to cancel your request. Please try again! :)
I attactched it if anyone needs me... I did it by hand so it's not the most even but here you go:
JJR512
08-05-2002, 01:16 AM
Originally posted by Itworx4me
Hi all,
I hope JJR512 doesn't mine. I added this to his hack. This will tell you what city,state, and country right after Your Current Weather. This will show on your forum home page. Your Current Weather For (City),(state),(country).
Find in forumhome_weather template
Your Current Weather
Then Add this right after Weather
For $weatherdata[city], $weatherdata[subdiv], $weatherdata[country]
Thanks for a wonderful hack JJR512
Sorry, I had meant to do this...I have code in weather.php which allows a subdivision name to show up as well, if there is one for the current location. I've updated the instructions to add this bit of code to the code added to index.php, and the forumhome_weather template. So, basically, re-do the instructions for index.php (remove the code you added before and add the new code now in the instructions), and replace the forumhome_weather template with the new version.
Erwin
08-05-2002, 01:45 AM
I've already customized the template - can you just post and tell us what the changes actually are? Is it just the addition of $weatherdata[subdiv] in the template? What changes need to be done in the index.php?
Erwin
08-05-2002, 01:47 AM
I see it. :)
I'll change it manually myself - thanks! Sorry to bother you.
Boofo
08-05-2002, 01:51 AM
Ok, Erwin, the ball's in your court. Can you tell us the changes? :)
Originally posted by Erwin
I see it. :)
I'll change it manually myself - thanks! Sorry to bother you.
Erwin
08-05-2002, 01:55 AM
To upgrade from version v1.0 to v1.0a - this post has been updated - it works. :)
In forumhome_weather template, find:
<smallfont><img src
REPLACE with:
<smallfont>
$weatherdata[city], $weatherdata[showsubdiv]$weatherdata[country]<br>
<img src
NOTE: The variable is $weatherdata[showsubdiv], NOT $weatherdata[subdiv]
Then, in index.php...
Find:
eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";");
ABOVE it, add:
if ($weatherdata[subdiv]) {
$weatherdata[showsubdiv] = "$weatherdata[subdiv], ";
} else {
$weatherdata[showsubdiv] = "";
}
That should do it. If there's a subdivision, it will show up, and if not, it won't.
JJR512
08-05-2002, 02:04 AM
The code addition is correct.
But in my version, in the forumhome_weather template, the bit you say to find isn't there. But you do have the addition correct, and it goes after "Current Weather" in that template (I believe originally, it was "Your Current Weather").
Erwin
08-05-2002, 02:26 AM
You're right JJ, I was upgrading from my own customized template... I've updated my post - just follow the instructions and you will upgrade from v1.0 to v1.0a :)
Boofo
08-05-2002, 02:44 AM
You might want to update it again and use the disable tags so it won't show the vbulletin.org path to the image file. :)
Originally posted by Erwin
You're right JJ, I was upgrading from my own customized template... I've updated my post - just follow the instructions and you will upgrade from v1.0 to v1.0a :)
skyline2002
08-05-2002, 02:48 AM
JJR512:
thanks for your new version. there is the another way to let the old version weather hack work.
as i know ,in the old version, only the high & low TEMP of Forecast Day of Week and icons did not work any more since MSN has changed their source provider .
so if we want to let the high & low temp works in old version, just have to make little changes like below:
in weather.php
find:
---------------------------------------------
// Forecast Highs
$weatherdata[forecasthigh1] = convert_temp($forecast[15],$usersettings[tpc]);
$weatherdata[forecasthigh2] = convert_temp($forecast[16],$usersettings[tpc]);
$weatherdata[forecasthigh3] = convert_temp($forecast[17],$usersettings[tpc]);
$weatherdata[forecasthigh4] = convert_temp($forecast[18],$usersettings[tpc]);
$weatherdata[forecasthigh5] = convert_temp($forecast[19],$usersettings[tpc]);
// Forecast Lows
$weatherdata[forecastlow1] = convert_temp($forecast[25],$usersettings[tpc]);
$weatherdata[forecastlow2] = convert_temp($forecast[26],$usersettings[tpc]);
$weatherdata[forecastlow3] = convert_temp($forecast[27],$usersettings[tpc]);
$weatherdata[forecastlow4] = convert_temp($forecast[28],$usersettings[tpc]);
$weatherdata[forecastlow5] = convert_temp($forecast[29],$usersettings[tpc]);
------------------------------------------
replace with:
-------------------------------------------
// Forecast Highs
$weatherdata[forecasthigh1] = convert_temp($forecast[20],$usersettings[tpc]);
$weatherdata[forecasthigh2] = convert_temp($forecast[21],$usersettings[tpc]);
$weatherdata[forecasthigh3] = convert_temp($forecast[22],$usersettings[tpc]);
$weatherdata[forecasthigh4] = convert_temp($forecast[23],$usersettings[tpc]);
$weatherdata[forecasthigh5] = convert_temp($forecast[24],$usersettings[tpc]);
// Forecast Lows
$weatherdata[forecastlow1] = convert_temp($forecast[40],$usersettings[tpc]);
$weatherdata[forecastlow2] = convert_temp($forecast[41],$usersettings[tpc]);
$weatherdata[forecastlow3] = convert_temp($forecast[42],$usersettings[tpc]);
$weatherdata[forecastlow4] = convert_temp($forecast[43],$usersettings[tpc]);
$weatherdata[forecastlow5] = convert_temp($forecast[44],$usersettings[tpc]);
-------------------------------------------
for icons, just replace old icons with new icons from jj's version!
or rename the old icons.
now, you old version should works fine.
sorry about my poor english. hope you guys understand me!
enjoy!!
Erwin
08-05-2002, 03:37 AM
Originally posted by Boofo
You might want to update it again and use the disable tags so it won't show the vbulletin.org path to the image file. :)
The disable tags didn't want to work, so I modified my post to remove the { imagesfolder} bits... :) You don't need them.
Originally posted by snyx
JJR512 would it be too much trouble to make say.. 3 preset weather locations (ie. Vancouver, Seattle, Toronto) and even if the user hasnt selected any of them for their own use, they could click a link to take them to that places weather?
sorry :lick: just curious..
hahaha, and again..
how would I change the default location (New York) when your not loggedin/or registered.. to another location?
JJR512
08-05-2002, 06:07 PM
I believe I put instructions for that (changing the default city) near the end of instructions.txt; it starts with "OPTIONAL". :)
thanks man, I will check that out.
chris2707
08-05-2002, 06:49 PM
This is brilliant and I got it working straight away!
One question, I notice that if I choose London, United Kingdom, the time of last update is showing the USA timezone rather than the boards timezone setting. Is the update value being picked up directly from MSN? Can it be changed so it matches the boards selected timezone?
Many thanks for a great addition (and you know what the English are like for weather!)
Chris
Crazy Mofo
08-05-2002, 07:26 PM
Database error in vBulletin 2.2.5:
Invalid SQL: SELECT subdivid FROM weather_city WHERE accid='USNY0996'
mysql error: Table '*****_db2.weather_city' doesn't exist
!!
JJR512
08-05-2002, 09:26 PM
I guess you didn't do Steps 2 and/or 3 in the instructions.
JJR512
08-05-2002, 09:32 PM
Originally posted by chris2707
This is brilliant and I got it working straight away!
One question, I notice that if I choose London, United Kingdom, the time of last update is showing the USA timezone rather than the boards timezone setting. Is the update value being picked up directly from MSN? Can it be changed so it matches the boards selected timezone?
Many thanks for a great addition (and you know what the English are like for weather!)
Chris
Yes, I know what English weather is like: When I was researching the new raw data layout for this hack, I had to find what a bunch of different forecasted-weather-type codes meant (how a code number in the raw data translated to meaningful text, which is what you see in the forecast under the icons). I did this by randomly checking weather forecasts for various cities on the MSNBC weather page, then looking at the raw data for the same city to see what code was associated with what description. Well, I solved a lot of that by looking up cities in England, which is where I got most of the rain-related codes, LOL! "AM Showers", "AM Light Rain", "Light Rain/ Wind", haha...about a dozen variations of what we in the US just call "rain"! :D
As for your actual question...The time comes straight from MSNBC; it's part of the raw data. I'll see if there's a way I can make it localized.
JJR512
08-05-2002, 09:36 PM
The raw data has this bit in it:
08/05/2002 18:00:00
As you can see, I just echo that in the display. I don't even know what time zone it is, so I'm wondering how you can tell?
chris2707
08-06-2002, 06:35 AM
On MSNBC is says ET somewhere near the time so I guess that's Eastern Time (shouldn't that be EST?).
Anyway, I guess there must be a way to convert the text back to time format and re-format it. I'll have a go and see if I can get it working.
Thanks again,
Chris
JJR512
08-06-2002, 04:12 PM
It probably says ET so it's correct if it's EDT or EST. Yeah, there's a way to convert it into a workable time format; I looked into it once, but never did anything with it.
Boofo
08-06-2002, 04:17 PM
Is there a way to have the Last Update Time set to the timezone and time/date format of our sites? :)
Originally posted by JJR512
It probably says ET so it's correct if it's EDT or EST. Yeah, there's a way to convert it into a workable time format; I looked into it once, but never did anything with it.
JJR512
08-06-2002, 04:20 PM
You have read Post #s 60 and 63-66, right?
reifegerste
08-06-2002, 04:22 PM
Hi,
When i click to Detailed Forecast or Change Settings i see the following error code:
Fatal error: Cannot redeclare convert_temp() in /home/username/www.forum.de/vbulletin/weather_functions.php on line 4
what can i do?
greetz
Lars
Boofo
08-06-2002, 04:31 PM
Yes, I read all of that. What I meant was, is there a way you can parse the time after you collect the raw data (instead of just echoing it) to match that of the site so everything stays in a site standard format.
Originally posted by JJR512
You have read Post #s 60 and 63-66, right?
JJR512
08-06-2002, 04:32 PM
Did you upload the new weather.php? It sounds like you are still using the old one. Get the new one out of the ZIP file and upload it to your forums directory. Also, in your forums directory, delete the file named weather_functions.php, which is not used anymore.
reifegerste
08-06-2002, 04:40 PM
where can i find the new weather.php?
in weather_mk2_v1[1].0.zip i can't see the weather.php
:paranoid:
JJR512
08-06-2002, 04:43 PM
reifegerste, you need to download the ZIP file currently attached to the original message in this thread. It's weather_mk2_v1.0a.zip.
Boofo, what you are asking for is exactly what we've been discussing in those posts. :)
reifegerste
08-06-2002, 04:54 PM
hi,
i do it https://vborg.vbsupport.ru/attachment.php?s=&postid=280268
weather_mk2_v1.0a.zip
but when i extract this file i can't see the weather.php
only the templates (4), instruction und readme files
an two zip files (icons and data)
reifegerste
08-06-2002, 04:55 PM
oh sorry
my cache was incorrect :D
this hack is great!!!
chris2707
08-06-2002, 05:15 PM
The problem with that Boofo is that the time the raw data is collected is not when the data was updated - in other words, could be 2 hours old when it is collected from the MSNBC server by vbWeather.
If you go to the MSNBC server mentioned near the beginning of this site you'll see no matter what country/city you select, the time remains constantly on the ET timezone - in my humble opinion it should change to whichever city you select since, even if you are going on holiday and checking the weather, it's still nice to know what time it is there!
I'm fairly new to PHP coding but I will have a look at converting the time string retrieved back to a time format for correct display.
Chris.
Originally posted by Boofo
Yes, I read all of that. What I meant was, is there a way you can parse the time after you collect the raw data (instead of just echoing it) to match that of the site so everything stays in a site standard format.
PhoenixBB
08-06-2002, 07:12 PM
This is a great hack. Thank you!
Got a couple of probs tho......
1) The table and default data comes up fine, but the 'Change Settings' and 'Get More Detailed Forecast. don't work. The pages loads but it just contains my header and background, nothing else. What am I doing wrong??
2) I don't actually want it on my forums page, I'm using VPBLite, so I want a vertical box like the ones on phpportals. I managed to get it into that format ok, but how would I get it to appear on the portal page? I've given up on making it a 'block'. I tried adding the info to the 'vpbincfile' (which generates the portal page), instead of the index, and putting the variable into the portal template instead of the forumhome, but it won't appear. Any ideas?
Boofo
08-06-2002, 07:24 PM
Ok, I see what you are saying now. What I was looking for is the time that my site went out and got the update, whether is be automatically or through force update type setting (since I can't do force update and have to do it through settings, I will call it that). They must be going by the server time itself on MSNBC then.
If you come up with the time conversion, I would be very interested in trying it out. Thank you. :)
Originally posted by chris2707
The problem with that Boofo is that the time the raw data is collected is not when the data was updated - in other words, could be 2 hours old when it is collected from the MSNBC server by vbWeather.
If you go to the MSNBC server mentioned near the beginning of this site you'll see no matter what country/city you select, the time remains constantly on the ET timezone - in my humble opinion it should change to whichever city you select since, even if you are going on holiday and checking the weather, it's still nice to know what time it is there!
I'm fairly new to PHP coding but I will have a look at converting the time string retrieved back to a time format for correct display.
Chris.
JJR512
08-06-2002, 08:06 PM
Originally posted by PhoenixBB
This is a great hack. Thank you!
Got a couple of probs tho......
1) The table and default data comes up fine, but the 'Change Settings' and 'Get More Detailed Forecast. don't work. The pages loads but it just contains my header and background, nothing else. What am I doing wrong??
2) I don't actually want it on my forums page, I'm using VPBLite, so I want a vertical box like the ones on phpportals. I managed to get it into that format ok, but how would I get it to appear on the portal page? I've given up on making it a 'block'. I tried adding the info to the 'vpbincfile' (which generates the portal page), instead of the index, and putting the variable into the portal template instead of the forumhome, but it won't appear. Any ideas?
I cannot support this hack for anything but vBulletin. If you are using vbPortal, there is a weather feature for that, which looks and works just like this. But, it was written specifically to work with vbPortal, which, although based on vBulletin, is a bit different. You could take mine and adapt it to vbPortal, but by then you'd have what someone else already did, so you may as well just get the one that's already made.
If whoever is responsible for that add-on to vbP hasn't updated it yet (last time I checked phpportals.com, they hadn't yet), they're welcome to take a look at mine to see what the changes are. And that would be the greatest of ironies, too, considering the fact that I wrote my hack because I couldn't get theirs without paying. :)
JJR512
08-06-2002, 09:32 PM
OK, I have uploaded a new ZIP which should show the time of the last update in the user's own local time zone. I have tested it on my own board and it seems to work fine, but let me know if there are any issues. Please note the time shown is the time stamp in the raw data that was last cached for the user. In other words, if a user sees the weather and this gets cached, then right after that, MSNBC releases a new raw data set, the user will still see the cached data, including the time stamp from it (adjusted for local time zone, of course), until the cache expires (by default after two hours), or the user does a force update.
If you already have an earlier version installed, here's how you upgrade. Upload the new weather.php file. Next, open index.php, and find
eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";");
Above that, add:
$time_lastup = strtotime($weather[lastup]);
$weather[updatedate] = vbdate($dateformat,$time_lastup);
$weather[updatetime] = vbdate($timeformat,$time_lastup);
(Note: You can perform the same change to your existing weather.php if for some reason you don't want to upload the new one.)
Now you need to change two templates: weather_main and forumhome_weather. Do the same change to both templates. Find:
Time of last update: $weatherdata[lastup]
Change to:
Time of last update: $weather[updatedate] at $weather[updatetime]
Remember, do this to both the forumhome_weather and weather_main templates.
***
If you've already installed this hack, you needn't worry about it, but, for the record, I've broken the weather_city.sql file into six smaller parts would should be easier for many websites to import without timing out.
PhoenixBB
08-06-2002, 09:47 PM
Originally posted by JJR512
I cannot support this hack for anything but vBulletin. If you are using vbPortal, there is a weather feature for that, which looks and works just like this. But, it was written specifically to work with vbPortal, which, although based on vBulletin, is a bit different. You could take mine and adapt it to vbPortal, but by then you'd have what someone else already did, so you may as well just get the one that's already made.
Except I'd have to pay $20 to get it and I can't afford it at the moment. Plus they haven't updated it yet.
The old one worked - not in the blocks but it rendered on the portal page. This one appears to only render when the code is in the index.php and the variable is on the forum page. Regardless of where I put it tho, the fact remains that even on the forum home page I cannot change the settings or get a detailed forecast. I just get a blank page. Is this fixable, or is this because the of the portal (which is only the lite version and shouldn't interfere with anything).
Obviously if users can't change the settings it will be unusable. :(
JJR512
08-06-2002, 10:45 PM
You can theoretically get it to appear on any page by adding the same bit of code you added to index.php to whatever file generates the page where you want it. For example, in vBulletin, if you wanted it to appear on the same page as a thread, you'd put it in showthread.php. Some files contain multiple actions which generate different displays and you may need to put the code in more than one spot in the same file. In general, you should probably put the code just before the line that calls the main template for the page you want it on. Because each page, file, and template are different, that is as far as I can go with helping to get it on other pages.
As for the other problem, I can't say if it's caused by the portal or not, because I don't have it. I don't know how the lite version is different from the regular version, but if it's really a portal, it should probably affect every single page. I just don't know how to help.
JJR512
08-06-2002, 10:52 PM
In the 1.1 version, in the new bit of code to show the update time in the local correct time, I had used an incorrect variable. If you've already installed it, in both index.php and weather.php, please find:
$time_lastup = strtotime($weather[lastup]);
And change it to:
$time_lastup = strtotime($weatherdata[lastup]);
Sorry for the inconvenience.
The fix will be in v1.1a which I am about to attach. This is the only difference between v1.1 and v1.1a, so if you already have v1.1, just use the fix I just described.
Erwin
08-06-2002, 10:56 PM
JJR512 - Thanks, the update works great!
PhoenixBB - the vBPortal weather add-on adds a whole LOT of queries to your forum, as opposed to this one, which only adds 2. I actually removed vBPortal which has optimized by many many times. You can convert your forum index into a portal very easily - no need to use a 3rd-party program.
Erwin
08-06-2002, 10:59 PM
It seemed to be working without the new variables being changed, but I've changed them anyway. :)
Erwin
08-06-2002, 11:44 PM
For some reason, the time of update lies 1 hour in the future for me... any way of fixing that?
JJR512
08-07-2002, 12:00 AM
What do you have your Time Zone Offset set to (in the admin cp/vbulletin options/date time options)? And your own time zone?
Erwin
08-07-2002, 12:04 AM
My time and timezone works everywhere else in vB - just not for weather.
Let me make sure I upgraded correctly... I followed the instructions in Post#79 and Post#82 - that's correct?
JJR512
08-07-2002, 12:12 AM
I didn't say anything else doesn't work anywhere else. I'd just like to know what those settings are so I can test it myself and maybe see what's going on.
Erwin
08-07-2002, 12:18 AM
I see... the server time is Pacific Mountain Time. My time is GMT +10. Currently my time is 11:12 am. The Weather tells me that it last updated 11:40 am. (Has been telling me that since 10 am actually).
JJR512
08-07-2002, 12:26 AM
Is the server time Pacific Time or Mountain Time? The two are different (PT is GMT-8, MT is GMT-7).
Erwin
08-07-2002, 12:29 AM
Sorry, server is at MT GMT -7
I am at Eastern Australian GMT +10
Currently I'm at 11:27 am
The weather still says 11:40 am.
JJR512
08-07-2002, 12:48 AM
Well this is odd...when I set my test board to a server time offset of MT GMT -7, and set my own profile to GMT +10, it says my local time is 2:45pm...three hours later than what it aparently really is!
Erwin
08-07-2002, 12:53 AM
LOL!
Actually, what you need to do is to keep your server time EXACTLY the way it was - but change your user time to GMT +10 - that should bring you to my time. (Our server offset would be different since our servers will be in different timezones).
Itworx4me
08-07-2002, 12:56 AM
JJR512,
Is there anyway to just show different citys weather conditions without having them set as your own. Like if I wanted to see what the conditions were in New York? Have you ever looked at the newspaper and it shows the temps around the world. Anyway of doing something like that as a hack. Where you input the citys you want to see listed there. Not sure how hard this is to do? Could you give some feedback?
JJR512
08-07-2002, 01:04 AM
You could see the weather for a different city, without having to set your settings to that city, by using a link like http://www.yourdomainhere.com/forums/weather.php?s=&action=getdata&citycode=xxxxxxxx where xxxxxxxx is the code for a city, like New York City is USNY0996. You can look up the code you want in the weather_city table.
Erwin, does your time zone go on daylight savings time? I set my server time zone back to what it should be, and I'm still an hour ahead of you. It says it's 12:56pm but I think it should be 11:56am, right? Plus, I don't think MT goes on daylight savings time at all, but ET does...GMT never does...it's so confusing. You may just want to change the line $time_lastup = strtotime($weatherdata[lastup]); to $time_lastup = strtotime($weatherdata[lastup])-3600;
Erwin
08-07-2002, 01:11 AM
Mmm... I did the fix you suggested... it took the time last update back by 1 hour for me...
So it was 10:40 - looked good. But then I forced an update. The last time update now says 12:40 pm. But I am at 12:00 pm now. :)
It doesn't really matter - no biggie. Looks better than before anyway.
PhoenixBB
08-07-2002, 01:12 AM
Hi again, Still not got it coming up on any other page but the index so far, but I'll figure that out at some point I hope.
What I'm still getting on the links is: ''url/forum/weather.php?s=&action=getdata'', but I noticed when I tested the one on your site it gave a string of digits after the '?s=' so it's not calling something. But what? Anyone got any ideas, coz that's the main problem at the moment.
JJR512
08-07-2002, 01:14 AM
Attached is 2.gif. Everyone should add this to wherever you have uploaded the rest of the icons.
JJR512
08-07-2002, 01:17 AM
Originally posted by PhoenixBB
Hi again, Still not got it coming up on any other page but the index so far, but I'll figure that out at some point I hope.
What I'm still getting on the links is: ''url/forum/weather.php?s=&action=getdata'', but I noticed when I tested the one on your site it gave a string of digits after the '?s=' so it's not calling something. But what? Anyone got any ideas, coz that's the main problem at the moment.
The string of digits after s= is irrelevant. That's the session hash, and you might not see it on your own board if you are set to use cookies. The board gets the session hash from the cookie rather than through the URL. Completely irrelevant.
Itworx4me
08-07-2002, 02:06 AM
Hello again,
Thanks for taking the time to look at my request. When I run your query it still show my current settings. Any ideas how to not have my saved settings interfer with using a different city setting?
David Bott
08-07-2002, 02:21 AM
I have received notices that the home page has stopped working with Netscape 4.7x. Seems to have just happened in the last hour when I instlled this hack (the other version worked without issues until the move). The weather shows up, but no forums are listed.
Page is ok with Netscape 6.3.2 and IE it seems.
HELP!
PhoenixBB
08-07-2002, 02:32 AM
I have received notices that the home page has stopped working with Netscape 4.7x.
Gawd, I'm starting to hyperventilate now!! The problems I had trying to get my whole forum to show up in NS4x still gives me nightmares. Better take it off my page then before the Mac people come on and yell at me. *sigh*
Thanks for the warning!
Erwin
08-07-2002, 02:35 AM
My site works with Netscape 4.x with the weather hack installed. Make sure it's not another hack (usually Javascript is what NN 4 has trouble with).
David Bott
08-07-2002, 02:56 AM
Nope...The issue was not their until the new code when into place. I did move the weather data to show up at the bottom vs the top...so maybe some this with the template is the issue???
THe members reported all they could see is the welcome pannel and the weather...no forums listed in between.
I have removed the code for now.
PhoenixBB
08-07-2002, 06:07 AM
Originally posted by Erwin
PhoenixBB - the vBPortal weather add-on adds a whole LOT of queries to your forum, as opposed to this one, which only adds 2. I actually removed vBPortal which has optimized by many many times. You can convert your forum index into a portal very easily - no need to use a 3rd-party program.
How can this give you only 2 queries when I get 9?? I had 38 queries before installing and now I got 47! See for yourself www.bigbad.net
Is it using 9 queries for me - as opposed to your 2 - because of the portal? I haven't actually got it in any of the blocks, I couldn't figure that out, so I just added a table on the right and it appears in the right place. Last time I tried that with a table the Mac users on NS4x couldn't load it, so I suppose I'll have to shift it from there tomorrow. *sigh*
It's still stuck on the default and I'm unable to change settings or get a detailed forecast as it just brings up the background page and header - nothing else. Will the queries go up further if I actually do get it to work properly?
Gonna be peeved if I have to remove it, as I think it's really great.
Boofo
08-07-2002, 06:48 AM
Have you put it with the icons in the file? I just downloaded it and it wasn't there. :) Just a reminder. :)
And thank you very much for the time fix. It looks much better and is a lot easier to understand.
Originally posted by JJR512
Attached is 2.gif. Everyone should add this to wherever you have uploaded the rest of the icons.
Kars10
08-07-2002, 07:28 AM
Hello JJR!
The Hack works like a charm. But one question. I use the Vbindex-Hack and in your old version (the first weatherhack ever) you put a template that can be used for guys like me with a Vbindex or something. Now i have the weather on the Forumhome, but i also wanna place it on my Vbindex-Site (home.php).
The template that youre old hack used was "homeindex_left_weather" (so i name it).
Whart must i do, to use this template again. The thing with the data-changes is clear, but what code must i put in my home.php??
Pleas help!! And Thanx for this great addition!!
* Minifreunde klicks the install-Button again! ;)
lookin tight man! love this hack..
Boofo
08-07-2002, 09:54 AM
For some reason, the time is showing way off of my local time set on the board. I just now did an update and it reads this:
Time of last update: Yesterday at 11:40 pm
but the time here is 5:53 AM (Today)
The time on the server is set at GMT and my time is set at -6 (Central US time). Any ideas why it is so far off?
JJR512
08-07-2002, 08:44 PM
Minifreunde: The code you put in home.php is the same code you add to index.php. Without having that hack, I can't guarantee this, but you should probably put my code just before the line in home.php that calls the main template...the template responsible for the overall appearance of the page; i.e., in index.php, it goes before the line that calls the forumhome template. That kind of line looks like this:
eval("dooutput(\"".gettemplate('forumhome')."\");"); (Where forumhome is the name of the template.) This kind of line is usually the last code line in the file, or the last line in a section of code for an action.
Itworx4me, I don't know what to tell you...It works for me ;)...Can anyone else try this? Assuming you have set your city to something other than New York City (the default), go to your detailed forecast page, then in your browser's address bar, add "&citycode=USNY0996" (without the quotes) to the end of the URL, right after "getdata", and go, and see if it gives you the detailed forecast for New York. Then go back to the home page and click the link to the detailed forecast to verify that your settings are still set to whatever you set them to, and that it shows you your own weather, not New York's.
Itworx4me
08-07-2002, 08:52 PM
Hello JJR512,
I have tried it many ways and it still doesn't work. Thanks for trying.
PhoenixBB
08-08-2002, 01:04 AM
Does anyone know if the database has to be initialized or something first? It's the first time I braved the mysql and everything went fine, no errors or anything. So I'm kinda peeved that it does nothing when I want to change settings or get a detailed forecast. The user settings thing in the database remain empty.
It's even rendering perfectly in NS4 which is a minor miracle. Unfortunately nobody wants to look at New York weather all the time so unless they can have their own cities it is making queries on the database for no real purpose.
I can't believe nobody knows the answer to this. What is it trying to call when it goes to change settings/get detailed forecast? Maybe I've missed something. If I knew what it was trying to call it might help me track it down. Is there anything I can do to the weather.php itself to make it do it's stuff??
I installed Fireflys /Me hack the night before installing this (with no problems) - could that be interfering??
Something has to be making the sessionhash not do it's job for this one particular file. But what?
Anybody?
JJR512
08-08-2002, 01:10 AM
Again, the sessionhash has nothing to do with it. You can make the sessionhash appear in the URL if you really want to by disabling cookies in your profile, logging out, and logging back in again.
When you click the link to modify settings, it activates the modifysettings action in weather.php, which uses the weather_settings template. If you have all the templates installed, and the file weather.php uploaded to your forums directory, it should work. You can test it on an unhacked-version (no other hacks, no portals, no nothing) of vBulletin. If it works there, but doesn't work on your version with the portal add-on, then there must be some conflict with that, and again, that's not something I can help with.
PhoenixBB
08-08-2002, 01:37 AM
Ok, it's official. I am indeed a moron! :P
It was the templates - main, select etc. Ya see I opened them in CoffeCupFTP's window and pasted them into the template like that. But the first one I'd opened was the 'redirect' and that was only one line, so when I opened the others I could only see up to the header - there was a lot of space before the tables. Never occured to me to scroll down to see if there was anymore to it. Everytime it called the weather_main or weather_select, there was only the headers there. Duh! I've just pasted the full versions in there and everything looks gorgeous and works perfectly.
So thank you for this, I'm thrilled with it. And next time somebody complains that something doesn't work and you have no idea why, bear in mind they have probably missed the blindingly obvious. ;)
Oh and the fella who wants it on his VBIndex page.....I can't tell you how to get it in the blocks, that's beyond me, but I got a template that'll fit your portal. It works on VBPLite, so should work on yours. Look at my portal (http://www.bigbad.net) and you'll see it blends in. I've left out the humidity and barometer stuff, they can get that from the detailed forecast, but it's easy enough to add in. The template is aligned to the right, but all you'd have to do is align it to the left if you prefer that. If you want the table as it is on the original hack, that'll work too - you'd just put the variable before the centre blocks load. I think.
As the man said, put your code on the page that calls VBIndex. I've put it on the vbplite.php (which I'd renamed to portal). It goes in the same place as you'd put it in the index.php - before it called your portal page. Mine is called 'P_home'. Dunno what VBIndex calls them, but just put it before it calls that template. Then put the $currentweather variable after the 'start themeleftcolumn' or 'rightcolumn' (or vbindex equivalent) in that template and it'll put it there. Should imagine if you want the original box with the hack, you'd put it before or after the centre block. Trial and error mate! If I could figure it out - and hey idiot here! - then you will. Persevere! ;)
PhoenixBB
08-08-2002, 07:29 AM
Here's a riddle.....
When I'm logged in I get either 42 or 43 queries on the page. When I'm logged out I get 47 or 51!!
/me is very puzzled
Kars10
08-08-2002, 08:51 AM
@ JJR!
Thanks, i did it so.
But i don?t get the weatherinfo.
I put youre hole code in the home.php directly for that line you say. I edit that line to fit my new template with the weather-Info for Home.php. The template called home_left_weather.
But the weather didn?t appear.... I placed the $currentweather in the home_left template.
Is there anything that must be done?
* Minifreunde get nervous if something like that happend... ;)
scottct1
08-08-2002, 12:30 PM
I have the weather being shown on both my home.php and my index.php page.
On my home.php page I added the forecast to the home_logout template this way only registered users see the weather.
I needed to add the code which I added to the index.php to my home.php file.
It works like a charm and my users love it.
You can see for yourself at
http://www.dbstalk.com/home.php
and
http://www.dbstlak.com/index.php
Enjoy!
Erwin
08-08-2002, 02:11 PM
My users are flabbergasted that their small little country towns are listed! :)
ExAvIoUr
08-08-2002, 04:16 PM
it worked perfectly. no problems.
A W E S O M E!!!
Easy to install and it works great. :)
This hack Rocks!
Thank You JJR512
Schorsch
08-08-2002, 05:01 PM
how can I change fahrenheit in celsius ?
ExAvIoUr
08-08-2002, 05:03 PM
click on change setting in the weather pert of the forum. then change it there.
its thats easy
Schorsch
08-08-2002, 05:18 PM
how do the weather symbols look on a dark background ?
because I think they look quite frayed. I can't say it exactly because I didn't install the hack yet.
would be nice if somebody could give a short information.
regards,
Schorsch
Schorsch
08-09-2002, 02:15 AM
hmmm see: http://www.minifreunde.com/images/weather//34.gif
looks not so good on dark backgrounds :(
can somebody make some sybmols that fit on dark backgrounds ?
cu
Schorsch
joeboo
08-09-2002, 02:15 AM
great job on the weather hack, i installed it with no problems :)
DarkDraco07
08-09-2002, 02:50 AM
whats so bad about that symbol? it looks fine
Schorsch
08-09-2002, 03:00 AM
u can see this ugly white border on dark backgrounds!! looks not so groovy in my mind :beard:
joeboo
08-09-2002, 04:37 AM
bah, i use it on a dark background and it aint that bad. it looks fine, and i aint complainin. just modify yourself, u can easily do it with even paint
hypedave
08-09-2002, 05:29 AM
I get this following error
Fatal error: Call to undefined function: convert_temp() in /home/ochroma/public_html/forums/index.php on line 581
JJR512
08-09-2002, 09:18 PM
Did you insert the functions into functions.php, as described in Step 5 of the instructions? Did you save functions.php after modifying it? Did you upload it to your forums/admin directory after saving it after modifying it?
Boofo
08-09-2002, 09:22 PM
JJR512,
Do you have any idea why the "Time Last updated" is still showing the server time and not the local user's time? The serevr is set to GMT and my time is -6 and it is always 6 hours behind.
hypedave
08-09-2002, 10:38 PM
Originally posted by JJR512
Did you insert the functions into functions.php, as described in Step 5 of the instructions? Did you save functions.php after modifying it? Did you upload it to your forums/admin directory after saving it after modifying it?
yes I did, right now im using the old index.php until I can fix that error.
Boofo
08-10-2002, 04:30 AM
Would you mind sharing your template for that? It looks fantastic! :)
Originally posted by snyx
lookin tight man! love this hack..
PhoenixBB
08-13-2002, 09:28 PM
Hit a bit of a problem......
One of my members has just told me she can't set the weather for her area - South Carolina. There are no cities listed for that (though there are for North Carolina). Have I got missing files somewhere??
I never got any errors when inputting the data into the database so is everybody missing data for South Carolina?
Matt87
08-13-2002, 09:41 PM
Are you sure this is alright doing this with the weather channel, doesn't this use up their bandwith?
JJR512
08-14-2002, 05:17 AM
Originally posted by PhoenixBB
Hit a bit of a problem......
One of my members has just told me she can't set the weather for her area - South Carolina. There are no cities listed for that (though there are for North Carolina). Have I got missing files somewhere??
I never got any errors when inputting the data into the database so is everybody missing data for South Carolina?
I have many cities listed for South Carolina.
Did you use the weather_city.sql (one big file) without breaking it apart? If you did, you should have them. If you broke apart the large file into smaller pieces, you may have accidentally somehow cut out the SC cities. Or, if you used the smaller weather_city1.sql, weather_city2.sql, and so on (through 6) that I put in the last release, I may have accidentally left out the SC cities. So, please let me know how you did it.
Matt87, this doesn't use any of The Weather Channel's bandwidth, because the data comes from MSNBC servers. I assume it is OK with MSNBC because: (1) the data is publically available, and not blocked or protected by password; (2) I have sent emails to MSNBC asking for additional information regarding the formatting of the raw data, and although I have received no helpful reply, they also have not asked me to stop using their data feed, either. So, I am taking this as implied consent.
PhoenixBB
08-14-2002, 03:11 PM
Hi
I used the chopped files given by the previous member, and you are right I probably accidentally missed some off.
Even the chopped files wouldn't always load without timing out on phpMyAdmin. Anything over 300k and it's potluck as to whether they'd upload without timeout errors. So those files I pasted half in, then the other half. Obviously I missed a bit out.
I went and downloaded your zip again and reuploaded the cities (after emptying the tables). 5 of the files I split in two so they were all under 300k. I double double checked I hadn't missed anything! ;)
Reuploaded them and everything went smoothly. Database holds 37k + where before it was only 36,000+. South Carolina now has cities and everything seems to be peachy! I'd have been totally oblivious if I hadn't had a member from there though. ;)
This is a fabulous hack and everybody loves it! :D
Now if only I can find a daily horoscope widget.........
beemer
08-15-2002, 07:41 AM
Best hack so far, very cool work!!
lemarsu
08-15-2002, 03:29 PM
Hi,
i get the following error:
Fatal error: Call to undefined function: convert_temp() in /home/sites/site12/users/ducati/web/monster/index.php on line 417
I Have version weather_mk2_v1[1].1a the file weather.php is loaded in the root for my forum web/monster/ with the following premissions.
-rw-r--r-- 1 ducati site12 weather.php
can you spot what is going wrong ?
LeMarsu
Matt87
08-16-2002, 12:00 AM
Is there any way to put this in ther user's cp instead of the forum home page?
Boofo
08-16-2002, 12:04 AM
JJR512, have you noticed that all of the update times end in 40 minutes? :)
Matt87
08-16-2002, 03:54 PM
Anyone know how to do this?
Boofo
08-16-2002, 04:54 PM
Do you want just the link in there or are you wanting to put all of the weather info in there, too?
Originally posted by Matt87
Anyone know how to do this?
beemer
08-16-2002, 05:14 PM
Lemarsu, you are getting this error because you didn't put all the changes in before you tested it. You have to put the functions into the admin/functions.php file. Do step #5 and the error will dissappear.
beemer
08-16-2002, 05:15 PM
Boofo, I did notice the same thing, everytime I do an update, it ends in 40 minutes, regardless of when I do this.
Boofo
08-16-2002, 05:29 PM
And how far off of your time are you when the update happens? I finally got mine to about 40 minutes ahead of my time. That is the closest I could get. :)
Originally posted by beemer
Boofo, I did notice the same thing, everytime I do an update, it ends in 40 minutes, regardless of when I do this.
Matt87
08-16-2002, 08:02 PM
I want to put everything that would be on the forum home
JJR512
08-17-2002, 01:26 AM
Boofo, if your update time is always ahead of your current real time, try adjusting it backwards by an hour by following the suggestion in Post #95 above. Subtracting 3600 (number of seconds in one hour) makes it one hour earlier.
Boofo
08-17-2002, 02:35 AM
Here's the code Xenon gave me to make it close. It was setting at the server time before (which is 6 hours behind me).
$time_lastup = strtotime($weatherdata[lastup]);
$time_lastup-=($bbuserinfo['timezoneoffset']+$timeoffset)*3600;
$weather[updatedate] = vbdate($dateformat,$time_lastup);
$weather[updatetime] = vbdate($timeformat,$time_lastup);
Originally posted by JJR512
Boofo, if your update time is always ahead of your current real time, try adjusting it backwards by an hour by following the suggestion in Post #95 above. Subtracting 3600 (number of seconds in one hour) makes it one hour earlier.
JJR512
08-17-2002, 02:46 AM
Try changing the 3600 to 7200.
Boofo
08-17-2002, 03:08 AM
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. :)
Originally posted by JJR512
Try changing the 3600 to 7200.
JJR512
08-17-2002, 03:23 AM
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.
Boofo
08-17-2002, 04:09 AM
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! ;)
Originally posted by JJR512
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.
Matt87
08-17-2002, 06:59 PM
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.
JJR512
08-17-2002, 09:33 PM
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.
webhost
08-18-2002, 11:13 AM
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?
webhost
08-18-2002, 02:19 PM
Something wrong with this country and city also gif does not showup and all readings are out of wack.
Bukit Timah, Singapore
scottct1
08-20-2002, 10:17 PM
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?
Erwin
08-20-2002, 10:47 PM
Working fine for me still. :)
Boofo
08-20-2002, 10:50 PM
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. :)
Originally posted by scottct1
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?
mbaskett
08-21-2002, 12:56 AM
Originally posted by Minifreunde
@ JJR!
Thanks, i did it so.
But i don?t get the weatherinfo.
I put youre hole code in the home.php directly for that line you say. I edit that line to fit my new template with the weather-Info for Home.php. The template called home_left_weather.
But the weather didn?t appear.... I placed the $currentweather in the home_left template.
Is there anything that must be done?
* Minifreunde get nervous if something like that happend... ;)
I run a (very) hacked up version of home.php and use a left/right in my index.php and forumdisplay.php... I had to add the weather code BEFORE I called the left and right templates.... and now it's showing up on the left side properly...
On a side note... this is agreat hack but I found a coding error in the weather_main template... the link to force an update seemed to be missing "&action=getdata" before "&forceupdate=yes"
*clicks Install Button* Thumbs up!!!!!
Boofo
08-21-2002, 01:04 AM
He's right! If I add that, then it doesn't give me a blank page anymore. I don't get the confirmation message either, but at least I don't get a blank page now on force update. JJR512, what do I need to change to get the confirmation message now? :)
Originally posted by mbaskett
On a side note... this is a great hack but I found a coding error in the weather_main template... the link to force an update seemed to be missing "&action=getdata" before "&forceupdate=yes"
floridaideal
08-21-2002, 10:59 PM
Hi
Using VB 2.6 and having a small problem, I just installed the hack and it works great, nice one. I changed the Country to Spain and it doesnt list any Cities so I saved it and whenever I now try and edit the settings for the time change I get a SQL Database error:
Database error in vBulletin 2.2.6:
Invalid SQL: SELECT accid,city_title FROM weather_city WHERE subdivid= 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: Thursday 22nd of August 2002 12:23:08 AM
Script: http://www.villas4spain.com/forums/forums/weather.php?action=modifysettings
Referer:
I am pretty sure this is because Spain didnt have a ny cities listed, I tested it before and changed the settings on US Cities.
Anyone know how I can solve this please? Other members don't have this problem so its just because mine saved on Spain, its sort of blocked it.
Any info would be cool
Thank you
Stu
novel44
08-22-2002, 05:25 PM
Fatal error: Call to undefined function: convert_temp() in /home/virtual/site13/fst/var/www/html/forum/index.php on line 424
i followed the instructions step by step.. and reinstalled, following each step very very carefully. Can someone assist.
Reach me on aol IM mysweetfocus
or yahoo zarkarin
or reply to this thread!
novel44
08-22-2002, 07:03 PM
re installed.. and it worked this time... ODDDD awesome hack!
cabnyorg
08-22-2002, 07:30 PM
What do I enter for the following, under "Create new table on database vbulletin"
Name : ????
Fields: ????
2 X Viverridae
08-22-2002, 10:19 PM
Installed, and it works great! I haven't tried setting it to Spain, though...
The time is screwed up it seems, I've tried a few things to get it to consistently give users something a little more accurate in reference to their local time, but no joy yet.
Thanks for a great hack!
Installed. Awesome. Easy to modify the design to cutomize to my board.
Thanks
TCS
Boofo
08-25-2002, 03:31 AM
JJR512, the guy who tried to set Spain as his default is right, there are no cities for Spain in there. Can we get some or at least take Spain out if there is none so we don't have users getting stuck like that? :)
scottct1
08-28-2002, 11:56 AM
Anyones weather working today?
Boofo
08-28-2002, 11:58 AM
Mine went down about an hour ago. They must be temporarily down.
ExAvIoUr
08-28-2002, 02:19 PM
mines went down too. i thought i was the only 1.
Kars10
08-28-2002, 03:58 PM
Mines went down too.... hope it will work again soon!! ;)
ExAvIoUr
08-28-2002, 04:21 PM
well it back up agian
Erwin
08-28-2002, 10:58 PM
It's working for me at the moment.
BrAinZ
08-29-2002, 09:21 AM
Just looking through the Weather_City data and I'm wondering whether I REALLY need to load all of this ?
I am based in the UK, and no-one is going to need any of the data for the rest of the world?
Would it help to keep things smaller and neater if I ONLY loaded the UK specific data?
Would it still work?
Boofo
08-29-2002, 09:25 AM
You don't get any users from anywhere else in the world? :)
Originally posted by BrAinZ
Just looking through the Weather_City data and I'm wondering whether I REALLY need to load all of this ?
I am based in the UK, and no-one is going to need any of the data for the rest of the world?
Would it help to keep things smaller and neater if I ONLY loaded the UK specific data?
Would it still work?
BrAinZ
08-29-2002, 03:59 PM
Originally posted by Boofo
You don't get any users from anywhere else in the world? :)
Nope.. Our board is only for staff of our Company, which is based in the UK. Well actually I might need to need Hong Kong in there, as we have a few staff there.
lemarsu
08-31-2002, 09:05 AM
Hi,
Most of the time under the Temperature box there is no temperature, showing. (as you can see in the pic)
but under Detailed Forecast all comes up !
is it possible to fix that ?
LeMarsu
Database error in vBulletin 2.2.7:
Invalid SQL: SELECT accid,city_title FROM weather_city WHERE subdivid=
mysql error: You have an error in your SQL syntax near '' at line 1
mysql error number: 1064
$cities = $DB_site->query("SELECT accid,city_title FROM weather_city WHERE subdivid=$current_subdiv[subdivid] ORDER BY city_title");
i think this query seems to complicate it..
i have created all tables and made the changes, i run it 4 times deleted it and made a fresh install... everytime i got this error, can anyone help?
--------------------------------------------------------
edit: ok fixed my errors, works great
/me clicks install
Gohan
09-10-2002, 12:03 AM
Originally posted by PsYc
Database error in vBulletin 2.2.7:
Invalid SQL: SELECT accid,city_title FROM weather_city WHERE subdivid=
mysql error: You have an error in your SQL syntax near '' at line 1
mysql error number: 1064
$cities = $DB_site->query("SELECT accid,city_title FROM weather_city WHERE subdivid=$current_subdiv[subdivid] ORDER BY city_title");
i think this query seems to complicate it..
i have created all tables and made the changes, i run it 4 times deleted it and made a fresh install... everytime i got this error, can anyone help?
--------------------------------------------------------
edit: ok fixed my errors, works great
* PsYc clicks install
same as my problem.. what did you fix?
==========================================
JJ.. Great hack!
Gohan
09-10-2002, 11:59 AM
Hello, someone can helped?
Gohan
09-11-2002, 12:09 AM
*BUMP* :(
PHiXTiT
09-11-2002, 03:35 PM
Great hack! (5)
Only 2 problems.
1) The time is 40 minutes in the future.
2) There are no subdivisions in Canada such as Alberta, Ontario, etc, but all the cities are listed. All others are working for me.
BTW: Just wondering if you are planning on adding the option for users to select different .gif files when modifying settings?
Running on 2.2.7
Originally posted by Gohan
same as my problem.. what did you fix?
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..
Gohan
09-11-2002, 04:38 PM
Originally posted by PsYc
cities1-5.sql
Hmm.. i havent it but well weather_city5.sql
EDIT: Doesnt working!!! :tired:
lemarsu
09-13-2002, 07:25 AM
Hi,
I am looking in placing the weather in my vbindex, as described in post #107 (https://vborg.vbsupport.ru/showthread.php?postid=282022#post282022).
can anyone point me towards the template ? and all the other info you think I might need.
Thanks
LeMarsu
Gohan
09-13-2002, 08:25 AM
Open vbindex.php and find:
// left & right templates
add ABOVE:
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()-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 /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("home_weather")."\";");
}
Create new template "home_weather":
<tr>
<td width="165" bgcolor="{tablebordercolor}" >
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td valign="top" bgcolor="{tableheadbgcolor}" align="center"><normalfont><font color="{categoryfontcolor}"><b>Weather</b></font></normalfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}" align="center">
<table bgcolor="{tablebordercolor}" border="0" cellpadding="4" cellspacing="1" width="100%" align="center">
<tr bgcolor="{categorybackcolor}">
<td align="center"><smallfont>$weatherdata[city]</smallfont></td>
</tr>
<tr bgcolor="{firstaltcolor}">
<td align="center"><smallfont><img src="{imagesfolder}/weather/$iconset/$weatherdata[cicon].gif" border="0" alt="$weatherdata[context]"><br>$weatherdata[context]</smallfont></td>
</tr>
<tr bgcolor="{secondaltcolor}">
<td align="center"><smallfont>Temperature:</smallfont><br><normalfont><b>$weatherdata[temp]</b></normalfont><br><smallfont>(Real Feel: <b>$weatherdata[realfeel]</b>)</smallfont></td>
</tr>
<tr bgcolor="{firstaltcolor}">
<td align="center"><smallfont><a href="weather.php?s=$session[sessionhash]&action=getdata">Detailed Forecast</a><br><a href="weather.php?s=$session[sessionhash]&action=modifysettings">Change Settings</a></smallfont></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
Open template "home_left" or "home_right" and add $currentweather (whatever want you put it)
Gohan, those are your microstats:
"Page generated in 0.80156398 seconds (90.45% PHP - 9.55% MySQL) with 71 queries."
you could say goodbye to your server... the way it is now your page. over 40queries can bring easy to it's knees the server.
i hope you dont have a busy site, orelse you will have your account cancelled in no time by your host...
Gohan
09-13-2002, 08:53 AM
Page generated in 0.80983102 seconds (90.22% PHP - 9.78% MySQL) with 72 queries.
[Debug Mode OFF] [PHP v4.2.2] [GZIP disabled] [Server Load: 0.00 ยป 0.01 : 0.00]
so bad for server??
just no problem cus so fast server without lag.
lemarsu
09-13-2002, 01:11 PM
Gohan,
Thanks for that ! :)
I have made one or 2 changes to the template "home_weather":
making it abit more generic.
<tr>
<td width="165" bgcolor="#8080A6">
<table bgcolor="#8080A6" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td bgcolor="#8080A6" valign="top" align="center"><normalfont><b>Weather</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#8080A6" align="center">
<table bgcolor="#8080A6" border="0" cellpadding="4" cellspacing="1" width="100%" align="center">
<tr>
<td bgcolor="#8080A6" align="center"><smallfont>$weatherdata[city]</smallfont></td>
</tr>
<tr>
<td align="center"><smallfont><img src="https://vborg.vbsupport.ru/vbimages/weather/$iconset/$weatherdata[cicon].gif" border="0" alt="$weatherdata[context]"><br>$weatherdata[context]</smallfont></td>
</tr>
<tr>
<td align="center"><smallfont>Temperature:</smallfont><br><normalfont><b>$weatherdata[temp]</b></normalfont><br><smallfont>(Real Feel: <b>$weatherdata[realfeel]</b> )</smallfont></td>
</tr>
<tr>
<td align="center"><smallfont><a href="weather.php?s=$session[sessionhash]&action=getdata">Detailed Forecast</a><br><a href="weather.php?s=$session[sessionhash]&action=modifysettings">Change Settings</a></smallfont></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
Thanks again.
LeMarsu
lemarsu
09-13-2002, 01:24 PM
how bizzar.
the code : bgcolor = "{ tableheadbgcolor } "
gets changed to bgcolor="#8080A6" even in [ code ] or [ php ]
:|
Erwin
09-13-2002, 01:26 PM
Originally posted by Gohan
Page generated in 0.80983102 seconds (90.22% PHP - 9.78% MySQL) with 72 queries.
[Debug Mode OFF] [PHP v4.2.2] [GZIP disabled] [Server Load: 0.00 ? 0.01 : 0.00]
so bad for server??
just no problem cus so fast server without lag.
TECK is right (as usual ;) ) - it's BAD for your server. What hacks do you have installed? Take them out. Get it to below 30.
NTLDR
09-13-2002, 07:14 PM
Originally posted by Erwin
TECK is right (as usual ;) ) - it's BAD for your server. What hacks do you have installed? Take them out. Get it to below 30.
Gohan, I strongly recomend that you either reduce the number of news posts & active threads and/or remove some of the addons to that page 71 for the sites home page is very, very, very high.
Gohan
09-13-2002, 11:07 PM
Originally posted by NTLDR
Gohan, I strongly recomend that you either reduce the number of news posts & active threads and/or remove some of the addons to that page 71 for the sites home page is very, very, very high.
Hmm.. but my server get every day around 10 users visitor.
i think better remove a weather and calendar hack from vbindex.
Gohan
09-13-2002, 11:44 PM
quote:
Originally posted by PsYc
Database error in vBulletin 2.2.7:
Invalid SQL: SELECT accid,city_title FROM weather_city WHERE subdivid=
mysql error: You have an error in your SQL syntax near '' at line 1
mysql error number: 1064
$cities = $DB_site->query("SELECT accid,city_title FROM weather_city WHERE subdivid=$current_subdiv[subdivid] ORDER BY city_title");
i think this query seems to complicate it..
i have created all tables and made the changes, i run it 4 times deleted it and made a fresh install... everytime i got this error, can anyone help?
--------------------------------------------------------
edit: ok fixed my errors, works great
* PsYc clicks install
same as my problem.. what did you fix?
Hello, nobody know fixed??
Gohan
09-16-2002, 08:00 PM
Originally posted by Gohan
Hello, nobody know fixed??
ok then.. i'll remove this hack!!! :( :tired: :dead:
PHiXTiT
09-17-2002, 05:33 PM
Originally posted by PHiXTiT
Great hack! (5)
Only 2 problems.
1) The time is 40 minutes in the future.
2) There are no subdivisions in Canada such as Alberta, Ontario, etc, but all the cities are listed. All others are working for me.
BTW: Just wondering if you are planning on adding the option for users to select different .gif files when modifying settings?
Running on 2.2.7
Anyone?
Have they blocked the data again?? It is not working on my site today.....
PHiXTiT
09-24-2002, 09:13 PM
Working here
Still wondering about the provinces in Canada for subdivisions as the are not showing up.
Help would be appreciated.
ThanX
sklwer
10-10-2002, 01:02 AM
Hi there,
I am new to this PHP stuff and i am trying how to impliment the above hack.. I figured everything but I am unable to
"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."
Help! Help! Help
lemarsu
10-10-2002, 09:45 AM
copy and paste the query window in phpMyAdmin should be enough.
sklwer
10-10-2002, 09:10 PM
I dont have a phpmyadmin
lemarsu
10-11-2002, 08:48 AM
How do you access your database ? :surprised:
I am new to this, I only had phpmyadmin, or Linux to use to access the mysql databases.
(not to sound to dumb I am working on a data warehouse project at work with Oracle and DB2 and Unix.... So I know what I am going) just this is the first time I user vbulletin
sklwer
10-13-2002, 03:55 AM
Finaly figured it out Got it installed sucessfully.
Two Minor problems
I modified the default city and when unregistared user is online the Default city is NY when registered user is online its the New Weather city any help????
How can i link the weather to a non php home site ( thats shtml)??
Thanks
Anyone try this hack on 2.2.8 yet?? Would love to add it to my forums :)
Thanks In advance!
lemarsu
10-14-2002, 07:40 AM
I have it up and running with 2.2.8 with no problem.
wolfe
10-18-2002, 12:28 AM
WOW awesome m8 niceone must have took you ages to do all that sql code :D
but 1 question how can i add it to the Who's Online in online.php i get this
Unknown Location: /forums/weather.php?&action=modifysettings&s=
also there is a error on it when i click on this link
<a href="weather.php?s=$session[sessionhash]&forceupdate=yes">Force Update</a>
i get a blank screen :( any ideas :D
Just an update, I've removed this hack because I found it to be slowing down, the loading of my frontpage, a lot.
scottct1
10-26-2002, 10:31 PM
Same here Ian, I just removed it from my site this morning. Seems like stuff went to hell when MSNBC changed from AccuWeather for The Weather Channel.
I still have the hack on my site, I just no longer have it on my index.php page.
Good hack though.
NuclioN
10-26-2002, 11:04 PM
Correct, it's slowing down and so i removed it.
Tigga
10-26-2002, 11:17 PM
I've noticed it slows my page down too, but it only seems to be something like 0.3 seconds or so. Occasionally when the weather isn't available it seems to slow it down a little more, but that isn't very often. Was it slowing your sites down more than that?
Erwin
10-27-2002, 02:21 AM
Mine's still working quite quickly - no discernable changes really.
scottct1
10-27-2002, 03:44 PM
It works correctly WHEN the local weather is available froom MSNBC / Weather.COM however if its not available my users are seeing a 25 to 75 second wait before the page comes up.
Erwin
10-27-2002, 05:40 PM
I have to say that this is happening to me now - there is a bit of delay before the page loads, about 60 seconds on average...
Tigga
10-27-2002, 06:30 PM
Yea, I've noticed that it slows down even more now when the weather isn't available from MSNBC. At least I have mine set where I can easilly turn it off in my admin CP, so if I happen to notice it delaying things I can switch it off for a few minutes. :)
wolfe
10-28-2002, 12:51 PM
getting a problem i click the Force Update button and it goes to blank page whats up :(
Erwin
10-28-2002, 05:15 PM
@ wolfe - missing template? Make sure all your templates are inserted.
Changing the city/etc. doesn't work on your test board.
Tigga
11-04-2002, 06:05 AM
Originally posted by lemarsu
Hi,
Most of the time under the Temperature box there is no temperature, showing. (as you can see in the pic)
but under Detailed Forecast all comes up !
is it possible to fix that ?
LeMarsu
I've noticed the same problem... The temperature works fine on one of my sites, but not on another. It's the exact same code on both, so I'm not sure what could cause this. Anyone happen to know why it does this?
Julio
11-09-2002, 03:58 AM
Has anyone been able to sucesfully change the default NY settings to your own? I have replaced the NY code with mine, (under weather.php) but it doesn't work.
Any help?
lemarsu
11-09-2002, 09:05 AM
yes there are 2 places you need to change it in weather.php line 20 and line 201 aprox.
I think that all the changes I did.
if it doesn't work have a look in the database, that is a place a looked in when I 1st installed the weather hack.
all the best
LeMarsu
Julio
11-13-2002, 05:06 AM
OK, thanks. Had to edit the database.
PlurPlanet - Can you please shoe me how to set it up that I can turn it on/off from the CP?
I have translated the text of this hack to another language, but notice that text under the 1st pic (below Current Weather..) still shows in English. I have modified functions.php already... anyone knows where exactly in the database I can change this (haven't found it) I know it is the "context" or it just comes from The Weather Channel?
lemarsu
11-13-2002, 09:08 AM
are you talking about text like "Mostly Cloudy" or "sunny" ?
I think this is pulled out from msnbc.com
Tigga
11-13-2002, 11:07 AM
Originally posted by Julio
PlurPlanet - Can you please shoe me how to set it up that I can turn it on/off from the CP?
Sure, it's not very hard to do. :)
Just open the file the weather is displayed on (I'd assume it would be your forums/index.php, but of course you can display it in any file) and add this code right before the code for the weather:
if ($showweather) {
Then right after the code for the weather add a } to close out that if statement.
Then using phpMyAdmin run this query:
INSERT INTO setting VALUES (NULL,1,'Show Weather?','showweather','0','Show the weather forcast on your homepage.','yesno','3');
That will display the option right below the "Reason for turning board off" option in your Admin CP. If you know anything about the "setting" table you can change those values in the query to display it somewhere else. If you don't know how to change the setting and want it displayed somewhere else just PM me and let me know where you want it and I'll give you the code. :)
Julio
11-13-2002, 11:56 AM
PlurPlanet:
I followed your instructions. It whows under "Reason for turning board off". If I leave it on, the board will show up fine, but if I turn it off, the board will not show at all. Just a blank screen.
GoTTi
11-14-2002, 09:25 PM
wow this hack is real tight...this 1 gets my vote for HOM
Tony DiMera
11-14-2002, 11:40 PM
Can we canadians use it for canadian cities?
Julio
11-15-2002, 11:26 AM
PlurPlanet: Any help?
Lemarsu: are you talking about text like "Mostly Cloudy" or "sunny" ?
I think this is pulled out from msnbc.com
Any news on this. I tried browsing the database and found no clue of it. (It just points to $context)
Tigga
11-15-2002, 12:16 PM
Julio - That's strange... I just tried it on my test server and it worked fine. You could try logging in with phpMyAdmin and go to your "setting" table. Then find that setting (it should be the last one unless you've added anything since) and check that the values for it are:
(could be any number) | 1 | Show Weather? | showweather | (0 if turned off, 1 if on) | Show the weather forcast on your homepage. | yesno | 3
Julio
11-16-2002, 12:40 PM
Verified the database and is OK. The problem may be where Im inserting the IF code at index.php?
I have tried inserting the IF expression in a line before the "// *** GET WEATHER *** or after it. And finalize with the } before the ?> or after it.
Depending where I put these, I get a blank screen , or a parse error.
Forest Sage
11-16-2002, 02:05 PM
I couldn't find this anywhere else on this thread
When I try to up weather_city1.sql and weather_city5.sql
I get
Error
SQL-query :
INSERT INTO weather_city
VALUES (
'AYXX0007', 'Base Arturo Prat', 263
)
MySQL said:
Duplicate entry 'AYXX0007' for key 1
Or something of the like
...I've never used a hack like this before so I have no clue why there would be a problem like this
Tigga
11-16-2002, 02:32 PM
Julio - I didn't think about that... I was thinking more of the board was being closed when the weather was turned off. It definitely sounds like you are putting the ending } in the wrong place. Sorry I misunderstood your first post.
The if statement can be either before or after "// *** GET WEATHER ***" (doesn't really matter since that's a comment line). The ending } should be right after this line:
eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";");
Julio
11-26-2002, 07:37 PM
OK thanks. It works now...
Now... my other problem... I changed all the values in the tables to show another state besides Nw York as defalut, but still not work.
Anyone could help?
Erwin
11-27-2002, 04:55 AM
I've had to remove this hack. It's a great hack, but the weather server is just too bad - most of the time there is no information available, and it slows down my forumhome by many seconds...
Julio
11-27-2002, 01:46 PM
Erwin: Too bad it doesn't work for you the way you expected. However, I do notice I slight increase in the time the page takes to load, but there's always information regarding my area.
The only "problem" i have is that even though I have edited the files and the database, I still can manage to make my area as default... All my users keep telling me they don't like to change te preferences... (New Users)
Tony DiMera
11-28-2002, 12:15 AM
I did this and for afew other tables to create. but for what was in this txt file:
CREATE TABLE weather_country (
countryid smallint(6) NOT NULL auto_increment,
regionid smallint(6) NOT NULL default '0',
country_title varchar(50) NOT NULL default '',
PRIMARY KEY (countryid)
) TYPE=MyISAM;
I got this error:
Error
SQL-query : [Edit]
CREATE TABLE `weather_country` (`countryid` SMALLINT(6) NOT NULL AUTO_INCREMENT, `regionid` SMALLINT(6) DEFAULT '0' NOT NULL, `country_title` VARCHAR(50) NOT NULL ) TYPE = MYISAM comment = 'PRIMARY KEY (countryid)'
MySQL said:
Incorrect table definition; There can only be one auto column and it must be defined as a key
Back
350Chevy
12-03-2002, 03:02 AM
Originally posted by PlurPlanet
I've noticed the same problem... The temperature works fine on one of my sites, but not on another. It's the exact same code on both, so I'm not sure what could cause this. Anyone happen to know why it does this?
Same here.. everything shows but no temperature...?? Any suggestions?
350Chevy
12-03-2002, 03:20 AM
Originally posted by lemarsu
Hi,
Most of the time under the Temperature box there is no temperature, showing. (as you can see in the pic)
but under Detailed Forecast all comes up !
is it possible to fix that ?
LeMarsu
Same question... still unanswered..
Julio
12-03-2002, 11:43 AM
Strange: I always get all the info displayed.
350Chevy
12-03-2002, 07:19 PM
I think it has something to do with the server settings. Maybe my server doesn't have something running that it needs to pull the temperatures... ?? Dunno.. everything works but the Temp.. but I don't even get the temperature on the forecast page. Weird..
350Chevy
12-06-2002, 04:06 AM
Nobody else has had this problem?
bahamut0
12-09-2002, 05:19 PM
hello i was uninstalling this and suddenly got this error.
nvm i fixed it :)
i took out the code from the index and admin functions files then went to my mysql and deleted the weather tables and got this after, did i forget something somewhere.
nymyth
12-09-2002, 06:34 PM
sup people...this is buggin the hell outta me.......everytime i try to run the sql files......my browser "page cannot be displayed" shows that page........im tired.....any ideas from anyone....thanx
Peace
Erwin
12-09-2002, 07:32 PM
The files are too big - you need to break them up into smaller sql files.
350Chevy
12-14-2002, 04:47 AM
Has anyone figured out why the temperature doesn't display on some web servers but everything else about this mod works fine? :)
EvilLS1
12-15-2002, 07:48 AM
Yeah, the temperature doesn't show up on my site either. So I disabled it for now, since the temperature is one of the most important details. Bummer.. I really wanted to use this hack. :(
Julio
12-15-2002, 01:02 PM
One thing I noticed on my testboard is that if the "Country" you choose to display data is rarely shown on their site, or tv channel, it ussually has no info at all.
-lucky me-
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.