Log in

View Full Version : VB World Weather


Pages : [1] 2

why-not
07-11-2004, 10:00 PM
This is VB World Weather...

It allow your users to look up and display local weather for 39,722 locations around the world! It is template based with multi language support built in!


The zip file contains...

1. Step by step install files
2. All images, language files, templates, weather database file and scripts

Demo

http://forum.ya-right.com/

user: test
pass: test

when you login go to the usercp to try the demo, also look at the bottom of the forum home for the other display...

The one on the forum home can be placed where ever you want to place it!

If you have any questions or need install help post your questions here...

UPDATES (7/15/2004 9:47 PM EDT)

Go here for the FORUMHOME template update install info

https://vborg.vbsupport.ru/showthread.php?p=533325&posted=1#post533325

UPDATES (7/18/2004 9:04 AM EDT)

Add a database install table script, for people who can not run
the single sql file (FOUND IN STEP 7). It is very easy to use!


Have a great day....

Sonia


_______________________________
Next mod -> translate this topic or post!

Natch
07-12-2004, 04:35 AM
Awesome !

Thanks for this - great coverage!

Merjawy
07-12-2004, 05:03 AM
Why not ... this is bad.. I love it.. will install.. much better than what I have now :)


just rename the file to WorldWeather if you don't mind :)


thnx

Giveit2u43
07-12-2004, 05:25 AM
Great looking hack :)

deathemperor
07-12-2004, 05:28 AM
COOL, it can show the weather of everywhere in our planet !!!

Erwin
07-12-2004, 05:36 AM
Very cool... I might just add this! :)

Beermonster
07-12-2004, 05:44 AM
Going to install this, thanks :)

KTBleeding
07-12-2004, 06:21 AM
Very neat hack..

I however don't have a use for it.
Looks nice though.

msimplay
07-12-2004, 07:53 AM
thas fantastic i will install now :D

Deska
07-12-2004, 08:09 AM
Beautiful hack :D

Phalynx
07-12-2004, 09:04 AM
really nice one, thanks!

nexialys
07-12-2004, 09:10 AM
i don't like it; it's telling that i will have showers for the rest of the week...
joking... it's cool...

nighteyes
07-12-2004, 11:56 AM
Awesome hack.... will install this later. :)

Lurk
07-12-2004, 01:18 PM
this is awesome!!
/me runs off to install

Boofo
07-12-2004, 01:27 PM
Very nice! Will install! ;)

The Realist
07-12-2004, 01:48 PM
In the instructions it says:

"If your setup uses a table_prefix then use the script that is included to add the
prefix name to the forecast table name"

Where do I look to see if my DB has a table_prefix and if it does not, do I need to run the sql file?

The Realist
07-12-2004, 01:51 PM
I ran the SQL file and received this error:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
CREATE TABLE forecast (id int(4) NOT NULL auto_increment

Im now stuck at stage No7

It says:

If your setup uses a table_prefix then use the script that is included to add the
prefix name to the forecast table name. To run the change.php script, place the
forecast.sql file and the change.php script in your main vbulletin directory (./)
then run the script from your browser. When it is finished it will update the
forecast.sql file to match your system settings! After this install the forecast
database into your main forum database!

Can someone explain this in English please.

yukayumi
07-12-2004, 03:40 PM
Ver nice hack,absolutely will give it a try.By the way,I like the template of your demo http://forum.ya-right.com/ . I wonder where to download that skin. Any suggestion would be appreciated.Thannks.

defi
07-12-2004, 05:26 PM
Awesome idea; I saw your post at vbulletintemplates and fell in love with it; Definetly going to use this.

Thanks bud!

why-not
07-12-2004, 06:07 PM
I ran the SQL file and received this error:

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
CREATE TABLE forecast (id int(4) NOT NULL auto_increment

Im now stuck at stage No7

It says:

If your setup uses a table_prefix then use the script that is included to add the
prefix name to the forecast table name. To run the change.php script, place the
forecast.sql file and the change.php script in your main vbulletin directory (./)
then run the script from your browser. When it is finished it will update the
forecast.sql file to match your system settings! After this install the forecast
database into your main forum database!

Can someone explain this in English please.
Hi The Realist

To find out if your using a prefix, go to ./includes/config.php, and find the variable...

$tableprefix = '';

If this has a value, then you need to run the 'change.php' script to add the prefix!


As for your MySql Error, something is not being escaped somewhere....

Tell me the following....

1. Are you using a prefix?

2. How are you trying to install the weather table (command line, phpMyAdmin, other) ?


If you can not get the SQL file to load, create the table manual, then I will give you a script to loop the file and do the inserts that way! I have tested this SQL file, on 8 different systems Unix, Linux, Windows and Mac and I can not reproduce your error.

Note you can not load this from the VB admin panel it will not work! I will help you, but answer my questions so I can!

Zombie
07-12-2004, 06:40 PM
I checked the test site but did not see any weather conditions on the main forum page even though it's checked in the user cp

Is that a bug or just an oversite on adding it to the forum home page?

edeab220
07-12-2004, 06:52 PM
I checked the test site but did not see any weather conditions on the main forum page even though it's checked in the user cp

Is that a bug or just an oversite on adding it to the forum home page?
Yea, that too is my question.

Once that question is answered I'm gonna install. It's very cool! :).

Zombie
07-12-2004, 06:56 PM
Yea, that too is my question.

Once that question is answered I'm gonna install. It's very cool! :).
Yeah, me to

I'm using vBadvanced's weather module right now and this will be a much better replacement

PixelFx
07-12-2004, 07:07 PM
this hack looks killer :)

Boofo
07-12-2004, 07:15 PM
Yea, that too is my question.

Once that question is answered I'm gonna install. It's very cool! :).
It is in the User CP. The link is at the bottom on the left. ;)

edeab220
07-12-2004, 08:00 PM
It is in the User CP. The link is at the bottom on the left. ;)
I saw that but it gives a choice to show it on the forum home page. Where exactly does it show it?

nineball
07-12-2004, 08:21 PM
I has already added a custom field so my field numbers are different.

I changed the array and the update statement and it does update the correct field, however the location on the user cp does not display.

Is there any other place I need to change to use a field other than field9 for the location field

if ( $_REQUEST['do'] == 'weather' )
{
$new_forecast = forecast_valid ( $bbuserinfo[field19], $bbuserinfo[field20], $bbuserinfo[field21], $bbuserinfo[field22], $bbuserinfo[field23] );
$new_forecast = fetch_forecast ( $new_forecast, 1 );
$customfields = array ();
fetch_profilefields(1);
$navbits[''] = $vbphrase['weather_title'];
}

if ( $_REQUEST['do'] == 'places' )
{
if ( !empty ( $_POST['location'] ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET field23=" . addslashes( $_POST['location'] ) . " WHERE userid=$bbuserinfo[userid]" );
$GLOBALS['url'] = 'profile.php?do=weather';
eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
}
else

Merjawy
07-12-2004, 08:32 PM
Right on the demo site it won't show on form home what you selected and thats because its not keeping your selection if you notice..

maybe cuz that is a demo as he said :)

kall
07-12-2004, 09:35 PM
*nods*

The concept is excellent, but the install is a bit of a killer, mainly for those people who already have custom fields installed.

:(

I have installed it, but the Location Field is a single-line text box...with no hints as to what the code to put in it is.

gmarik
07-12-2004, 10:24 PM
Looks just fine!

MooMan65
07-12-2004, 10:52 PM
Hmm. After waiting for about half an hour on my 56k modem to apply the Database changes I get an error with the first damn query when it tried to create the forecast table:

CREATE TABLE forecast(

id int( 4 ) NOT NULL AUTO_INCREMENT ,
rid char( 2 ) default NULL ,
region varchar( 15 ) default NULL ,
cid char( 2 ) default NULL ,
country varchar( 33 ) default NULL ,
sid char( 2 ) NOT NULL default '',
state varchar( 20 ) default NULL ,
pid varchar( 5 ) NOT NULL default '',
place varchar( 120 ) default NULL ,
code varchar( 8 ) default NULL ,
PRIMARY KEY ( id ) ,
KEY forecast_rid_cid_sid_pid( rid, cid, sid, pid )
)ENGINE = MYISAM DEFAULT CHARSET = latin1

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET = latin1' at line 12

I'm pretty sure it's because my PHP version is too old, which is a shame as this isn't my server so I don't have a choice as to upgrading the version. :( But this is a great hack though! :) Thanks!

romanticyao
07-12-2004, 10:58 PM
can someone please tell me how do i install the weather table using command line? :nervous:

why-not
07-12-2004, 11:40 PM
Hmm. After waiting for about half an hour on my 56k modem to apply the Database changes I get an error with the first damn query when it tried to create the forecast table:

CREATE TABLE forecast(

id int( 4 ) NOT NULL AUTO_INCREMENT ,
rid char( 2 ) default NULL ,
region varchar( 15 ) default NULL ,
cid char( 2 ) default NULL ,
country varchar( 33 ) default NULL ,
sid char( 2 ) NOT NULL default '',
state varchar( 20 ) default NULL ,
pid varchar( 5 ) NOT NULL default '',
place varchar( 120 ) default NULL ,
code varchar( 8 ) default NULL ,
PRIMARY KEY ( id ) ,
KEY forecast_rid_cid_sid_pid( rid, cid, sid, pid )
)ENGINE = MYISAM DEFAULT CHARSET = latin1

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET = latin1' at line 12

I'm pretty sure it's because my PHP version is too old, which is a shame as this isn't my server so I don't have a choice as to upgrading the version. :( But this is a great hack though! :) Thanks!
Hi MooMan 65

Just remove that line.....

As it is the default chr/set anyways! It will cause problems with some mysql managers! Like in MyPHPAdmin, if you use browse and upload having the charset is ok, but if you try to run the create in the query text box you will get the same error you got!

change to.....


DROP TABLE IF EXISTS forecast;
CREATE TABLE forecast (
id int(4) NOT NULL auto_increment,
rid char(2) default NULL,
region varchar(15) default NULL,
cid char(2) default NULL,
country varchar(33) default NULL,
sid char(2) NOT NULL default '',
state varchar(20) default NULL,
pid varchar(5) NOT NULL default '',
place varchar(120) default NULL,
code varchar(8) default NULL,
PRIMARY KEY (id),
KEY forecast_rid_cid_sid_pid (rid,cid,sid,pid)
);



Sonia

ambrosious
07-12-2004, 11:51 PM
Question, what will happen if I install this and have already messed with the profile.php and functions_user.php while installing another hack. I'm pretty sure I've messed these around some.

Can I not add this?

why-not
07-12-2004, 11:55 PM
Yeah, me to

I'm using vBadvanced's weather module right now and this will be a much better replacement
Hi

This was done, because I want everyone to first install the core system. Adding it to any page after the core system is installed is easy! I don't know why you said the example on my demo site was not working, because it is!


Maybe someone switched it off when you were trying it!


HINT!!!!!

Look under the "WHOS ON LINE"


This will be released tomorrow, along with transparent images using (2) sizes, (1) for the CP, the other for the FORUMHOME and Members Profile page. The templates are easy to make, so you can design any type of display you want, using 60 different forecast array values! I will include 2 templates based on the USERCP template, which is CSS controled, so making it look the way you want is as easy as creating (2) images (gradients) and changing the colors you want to use!


Sonia

why-not
07-12-2004, 11:59 PM
Question, what will happen if I install this and have already messed with the profile.php and functions_user.php while installing another hack. I'm pretty sure I've messed these around some.

Can I not add this?
Hi


If you tell what you installed, better yet give your 'profile.php, functions_user.php', and I can write a work around for whatever you have installed that might get in the way of this system!


Sonia

MooMan65
07-13-2004, 12:03 AM
Thanks Sonia I got it working now, well, I think so. I already had existing custom profile fields like a number of people here so it's not working correctly at the moment. Where abouts would I need to edit in the files so I can change the profile field ids manually?

romanticyao
07-13-2004, 12:05 AM
hi can you please show me how to install the .sql file? i tried with phpmyadmin but the filesize was too big. so if you could show me how to do it with command line would be great, thank you in advance

why-not
07-13-2004, 12:07 AM
*nods*

The concept is excellent, but the install is a bit of a killer, mainly for those people who already have custom fields installed.

:(

I have installed it, but the Location Field is a single-line text box...with no hints as to what the code to put in it is.
Hi

If you already have custom fields installed, this is not a problem! You just have to update the array that validates the custom fields for the weather system. I am writing a very simple 'HOW TO' with images that show you how to do this! Once the system is installed this takes less than 30 seconds to fix or change if you add more fields later!


Sonia

ambrosious
07-13-2004, 12:20 AM
Hi


If you tell what you installed, better yet give your 'profile.php, functions_user.php', and I can write a work around for whatever you have installed that might get in the way of this system!


Sonia
Will do shortly! Thanks!

kall
07-13-2004, 12:21 AM
Hi

If you already have custom fields installed, this is not a problem! You just have to update the array that validates the custom fields for the weather system. I am writing a very simple 'HOW TO' with images that show you how to do this! Once the system is installed this takes less than 30 seconds to fix or change if you add more fields later!


Sonia
Yep. Worked that out for myself.

That's the array in profile.php , yes?

It did nothing to fix the 'lack of a button to press to choose the location' problem tho.

Now I am getting: Warning: file_get_contents(forecast.php?wid=4416&lid=66235): failed to open stream: No such file or directory in /public_html/forums/includes/functions_weather.php on line 184

... when I add a valid number manually into the text box.

why-not
07-13-2004, 12:28 AM
hi can you please show me how to install the .sql file? i tried with phpmyadmin but the filesize was too big. so if you could show me how to do it with command line would be great, thank you in advance
Hi romanticyao

If your having a hard time installing the DB because it is to big, install it in parts!


Download this file....

http://www.ya-right.com/sql.zip


unzip it, then install every file starting at (1) to (8), make sure you install it in order 1, 2, 3, 4, 5, 6, 7, 8 this is very important!

I have installed this on 7 boards today already, and I am working on 3 right now. (3) of those had the same trouble, so spliting the INSERT up seems to have worked for me, I hope it will for you!


Sonia

romanticyao
07-13-2004, 12:32 AM
great! thanx! I'll do it now

MooMan65
07-13-2004, 12:40 AM
Yeah, I've found also that the only mentioning of the profile field ids are in the profile.php file mod you do. I don't have the problem with the Select button not appearing, instead even after I pick and Region and Location etc. it doesn't display it in 'Current Location:' afterward. That's no doubt due to the Profile Field IDs being inconsistant, but adjusting the profile ids in the profile.php mod above still doesn't solve this. :( I'm sure there's something I'm missing. :p

kall
07-13-2004, 12:46 AM
Yeah, I've found also that the only mentioning of the profile field ids are in the profile.php file mod you do. I don't have the problem with the Select button not appearing, instead even after I pick and Region and Location etc. it doesn't display it in 'Current Location:' afterward. That's no doubt due to the Profile Field IDs being inconsistant, but adjusting the profile ids in the profile.php mod above still doesn't solve this. :( I'm sure there's something I'm missing. :p
*grins* I was missing something...my brain.

Missed the 'make field private' instruction on the last field.

Still getting the Warning: file_get_contents(forecast.php?wid=4416&lid=66235): failed to open stream: No such file or directory error tho.

Any thoughts on this?

why-not
07-13-2004, 12:48 AM
Yeah, I've found also that the only mentioning of the profile field ids are in the profile.php file mod you do. I don't have the problem with the Select button not appearing, instead even after I pick and Region and Location etc. it doesn't display it in 'Current Location:' afterward. That's no doubt due to the Profile Field IDs being inconsistant, but adjusting the profile ids in the profile.php mod above still doesn't solve this. :( I'm sure there's something I'm missing. :p
Hi


can you give a screen shot of your admin panel userprofile fields manager and also send me your (2) files profile.php, functions_user.php....

Send to Fataqui@ya-right.com

I will look them over real quick and tell you what you must do!

Also if I could access your board to see what is happening it would help me help you much better!

Sonia

why-not
07-13-2004, 12:51 AM
*grins* I was missing something...my brain.

Missed the 'make field private' instruction on the last field.

Still getting the Warning: file_get_contents(forecast.php?wid=4416&lid=66235): failed to open stream: No such file or directory error tho.

Any thoughts on this?
Hi

I thought about this so many dam times, I should of wrote a simple test to see where php was placing the url, but I did not, give me a second to write a quick one liner to fix this!


Sonia

kall
07-13-2004, 12:55 AM
*waits patiently*

This has the potential to be really cool. :)

Am now trying to work out how the 'location' type info could be integrated with the much-vaunted "Display your users' locations on a world map" mod...

why-not
07-13-2004, 01:14 AM
*waits patiently*

This has the potential to be really cool. :)

Am now trying to work out how the 'location' type info could be integrated with the much-vaunted "Display your users' locations on a world map" mod...
Hi


Go to ./includes/

And open functions_weather.php


Search for.....


function fetch_new_weather ( $in )



Below that, does your code look like this.....



global $vbphrase, $vboptions;
$data = array ();
$soap_server = $vboptions['homeurl'] . '/forecast.php?wid=' . $in . '&lid=' . WEATHER_ID;


Just tell me that.... (does it look the same as I just posted?

Sonia

ambrosious
07-13-2004, 01:16 AM
Did you want the php file, or just the text from it?

kall
07-13-2004, 01:23 AM
Nope.

It looks like

function fetch_new_weather ( $in )
{
global $vbphrase;

$data = array ();
$soap_server = 'forecast.php?wid=' . $in . '&lid=' . WEATHER_ID;
$out = explode ( '-ss-', file_get_contents ( $soap_server ) );

if ( !strstr ( $out[0], 'ok' ) )
{
return ( $data );
}

return ( unserialize ( $out[1] ) );
}


**edit**

WOOHOO! Got it working! (used 'bburl' as the other one is my homepage.)

There's also a 'cannot find lang_en.php' error in there after it finds forecast.php

ChuanSE
07-13-2004, 01:37 AM
Pfff, i really really having a hard time with importing this db

a request: PLZ make phpmyadmin compliant sql with limit to 2mb, al what goes higher is /dev/null

i tried with mysqlimport on shell comand line, but that gave me like 300.000 warnings and all tables with data "NULL"

also, with taking away the latin 1 line, the table isn't myIsam either :p

kall
07-13-2004, 01:56 AM
Pfff, i really really having a hard time with importing this db

a request: PLZ make phpmyadmin compliant sql with limit to 2mb, al what goes higher is /dev/null

i tried with mysqlimport on shell comand line, but that gave me like 300.000 warnings and all tables with data "NULL"

also, with taking away the latin 1 line, the table isn't myIsam either :p
You don't want to take away the whole line... just the part about default charset...

And, there's a split up zip file somewhere here, each one is about 5000 instructions. They phpmyadmin up really well.

???`S?LV?R???`
07-13-2004, 04:13 AM
:) nice one..

ChuanSE
07-13-2004, 04:54 AM
You don't want to take away the whole line... just the part about default charset...

And, there's a split up zip file somewhere here, each one is about 5000 instructions. They phpmyadmin up really well.

Hmm, I entered them manually but when i created the table, i did took away the whole line, so my table isn't MyIsam :/ anyway to correct it without dropping the table?

The forcast system works but it doesn't save the selected options & location, and so i have no forecast displayed. Is that due to the rease of the myisam line?

why-not
07-13-2004, 05:29 AM
Hmm, I entered them manually but when i created the table, i did took away the whole line, so my table isn't MyIsam :/ anyway to correct it without dropping the table?

The forcast system works but it doesn't save the selected options & location, and so i have no forecast displayed. Is that due to the rease of the myisam line?
Hi

I checked your forum, you have everything right but two things.... (it not the MyIsam, it script and path related)

Send me an email, and I will send you the the scripts you need to fix!

In the email put your URL (http://community.digitainment.org) to your forum so I know which one I am working on!



Sonia

ChuanSE
07-13-2004, 05:45 AM
oki, i sent it allready ;)

Thx

Bryan Ex
07-13-2004, 06:33 AM
Just a quick question on this.... it seems the list of locations is mostly in alphabetical order but not entirely. Is there a way to correct the sort order at all?

Btw... thanks very much for this! It's exactly what I was after.

Marulatree
07-13-2004, 06:47 AM
Does this work with VB 3.0.3?

MooMan65
07-13-2004, 07:10 AM
Sonia, I can't seem to email anything to that address without it getting bounced back so I'll attach the package here.

Unfortunatly I can't give you access to the forum I'm hacking as I don't own the license or the server. I'm managing the forums for someone else. But hopefully that package is enough. Thanks!

ChuanSE
07-13-2004, 08:09 AM
Sonia, I can't seem to email anything to that address without it getting bounced back so I'll attach the package here.

Unfortunatly I can't give you access to the forum I'm hacking as I don't own the license or the server. I'm managing the forums for someone else. But hopefully that package is enough. Thanks!

Hacking the board??:ninja:

The Realist
07-13-2004, 08:40 AM
Hi M8,
Sorry for the delay reply, here are my answers.

1) Are you using a prefix?
A: No it says in config $tableprefix = '';

