VB World Weather
This modification is in the archives.
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 Spoiler (click to open)
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... Code:
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.... 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... Code:
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.... open 'FORUMHOME' Then find the following.... Code:
<head> // change the url to the url you are using Code:
<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.... Code:
</table> <br /> <!-- end what's going on box --> Right above the '</table>' add what is below... Code:
<!-- 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.... Code:
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..... Code:
(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.... // 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.... PHP Code:
'places' => array(
replace with.... PHP Code:
'places' => array(
find this... (the old weather block) PHP Code:
if (!($permissions['genericpermissions'] & CANMODIFYPROFILE))
replace with.... PHP Code:
if (!($permissions['genericpermissions'] & CANMODIFYPROFILE))
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'! Code:
(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! PHP Code:
open ./index.php find the following..... PHP Code:
// ### WELCOME MESSAGE #################################################
replace with..... PHP Code:
// ### WELCOME MESSAGE #################################################
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..... PHP Code:
// special tags you need to change ( 2 -> field_start, field_end )
Open.... ./includes/functions_user.php find the following code! PHP Code:
function fetch_profilefields($formtype = 0) // 0 indicates a profile field, 1 indicates an option field
PHP Code:
function fetch_profilefields($formtype = 0) // 0 indicates a profile field, 1 indicates an option field
using my example..... PHP Code:
// special tag you need to change ( 1 -> option_id )
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 Close
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! Download This modification is archived and cannot be downloaded. Screenshots
|
Similar Mods
vB Weather: Give your members current weather and forecasts! | vBulletin 2.x Full Releases |