install

Reviews
Shared by: cmoney12051
Categories
Tags
Stats
views:
108
rating:
not rated
reviews:
0
posted:
12/28/2008
language:
English
pages:
0
############################################################## ## MOD Title: Current Local Weather w/10 day forecast & PCP Integration## MOD Author: GroovePlugs < Francis@michaellewismusic.com > (Francis Lewis) http://michaellewismusic.com/forum## MOD Description: This mod allows registered users to pick a city## from within their profile and have the current and## 10 day forecast displayed on the main phpbb page. If## no city is selected or an invalid code is entered,## then no weather is displayed.#### MOD Version: 2.0.1## ## Installation Level: Intermediate## Installation Time: 15 Minutes ## Files To Edit: ## admin/admin_users.php## index.php## includes/usercp_register.php## includes/usercp_viewprofile.php## language/lang_english/lang_main.php## templates/subSilver/admin/user_edit_body.tpl## templates/subSilver/index_body.tpl## templates/subSilver/profile_add_body.tpl## templates/subSilver/profile_view_body.tpl## Included Files: ## admin/avc_mods/avc_weather.php## includes/weather.php## License: http://opensource.org/licenses/gpllicense.php GNU General Public License v2 ################################################################ For security purposes, please check: http://www.phpbb.com/mods/## for the latest version of this MOD. Although MODs are checked## before being allowed in the MODs Database there is no guarantee## that there are no security problems within the MOD. No support## will be given for MODs not found within the MODs Database which## can be found at http://www.phpbb.com/mods/############################################### ################# Author Notes: ## ## Copyright 2005 © Handyman.#### This mod will create a new field in your users table, Registering table## (for PCP only).## Registered members will see one of two things. Either "No City## Selected" or their weather. Users can modify their city code via their## profile and admins can edit them in the User Admin Management page. I## have made the zipcodes hidden to everyone (except the admin) when you## look at another user's profile. I don't think that should be public. As## I designed this mod, only the main index.php## page shows the weather. This can be altered, however, I don't think## users would want to see their weather on every page.## This Version now uses weather from weather.com#### I will not be able to offer support on any forum except for mine and## phpbb http://phpbb.com## "http://michaellewismusic.com/forum" as I don't have time to check the## other forums.#### Thanks. Have fun and God Bless.## http://michaellewismusic.com/pope (tribute to the great Pope John Paul## II)#### This mod utilizes the "Advanced Version Check" mod, the latest version## can be found here. http://www.phpbb.com/phpBB/viewtopic.php?t=277654######################## ######################################## MOD History:#### 2005-04-30 - Version 1.0.0## - Original release#### 2005-05-25 Version 1.1## - Fixed the code to be compatible with heavily modded boards#### 2005-6-28 - Version 1.2## - Fixed code to be compatible with different languages#### 2005-7-11 - Version 1.3## - Fixed some bugs in the city selector and the popups.#### 2005-7-23 - Version 1.3.1## - Fixed some not critical code in the install file.#### 2005-8-17 - Version 1.3.2## - Fixed an error PCP only. (see the PCP install file for## details) And made the install file more compatible with## Heavily modded boards#### 2005-12-26 - Version 2.0.0## - Now using Weather.com## - Added Advanced Version Check#### 2006-1-5 - Version 2.0.0## - Updated Install Files ## ## 2006-1-31 - Version 2.0.1 ## - Fixed a few errors in the install file and in ## includes/weather.php ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ SQL ]-----------------------------------------# ALTER TABLE phpbb_users ADD user_zipcode VARCHAR (10); # #-----[ COPY ]-----------------------------------------# copy admin/avc_mods/avc_weather.php to admin/avc_mods/avc_weather.php copy includes/weather.php to includes/weather.php # #-----[ OPEN ]-----------------------------------------# index.php # #-----[ FIND ]-----------------------------------------# include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); # #-----[ AFTER, ADD ]-----------------------------------------# // start weather mod require($phpbb_root_path . 'includes/weather.'.$phpEx); // start weather mod # #-----[ FIND ]-----------------------------------------# $template->set_filenames(array( 'body' => 'index_body.tpl') ); # #-----[ AFTER, ADD ]-----------------------------------------# // start weather mod $zip_code = $userdata['user_zipcode']; // end weather mod # #-----[ FIND ]-----------------------------------------# 'FORUM_LOCKED_IMG' => $images['forum_locked'], # #-----[ AFTER, ADD ]-----------------------------------------# // start weather mod 'ZIPCODE' => $zip_code, 'MY_WEATHER' => weather($zip_code), 'L_FORECAST' => $lang['forecast'], 'L_CURRENT_CONDITIONS' => $lang['Current_Conditions'], // end weather mod # #-----[ OPEN ]-----------------------------------------# templates/subSilver/index_body.tpl # #-----[ FIND ]-----------------------------------------# # #-----[ AFTER, ADD ]-----------------------------------------#
{L_FORECAST}
{MY_WEATHER}
# #-----[ OPEN ]-----------------------------------------# includes/usercp_register.php # #-----[ FIND ]-----------------------------------------# 'interests' => 'interests' # #-----[ IN-LINE FIND ]--------------------------------# 'interests' => 'interests' # #-----[ IN-LINE AFTER, ADD ]-----------------------------------# , 'zipcode' => 'zipcode' # #-----[ FIND ]-----------------------------------------# " . $avatar_sql . " # #-----[ IN-LINE FIND ]--------------------------------# " . $avatar_sql . " # #-----[ IN-LINE AFTER, ADD ]-----------------------------------# , user_zipcode = '" . str_replace("\'", "''", $zipcode) . "' # #-----[ FIND ]-----------------------------------------# user_id, username, # #-----[ IN-LINE FIND ]--------------------------------# username, # #-----[ IN-LINE AFTER, ADD ]-----------------------------------# user_zipcode, # #-----[ FIND ]-----------------------------------------# $user_id, '" . str_replace("\'", "''", $username) . "', # #-----[ IN-LINE FIND ]--------------------------------# '" . str_replace("\'", "''", $username) . "', # #-----[ IN-LINE AFTER, ADD ]-----------------------------------# '" . str_replace("\'", "''", $zipcode) . "', # #-----[ FIND ]-----------------------------------------# $username = $userdata['username']; # #-----[ AFTER, ADD ]-----------------------------------------# $zipcode = $userdata['user_zipcode']; # #-----[ FIND ]-----------------------------------------# $user_timezone, $user_dateformat, # #-----[ IN-LINE FIND ]--------------------------------# $user_dateformat, # #-----[ IN-LINE AFTER, ADD ]-----------------------------------# $zipcode, # #-----[ FIND ]-----------------------------------------# $template->assign_vars(array( 'USERNAME' => $username, # #-----[ AFTER, ADD ]-----------------------------------------# 'ZIPCODE' => $zipcode, # #-----[ FIND ]-----------------------------------------# $lang['Email_address'], # #-----[ AFTER, ADD ]-----------------------------------------# 'L_ZIPCODE' => $lang['zip_code'], 'L_ZIPCODE_VIEWABLE' => $lang['zip_code_viewable'], # #-----[ OPEN ]-----------------------------------------# admin/admin_users.php # #-----[ FIND ]-----------------------------------------# $email = ( !empty($HTTP_POST_VARS['email']) ) ? trim(strip_tags(htmlspecialchars( $HTTP_POST_VARS['email'] ) )) : ''; # #-----[ AFTER, ADD ]-----------------------------------------# $zipcode = ( !empty($HTTP_POST_VARS['zipcode']) ) ? trim(strip_tags( $HTTP_POST_VARS['zipcode'] ) ) : ''; # #-----[ FIND ]-----------------------------------------# if( isset( $HTTP_POST_VARS['avatargallery'] ) || isset( $HTTP_POST_VARS['submitavatar'] ) || isset( $HTTP_POST_VARS['cancelavatar'] ) ) { $username = stripslashes($username); $email = stripslashes($email); # #-----[ AFTER, ADD ]-----------------------------------------# $zipcode = htmlspecialchars(stripslashes($zipcode)); # #-----[ FIND ]-----------------------------------------# user_email = '" . str_replace("\'", "''", $email) . "', # #-----[ IN-LINE FIND ]--------------------------------# user_email = '" . str_replace("\'", "''", $email) . "', # #-----[ IN-LINE AFTER, ADD ]-----------------------------------# user_zipcode = '" . str_replace("\'", "''", $zipcode) . "', # #-----[ FIND ]-----------------------------------------# $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); $username = htmlspecialchars(stripslashes($username)); # #-----[ AFTER, ADD ]-----------------------------------------# $zipcode = stripslashes($zipcode); # #-----[ FIND ]-----------------------------------------# $username = $this_userdata['username']; $email = $this_userdata['user_email']; # #-----[ AFTER, ADD ]-----------------------------------------# $zipcode = $this_userdata['user_zipcode']; # #-----[ FIND ]-----------------------------------------# $s_hidden_fields .= ''; # #-----[ AFTER, ADD ]-----------------------------------------# $s_hidden_fields .= ''; # #-----[ FIND ]-----------------------------------------# $template->assign_vars(array( 'USERNAME' => $username, # #-----[ AFTER, ADD ]-----------------------------------------# 'ZIPCODE' => $zipcode, # #-----[ FIND ]-----------------------------------------# 'RANK_SELECT_BOX' => $rank_select_box, # #-----[ AFTER, ADD ]-----------------------------------------# 'L_ZIPCODE' => $lang['zip_code'], # #-----[ FIND ]-----------------------------------------# 'L_EMAIL_ADDRESS' => $lang['Email_address'], # #-----[ AFTER, ADD ]-----------------------------------------# 'L_ZIP_CODE' =>$lang['zip_code'], 'L_SELECT_CITY' => $lang['select_city'], # #-----[ OPEN ]-----------------------------------------# templates/subSilver/profile_add_body.tpl # #-----[ FIND ]-----------------------------------------# # #-----[ AFTER, ADD ]-----------------------------------------# {L_ZIPCODE}: {L_ZIPCODE_VIEWABLE} # #-----[ OPEN ]-----------------------------------------# templates/subSilver/admin/user_edit_body.tpl # #-----[ FIND ]-----------------------------------------# {L_USERNAME}: * # #-----[ AFTER, ADD ]-----------------------------------------# {L_ZIPCODE}: # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]-----------------------------------------# $lang['datetime']['Nov'] = 'Nov'; $lang['datetime']['Dec'] = 'Dec'; # #-----[ AFTER, ADD ]-----------------------------------------# $lang['zip_code'] = 'Weather City Code'; $lang['zip_code_viewable'] = '[This is NOT publicly viewable.]'; $lang['forecast'] = 'Your Local Forecast'; $lang['select_city'] = 'Select Your City'; $lang['withheld'] = 'Withheld'; $lang['no_city_selected'] = 'No City Selected
For Help, visit the forums at http://michaellewismusic.com/forum
'; $lang['Current_Conditions'] = 'Weather by http://michaellewismusic.com'; # #-----[ OPEN ]-----------------------------------------# includes/usercp_viewprofile.php # #-----[ FIND ]-----------------------------------------# // // Generate page // # #-----[ BEFORE, ADD ]-----------------------------------------# if($userdata['user_level'] == ADMIN) { $zipcode = $profiledata['user_zipcode']; } else { $zipcode = $lang['withheld']; } # #-----[ FIND ]-----------------------------------------# 'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage), # #-----[ AFTER, ADD ]-----------------------------------------# 'ZIPCODE' => $zipcode, # #-----[ FIND ]-----------------------------------------# 'L_INTERESTS' => $lang['Interests'], # #-----[ AFTER, ADD ]-----------------------------------------# 'L_ZIPCODE' => $lang['zip_code'], # #-----[ OPEN ]-----------------------------------------# templates/subSilver/profile_view_body.tpl # #-----[ FIND ]-----------------------------------------# {AVATAR_IMG}
{POSTER_RANK} # #-----[ AFTER, ADD ]-----------------------------------------# # #-----[ SAVE/CLOSE ALL FILES ]-----------------------------------------# # EoM
Shared by: cmoney12051
Other docs by cmoney12051
avc_weather
Views: 3  |  Downloads: 0
weather
Views: 4  |  Downloads: 0
install
Views: 65  |  Downloads: 0
test
Views: 2  |  Downloads: 0
test
Views: 2  |  Downloads: 0
mirandas story toc
Views: 20  |  Downloads: 0
mirandas story complete
Views: 35  |  Downloads: 0
mirandas story about the author
Views: 17  |  Downloads: 0
Related docs
install
Views: 19  |  Downloads: 0
strawwattle install
Views: 3  |  Downloads: 0
FIBA Install
Views: 9  |  Downloads: 0
ftire install
Views: 21  |  Downloads: 0
install en
Views: 6  |  Downloads: 0
install 1-0
Views: 0  |  Downloads: 0
install-mgmt
Views: 1  |  Downloads: 0
xamime install
Views: 6  |  Downloads: 0
FRPTank Install
Views: 5  |  Downloads: 0
install
Views: 0  |  Downloads: 0


{L_ZIPCODE}:  {ZIPCODE}