2) How are you trying to install the weather table (command line, phpMyAdmin, other) ?
A: Tried Phpmyadmin and it times out and from Vbulletins own php installer panel.

Regards,

Brian

PS.

Just tried again running the SQL in phpmyadmin and I received this error:

Fatal error: Maximum execution time of 300 seconds exceeded in /usr/local/cpanel/base/3rdparty/phpMyAdmin/libraries/read_dump.lib.php on line 77

Line 77 says: $sql = ltrim(substr($sql, min($i + 1, $sql_len)));

Laters


Hi The Realist

To find out if your using a prefix, go to ./includes/config.php, and find the variable...

$tableprefix = '';

If this has a value, then you need to run the 'change.php' script to add the prefix!


As for your MySql Error, something is not being escaped somewhere....

Tell me the following....

1. Are you using a prefix?

2. How are you trying to install the weather table (command line, phpMyAdmin, other) ?


If you can not get the SQL file to load, create the table manual, then I will give you a script to loop the file and do the inserts that way! I have tested this SQL file, on 8 different systems Unix, Linux, Windows and Mac and I can not reproduce your error.

Note you can not load this from the VB admin panel it will not work! I will help you, but answer my questions so I can!

Bryan Ex
07-13-2004, 10:32 AM
Yeah, I've found also that the only mentioning of the profile field ids are in the profile.php file mod you do. I don't have the problem with the Select button not appearing, instead even after I pick and Region and Location etc. it doesn't display it in 'Current Location:' afterward. That's no doubt due to the Profile Field IDs being inconsistant, but adjusting the profile ids in the profile.php mod above still doesn't solve this.
I have this exact same problem and have spent most of the night trying to figure it out without luck. I have custom profile fields but have adjusted the array in profile.php, the final field is set to private, yet the location and forecast both remain blank (it is being written to the database if I change it).

why-not
07-13-2004, 06:26 PM
Just a quick question on this.... it seems the list of locations is mostly in alphabetical order but not entirely. Is there a way to correct the sort order at all?

Btw... thanks very much for this! It's exactly what I was after.
Hi

Yes you can fix this, give a few seconds and I will post the code!


Sonia

why-not
07-13-2004, 06:28 PM
Sonia, I can't seem to email anything to that address without it getting bounced back so I'll attach the package here.

Unfortunatly I can't give you access to the forum I'm hacking as I don't own the license or the server. I'm managing the forums for someone else. But hopefully that package is enough. Thanks!
Hi MooMan65

Edit your post, I got the file, I will post you a new file very shortly!

Sonia

ImportPassion
07-13-2004, 08:10 PM
ur demo is giving a 404

MooMan65
07-13-2004, 11:33 PM
Thank you! Hopefully this will fix it all. :)

EDIT: Holy crap! I got it working! Woo! The profile.php changes is all you need to do in the end I believe. Because the Field9 (that by default is the Region) is instead my Temperature Format selection. So after selecting a region which didn't seem to work I noticed that I didn't have either Radio button checked for the Temperature. It was probably confusing the two fields still so I selected an option there and voila! The same process should fix it for the other options. I asked another member to set it up from that point on and he had no problems, so it seems it's all ready now.

Oh Sonia, have you even done anything with relation to the 'display current weather on forumhome' option? As I don't see any instructions relating to it. But thx for the great hack! And the support you're giving. :)

momzone
07-14-2004, 02:45 AM
this is a great hack! Thanks Sonia - you rock :-)

Bryan Ex
07-14-2004, 02:49 AM
Oh Sonia, have you even done anything with relation to the 'display current weather on forumhome' option? As I don't see any instructions relating to it. But thx for the great hack! And the support you're giving. :)
Yeah! What he said ^ !! It's now working for me as well even with custom fields already in use but as mentioned above there were no template edits for Forum Home and it does not appear on the index page. Everything else is fine that I've seen so far. :nervous:

Bryan Ex
07-14-2004, 03:01 AM
Sort order for the list of locations could use a little adjustment so they are listed by name rather than ID... many are out of place making it very difficult to find some locations.

Bryan Ex
07-14-2004, 04:47 AM
An easy addition to include Sonia's weather hack in the Who's Online module;

Open includes/functions_online.php and find;
case 'manageattachment':
$userinfo['action'] = $vbphrase['managing_attachments'];
break;

Directly after it add;
case 'weather':
$userinfo['action'] = 'Viewing Weather Forecast';
$userinfo['where'] = "<a href=\"profile.php?$session[sessionurl]do=weather\">Weather Forecast</a>";
break;

Then find;
else if ($values['do'] == 'editattachments')
{
$userinfo['activity'] = 'attachments';
}

Directly after it add;
else if ($values['do'] == 'weather' OR $values['do'] == 'places' OR $values['do'] == 'forecast')
{
$userinfo['activity'] = 'weather';
}

Save and upload... that's it.

deathemperor
07-14-2004, 06:00 AM
why-not, is it just me or your demo link is dead ?

ChuanSE
07-14-2004, 06:07 AM
Sonia, thx dear ;)

Works great :D

Awaiting the cron update ;)

Bryan Ex
07-14-2004, 06:15 AM
One more item... the style sheet isn't being used on my install for some reason. The link was added after the HEAD tag in usercp_shell (I've double checked it) and I've also checked that both the style sheet and all images have been properly uploaded.

ChuanSE
07-14-2004, 06:23 AM
you didn't tampered the code, cause it works fine for me?

Bryan Ex
07-14-2004, 06:27 AM
Alrighty ... I've upgraded from the earlier version so I guess I'll work through all the edits again then.

ChuanSE
07-14-2004, 06:33 AM
Let us know what it says mate ;)

NuclioN
07-14-2004, 07:18 AM
The sql split up (zip) link is dead :( http://www.ya-right.com/sql.zip

Bryan Ex
07-14-2004, 08:02 AM
Let us know what it says mate ;)
I don't know why but I had to use the full URL path to the style sheet... but it now works. ;)

NuclioN
07-14-2004, 09:03 AM
What does this user profilefield do?

// title <- you can change this
Forum Display

//description <- you can change this
Show your current conditions on the forum home page...

Is a sort of weatherdisplay visible somewhere on the forumhomepage?

romanticyao
07-14-2004, 12:15 PM
sorry could you put the sql zip file link up again, thank you in advance.

Ted S
07-14-2004, 04:55 PM
Ive got the hack installed properly after a little fidgeting (for some reason the change to user_shell template didnt stick). But for some reason when i go through the set forcast location process nothing sets and I dont get any errors. What could be wrong that would cause the value not to stay set?

Update: I modified profile.php as per other peoples instructions to use the field IDs for my actual weather fields (I have several custom fields in the system already). Everything is working great and this hack is truly amazing... for the time being I am linking users to it from the forumhomepage, a little plugin for forumhome would be great but after getting this well done of a hack for free I am not expecting more. Thank you!

Bryan Ex
07-14-2004, 05:23 PM
Is a sort of weatherdisplay visible somewhere on the forumhomepage?
It's supposed to add another row to the Who's Online block at the bottom of the index page but that part of the hack seems to have been omitted so far.

