![]() |
Try it now, Erwin. It just kicked in for some reason. All is working well. :)
|
Okay, it was probably a temporary weather server problem - everything is working perfectly now! :)
Thanks for your great work JJ!!! |
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:
|
Quote:
|
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?
|
I see it. :)
I'll change it manually myself - thanks! Sorry to bother you. |
Ok, Erwin, the ball's in your court. Can you tell us the changes? :)
Quote:
|
To upgrade from version v1.0 to v1.0a - this post has been updated - it works. :)
In forumhome_weather template, find: Code:
Code:
Then, in index.php... Find: PHP Code:
PHP Code:
|
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"). |
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 :)
|
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. :)
Quote:
|
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!! |
Quote:
|
Quote:
|
hahaha, and again..
how would I change the default location (New York) when your not loggedin/or registered.. to another location? |
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.
|
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 |
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 !! |
I guess you didn't do Steps 2 and/or 3 in the instructions.
|
Quote:
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. |
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? |
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 |
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.
|
Is there a way to have the Last Update Time set to the timezone and time/date format of our sites? :)
Quote:
|
You have read Post #s 60 and 63-66, right?
|
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 |
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.
Quote:
|
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.
|
where can i find the new weather.php?
in weather_mk2_v1[1].0.zip i can't see the weather.php :paranoid: |
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. :) |
hi,
i do it https://vborg.vbsupport.ru/attachmen...&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) |
oh sorry
my cache was incorrect :D this hack is great!!! |
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. Quote:
|
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? |
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. :) Quote:
|
Quote:
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. :) |
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 Code:
eval("\$currentweather = \"".gettemplate("forumhome_weather")."\";"); Code:
$time_lastup = strtotime($weather[lastup]); Now you need to change two templates: weather_main and forumhome_weather. Do the same change to both templates. Find: Code:
Time of last update: $weatherdata[lastup] Code:
Time of last update: $weather[updatedate] at $weather[updatetime] *** 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. |
Quote:
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. :( |
All times are GMT. The time now is 02:47 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|