vb.org Archive

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

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:
Code:

$time_lastup = strtotime($weather[lastup]);
And change it to:
Code:

$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...ycode=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

Quote:

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

Quote:

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

Quote:

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.

Quote:

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!!
[high]* Minifreunde klicks the install-Button again! ;)[/high]

snyx 08-07-2002 08:25 AM

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:
Code:

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 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?
[high]* Minifreunde get nervous if something like that happend... ;)[/high]

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.

w596 08-08-2002 04:52 PM

A W E S O M E!!!

Easy to install and it works great. :)

This hack Rocks!

Thank You JJR512


All times are GMT. The time now is 09:49 PM.

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

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

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

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