Bryan Ex
07-14-2004, 05:25 PM
Update: I modified profile.php as per other peoples instructions to use the field IDs for my actual weather fields (I have several custom fields in the system already).
I was just about to ask that... LOL

Zombie
07-14-2004, 08:17 PM
What does this user profilefield do?

// title <- you can change this
Forum Display

//description <- you can change this
Show your current conditions on the forum home page...

Is a sort of weatherdisplay visible somewhere on the forumhomepage?
I'd like to know how to get it to display on the main forum page also

orca
07-14-2004, 08:25 PM
Just a quick question on this.... it seems the list of locations is mostly in alphabetical order but not entirely. Is there a way to correct the sort order at all?

Btw... thanks very much for this! It's exactly what I was after.
Where did you get this dropdown? I only have a textbox to enter the number for the location

Zombie
07-14-2004, 08:43 PM
Where did you get this dropdown? I only have a textbox to enter the number for the location Make sure your Private Field is set to yes

Bryan Ex
07-14-2004, 08:57 PM
Exactly... I think it's labelled something like "Field Hidden on Profile?" instead of "Private" but same difference. Set it to yes for the location field.

Zombie
07-14-2004, 09:03 PM
Exactly... I think it's labelled something like "Field Hidden on Profile?" instead of "Private" but same difference. Set it to yes for the location field. This is what mine looks like, not sure about yours though

ChuanSE
07-14-2004, 10:02 PM
Note to Sonia:

Maybe you should give directives to enter that cron task in de admincp scheduled tasks :D

why-not
07-14-2004, 11:28 PM
Note to Sonia:

Maybe you should give directives to enter that cron task in de admincp scheduled tasks :D
Hi ChaunSe

Yes I have added that to the release tomorrow, all done!


C, Ya...

Sonia

NuclioN
07-15-2004, 12:18 AM
The display on forumhome looks awesome :) Do we have to re-install or will there be an upgrade?

why-not
07-15-2004, 12:57 AM
The display on forumhome looks awesome :) Do we have to re-install or will there be an upgrade?
Just a upgade, if you want, I will put (2) files out, (1) will be for people using this method.....


$new_forecast = forecast_valid($bbuserinfo[field5],$bbuserinfo[field6],$bbuserinfo[field7],$bbuserinfo[field8],$bbuserinfo[field9]);
$new_forecast = fetch_forecast($new_forecast, 1);


And the other using the new faster method ( it does not use VB code to validate or fetch inputs, because VB fetches all the inputs, even if your not using them)...


$w_fields = array ( '16', '20' );
$new_forecast = fetch_w_fields ( $w_fields );
$new_forecast = fetch_forecast ( $new_forecast, 3 );



1. Plus fixed the sort that was messed up the locations select box!

Also have almost 4,000 more locations for Western Europe, Canada and South America. I am going through each one now many times weather.com sends me an update and many don't work! I 've tested 732 so far and 17 are no good, 12 don't work, and 5 point to the wrong location, someone was sleeping when they wrote them STWS files!


C, ya...

Sonia

Erwin
07-15-2004, 03:23 AM
Looking forward to the latest update. :)

The Realist
07-15-2004, 02:02 PM
Managed to get the database installed and continued the install. Problem I now have is when I click weather in the userCP it goes to a blank white page.

Any udeas?

why-not
07-15-2004, 03:01 PM
Managed to get the database installed and continued the install. Problem I now have is when I click weather in the userCP it goes to a blank white page.

Any udeas?
Hi


Tell me these 3 things....

Question 1. What is the options (#) for the weather system that you used in ./admincp/profilefield.php

example.... (mine is #9)

edit (1) in profilefield.php


print_select_row($vbphrase['which_page_displays_option'], 'profilefield[form]', array(
$vbphrase['edit_profile'],
"$vbphrase[options]: $vbphrase[log_in] / $vbphrase[privacy]",
"$vbphrase[options]: $vbphrase[messaging] / $vbphrase[notification]",
"$vbphrase[options]: $vbphrase[thread_viewing]",
"$vbphrase[options]: $vbphrase[date] / $vbphrase[time]",
"$vbphrase[options]: $vbphrase[other]",
"$vbphrase[options]: $vbphrase[translate]",
"$vbphrase[options]: $vbphrase[ecards]",
"$vbphrase[options]: $vbphrase[webmail]",
"$vbphrase[options]: $vbphrase[weather]"
), $profilefield['form']);



edit (2) in profilefield.php


$forms = array(
0 => $vbphrase['edit_profile'],
1 => "$vbphrase[options]: $vbphrase[log_in] / $vbphrase[privacy]",
2 => "$vbphrase[options]: $vbphrase[messaging] / $vbphrase[notification]",
3 => "$vbphrase[options]: $vbphrase[thread_viewing]",
4 => "$vbphrase[options]: $vbphrase[date] / $vbphrase[time]",
5 => "$vbphrase[options]: $vbphrase[other]",
6 => "$vbphrase[options]: $vbphrase[translate]",
7 => "$vbphrase[options]: $vbphrase[ecards]",
8 => "$vbphrase[options]: $vbphrase[webmail]",
9 => "$vbphrase[options]: $vbphrase[weather]",
);


Question 2. what are the field (#) numbers for the weather system?

!! Mine are field41 to field45, what are yours!

Hint: you can find the answer to question 2 in the profile fields manager AdminCP

3. give me acess to your board, so I can see the usercp or tell me the answer to questions (1 and 2) and post in a zip file (profile.php, functions_user.php and ( index.php <- to add the code for the forum disply!) so I can fix them for you!

I'll check back in a little bit for the files and your reply!


Sonia

The Realist
07-15-2004, 03:20 PM
Hi,
Answers:

1) 9
2) 7,8,9,10 and 11
3) Zip attached with Profile.php & functions_user.php (What index do you need)

Regards

why-not
07-15-2004, 03:43 PM
Hi,
Answers:

1) 9
2) 7,8,9,10 and 11
3) Zip attached with Profile.php & functions_user.php (What index do you need)


Regards
Hi

delete that zip, I got the files, I need the index.php, in the main VB ./ directory...


Give a a few mins, I'll have this done!

Sonia

The Realist
07-15-2004, 03:49 PM
1st zip deleted.

Here is the 2nd one with the index file.

why-not
07-15-2004, 04:19 PM
Hi

delete that zip, I got the files, I need the index.php, in the main VB ./ directory...


Give a a few mins, I'll have this done!

Sonia
Hi I am typing as fast as I can, almost done!

Sonia

The Realist
07-15-2004, 04:21 PM
Im willing to wait - I deleted the index zip, I presume you have downloaded it.



Hi I am typing as fast as I can, almost done!

Sonia

Bryan Ex
07-15-2004, 04:24 PM
Commendable support Sonia. ;) If you have the template for forum home completed that's what several of us are likely waiting on next.

The Realist
07-15-2004, 04:27 PM
Commendable support indeed and a big thanks from me Sonia.

Commendable support Sonia. ;) If you have the template for forum home completed that's what several of us are likely waiting on next.

why-not
07-15-2004, 04:42 PM
Hi


Download this file.....

http://24.60.6.48/errors/files.zip


Then as soon as I login into the other server (while your waiting do the install of the files and templates, any questions I will wait!

download this file..... (ready now)

http://www.ya-right.com/temp/img_css.zip



Sonia

The Realist
07-15-2004, 04:48 PM
Files.zip downloaded.

Installing files now.

Be back ASAP.

why-not
07-15-2004, 04:49 PM
Hi


Download this file.....

http://24.60.6.48/errors/files.zip


Then as soon as I login into the other server (while your waiting do the install of the files and templates, any questions I will wait!

download this file..... (not ready yet)

http://www.ya-right.com/temp/img_css.zip



Sonia
Hi

The file is there now!~

I included the (2) files I forgot in the other file, this will not work for others, so don't pass it to others.

Tell me how it goes!

The Realist
07-15-2004, 04:59 PM
Cant download the img_css.zip says no file on server?



Hi


Download this file.....

http://24.60.6.48/errors/xxxxx.zip


Then as soon as I login into the other server (while your waiting do the install of the files and templates, any questions I will wait!

download this file..... (ready now)

http://www.ya-right.com/temp/xxxxxxx.zip



Sonia

why-not
07-15-2004, 05:01 PM
Cant download the img_css.zip says no file on server?
Hi

Ok now, sorry forgot to change permissions...

Sonia

The Realist
07-15-2004, 05:01 PM
CSS file received

The Realist
07-15-2004, 05:10 PM
Nope - still does not work :(

Are you on MSN, ICQ etc.

We can chat there.

why-not
07-15-2004, 05:17 PM
Nope - still does not work :(

Are you on MSN, ICQ etc.

We can chat there.
Hi

I am not on a computer that has ICQ or MSN! It is hard for to know what is wrong without seeing the USERCP, I know it something simple, I just can not guess! Let try to install MSN, as I think they don't want me installing ICQ, be back in a second!


Sonia

why-not
07-15-2004, 05:25 PM
Hi

msn

fataqui@ya-right.com

Sonia

The Realist
07-15-2004, 08:06 PM
Well I owe Sonia a big thanks indeed. She worked her little a$$ off and solved all my problems and now the weather addition is in 100% fully working order.

Thanks Sonia a big thanks from me.

Brian

why-not
07-16-2004, 12:50 AM
Update to display forum home view (Jul 15, 9:47 PM EDT)


This is the update for the forum home weather view....

This can be done many ways but I think I will only do it one way, so that this final update that will support the AdminCP addon that I will release to control the weather system....

Lets begin.....

(1)

Go to Languages & Phrases >> Phrase Manager

In the Phrase Type selectbox, select 'Posting'

When it changes, select pages '9/10'

in the list below you should see 'weather_none'

Delete it!!!!

When the page reloads, click the button 'Add New Phrase'

Make sure you are still in 'Posting'

Then add the new phrase below...



Phrase Type: Posting

Varname: weather_none_one

value....

copy below this line....
<span align="center">--<font color="ff0000"> NO FORECAST SELECTED </font>--
<br />
<br />
Use the Forecast Options below to configure your weather display
<br />
<br />
--<font color="ff0000"> NO FORECAST SELECTED </font>--</span>
copy above this line....



Click 'Save'

When the page reloads, , click the button 'Add New Phrase'

When that page loads, change the Phrase Type to 'GLOBAL' in the selectbox

Then add the new phrase below...



Phrase Type: GLOBAL

Varname: weather_none_two

value....

copy below this line....
<span class="smallfont"><font color="ff0000">--</font> no forecast location has been configured, click the weather icon to the left to select one <font color="ff0000">--</font></span>
copy above this line....



No go to 'Styles & Templates' >> Search in templates >> search for 'FORUMHOME'

open 'FORUMHOME'

Then find the following....


<head>


right below that add....

// change the url to the url you are using


<if condition="$show['forecast']"><if condition="$forecast_home['location']!='0'">
<link rel="stylesheet" type="text/css" href="/forecast/css/main.css" />
</if></if>



Now go almost to the bottom of 'FORUMHOME'

Find what is below....


</table>
<br />
<!-- end what's going on box -->



Right above the '</table>' add what is below...


<!-- the weather condition -->
<if condition="$show['forecast']"><if condition="$forecast_home['location']!='0'">$forecast_home[data]<else /><tbody>
<tr>
<td class="thead" colspan="2"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_weather')"><img id="collapseimg_forumhome_weather" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_weather].gif" alt="" border="0" /></a>$vbphrase[local_weather]</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_weather" style="$vbcollapse[collapseobj_forumhome_weather]">
<tr>
<td class="alt2"><a href="profile.php?$session[sessionurl]do=weather"><img border='0' src='$stylevar[imgdir_misc]/weather.gif' alt='$vbphrase[local_weather]' /></a></td>
<td class="alt1" width="100%" align="center"><div class="smallfont" align="center">$forecast_home[data]</div></td>
</tr>
</tbody></if></if>
<!-- / the weather condition -->



Save...

Now go back to Styles & Templates >> Styles Manager

Use the selectbox, for the style you are adding the weather system to....

Scroll UP >> select >> Add New Template

Then add the following template....



Title = current_weather_two

template value.....

copy what is below this line...
<tbody>
<tr>
<td class="thead" colspan="2"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_weather')"><img id="collapseimg_forumhome_weather" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_weather].gif" alt="" border="0" /></a>$tpl[location_header]$tpl[location]</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_weather" style="$vbcollapse[collapseobj_forumhome_weather]">
<tr>
<td class="wic"><div><a href="profile.php?$session[sessionurl]do=weather"><img border='0' src='$tpl[current_icon]' title="$tpl[current_text]" alt='' /></a></div><div class='smallfont'>$tpl[current_temp]</div></td>
<td class="wic">
<table border="0" cellpadding="1" width="100%">
<tr>
<td class="ihs">$tpl[time_text]</td><td width='4'></td>
<td class="ihs">$tpl[humd_header]</td><td width='4'></td>
<td class='ihs'>$tpl[vis_header]</td><td width='4'></td>
<td class='ihs'>$tpl[ultra_header]</td><td width='4'></td>
<td class='ihs'>$tpl[baro_header]</td><td width='4'></td>
<td class='ihs'>$tpl[direct_header] ($tpl[direct_type])</td>
</tr>
<tr>
<td class="smallfont">$tpl[local_time]</td><td width='4'></td>
<td class="smallfont">$tpl[current_humd]</td><td width='4'></td>
<td class='smallfont'>$tpl[current_vis]</td><td width='4'></td>
<td class='smallfont'>$tpl[current_ultra]</td><td width='4'></td>
<td class='smallfont'>$tpl[current_baro] <span><img border='0' src='$tpl[icon_baro]' alt='' /></span></td><td width='4'></td>
<td class='smallfont'>$tpl[current_direct]</td>
</tr>
</table>
</td>
</tr>
</tbody>

copy what is above this line...



Before you do the next thing....

Find out the following.....



(1) What is the starting 'field#' for the weather system
(2) What is the ending 'field#' for the weather system

If you fields are....

field11, field12, field13, field14, field15

Then your starting field# is -> 11
And your ending field# is -> 15

(3) find out what option (#) is option : weather in profilefield.php

To do this >> Go To >> left nav >> User Profile Fields >> 'add new profile field'

just click 'continue'........

When the page loads..... >> 'View Page Source'

Look for......

<select name="profilefield[form]" id="sel_profilefield[form]" tabindex="1" class="bginput">

Below the above select name you will see 'Options : Weather'

<option value="?">Options: weather</option>


You want the value where the '?' is....



After you have these values copy them to notepad or whatever your system has

// field_start = 11 <- this an example, yours may be different!
// field _end = 15 <- this an example, yours may be different!
// option_id = 6 <- this an example, yours may be different!


Now open ./profile.php

find this....


'places' => array(
'weather_new',
),



replace with....


'places' => array(
'places_display',
),



find this... (the old weather block)


if (!($permissions['genericpermissions'] & CANMODIFYPROFILE))
{
print_no_permission();
}

// ####### weather forecast and the forecast options ######

if ( $_REQUEST['do'] == 'weather' || $_REQUEST['do'] == 'places' )
{
define ( 'DO_WEATHER', 1 );
construct_usercp_nav ( $_REQUEST['do'] );
$templatename = $_REQUEST['do'] . '_display';
$shelltemplatename = 'USERCP_SHELL';
include_once ( './includes/functions_weather.php' );
}

if ( $_REQUEST['do'] == 'weather' )
{
$new_forecast = forecast_valid ( $bbuserinfo[field5], $bbuserinfo[field6], $bbuserinfo[field7], $bbuserinfo[field8], $bbuserinfo[field9] );
$new_forecast = fetch_forecast ( $new_forecast, 1 );
$customfields = array ();
fetch_profilefields(1);
$navbits[''] = $vbphrase['weather_title'];
}

if ( $_REQUEST['do'] == 'places' )
{
if ( !empty ( $_POST['location'] ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET field9=" . addslashes( $_POST['location'] ) . " WHERE userid=$bbuserinfo[userid]" );
$GLOBALS['url'] = 'profile.php?do=weather';
eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
}
else
{
$tpl = places_validate ();
$navbits[''] = $tpl['page_title'];
}
}

if ( $_POST['do'] == 'forecast' )
{
$forecast_fields = verify_profilefields ( 6 );

if ( !empty ( $forecast_fields ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET userid=$bbuserinfo[userid]$forecast_fields WHERE userid=$bbuserinfo[userid]" );
}

eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
}



replace with....


if (!($permissions['genericpermissions'] & CANMODIFYPROFILE))
{
print_no_permission();
}

// ####### weather forecast and the forecast options ######

if ( $_REQUEST['do'] == 'weather' || $_REQUEST['do'] == 'places' )
{
define ( 'DO_WEATHER', 1 );
// special tags you need to change ( 2 -> field_start, field_end )
$w_fields = array ( 'field_start', 'field_end' );
construct_usercp_nav ( $_REQUEST['do'] );
$templatename = $_REQUEST['do'] . '_display';
$shelltemplatename = 'USERCP_SHELL';
include_once ( './includes/functions_weather.php' );
}

if ( $_REQUEST['do'] == 'weather' )
{
$new_forecast = forecast_valid ( $w_fields );
$new_forecast = fetch_forecast ( $new_forecast, 1 );
$customfields = array ();
// special tag you need to change ( 1 -> option_id )
fetch_profilefields ( option_id );
$navbits[''] = $vbphrase['weather_title'];
}

if ( $_REQUEST['do'] == 'places' )
{
if ( !empty ( $_POST['location'] ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET field" . $w_fields[1] . " = '" . addslashes( $_POST['location'] ) . "' WHERE userid = '" . $bbuserinfo['userid'] . "'" );
$GLOBALS['url'] = WEATHER_URL . 'profile.php?' . $session['sessionurl'] . 'do=weather';
eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
}
else
{
$tpl = places_validate ();
$navbits[''] = $tpl['page_title'];
}
}

if ( $_POST['do'] == 'forecast' )
{
// special tag you need to change ( 1 -> option_id )
$forecast_fields = verify_profilefields ( option_id );

if ( !empty ( $forecast_fields ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET userid=" . $bbuserinfo['userid'] . $forecast_fields . " WHERE userid = '" . $bbuserinfo['userid'] . "'" );
}

eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
}



Now in the code you just replaced, find the following special tags and replace them with the values I told you to save right before you opened'profile.php'!



(1) field_start, occurs (1) time

change 'field_start', to the (#) that is the value for field_start!

(2) field_end, occurs (1) time

change 'field_end', to the (#) that is the value for field_end!

(3) option_id, occurs (2) time

change 'option_id, to the (#) that is the value for option_id!



Using my example values I would change the following lines in the replaced code above!



// my example values....

// field_start = 11 <- this an example, yours may be different!
// field _end = 15 <- this an example, yours may be different!
// option_id = 6 <- this an example, yours may be different!


// special tags you need to change ( 2 -> field_start, field_end )
$w_fields = array ( 'field_start', 'field_end' );

// after changing the above (occurs 1 time in the replace code)
$w_fields = array ( '11', '15' );

// special tag you need to change ( 1 -> option_id )
$forecast_fields = verify_profilefields ( option_id );

// after changing the above (occurs 2 time in the replace code)
$forecast_fields = verify_profilefields ( 6 );


after save and close profile.php!


open ./index.php

find the following.....


// ### WELCOME MESSAGE #################################################
if ($bbuserinfo['userid'])
{ // registered user
$showmemberwelcome = true;
}
else
{ // guest
$showmemberwelcome = false;
}



replace with.....


// ### WELCOME MESSAGE #################################################
if ($bbuserinfo['userid'])
{
$showmemberwelcome = true;
// special tags you need to change ( 2 -> field_start, field_end )
$w_fields = array ( 'field_start', 'field_end' );
$w_m = 'field' . ( $w_fields[1] - 1 );

if ( strpos ( $bbuserinfo[$w_m], 'always' ) )
{
$show['forecast'] = true;

define ( 'DO_WEATHER', 1 );

include_once ( './includes/functions_weather.php' );

$forecast_home = forecast_valid ( $w_fields );

if ( !empty ( $forecast_home ) )
{
$forecast_home = fetch_forecast ( $forecast_home, 2 );
}
}
}
else
{
$showmemberwelcome = false;
$show['forecast'] = false;
}




There are (2) special tags in the replace code above, be sure to change them just like you did before!

These are the tags you need to replace in the replace code above.....


// special tags you need to change ( 2 -> field_start, field_end )
$w_fields = array ( 'field_start', 'field_end' );

// after changing the above (occurs 1 time in the replace code)
$w_fields = array ( '11', '15' );


After save changes to ./index.php and close it!

Open....

./includes/functions_user.php

find the following code!


function fetch_profilefields($formtype = 0) // 0 indicates a profile field, 1 indicates an option field
{

global $DB_site, $vboptions, $stylevar, $customfields, $bgclass;
global $vbphrase, $altbgclass, $bgclass1, $tempclass, $bbuserinfo;

// get extra profile fields
$profilefields = $DB_site->query("
SELECT * FROM " . TABLE_PREFIX . "profilefield
WHERE editable = 1
AND form " . iif($formtype, '>= 1', '= 0'). "
ORDER BY displayorder
");


replace with.....


function fetch_profilefields($formtype = 0) // 0 indicates a profile field, 1 indicates an option field
{

global $DB_site, $vboptions, $stylevar, $customfields, $bgclass;
global $vbphrase, $altbgclass, $bgclass1, $tempclass, $bbuserinfo, $new_forecast;

// get extra profile fields
$profilefields = $DB_site->query ( "SELECT * FROM " . TABLE_PREFIX . "profilefield WHERE editable = '1' AND form " . ( $formtype == option_id ? "= '" . $formtype . "'" : ( $formtype ? ">= '" . $formtype . "'" : "= '0'" ) ) . " ORDER BY displayorder" );


There is (1) special tag in the replace code above! You need to change it to the value of 'option_id'

using my example.....


// special tag you need to change ( 1 -> option_id )
$profilefields = $DB_site->query ( "SELECT * FROM " . TABLE_PREFIX . "profilefield WHERE editable = '1' AND form " . ( $formtype == option_id ? "= '" . $formtype . "'" : ( $formtype ? ">= '" . $formtype . "'" : "= '0'" ) ) . " ORDER BY displayorder" );

// after changing the above (occurs 1 time in the replace code)
$profilefields = $DB_site->query ( "SELECT * FROM " . TABLE_PREFIX . "profilefield WHERE editable = '1' AND form " . ( $formtype == 6 ? "= '" . $formtype . "'" : ( $formtype ? ">= '" . $formtype . "'" : "= '0'" ) ) . " ORDER BY displayorder" );


Save changes and close ./includes/functions_user.php


Download the file new_weather.zip

Move the folder 'si' in the zip file to, ./forecast/img/

over write the current ./forecast/css/main.css, with the new one in the zip file...

copy 'weather.gif' to the ./images/misc/ directory of the style you are using!

overwrite ./forecast.php with the new one in the zip file
overwrite ./includes/functions_weather, with the one included in the zip file!

All done...

1. Adds forum display
2. 20% speed gain...
3. fixes sort order in location select boxes
4. setups the weather system to plugin to the new Admin CP 'Weather Manager', which will be released on the 23 of July!

Need help just post!

Sonia

Ted S
07-16-2004, 01:47 AM
why-not,
You are simply amazing! The update has been installed, a warning to everyone else doing this: if you have issues with forecast elements not showing double check your field start and end dates, I got so wrapped up in the instructions that on the index.php changes I entered 15 instead of 14 in one place and it took me a few minutes to figure out what went wrong.

Again thank you for this amazing hack on behalf off all my users (who have had nothing but praise in the thread I started about the feature).

MikeRoweForums
07-16-2004, 02:09 AM
Absolutely amazing.

Just installed the entire hack and your most recent update on my test board (for version 2 of my site), everything works perfect. This is one of the most in depth hacks I have ever seen. Very good work.

NuclioN
07-16-2004, 07:24 AM
Upgraded and all works very well. Great job! :) Question..how important is the cron job in this function and will there be an instruction to set these in the admin cp?

It would be nice to display the forumhome weatherinfo right under the navbar. Then it has to be smaller i guess. How to do this?

why-not
07-16-2004, 08:21 AM
It would be nice to display the forumhome weatherinfo right under the navbar. Then it has to be smaller i guess. How to do this?


Let me look at putting it there, I think I can make something that will work for you! Check a little later today, say around 11:00 AM EST/EDT...


Question..how important is the cron job in this function and will there be an instruction to set these in the admin cp?


I started working on adding this to the AdminCP, VB cron task. I should have it done before leaving for the office this morning! Say around 9:00 AM!

Sonia

NuclioN
07-16-2004, 09:16 AM
Tnx that would be nice. I've placed the actual code in forumhome under the navbar but it is to large and it pushed the other tables to far down. If this could be done on a few lines it would be perfect. :)

Natch
07-16-2004, 11:47 AM
Sorry to be a pain in the ass, but can I ask why you designed this with a external CSS file ? Why not use vB styles to format this - it would make a bundle more sense to do it this way?

Not denying the value of htis hack - I think it's amazing! but this is just bugging me a bit ...

Ted S
07-16-2004, 02:54 PM
Upgraded and all works very well. Great job! :)
It would be nice to display the forumhome weatherinfo right under the navbar. Then it has to be smaller i guess. How to do this?

I've actually changed this myself... it wasnt hard as I just moved the element up to where I wanted it. The main hasstle is that the entire weather block for people who have it setup is held in a single variable so changing the actual block is a bit of a pain. After moving it uptop I've found that even with the full height and a label bar it fits my site just fine and it is afterall an option for only those who want to see it.

You can check out my version at www.scubaboard.com if you like.

SteveK
07-16-2004, 03:39 PM
You can check out my version at www.scubaboard.com if you like.
Nice site. May I ask which shopping cart you're using?

why-not
07-16-2004, 03:42 PM
Tnx that would be nice. I've placed the actual code in forumhome under the navbar but it is to large and it pushed the other tables to far down. If this could be done on a few lines it would be perfect. :)
Hi


Go to the demo and login, and select the default template, and tell if that is what you are wanting!

If it is I will post the change for you!


Sonia

NuclioN
07-16-2004, 05:11 PM
Yes that's ok why-not. :) The display in default looks good

why-not
07-16-2004, 05:53 PM
Yes that's ok why-not. :) The display in default looks good
Hi

Ok,

Go to Styles & Templates >> Search >> 'FORUMHOME'

Open that template up....

Find...


<if condition="$show['forecast']"><if condition="$forecast_home['location']!='0'">$forecast_home[data]<else /><tbody>
<tr>
<td class="thead" colspan="2"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_weather')"><img id="collapseimg_forumhome_weather" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_weather].gif" alt="" border="0" /></a>$vbphrase[local_weather]</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_weather" style="$vbcollapse[collapseobj_forumhome_weather]">
<tr>
<td class="alt2"><a href="profile.php?$session[sessionurl]do=weather"><img border='0' src='$stylevar[imgdir_misc]/weather.gif' alt='$vbphrase[local_weather]' /></a></td>
<td class="alt1" width="100%" align="center"><div class="smallfont" align="center">$forecast_home[data]</div></td>
</tr>
</tbody></if></if>


Dlete it and save the update!

Go back to Styles & Templates >> Search >> 'navbar'

Open that template up....

Find...


</div>
<!-- / nav buttons bar -->


Right above '</div>'

Add the following...


<if condition="$show['forecast']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<if condition="$forecast_home['location']!='0'">$forecast_home[data]<else /><tbody>
<tr>
<td class="thead" colspan="2"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_weather')"><img id="collapseimg_forumhome_weather" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_weather].gif" alt="" border="0" /></a>$vbphrase[local_weather]</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_weather" style="$vbcollapse[collapseobj_forumhome_weather]">
<tr>
<td class="alt2"><a href="profile.php?$session[sessionurl]do=weather"><img border='0' src='$stylevar[imgdir_misc]/weather.gif' alt='$vbphrase[local_weather]' /></a></td>
<td class="alt1" width="100%" align="center"><div class="smallfont" align="center">$forecast_home[data]</div></td>
</tr>
</tbody></if></table></if>


Same changes....

All Done....

Sonia

NuclioN
07-16-2004, 06:12 PM
--edit-- Have it..i had to change the css. :) It looks awesome

Zelda-King
07-16-2004, 06:56 PM
Hello! I managed to see your demo. Excellent work!

I've been having a couple of the same issues as I've seen posted here, but I've not found a formula in this thread that's fixed it. I was really hoping to have this fixed without having to bother you as you seem very busy with other people, but I'm not doing very well.

I have the hack installed on my board but;

a) forecast.php itself is blank (save for having "0-ss-0" in the top left hand corner).
b) I can't save the location. I do have custom fields and have altered profile.php accordingly.

My fields 5, 6, 7, 8 and 9 are edited to fields;
31, 32, 33, 34 and 35 respectively.

Here is the PHP I am using;
/ ####### weather forecast and the forecast options ######

if ( $_REQUEST['do'] == 'weather' || $_REQUEST['do'] == 'places' )
{
define ( 'DO_WEATHER', 1 );
construct_usercp_nav ( $_REQUEST['do'] );
$templatename = $_REQUEST['do'] . '_display';
$shelltemplatename = 'USERCP_SHELL';
include_once ( './includes/functions_weather.php' );
}

if ( $_REQUEST['do'] == 'weather' )
{
$new_forecast = forecast_valid ( $bbuserinfo[field31], $bbuserinfo[field32], $bbuserinfo[field33], $bbuserinfo[field34], $bbuserinfo[field35] );
$new_forecast = fetch_forecast ( $new_forecast, 1 );
$customfields = array ();
fetch_profilefields(1);
$navbits[''] = $vbphrase['weather_title'];
}

if ( $_REQUEST['do'] == 'places' )
{
if ( !empty ( $_POST['location'] ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET field35=" . addslashes( $_POST['location'] ) . " WHERE userid=$bbuserinfo[userid]" );
$GLOBALS['url'] = 'profile.php?do=weather';
eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
}
else
{
$tpl = places_validate ();
$navbits[''] = $tpl['page_title'];
}
}

if ( $_POST['do'] == 'forecast' )
{
$forecast_fields = verify_profilefields ( 6 );

if ( !empty ( $forecast_fields ) )
{
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "userfield SET userid=$bbuserinfo[userid]$forecast_fields WHERE userid=$bbuserinfo[userid]" );
}

eval ( print_standard_redirect ( 'redirect_updatethanks' ) );
You can see how it looks on my board with the following login information;

Username: Test
Password: beer
URL: http://www.gamercrossfire.net/bb
And one other thing: embarrassingly I'm not sure what the following conditions:
(B) Yes, I have allow_url_fopen turned on!
(C) Yes, I have permission to the I/O File system! mean. Everything else is present and correct. I assume C is about file uploading, in which case there's not a problem there.

Bryan Ex
07-16-2004, 07:20 PM
And one other thing: embarrassingly I'm not sure what the following conditions:.
Those you can check from your vB admin panel... just scroll down the the bottom for diagnostics and click on php info. Both those items will be listed long with all the other php config settings for your server.

Zelda-King
07-16-2004, 07:37 PM
Ah... well I'm all clear for directive B then. I didn't see anything that specifically says 'I/O File System' though. Wat exactly am I looking for?

Oh yes, I found another problem. The locations interferes with my do=editprofile.

EDIT: I've just found a mistake I made. Please ignore my support request until I rectify it. I will give an update shortly.

nineball
07-16-2004, 07:38 PM
If you want to display a center block using the forum home template create a new module with the uploaded weather.php file and the adv_portal_world_weather.

Put the weather.php in your modules directory, create a CMPS module with it, and add a new template using the adv_portal_world_weather text file with the same name as the text file.

Zelda-King
07-16-2004, 07:47 PM
OK, I actually fixed my problem, but now I get this at the top of the profile page;

Warning: weather_display(./includes/weather/lang/lang_en.php): failed to open stream: No such file or directory in /home/gamercr/public_html/bb/includes/functions_weather.php on line 86

Warning: weather_display(): Failed opening './includes/weather/lang/lang_en.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gamercr/public_html/bb/includes/functions_weather.php on line 86

Plus the location is interfering with my custom field 30 and and my field 9 text input is replaced with 37642. Is there something other than profile.php that I need to edit for the custom fields?

why-not
07-16-2004, 07:56 PM
OK, I actually fixed my problem, but now I get this at the top of the profile page;

Warning: weather_display(./includes/weather/lang/lang_en.php): failed to open stream: No such file or directory in /home/gamercr/public_html/bb/includes/functions_weather.php on line 86

Warning: weather_display(): Failed opening './includes/weather/lang/lang_en.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/gamercr/public_html/bb/includes/functions_weather.php on line 86

Plus the location is interfering with my custom field 30 and and my field 9 text input is replaced with 37642. Is there something other than profile.php that I need to edit for the custom fields?
Hi

I know what your problem is, somehow you have code for another profile function running into weather, I saw this 3 times yesterday...

Do me a favor....

1. Post these files.... (and I will fix your problem)

./profile.php, ./includes/functions_user.php, ./index.php, ./admincp/profilefield.php


2. tell me the field# <- numbers you have assigned for the 5 weather form inputs


I will you give you all the fixes in just a few min(s)


Sonia

Zelda-King
07-16-2004, 08:03 PM
Hello, thanks for the response. There is a problem though: it's forbidden to post significant portions of vBulletin script, both legally and by vb.org rules.

why-not
07-16-2004, 08:12 PM
Hello, thanks for the response. There is a problem though: it's forbidden to post significant portions of vBulletin script, both legally and by vb.org rules.
Send it to my email then, it not like we are selling it, and you have a license and I have a license, and if you upload it no one can get it, that does not have a license. Send it here....

Fataqui@netscape.net

I will wait for your reply...

Sonia

Zelda-King
07-16-2004, 08:22 PM
In the process of sending now (just so you know). I just need to grab the new files from the server.

why-not
07-16-2004, 08:28 PM
In the process of sending now (just so you know). I just need to grab the new files from the server.
Ok I got them, be right back....


Sonia

Zelda-King
07-16-2004, 08:34 PM
OK, I'll be here. :) Sorry for any delays. Multitasking here.

why-not
07-16-2004, 08:41 PM
OK, I'll be here. :) Sorry for any delays. Multitasking here.
Hi


Just explain this.... (confused)

What are these...

31, 32, 33, 34 and 35

look at the attached image, these are the values I want!


Tell me what yours are!


Sonia

Zelda-King
07-16-2004, 08:43 PM
Sorry that's what I meant. Mine are;

field31
field32
field33
field34
field35

why-not
07-16-2004, 08:52 PM
Sorry that's what I meant. Mine are;

field31
field32
field33
field34
field35
ok, almost done!

Sonia

The Realist
07-16-2004, 08:52 PM
Cant get this to work. Does not show up on my main page.



If you want to display a center block using the forum home template create a new module with the uploaded weather.php file and the adv_portal_world_weather.

Put the weather.php in your modules directory, create a CMPS module with it, and add a new template using the adv_portal_world_weather text file with the same name as the text file.

why-not
07-16-2004, 09:03 PM
Hi

I am just writing the install file, I will PM you the link in 2 or 3 min(s), after you have finished getting the file and doing what I said report back here!

Check your PM in a few min(s)

Sonia

why-not
07-16-2004, 09:10 PM
Sorry that's what I meant. Mine are;

field31
field32
field33
field34
field35
Sending PM now....


Sonia

Zelda-King
07-16-2004, 09:32 PM
Reply sent. :)

why-not
07-16-2004, 09:47 PM
Reply sent. :)
Check your PM, please...

Sonia

Zelda-King
07-16-2004, 09:58 PM
Acknowledged.

Reply sent.

why-not
07-16-2004, 10:03 PM
Acknowledged.

Reply sent.
hehehe....

Would you believe I spelt the thing wrong.... (I DID)

Open functions_user.php

Search for -> '$fomtype'

And change that to -> '$formtype' <- without the quotes, that will fix all the inputs from interfaring with each other, and should slove all your problems!

Sonia, sorry about that!

Zelda-King
07-16-2004, 10:09 PM
Corrected. It appears the problem remains though. I'm going to check again and reupload.

why-not
07-16-2004, 10:11 PM
Corrected. It appears the problem remains though. I'm going to check again and reupload.
It works for me!...

Sonia

Zelda-King
07-16-2004, 10:17 PM
Hah! Silly me. I just needed to erase the number and make it blank in my profile. It had been left there by being updated earlier I imagine. Well yes that looks in order now. Thanks, you've been excellent!

Now I just need to sort out FORUMHOME. I'll look at that earlier post of yours.

why-not
07-16-2004, 10:27 PM
Hah! Silly me. I just needed to erase the number and make it blank in my profile. It had been left there by being updated earlier I imagine. Well yes that looks in order now. Thanks, you've been excellent!

Now I just need to sort out FORUMHOME. I'll look at that earlier post of yours.
Hi

If you get stuck, just ask and I will whip you up a quick install for your setup!


Sonia

nineball
07-16-2004, 11:29 PM
Cant get this to work. Does not show up on my main page.

I have it working on my site.

You need to set up a new module

module - weather.php

template - blank

template used - world_weather

You need to have the forumhome stuff installed and it should work.

Zelda-King
07-16-2004, 11:30 PM
EDIT: I have everything working now, including the FORUMHOME (after finally getting some sleep). Well the least I can do after all that assistance is ensure this gets nominated for Hack of the Month.

Bryan Ex
07-17-2004, 02:43 AM
I just did the update to include forum home and it works beauitifully Sonia. Thanks so much for this one!

Natch
07-17-2004, 02:45 AM
I have it working on my site.

You need to set up a new module

module - weather.php

template - blank

template used - world_weather

You need to have the forumhome stuff installed and it should work.
The way I have this working (not with your code) is to make some modifications to the includes/functions_weather.php, as well as a slightly different weather.php module and the template has been re-written to use the style colours.

If anyone is interested I'll work up a set of instructions...

FWF
07-17-2004, 09:34 AM
The way I have this working (not with your code) is to make some modifications to the includes/functions_weather.php, as well as a slightly different weather.php module and the template has been re-written to use the style colours.

If anyone is interested I'll work up a set of instructions...

Id like to see a demo if this, as well as instructions incase i like the mods you have made ;)

Bryan Ex
07-17-2004, 09:49 AM
Ummm... try the first post in this thread?

nineball
07-17-2004, 01:44 PM
I have it working on my site.

You need to set up a new module

module - weather.php

template - blank

template used - world_weather

You need to have the forumhome stuff installed and it should work.

I forgot to mention that you need to change the field numbers in the module weather.php to match your field numbers.

I already had a custom field, so I am using 6,10. If you didn't then you would use 5,9

// special tags you need to change ( 2 -> field_start, field_end )
$w_fields = array ( '6', '10' );

NuclioN
07-17-2004, 05:04 PM
Nope, that don't worked eighter nineball. The error is that it points to forecast.php and it should be (in our case) /forums/forecast.php

Natch
07-18-2004, 03:42 AM
The way I have this working (not with your code) is to make some modifications to the includes/functions_weather.php, as well as a slightly different weather.php module and the template has been re-written to use the style colours.

If anyone is interested I'll work up a set of instructions...
Anyone wanting to see a demo of this, will have to sign up (I do not create test accounts) but you can see it on www.mobileforces.org <=

The Realist
07-18-2004, 11:30 AM
Installed the additional frontpage module and changed the field id's to match, but Im getting this error at the very top of the forum home page:

Warning: file_get_contents(http://www.tech-tronix.com/forecast.php?wid=37385&lid=xxvvzz): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/techtro/public_html/forums/includes/functions_weather.php on line 190

And the weather module does not load, its a red x.

Any ideas?

Brian

why-not
07-18-2004, 11:57 AM
Installed the additional frontpage module and changed the field id's to match, but Im getting this error at the very top of the forum home page:

Warning: file_get_contents(http://www.tech-tronix.com/forecast.php?wid=37385&lid=xxvvzz): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/techtro/public_html/forums/includes/functions_weather.php on line 190

And the weather module does not load, its a red x.

Any ideas?

Brian
Hi

send me the following.....

forecast.php, functions_weather.php, profile.php, index.php

put them in a zip file....

Fataqui@netscape.net

or I have that MSN thingie open helping someone else right now, just post a link in there where I can download them files! MSN -> fataqui@ya-right.com

Sonia

The Realist
07-18-2004, 12:36 PM
Sent Sonia.

Thanks,

Brian


Hi

send me the following.....

forecast.php, functions_weather.php, profile.php, index.php

put them in a zip file....

Fataqui@netscape.net

or I have that MSN thingie open helping someone else right now, just post a link in there where I can download them files! MSN -> fataqui@ya-right.com

Sonia

Bryan Ex
07-18-2004, 11:06 PM
This can be done many ways but I think I will only do it one way, so that this final update that will support the AdminCP addon that I will release to control the weather system....
Curiousity has caught my interest... control the weather from admin in what way? The weather reporting is set up by each individual member so what is there for admin to control?

nineball
07-19-2004, 10:03 PM
Anyone wanting to see a demo of this, will have to sign up (I do not create test accounts) but you can see it on www.mobileforces.org <=

I like your layout better than mine. Could you attach the instructions and template

Natch
07-19-2004, 11:17 PM
I like your layout better than mine. Could you attach the instructions and template
Mine requires modifications to the includes/functions_weather.php - so MAKE A BACKUP OF THE ORIGINAL FILE:
Find:function get_w_home()Insert ABOVE:function get_j_home ()
{
global $vboptions;
$returned = "$vboptions[bburl]/";
return $returned;
}

Find:define ( 'WEATHER_URL', get_w_home () );
REPLACE WITH:define ( 'WEATHER_URL', get_j_home () );
Find: $current = $type == '1' ? 'current_weather_one' : 'current_weather_two';
Insert BELOW: $current = (THIS_SCRIPT == 'adv_index') ? 'adv_portal_weather': $current;
Save, close and Upload this new file.

New Template: adv_portal_weather<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('cmps_weather')"><img id="collapseimg_cmps_weather" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_cmps_weather].gif" alt="" border="0" /></a>
<span class="smallfont"><strong>$vba_options[portal_blockbullet] <a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=weather" alt="Detailed Weather Report">$tpl[location_header]<br />$tpl[location]</a></strong></span>
</td>
</tr>
</thead>
<tbody id="collapseobj_cmps_weather" style="$vbcollapse[collapseobj_cmps_weather];text-align:center">
<tr class="alt1">
<td class="smallfont"><a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=weather"><img border='0' src='$tpl[current_icon]' title="$tpl[current_text]" alt='' /></a> $tpl[current_temp]</td>
</tr>

<tr class="alt2">
<td class="thead">$tpl[time_text]</td>
</tr>
<tr class="alt2">
<td class="smallfont">$tpl[local_time]</td>
</tr>

<tr class="alt1">
<td class="thead">$tpl[humd_header]</td>
</tr>
<tr class="alt1">
<td class="smallfont">$tpl[current_humd]</td>
</tr>

<tr class="alt2">
<td class="thead">$tpl[vis_header]</td>
</tr>
<tr class="alt2">
<td class="smallfont">$tpl[current_vis]</td>
</tr>

<tr class="alt1">
<td class="thead">$tpl[ultra_header]</td>
</tr>
<tr class="alt1">
<td class="smallfont">$tpl[current_ultra]</td>
</tr>

<tr class="alt2">
<td class="thead">$tpl[baro_header]</td>
</tr>
<tr class="alt2">
<td class="smallfont">$tpl[current_baro] <span><img border='0' src='$tpl[icon_baro]' alt='' /></span></td>
</tr>

<tr class="alt1">
<td class="thead">$tpl[direct_header] ($tpl[direct_type])</td>
</tr>
<tr class="alt1">
<td class="smallfont">$tpl[current_direct]</td>
</tr>
</tbody>
</table>
<br />
New Module: forumroot/modules/weather.php<?
// here you change the field_start and field_end values to match your own board configuration
$w_fields = array ( 'field_start', 'field_end' );
$w_m = 'field' . ( $w_fields[1] - 1 );

if ( strpos ( $bbuserinfo[$w_m], 'always' ) )
{
$show['forecast'] = true;

define ( 'DO_WEATHER', 1 );

include_once ( './includes/functions_weather.php' );

$forecast_home = forecast_valid ( $w_fields );

if ( !empty ( $forecast_home ) )
{
$forecast_home = fetch_forecast ( $forecast_home, 2 );
}

eval('$home[$mods[\'modid\']][\'content\'] = "$forecast_home[data]";');
}
else
{
$show['forecast'] = false;
}
?>

Upload this file to forumroot/modules folder.

Install into the vB Advanced CMPS using the following settings:

Module title: World Weather
Module Identifier: leave this blank
File to include: weather.php
OR Template to Include: leave this blank
Templates Used: adv_portal_weather

That's it - screenshot demo:
https://vborg.vbsupport.ru/attachment.php?attachmentid=19760

nineball
07-20-2004, 04:17 AM
Thanks. Very nice. I installed it and it works great

Natch
07-20-2004, 08:04 AM
Thanks. Very nice. I installed it and it works great
Glad to help - sorry I hadn't gotten to your PM yet - been busy as ...

Bro_Joey_Gowdy
07-20-2004, 02:35 PM
clicks install

nineball
07-20-2004, 06:15 PM
Glad to help - sorry I hadn't gotten to your PM yet - been busy as ...
The pm was just asking about how to do this, so just delete it

Chriss74
07-21-2004, 11:34 PM
Ver nice hack,absolutely will give it a try.By the way,I like the template of your demo http://forum.ya-right.com/ .
The demo-board seems to not work any longer... I got a 404-Message.

Greetings,
Chriss

Bryan Ex
07-21-2004, 11:47 PM
Here's what you end up with for the regular install (colours changed to match my board);

romanticyao
07-22-2004, 05:42 PM
Hello:

I have just one questions for today...
I would like to translate the location name into chinese... how do i do that? can i just replace the english name with chinese? use Shanghai as an example,
in newdb.txt i found the following line:

814', '3', 'Asia', '7', 'China', '', '', '339', 'Shanghai', 'CHXX0116

can i change it "Shanghai" to "上海"

814', '3', 'Asia', '7', 'China', '', '', '339', '上海', 'CHXX0116

then run the newdb.php again to make it work?

romanticyao
07-23-2004, 05:58 AM
Glad to help - sorry I hadn't gotten to your PM yet - been busy as ...

<?
// here you change the field_start and field_end values to match your own board configuration
$w_fields = array ( 'field_start', 'field_end' );
$w_m = 'field' . ( $w_fields[1] - 1 );


What does 'field_start', 'field_end' mean? my mod doesn't show up on my page...

Natch
07-23-2004, 06:13 AM
It means the same as it means for the rest of this hack - you need to know the fieldXX values for each of your new profile fields...

romanticyao
07-23-2004, 10:11 PM
sorry its still not showin up...

tteal
07-28-2004, 12:11 AM
I tried installing the weather/forecast and everything appears to be good and have double and triple checked everything and here is the scenario:

> Go to Usercp
> Choose Display type, languages, extended forecast, then forecast locations (Select!)
> Get a dropdown menu for "Regions" and choose united states
> Choose forecast state, choose a state
> Select forecast location (It's populating this fine) and I choose
> Click Update Location

Nothing happens and it just shows "No forecast selected" on the main page.

I've imported the forecast.sql file and that worked just fine but it's just not updating the forecast location.

Here is a layout of my profile fields:

Forecast Display Type
Single-Selection Radio Buttons Required, Editable field66 [Edit] [Delete]
Display Languages
Single-Selection Menu Required, Editable field67 [Edit] [Delete]
Extended Forecast
Single-Selection Menu Required, Editable field68 [Edit] [Delete]
Forum Display
Single-Selection Radio Buttons Required, Editable field69 [Edit] [Delete]
Forecast Locations
Single-Line Text Box Required, Editable, Hidden field70 [Edit] [Delete]

Did I do something wrong? Can someone help please I'd love to get this working on my site.

Thank you,
Tim

kall
07-28-2004, 09:31 PM
After installing the forumhome update, I'm getting:


Warning: Missing argument 2 for forecast_valid() in /home/nzboards/public_html/forums/includes/functions_weather.php on line 23

Warning: Missing argument 3 for forecast_valid() in /home/nzboards/public_html/forums/includes/functions_weather.php on line 23

Warning: Missing argument 4 for forecast_valid() in /home/nzboards/public_html/forums/includes/functions_weather.php on line 23

Warning: Missing argument 5 for forecast_valid() in /home/nzboards/public_html/forums/includes/functions_weather.php on line 23

Warning: Illegal offset type in /home/nzboards/public_html/forums/includes/functions_weather.php on line 33


What have I missed?

Ferny72
07-29-2004, 06:46 AM
I tried installing the weather/forecast and everything appears to be good and have double and triple checked everything and here is the scenario:

> Go to Usercp
> Choose Display type, languages, extended forecast, then forecast locations (Select!)
> Get a dropdown menu for "Regions" and choose united states
> Choose forecast state, choose a state
> Select forecast location (It's populating this fine) and I choose
> Click Update Location

Nothing happens and it just shows "No forecast selected" on the main page.

I've imported the forecast.sql file and that worked just fine but it's just not updating the forecast location.

Here is a layout of my profile fields:

Forecast Display Type
Single-Selection Radio Buttons Required, Editable field66 [Edit] [Delete]
Display Languages
Single-Selection Menu Required, Editable field67 [Edit] [Delete]
Extended Forecast
Single-Selection Menu Required, Editable field68 [Edit] [Delete]
Forum Display
Single-Selection Radio Buttons Required, Editable field69 [Edit] [Delete]
Forecast Locations
Single-Line Text Box Required, Editable, Hidden field70 [Edit] [Delete]

Did I do something wrong? Can someone help please I'd love to get this working on my site.

Thank you,
Tim

I have the same problem I don't know how to fix it.

tteal
07-29-2004, 11:00 AM
I have the same problem I don't know how to fix it.

I wonder if anyone is still supporting this or if we've installed it to now have to de-install it? ERRRRRRRRRRRRR!!!!!!

Natch
07-29-2004, 02:42 PM
Wou will find that if you do the last step first, then complete the rest of the options the whole thing works ...Go right down to the bottom and set in the city first and of course it then goes back to the top of the page.
Then set in the rest of the info but don't reinsert the city name.
Go down to the bottom and select "save changes".
Once I did this the weather for my area was displayed and showed up in the MoFo homepage when I logged in the next time.
Hope this helps!

Bryan Ex
07-30-2004, 01:04 AM
I wonder if anyone is still supporting this
Keep in mind that it's peek vacation time right now so some people are bound to disappear for a while.

tteal
07-30-2004, 07:40 PM
Keep in mind that it's peek vacation time right now so some people are bound to disappear for a while.

Understood. I just can't seem to understand how everyone got theirs working and I can't. I've made many modifications to my Vbulletin and never had one issue until now... that's all.

Lostnode
08-01-2004, 12:26 AM
Ok, this is what is happening, dunno where I went wrong..


Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/html/forums/includes/functions_weather.php on line 190

Warning: file_get_contents(http://linserv/forums/forecast.php?wid=2829&lid=90076): failed to open stream: Success in /var/www/html/forums/includes/functions_weather.php on line 190


Linserv is ,my test server on my local lan, This is what i get when I go to the home page. Anyone else ever get this?

Oh, and when I go to http://linserv/forums/forcast.php?wid=2829&lid=90076 I get this


ok-ss-a:2:{s:7:"current";a:26:{s:6:"region";s:6:"Canada";s:7:"country";s:6:"Canada";s:5:"state";s:4:"-na-";s:5:"place";s:10:"Edmundston";s:3:"now";s:2:"-3";s:4:"sunr";i:1091268720;s:4:"suns";i:1091322360;s:4:"last";i:1091325180;s:6:"f_temp";s:8:"70?F";s:6:"c_temp";s:8:"21?C";s:6:"f_like";s:8:"70?F";s:6:"c_like";s:8:"21?C";s:4:"icon";s:6:"27.gif";s:4:"cond";s:6:"++27++";s:6:"f_baro";s:8:"29.86 in";s:6:"c_baro";s:9:"1011 mbar";s:3:"cbi";s:5:"b.gif";s:5:"f_spd";s:5:"9 mph";s:5:"c_spd";s:5:"14 km";s:6:"direct";s:1:"S";s:5:"humid";s:3:"97%";s:5:"f_vis";s:6:"8.0 mi";s:5:"c_vis";s:6:"++60++";s:5:"ultra";s:8:"0 ++55++";s:5:"f_dew";s:8:"69?F";s:5:"c_dew";s:8:"21?C";}s:8:"extended";a:6:{i:0;a:12:{s:3:"day";s:6:"++54++";s:4:"date";i:1091246400;s:6:"f_high";s:4:"-na-";s:6:"c_high";s:4:"-na-";s:5:"f_low";s:8:"68?F";s:5:"c_low";s:8:"20?C";s:4:"sunr";i:1091268660;s:4:"suns";i:1091322480;s:6:"d_icon";s:5:"-.gif";s:6:"d_cond";s:5:"++-++";s:6:"n_icon";s:5:"4.gif";s:6:"n_cond";s:5:"++4++";}i:1;a:10:{s:3:"day";s:6:"++48++";s:4:"date";i:1091332800;s:6:"f_high";s:8:"78?F";s:6:"c_high";s:8:"26?C";s:5:"f_low";s:8:"60?F";s:5:"c_low";s:8:"16?C";s:4:"sunr";i:1091355120;s:4:"suns";i:1091408760;s:6:"d_icon";s:6:"39.gif";s:6:"d_cond";s:6:"++39++";}i:2;a:10:{s:3:"day";s:6:"++49++";s:4:"date";i:1091419200;s:6:"f_high";s:8:"78?F";s:6:"c_high";s:8:"26?C";s:5:"f_low";s:8:"60?F";s:5:"c_low";s:8:"16?C";s:4:"sunr";i:1091441580;s:4:"suns";i:1091495100;s:6:"d_icon";s:6:"37.gif";s:6:"d_cond";s:6:"++37++";}i:3;a:10:{s:3:"day";s:6:"++50++";s:4:"date";i:1091505600;s:6:"f_high";s:8:"77?F";s:6:"c_high";s:8:"25?C";s:5:"f_low";s:8:"58?F";s:5:"c_low";s:8:"14?C";s:4:"sunr";i:1091528040;s:4:"suns";i:1091581440;s:6:"d_icon";s:6:"30.gif";s:6:"d_cond";s:6:"++30++";}i:4;a:10:{s:3:"day";s:6:"++51++";s:4:"date";i:1091592000;s:6:"f_high";s:8:"74?F";s:6:"c_high";s:8:"23?C";s:5:"f_low";s:8:"53?F";s:5:"c_low";s:8:"12?C";s:4:"sunr";i:1091614560;s:4:"suns";i:1091667720;s:6:"d_icon";s:6:"30.gif";s:6:"d_cond";s:6:"++30++";}i:5;a:10:{s:3:"day";s:6:"++52++";s:4:"date";i:1091678400;s:6:"f_high";s:8:"68?F";s:6:"c_high";s:8:"20?C";s:5:"f_low";s:8:"54?F";s:5:"c_low";s:8:"12?C";s:4:"sunr";i:1091701020;s:4:"suns";i:1091754060;s:6:"d_icon";s:6:"11.gif";s:6:"d_cond";s:6:"++11++";}}}

tteal
08-01-2004, 02:53 AM
I have the same problem I don't know how to fix it.
:disappointed:

Natch
08-01-2004, 11:59 PM
<a href="https://vborg.vbsupport.ru/showpost.php?p=538080&postcount=181" target="_blank">https://vborg.vbsupport.ru/showp...&postcount=181</a> <] how about htat - should resolve your non-working versions...

tteal
08-02-2004, 02:13 AM
https://vborg.vbsupport.ru/showpost.php?p=538080&postcount=181 <] how about htat - should resolve your non-working versions...

I looked/tried that ---- still no help and still have non-functional weather page.

PixelFx
08-02-2004, 03:45 AM
has the front zip been updated with hacks and or template updates and changes? and if so does it work with vb 3.0.3 ?

Natch
08-02-2004, 05:34 AM
Well for mine I'm running this on vB 3.0.3 with no problems -

Ted S
08-02-2004, 08:35 PM
While the system is working fine my error logs show some issues...

[Mon Aug 2 16:25:53 2004] [error] PHP Warning: fopen(./includes/weather/db/4029.php): failed to open stream: Permission denied in /usr/local/www/data-dist/forecast.php on line 305
[Mon Aug 2 16:25:53 2004] [error] PHP Warning: fputs(): supplied argument is not a valid stream resource in /usr/local/www/data-dist/forecast.php on line 306
[Mon Aug 2 16:25:53 2004] [error] PHP Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/www/data-dist/forecast.php on line 307
[Mon Aug 2 16:26:24 2004] [error] PHP Warning: fopen(./includes/weather/db/7887.php): failed to open stream: Permission denied in /usr/local/www/data-dist/forecast.php on line 305
[Mon Aug 2 16:26:24 2004] [error] PHP Warning: fputs(): supplied argument is not a valid stream resource in /usr/local/www/data-dist/forecast.php on line 306
[Mon Aug 2 16:26:24 2004] [error] PHP Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/www/data-dist/forecast.php on line 307

The files it is trying to call do not exist and thus I'm not sure how users are selecting those locations? What can I do to avoid this from happening?

Bahawolf2
08-02-2004, 09:43 PM
I clicked 'Local Weather' and the page is blank.

kall
08-04-2004, 08:29 AM
While the system is working fine my error logs show some issues...



The files it is trying to call do not exist and thus I'm not sure how users are selecting those locations? What can I do to avoid this from happening?
Yup, I am getting those too..


:08 2004] [error] PHP Warning: fclose(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 307
[Wed Aug 4 05:26:08 2004] [error] PHP Warning: fputs(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 306
[Wed Aug 4 05:26:08 2004] [error] PHP Warning: fopen(./includes/weather/db/4416.php): failed to open stream: Permission denied in /home/nzboards/public_html/forums/forecast.php on line 305
[Wed Aug 4 05:25:18 2004] [error] PHP Warning: fclose(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 307
[Wed Aug 4 05:25:18 2004] [error] PHP Warning: fputs(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 306
[Wed Aug 4 05:25:18 2004] [error] PHP Warning: fopen(./includes/weather/db/4416.php): failed to open stream: Permission denied in /home/nzboards/public_html/forums/forecast.php on line 305
[Wed Aug 4 05:25:03 2004] [error] PHP Warning: fclose(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 307
[Wed Aug 4 05:25:03 2004] [error] PHP Warning: fputs(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 306
[Wed Aug 4 05:25:03 2004] [error] PHP Warning: fopen(./includes/weather/db/4416.php): failed to open stream: Permission denied in /home/nzboards/public_html/forums/forecast.php on line 305

In fact, the entire db directory is empty.

HC.
08-05-2004, 06:24 PM
step 7 has me stumped I have tried both ways I have nothing showing on the forums

I feel that since there are so many updates that I might have things so screwed up
Sonia I sent you a pm

xTerMn8R
08-05-2004, 08:19 PM
This looks like a great addition for my site but I have a few questions before I undertake this Task. My board current has the following hacks installed...

1) vbindex
2) vbxirc
3) shoutbox 1.03
4) Quote it
5)last but not least HTL

I am running vb3.03 with version 4.3.8 of php on a windows 2000 Server.

First question is ...
Are the installation instructions listed in the First post STILL the correct Instructions? There seems to have been a multitude of questions and changes through out this thread, so many that I'm a bit lost and getting scared of trying this.

Is there a way of having this show up on the Portal Page (vbindex) instead of the forum Home?

thanks in advance... and I do believe that some changes to the user and fuction files have been made byu the other hacks.

Peace....

HC.
08-06-2004, 12:19 AM
It will not let me change the location
I go through the steps looks like it will change but this is all I get afterwards
any help

Overseer
08-06-2004, 04:18 PM
I have no prefix listed, so I ran the change.php. I got a blank page and don't know if anything changed. I am also stumped as to getting the new db in with my existing one. I am very very new to this, any help is appriciated.

Thanks. :nervous:

HC.
08-06-2004, 05:11 PM
got it up and running very nice hack

Overseer
08-06-2004, 05:22 PM
I was able to create the new batabase by using the browser .php command. What do I do with the forecast.txt file. How can i see if it got tied tothe DB. I also dont' see the weather option anywhere in the user CP.

Paul9
08-09-2004, 03:24 PM
Hi,

it seems to be a very good hack... when it works :D. Effectively I follow the instructions and when I go to the user CP, I click on "Local Weather" but then this message appears :

Database error in vBulletin 3.0.3:

Invalid SQL: SELECT COUNT(*)AS total FROM forecast WHERE id = ''
mysql error: La table 'forum.forecast' n'existe pas

mysql error number: 1146

Date: Monday 09th of August 2004 06:20:25 PM
Script: http://127.0.0.1/forums/profile.php?do=weather
[...]

I think I didn't do correctly the step 7, but I don't know how I can insert forecast.sql in my database ? With phpmyadmin ?
An other question : at step 5 we must put an id, so I want to know if it works with 1 ? Because I don't really know what is the meaning of this ID... user id ?

Thank you for your help. ;)

Paul9
08-09-2004, 09:43 PM
OK now I use new_db.php with new_db.txt and it seems to work because I have the complete list of cities in control panel :) . But there is a last problem... :(
In cp user I have all the options and I can select or deselect them, but when I update the city, its name doesn't appear in "Local Weather" options. Moreover I always have this message in red :

-- NO FORECAST SELECTED --

Use the Forecast Options below to configure your weather display

-- NO FORECAST SELECTED -- So what is your opinion about this problem please ? :(

I think maybe this problem comes from the step 8 because I am French and I don't understand very good this sentence :

In USERCP_SHELL add this code right blow the header tag
Is the French meaning it : "Dans le template USERCP_SHELL, ajoutez ce code ? droite de la balise du header" ?

So I don't understood this and I put the code in USERCP_SCHELL like this :

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - $pagetitle</title>
$headinclude
</head>
<body$onload>
$header<link rel="stylesheet" type="text/css" href="/forecast/css/main.css" />
$navbarIs this right ?

Thank you very much for this hack, and even it doesn't work (I hope not for long ! :) ) it seems very powerful and useful !

Ntenze
08-10-2004, 06:00 PM
I am having the same problem, but i'm not french ;)...

OK now I use new_db.php with new_db.txt and it seems to work because I have the complete list of cities in control panel :) . But there is a last problem... :(
In cp user I have all the options and I can select or deselect them, but when I update the city, its name doesn't appear in "Local Weather" options. Moreover I always have this message in red :

So what is your opinion about this problem please ? :(

I think maybe this problem comes from the step 8 because I am French and I don't understand very good this sentence :


Is the French meaning it : "Dans le template USERCP_SHELL, ajoutez ce code ? droite de la balise du header" ?

So I don't understood this and I put the code in USERCP_SCHELL like this :

Is this right ?

Thank you very much for this hack, and even it doesn't work (I hope not for long ! :) ) it seems very powerful and useful !

Paul9
08-10-2004, 09:19 PM
Is there someone here who can help us please ? :(

but i'm not french ...:D :D In fact I find this afternoon (it is 1 am in France now) that there is a fault in the explanations because it is write "blow" and we must read "below" so for you it is very easy but not for me because I mixed with Souffler (to blow, blew, blown :D ). :ermm:
But in France we have good wines and good food so I prefer to stay French, even if I don't understand very well English explanations ! :)

Now I understand the good configuration is :

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<link rel="stylesheet" type="text/css" href="/forecast/css/main.css" />
<title>$vboptions[bbtitle] - $pagetitle</title>
$headinclude
</head>
<body$onload>
$header
$navbar

Is this right ?

Good night !

tteal
08-10-2004, 09:36 PM
Is there someone here who can help us please ? :(



Nope. I had this hack installed and it never worked nor did anyone offer up to help make it work. I've since forgotten about it.

Natch
08-10-2004, 10:10 PM
Nope. I had this hack installed and it never worked nor did anyone offer up to help make it work. I've since forgotten about it.
That's not quite accurate - you were offered help, ybut you didn't give enough extra information for anyone to be able to help you further.

There have been plenty of installs that have worked - on both heavily hacked and non-hacked boards. The instructions iterate that you should not install this hack unless you r board is stock vB3 - if it's been hacked and you are having problem siwht htis hack, then you need ot reverse all the changes and start again.

tteal
08-10-2004, 10:26 PM
That's not quite accurate - you were offered help, ybut you didn't give enough extra information for anyone to be able to help you further.

There have been plenty of installs that have worked - on both heavily hacked and non-hacked boards. The instructions iterate that you should not install this hack unless you r board is stock vB3 - if it's been hacked and you are having problem siwht htis hack, then you need ot reverse all the changes and start again.

Really? I provided plenty of information (read the first post that I put up in this thread about the issue I was having) and why is it that there are plenty of folks reporting the exact same problem/issue that I'm having? If it were only my board, I wouldn't have this issue and it would have been solved a long time ago.

Paul9
08-10-2004, 10:40 PM
Ohhh !! Now it's work !!!!!!!
I reinstall vBulletin and then I install this hack and now I have this amazing hack on my board !!! :D :D :D
Well, I want to thank you Sonia for this very nice hack !!

Good night. ;)

Ntenze
08-10-2004, 11:22 PM
Natch, when you say "then you need ot reverse all the changes and start again." Do you mean uninstall the hack & start over? Or, Fresh install of vBulletin? I feel like i'm so close to the completion of this hack.. LOL It seems to me there may be an error in one of my templates, phrases or something. But then again i've been wrong before :D
Thank you for your time.

When i click through to setup my weather info ie: Country, State, City, & try to Save Is where i get the error "You have not completed the required field "Forecast Display Type".
"

Natch
08-11-2004, 01:00 AM
I mean reverse the changes you made to your vBulletin files and database, and start again.

If you want a hand, please give me a test login to your board and I'll take a look @ it.

Ntenze
08-11-2004, 02:55 AM
Thanks Natch.

http://www.forthebayarea.com/forums/index.php
user=test
pass=test

Natch
08-11-2004, 04:26 AM
OK Ntenze (and anyone else who's having troubles with this hack):

It loks like you have missed out some edits, in one of trhe following steps: profile.php Phrases Template insertions Field numbersThis last is the most likely - did you check to see that your field#'s matched the ones in the file modifications you made ?

This is a complex hack but well worth it - please do any modifications carefully and according to the instructions - they are clear and easy to follow if you take it step by step.

Paul9
08-11-2004, 12:29 PM
Hi everybody !

the hack works very well but I have a question about the design. In fact I just see the joint picture of why-not and it looks different from my board. See the attached file named weather.gif to see what I have. So is this difference appears after the update ?
In fact I don't update the hack because I don't find this :

(3) find out what option (#) is option : weather in profilefield.php

To do this >> Go To >> left nav >> User Profile Fields >> 'add new profile field'

just click 'continue'........

When the page loads..... >> 'View Page Source'

Look for......

<select name="profilefield[form]" id="sel_profilefield[form]" tabindex="1" class="bginput">

Below the above select name you will see 'Options : Weather'

<option value="?">Options: weather</option>

You want the value where the '?'

In profielfield.php I don't have <option value="?">Options: weather</option>, and I saw all the steps wrotten by why-not but my files seems to be very different from why-not's because for example I don't find this code :

Now open ./profile.php

find this....
'places' => array(
'weather_new',
),

Anybody wants to help a desesperate French boy ? :(

FrankHolland
08-12-2004, 11:00 AM
please help me out

I get this message after I try to select my location:

"-- NO FORECAST SELECTED --

Use the Forecast Options below to configure your weather display

-- NO FORECAST SELECTED --"

I searched the whole thread for this but I could only find that the fields have to be correct in profile.php, and they are as far as I know.

Sonia could you please help me out with this, I would really really appreciate your help!

Beermonster
08-12-2004, 07:04 PM
First of all great hack, I've installed it took me a while but got there in the end :)

Just one thing, for some reason it displays perfect on one of my styles but on the other it's the same colour as the main style (green) and not blue like it should be so you can't read the text, any ideas?

Ntenze
08-12-2004, 11:20 PM
Natch, sorry it took so long for me to get back to you.
1. Field #'s are right triple checked etc.
2. I have checked all php files several times.
3. Fixin to start checking Phrases Then templates.

Thanks again for your help.

Natch
08-12-2004, 11:28 PM
Best bet for the checking is the USERCP_SHELL template - hth

Beermonster
08-13-2004, 06:48 AM
First of all great hack, I've installed it took me a while but got there in the end :)

Just one thing, for some reason it displays perfect on one of my styles but on the other it's the same colour as the main style (green) and not blue like it should be so you can't read the text, any ideas?


Ignor this post I forgot about the CSS :ermm: Works great now :)

Doug22
08-13-2004, 06:06 PM
I can't get the hack to show up on my main forum and my profile.php errors up now when I try to edit profile. Any ideas?

FrankHolland
08-13-2004, 06:15 PM
I could use some help too, I triple checked everything...

Is Sonia on vacation or did she forget about us? :ermm:

Beermonster
08-13-2004, 06:42 PM
I can't get the hack to show up on my main forum and my profile.php errors up now when I try to edit profile. Any ideas?

Did you do the updates on page 8 of this thread?

kall
08-13-2004, 06:59 PM
I'm getting lots and lots of the following:

fclose(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 307
[error] PHP Warning: fputs(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 306
[error] PHP Warning: fopen(./includes/weather/db/4416.php): failed to open stream: Permission denied in /home/nzboards/public_html/forums/forecast.php on line 305
[error] PHP Warning: fclose(): supplied argument is not a valid stream resource in /home/nzboards/public_html/forums/forecast.php on line 307

etc etc.

Any suggestions?

*edit* This is what happens when the cronjob calls it.

Doug22
08-13-2004, 09:25 PM
Did you do the updates on page 8 of this thread?


Yes I did. I fixed the profile.php but I still have nothing showing on my main forum page. :(

Doug22
08-13-2004, 11:32 PM
Okay I got it to show but it doesn't match my default theme. How can I make it match?

Beermonster
08-14-2004, 06:45 AM
Okay I got it to show but it doesn't match my default theme. How can I make it match?

You need to edit the forecast/css/main.css

Lostnode
08-14-2004, 03:08 PM
Ok, fixed my previous errors, had to do with the fact I was on a pivate lan trying to access a NetBio name (http://linserv) when I typed in the IP and acessed it that way, no more errors, however I have one problem with my tempolate, and I cannot figure out where it went wrong? Seeing how I did a direct copy and paste. Attached is an image of the offending page abd right below is the temopplate code...

cuurent_weather_one

</td>
</tr>
<tr>
<td height='20' class='shead'>$tpl[location_header]$tpl[location]</td>
</tr>
<tr>
<td height='6'></td>
</tr>
<td class='ninfo'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td width='32%' height='20' class='ihead'>$tpl[rsun_text]</td>
<td height='20' width='2%'></td>
<td width='32%' height='20' class='ihead'>$tpl[time_text]</td>
<td height='20' width='2%'></td>
<td width='32%' height='20' class='ihead'>$tpl[ssun_text]</td>
</tr>
<tr>
<td colspan='5' height='6'></td>
</tr>
<tr>
<td width='32%' height='20' class='pinfo'>
<table width='100%'>
<tr>
<td width='30%' class='pinfo'><img src='$tpl[rsun_icon]' title='$tpl[rsun_text]' alt='' /></td>
<td width='70%' class='pinfo'>$tpl[sun_rise]</td>
</tr>
</table>
</td>
<td height='20' width='2%'></td>
<td width='32%' height='20' class='pinfo'>$tpl[local_time]</td>
<td height='20' width='2%'></td>
<td width='32%' height='20' class='pinfo'>
<table width='100%'>
<tr>
<td width='30%' class='pinfo'><img src='$tpl[ssun_icon]' title='$tpl[ssun_text]' alt='' /></td>
<td width='70%' class='pinfo'>$tpl[sun_set]</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height='6'></td>
</tr>
<tr>
<td class='ninfo'>
<table border='0' cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td width='34%' class='atc'>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' class='ihead'>$tpl[cuurent_header]</td>
</tr>
<tr>
<td height='16'></td>
</tr>
<tr>
<td height='20' class='pinfo'>$tpl[current_text]</td>
</tr>
<tr>
<td height=20 class='pinfo'><img src='$tpl[current_icon]' title='$tpl[current_text]' alt='' /></td>
</tr>
<tr>
<td height='20' class='pinfo'><b>$tpl[current_temp]</b></td>
</tr>
</table>
</td>
<td width='66%'>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' class='pinfo'>$tpl[current_time]</td>
</tr>
<tr>
<td height='4'></td>
</tr>
<tr>
<td>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' width='47%' class='ihead'>$tpl[humd_header]</td>
<td height='20' width='3%'></td>
<td height='20' width='50%' class='pinfo'>$tpl[current_humd]</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height='4'></td>
</tr>
<tr>
<td>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' width='47%' class='ihead'>$tpl[vis_header]</td>
<td height='20' width='3%'></td>
<td height='20' width='50%' class='pinfo'>$tpl[current_vis]</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height='4'></td>
</tr>
<tr>
<td>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' width='47%' class='ihead'>$tpl[ultra_header]</td>
<td height='20' width='3%'></td>
<td height='20' width='50%' class='pinfo'>$tpl[current_ultra]</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height='4'></td>
</tr>
<tr>
<td>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' width='47%' class='ihead'>$tpl[baro_header]</td>
<td height='20' width='3%'></td>
<td height='20' width='50%' class='pinfo'>$tpl[current_baro] <span><img border='0' src='$tpl[icon_baro]' alt='' /></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height='4'></td>
</tr>
<tr>
<td>
<table border='0' cellpadding='0' cellspacing='0' width='98%'>
<tr>
<td height='20' width='47%' class='ihead'>$tpl[direct_header] ($tpl[direct_type])</td>
<td height='20' width='3%'></td>
<td height='20' width='50%' class='pinfo'>$tpl[current_direct]</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>


BTW, the image is of the 5 day forcast, even the 1 day forcast is messed up.....

Lostnode
08-14-2004, 03:18 PM
A little more info

Here are the rest of the images, like I said, everything works create (btw, I implemented the css file, which was wrong cuz it was only pointing to the foler /forcast and not /forums/forcast, still didn;t fix the problem though)

EDIT

Never mind folks, did a repast, seems I missed a <table> tag... LOL all works GREAT and I clicked the Install button.

Awsome script....

Lostnode
08-14-2004, 03:54 PM
Ok, last little problem, and I dunno if it can be fixed in any way.

I just singed onto anohter forum that has the weather mod on it, and mine does this as well... attacked are the registration image, and the config image from the UserCP

When you register, you get a number, which I know is very confusing, in the UserCP you get the actual menu, is there any way to either 1. Remove it from the registration page, or 2 make it a selection like it is in the usercp?

Mickie D
08-15-2004, 06:55 PM
will this be possible to work with https sites ?

my apache error log tells me this:

[Sun Aug 15 20:33:43 2004] [error] mod_ssl: SSL handshake failed: HTTP spoken on HTTPS port; trying to send HTML error page (OpenSSL library error follows)
[Sun Aug 15 20:33:43 2004] [error] OpenSSL: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request [Hint: speaking HTTP to HTTPS port!?]
[Sun Aug 15 20:39:56 2004] [error] mod_ssl: SSL handshake failed: HTTP spoken on HTTPS port; trying to send HTML error page (OpenSSL library error follows)
[Sun Aug 15 20:39:56 2004] [error] OpenSSL: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request [Hint: speaking HTTP to HTTPS port!?]


i have edited the url section in the functions_weather with no luck (near the top of file)

thanks very much for the help

Overseer
08-17-2004, 06:15 PM
I have been plugging away with this hack, and am getting closer. 2 things. I cannot see the options in the user CP unless I move them to a different display page, such as 'options'. When I can see them, I can choose all options, but I get a 'no forecast selected' when I choose the city I would like to view. Any help is appriciated. Thank you in advance. :ermm:

Zelda-King
08-17-2004, 07:37 PM
I have an incompatibility issue with the upgrade from 3.0.1 to 3.0.3. If I use the file you made me specially to my own specifications (which works perfectly on 3.0.1) there are no profile field clashes but on the weather page, the Weather Location shows up as the numeric value in a text window instead of saying that actual location (and there's no button to select one). Now if I apply the file edits freshly to vB 3.0.3 files, that DOES show properly but I get a clash with one of my profile fields in 'edit profile'. The problem seems (as before when I installed the hack) to be with functions_user.php.

As far as I can make out, this is the key bit of code:

The original code that worked on 3.0.1 was;
if ($profilefield['type'] == 'input' AND $profilefield['hidden'] == '1' AND $fomtype == '6' )
{
eval('$tempcustom = "' . fetch_template('userfield_weather') . '";');
}
else if ($profilefield['type'] == 'input')
{
eval('$tempcustom = "' . fetch_template('userfield_textbox') . '";');
}
else if ($profilefield['type'] == 'textarea')
{
eval('$tempcustom = "' . fetch_template('userfield_textarea') . '";');
}That's the code that now shows the Weather Location as a text input box with the numeric value.

The code below is the other code... which leaves uncached weather templates anyway;
if ($profilefield['type'] == 'input' AND $profilefield['hidden'] == '1')
{
eval('$tempcustom = "' . fetch_template('userfield_weather') . '";');
}
else if ($profilefield['type'] == 'input')
{
eval('$tempcustom = "' . fetch_template('userfield_textbox') . '";');
}
else if ($profilefield['type'] == 'textarea')
{
eval('$tempcustom = "' . fetch_template('userfield_textarea') . '";');
}
They appear to be the same except for this bit;
AND $fomtype == '6'

Moya
08-19-2004, 08:06 AM
Hello All,

I follow the instruction to the last bit. However, my system fail to update the Forecast Location. I went thru to the process of selecting the country, states etc. without error. At the end it fails to update the location.

My userfields are kinda wacky they are 7,9,10,11,12

Any help would be greatly appreciated.

Thanks

Zelda-King
08-19-2004, 11:15 AM
It's ok, I fixed my problem. 'fomtype' should be 'formtype'. This had been addressed before and I'd partially forgotten about it. Yeah, so it works fine on 3.0.3. :)

HC.
08-20-2004, 05:52 AM
How do you unistall this since we can not get any support
I have reloaded my back up but still have local weather in the usercp under misc........
This has to go on my board since there is no support with problems we have

any help would be great

Overseer
08-20-2004, 10:31 AM
You have to remove the templates from the admincp, put back the original files that you altered. Basically just work backwards from the end of the install and revert the files back to the originals with backups. The user profile manager has to be altered as well. You could also use PHPAdmin to drop the tables that were created as well.

HC.
08-20-2004, 03:57 PM
I have uploaded all backup files but still when someone new registers it has the forecast options still in there
How can I get rid of this

Overseer
08-20-2004, 05:31 PM
You have to have missed something. I have uninstalled this hack and nothign appears for anyone. The screens that the new users are seeing is part if the user profile manager area in the admincp. If you have removed all the new template changes, you can't see the new screens. If you can create me a test account I can log into your forum and try to help you. Let me know. Good luck.

HC.
08-21-2004, 02:34 PM
here are the files that I can remember that were edited
profile.php
admincp/profilefield.php
includes/fuctions_user.php
Did I miss any?

mrboz
08-21-2004, 10:42 PM
anybody know how i can make this use my forum's style and not the one in the css file that comes with it? :ermm:

Zelda-King
08-21-2004, 11:26 PM
If you're referring to the index page add-on you can just change the .css URL in your FORUMHOME template to that of your forum's style sheet... but that doesn't look very good.

That is an issue really... especially for darker styles or those that use certain flourescent colour combinations.

You could also consider taking the code from the .css file (for this hack) and adding that code to the CSS in your admin cp style options, and then just editing the colours. The way this hack currently works, I think that's the easiest option. The only thing I don't like about that is you have to use hexidecimal values. You can't just put "alt1", etc... so if you were to alter your style you'd need to manually chnage those colour settings.

Coyote75
08-22-2004, 08:13 AM
I get a 404 not found in my user profile field when using my admin cp.

Wential
08-23-2004, 04:12 AM
I was considering installing this. Based on the posts I've been reading, is it more trouble than it's worth?

Coyote75
08-23-2004, 04:40 AM
im thinking the only problem I am having is the lack of support right now. This really is an amazing hack and would love to have it work. But I feel I found it to late and now will miss out on something simply awesome.

The Realist
08-23-2004, 09:41 AM
I have it working 100% on my forums, but I will say the developer sorted the problems out for me.

Regarding the developer, she was talking to me a few weeks ago on MSN and said she would be back in 10 minutes cos she was picking her son up from baseball. So far she's not come back on MSN or these forums.

Hopes she's ok?

But if you can solve your problems its well worth the hassle and trouble to get it working.



I was considering installing this. Based on the posts I've been reading, is it more trouble than it's worth?

Overseer
08-23-2004, 10:39 AM
Just a thought. Did you go inside the database and remove the querys that you added for the hack? I am not really skilled in PHP and have learned more from this hack than anything else. Let me know. Can I log into your forum and take a look for you? MIght be the easiest way.

Wential
08-23-2004, 01:47 PM
Ack, I installed it and got all the updates Sonia posted. But for some reason, I still can't save a location in the User/CP. All it says is:

-- NO FORECAST SELECTED --

Use the Forecast Options below to configure your weather display

-- NO FORECAST SELECTED --

Coyote75
08-23-2004, 04:52 PM
Just a thought. Did you go inside the database and remove the querys that you added for the hack? I am not really skilled in PHP and have learned more from this hack than anything else. Let me know. Can I log into your forum and take a look for you? MIght be the easiest way. If you want yes
pm me and I will give you my log in info

endless
08-23-2004, 08:12 PM
I have installed the hack, including the forumhome template addition.

I am getting an error in profile.php

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/williams/public_html/profile.php on line 3

Parse error: parse error, unexpected T_STRING in /home/williams/public_html/profile.php on line 3

I cannot figure this ;ast problem out. I'm not very well versed in php, though i have successfully installed other hacks and addons, as well as many other scripts without problem.

Any idea how I can fix the profile page?
http://www.williamslake.info/profile.php

Wential
08-23-2004, 08:25 PM
Can't help until you tell us what you're line 3 says in profile.php.

endless
08-23-2004, 08:30 PM
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 3.0.3 - Licence Number L-------
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000-2004 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('GET_EDIT_TEMPLATES', 'editsignature,updatesignature');
define('THIS_SCRIPT', 'profile');

That's the top of my profile.php page
Thanks alot, I appreciate it.

Wential
08-23-2004, 09:08 PM
Try removing this to see if it's what I think it is:
Start at line 2, don't remove the php code on line 1

/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBulletin 3.0.3 - Licence Number L-------
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2000-2004 Jelsoft Enterprises Ltd. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com (http://www.vbulletin.com/) | http://www.vbulletin.com/license.html # ||
|| ################################################## ################## ||
\*================================================ ======================*/

Holidazed
08-24-2004, 01:15 AM
I got this thing installed in my vb3.03 messageboard and got no errors doing it. Howver, I have no link anywhere in the usercp that refers to the worldweather forecast.

ideas?