[外掛]使用者編輯頭像大小0.0.1.a

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
御津闇慈
竹貓忠實會員
竹貓忠實會員
文章: 645
註冊時間: 2001-11-17 10:59

[外掛]使用者編輯頭像大小0.0.1.a

文章 御津闇慈 »

這外掛是稍微有點棘手
所以要仔細比對安裝喔(我看比對完眼睛拖窗XDXD)
雖然國外有這類型的外掛
不過卻蠻多人安裝失敗
除非是實體主機...........
所以我才寫了這外掛 :mrgreen:

代碼: 選擇全部

############################################################## 
## 外掛名稱: 使用者編輯頭像大小
## 外掛作者: 炎之虛空 < zxery3@hotmail.com > (廢鐵處理場) http://zxerpro.org/phpbb/index.php 
## 外掛描述: 這個外掛可以使用戶自行調整連結頭像大小  
##        只在 phpBB 2.0.6 執行過測試 
## 外掛版本: 0.0.1.a 
## 
## 此外掛的安裝難度: 中等 
## 安裝須時: 40 ~ 60 分鐘 
## 要修改的檔案: 8 
## admin/admin_users.php 
## language/lang_xxx/lang_main.php  
## includes/usercp_viewprofile.php 
## includes/usercp_register.php 
## includes/usercp_avatar.php 
## viewtopic.php 
## templates/YOUR_TEMPLATE/admin/user_edit_body.tpl 
## templates/YOUR_TEMPLATE/profile_add_body.tpl 
## 
############################################################## 
## 備註A: 
## 
############################################################## 
## 在安裝前, 必須備份所有檔案 
############################################################## 
## 備註B: 
## 
############################################################## 
## 禁止PHPBB-HK擅自使用(嚴重警告) 
##############################################################
# 
#-----[ SQL語法開始 ]------------------------------------------ 
# 
ALTER TABLE phpbb_users ADD user_width int(11) unsigned NOT NULL default '0';
ALTER TABLE phpbb_users ADD user_height int(11) unsigned NOT NULL default '0';
# 
#-----[ SQL語法結束 ]------------------------------------------ 
# 
# 
#-----[ 開啟 ]------------------------------------------ 
# 
language/lang_xxx/lang_main.php 
# 
#-----[ 尋找 ]-------------------------------------- 
# 
// 
// That's all Folks!
# 
#-----[ 在上面加入 ]-------------------------------- 
# 
Virtual_Width_Height_MOD
$lang['User_Width_Height'] = "圖片大小設定"; // Virtual_Width_Height_MOD
$lang['Virtual_Width'] = "寬度(像素)"; // Virtual_Width_MOD
$lang['Virtual_Height'] = "長度(像素)"; // Virtual_Height_MOD
$lang['Width_too_long'] = "您的頭像寬度設定超過論壇預設值,預設值為" . $board_config['avatar_max_width'] . "像素";
$lang['Height_too_long'] = "您的頭像長度設定超過論壇預設值,預設值為" . $board_config['avatar_max_height'] . "像素";
# 
#-----[ 開啟 ]------------------------------------------ 
# 
includes/usercp_viewprofile.php 
# 
#-----[ 尋找 ]-------------------------------------- 
# 
case USER_AVATAR_REMOTE:
			$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0"/>' : '';
# 
#-----[ 替換 ]-------------------------------------- 
# 
case USER_AVATAR_REMOTE:
			$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" width="' . $profiledata['user_width'] . '" height="' . $profiledata['user_height'] . '"/>' : '';
# 
#-----[ 存檔 ]------------------------------------------ 
# 
# 
#-----[ 開啟 ]------------------------------------------ 
# 
includes/usercp_register.php
# 
#-----[ 尋找 ]-------------------------------------- 
#
$strip_var_list = array('username' => 'username', 'email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests');
# 
#-----[ 替換]-------------------------------------- 
#
$strip_var_list = array('username' => 'username', 'email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests', 'width' => 'width', 'height' => 'height');
# 
#-----[ 備註 ]-------------------------------------- 
#
在 'interests' => 'interests'後面加入, 'width' => 'width', 'height' => 'height'
# 
#-----[ 尋找 ]-------------------------------------- 
#
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);
# 
#-----[ 替換]-------------------------------------- 
#
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $width, $height, $signature);
# 
#-----[ 備註 ]-------------------------------------- 
#
在$interests後面加入, $width, $height
# 
#-----[ 尋找 ]-------------------------------------- 
#
$occupation = stripslashes($occupation);
# 
#-----[ 下方加入 ]-------------------------------------- 
#
		$width = stripslashes($width);
		$height = stripslashes($height);
# 
#-----[ 尋找 ]-------------------------------------- 
#
if ( $signature != '' )
# 
#-----[ 上面加入 ]-------------------------------------- 
#
	if ( $height > $board_config['avatar_max_height'] ) 
	        { 
	                $error = TRUE; 
	                $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Height_too_long'];
	                $height = $board_config['avatar_max_height']; 
	        }
	if ( $width > $board_config['avatar_max_width'] ) 
	        { 
	                $error = TRUE; 
	                $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Width_too_long']; 
	                $width = $board_config['avatar_max_width'];
	        }
# 
#-----[ 說明 ]-------------------------------------- 
#
假如頭像超過設定值,上方會出現錯誤訊息,並且會強制修改成論壇預設值的大小
# 
#-----[ 尋找 ]-------------------------------------- 
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
# 
#-----[ 替換]-------------------------------------- 
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_width = '" . str_replace("\'", "''", $width) . "', user_height = '" . str_replace("\'", "''", $height) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
# 
#-----[ 備註 ]-------------------------------------- 
#
在, user_sig = '" . str_replace("\'", "''", $signature) . "'後面加入, user_width = '" . str_replace("\'", "''", $width) . "', user_height = '" . str_replace("\'", "''", $height) . "'
# 
#-----[ 尋找 ]-------------------------------------- 
#
$sql = "INSERT INTO " . USERS_TABLE . "	(user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
# 
#-----[ 替換]-------------------------------------- 
#
$sql = "INSERT INTO " . USERS_TABLE . "	(user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_width, user_height, user_style, user_level, user_allow_pm, user_active, user_actkey)
# 
#-----[ 備註 ]-------------------------------------- 
#
在user_lang,後面加入 user_width, user_height,
# 
#-----[ 尋找 ]-------------------------------------- 
#
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
# 
#-----[ 替換]-------------------------------------- 
#
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', '" . str_replace("\'", "''", $width) . "', '" . str_replace("\'", "''", $height) . "', $user_style, 0, 1, ";
# 
#-----[ 備註 ]-------------------------------------- 
#
在 '" . str_replace("\'", "''", $user_lang) . "',後面加入 '" . str_replace("\'", "''", $width) . "', '" . str_replace("\'", "''", $height) . "',
# 
#-----[ 尋找 ]-------------------------------------- 
#
'OCC' => $occupation,
# 
#-----[ 下方加入 ]-------------------------------------- 
#
					'USER_WIDTH' => $user_width,
					'USER_HEIGHT' => $user_height,
# 
#-----[ 尋找]-------------------------------------- 
#
	$occupation = stripslashes($occupation);
# 
#-----[ 下方加入 ]-------------------------------------- 
#
	$height = stripslashes($height);
	$width = stripslashes($width);	
# 
#-----[ 尋找]-------------------------------------- 
#
$occupation = $userdata['user_occ'];
# 
#-----[ 下方加入 ]-------------------------------------- 
#
	$width = $userdata['user_width'];
	$height = $userdata['user_height'];
# 
#-----[ 尋找 ]-------------------------------------- 
#	
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
# 
#-----[ 替換]-------------------------------------- 
#
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $width, $height, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
# 
#-----[ 備註 ]-------------------------------------- 
#
在$occupation,加入 $width, $height,
# 
#-----[ 尋找 ]-------------------------------------- 
#
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt=""/>' : '';
# 
#-----[ 替換]-------------------------------------- 
#
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt="" width="' . $width . '" height="' . $height . '"/>' : '';
# 
#-----[ 尋找 ]-------------------------------------- 
#
'OCCUPATION' => $occupation,
# 
#-----[ 下方加入 ]-------------------------------------- 
#
		'WIDTH' => $width,
		'HEIGHT' => $height,
# 
#-----[ 尋找 ]-------------------------------------- 
#
'L_INTERESTS' => $lang['Interests'],
# 
#-----[ 下方加入 ]-------------------------------------- 
#
		'USER_WIDTH' => $user_width, // Virtual_Width_MOD
		'USER_HEIGHT' => $user_height, // Virtual_Height_MOD
		'L_USER_WIDTH_HEIGHT' => $lang['User_Width_Height'], // Virtual_Width_Height_MOD
		'L_USER_WIDTH' => $lang['Virtual_Width'], // Virtual_Width_MOD
		'L_USER_HEIGHT' => $lang['Virtual_Height'], // Virtual_Height_MOD
# 
#-----[ 存檔 ]------------------------------------------ 
# 
# 
#-----[ 開啟 ]------------------------------------------ 
# 
includes/usercp_avatar.php 
# 
#-----[ 尋找 ]-------------------------------------- 
#
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popup_pm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat, &$session_id)
# 
#-----[ 替換]-------------------------------------- 
#
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popup_pm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$height, &$width, &$timezone, &$dateformat, &$session_id)
# 
#-----[ 備註 ]-------------------------------------- 
#
在 &$language,後面加入 &$height, &$width,
# 
#-----[ 尋找 ]-------------------------------------- 
#
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
# 
#-----[ 替換]-------------------------------------- 
#
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'width', 'height', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
# 
#-----[ 備註 ]-------------------------------------- 
#
在, 'location',後面加上 'width', 'height',
# 
#-----[ 存檔 ]------------------------------------------ 
# 
# 
#-----[ 開啟 ]------------------------------------------ 
# 
viewtopic.php
# 
#-----[ 尋找 ]-------------------------------------- 
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_level, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, $cash_field u.user_allow_viewonline, u.user_session_time, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
# 
#-----[ 替換]-------------------------------------- 
#
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_width, u.user_height, u.user_level, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, $cash_field u.user_allow_viewonline, u.user_session_time, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
# 
#-----[ 備註 ]-------------------------------------- 
#
在, u.user_sig,後面加上 u.user_width, u.user_height, 
# 
#-----[ 尋找 ]-------------------------------------- 
#
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0"/>' : '';
# 
#-----[ 替換]-------------------------------------- 
#
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" width="' . $postrow[$i]['user_width'] . '" height="' . $postrow[$i]['user_height'] . '"/>' : '';
# 
#-----[ 存檔 ]------------------------------------------ 
# 
# 
#-----[ 開啟 ]------------------------------------------ 
# 
admin/admin_users.php 
# 
#-----[ 尋找 ]-------------------------------------- 
#
$user_allowavatar = ( !empty($HTTP_POST_VARS['user_allowavatar']) ) ? intval( $HTTP_POST_VARS['user_allowavatar'] ) : 0;
# 
#-----[ 下方加入 ]-------------------------------------- 
#
		// Virtual_Width_MOD
		$user_width = (!empty($HTTP_POST_VARS['user_width'])) ? $HTTP_POST_VARS['user_width'] : 0;
		// Virtual_Height_MOD
		$user_height = (!empty($HTTP_POST_VARS['user_height'])) ? $HTTP_POST_VARS['user_height'] : 0;
# 
#-----[ 尋找 ]-------------------------------------- 
#
		else if( $user_avatar_local != "" && $avatar_sql == "" && !$error )
		{
			$avatar_sql = ", user_avatar = '" . str_replace("\'", "''", $user_avatar_local) . "', user_avatar_type = " . USER_AVATAR_GALLERY;
		}
# 
#-----[ 下方加入 ]-------------------------------------- 
#
		// Virtual_Width_MOD
		if( !is_numeric($user_width) )
		{
			$error = TRUE;
			$error_msg = ( !empty($error_msg) ) ? ($error_msg . "<br />" . $lang['Width_Format_Error']) : $lang['Width_Format_Error'];
		}
		// Virtual_Height_MOD
		if( !is_numeric($user_height) )
		{
			$error = TRUE;
			$error_msg = ( !empty($error_msg) ) ? ($error_msg . "<br />" . $lang['Height_Format_Error']) : $lang['Height_Format_Error'];
		}
# 
#-----[ 尋找 ]-------------------------------------- 
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_nickname = '" . str_replace("\'", "''", $nickname) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
# 
#-----[ 替換 ]-------------------------------------- 
#
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_nickname = '" . str_replace("\'", "''", $nickname) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . ", user_width = '$user_width', user_height = '$user_height'
# 
#-----[ 備註 ]-------------------------------------- 
#
在$avatar_sql . "後方加入, user_width = '$user_width', user_height = '$user_height'
# 
#-----[ 尋找 ]-------------------------------------- 
#
$smilies_status = ($this_userdata['user_allowsmile'] ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
# 
#-----[ 下方加入 ]-------------------------------------- 
#
		$user_width = $this_userdata['user_width'];
		$user_height = $this_userdata['user_height'];
# 
#-----[ 尋找 ]-------------------------------------- 
#
$s_hidden_fields .= '<input type="hidden" name="user_rank" value="' . $user_rank . '" />';
# 
#-----[ 下方加入 ]-------------------------------------- 
#
			$s_hidden_fields .= '<input type="hidden" name="user_width" value="' . $user_width . '" />';
			$s_hidden_fields .= '<input type="hidden" name="user_height" value="' . $user_height . '" />';
# 
#-----[ 尋找 ]-------------------------------------- 
#
$avatar = '<img src="' . $user_avatar . '" alt=""/>';
# 
#-----[ 替換 ]-------------------------------------- 
#
$avatar = '<img src="' . $user_avatar . '" alt="" width="' . $user_width . '" height="' . $user_height . '"/>';
# 
#-----[ 尋找 ]-------------------------------------- 
#
	'RANK_SELECT_BOX' => $rank_select_box,
# 
#-----[ 下方加入 ]-------------------------------------- 
#	
			'USER_WIDTH' => $user_width, // Virtual_Width_MOD
			'USER_HEIGHT' => $user_height, // Virtual_Height_MOD
			'L_USER_WIDTH_HEIGHT' => $lang['User_Width_Height'], // Virtual_Width_Height_MOD
			'L_USER_WIDTH' => $lang['Virtual_Width'], // Virtual_Width_MOD
			'L_USER_HEIGHT' => $lang['Virtual_Height'], // Virtual_Height_MOD

# 
#-----[ 存檔 ]------------------------------------------ 
# 
[以下有可能大家的風格不一樣,所以請自行判斷]
# 
#-----[ 開啟 ]------------------------------------------ 
#
user_edit_body.tpl
# 
#-----[ 尋找 ]-------------------------------------- 
#
</tr>
<!-- END avatar_remote_link -->
# 
#-----[ 上方加入 ]-------------------------------------- 
#	
<tr> 
<td class="row1"><span class="gen">{L_USER_WIDTH_HEIGHT}:</span></td>
<td class="row2">{L_USER_HEIGHT}<input type="text" name="user_height" value="{USER_HEIGHT}" size="3" /> x {L_USER_WIDTH}<input type="text" name="user_width" value="{USER_WIDTH}" size="3" /></td>
</tr>
# 
#-----[ 存檔 ]------------------------------------------ 
# 
# 
#-----[ 開啟 ]------------------------------------------ 
#
profile_add_body.tpl
# 
#-----[ 尋找 ]-------------------------------------- 
#
</tr>
<!-- END switch_avatar_remote_link -->
# 
#-----[ 上方加入 ]-------------------------------------- 
#
<tr> 
<td class="row1"><span class="gen">{L_USER_WIDTH_HEIGHT}:</span></td>
<td class="row2">{L_USER_HEIGHT}<input type="text" name="height" value="{HEIGHT}" size="3" /> x {L_USER_WIDTH}<input type="text" name="width" value="{WIDTH}" size="3" /></td>
</tr>
# 
#-----[ 存檔 ]------------------------------------------ 
# 
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

文章 天霜 »

  • Bug 修正:
    修正選完系統相簿的圖後,回到個人資料時發生資料錯亂的問題
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

includes/usercp_avatar.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popup_pm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$height, &$width, &$timezone, &$dateformat, &$session_id)
#
#-----[ DELETE 刪除 ]----------------------------------------------
#

代碼: 選擇全部

 &$height, &$width,
#
#-----[ IN LINE FIND 繼續在這一行尋找 ]----------------------------
#

代碼: 選擇全部

&$location, &$occupation, 
#
#-----[ IN LINE AFTER, ADD 在指定之後, 加上 ]----------------------
#

代碼: 選擇全部

&$height, &$width, 
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'width', 'height', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
#
#-----[ DELETE 刪除 ]----------------------------------------------
#

代碼: 選擇全部

 'width', 'height',
#
#-----[ IN LINE FIND 繼續在這一行尋找 ]----------------------------
#

代碼: 選擇全部

'location', 'occupation', 
#
#-----[ IN LINE AFTER, ADD 在指定之後, 加上 ]----------------------
#

代碼: 選擇全部

'width', 'height', 
#
#-----[ SAVE/CLOSE ALL FILES 儲存/關閉所有檔案 ]-------------------
#
# EoM 外掛修正結束
天霜
竹貓忠實會員
竹貓忠實會員
文章: 882
註冊時間: 2003-04-15 19:40
來自: 星之鄉學園
聯繫:

文章 天霜 »

如果你不希望高&寬數值留白就是強制顯示成小小的一點的話\r

照以下修改就可改成高&寬數值留白顯示為原始大小

也就是將這個外掛改為單純的設定連結頭像高&寬的功能\r

#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

language/lang_chinese_traditional_taiwan/lang_main.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

$lang['User_Width_Height'] = "圖片大小設定"; // Virtual_Width_Height_MOD
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

$lang['User_Width_Height_explain'] = "輸入連結頭像的高度與寬度數值<br/>如果留白, 圖片將以原來的大小顯示";
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

includes/usercp_viewprofile.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
#
#-----[ BEFORE ADD 之前, 加上 ]------------------------------------
#

代碼: 選擇全部

$user_width = ( $profiledata['user_width'] ) ? 'width="' . $profiledata['user_width'] . '"' : '';
$user_height = ( $profiledata['user_height'] ) ? 'height="' . $profiledata['user_height'] . '"' : '';
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

case USER_AVATAR_REMOTE: 
         $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" width="' . $profiledata['user_width'] . '" height="' . $profiledata['user_height'] . '"/>' : '';
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

case USER_AVATAR_REMOTE:
         $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" alt="" border="0" ' . $user_width . ' ' . $user_height . '/>' : '';
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

includes/usercp_register.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

	if ( $user_avatar_type )
	{
		switch( $user_avatar_type )
		{
			case USER_AVATAR_UPLOAD:
#
#-----[ BEFORE ADD 之前, 加上 ]------------------------------------
#

代碼: 選擇全部

	$user_width = ( $userdata['user_width'] ) ? 'width="' . $userdata['user_width'] . '"' : '';
	$user_height = ( $userdata['user_height'] ) ? 'height="' . $userdata['user_height'] . '"' : '';
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt="" width="' . $width . '" height="' . $height . '"/>' : '';
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $user_avatar . '" alt="" ' . $user_width . ' ' . $user_height . '/>' : '';
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

'L_USER_WIDTH_HEIGHT' => $lang['User_Width_Height'], // Virtual_Width_Height_MOD
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

'L_USER_WIDTH_HEIGHT_EXPLAIN' => $lang['User_Width_Height_explain'], // Virtual_Width_Height_MOD 
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

viewtopic.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

	if ( $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] )
	{
		switch( $postrow[$i]['user_avatar_type'] )
		{
			case USER_AVATAR_UPLOAD:
#
#-----[ BEFORE ADD 之前, 加上 ]------------------------------------
#

代碼: 選擇全部

	$user_width = ( $postrow[$i]['user_width'] ) ? 'width="'.$postrow[$i]['user_width'].'"' : '';
	$user_height = ( $postrow[$i]['user_height'] ) ? 'height="'.$postrow[$i]['user_height'].'"' : '';
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" width="' . $postrow[$i]['user_width'] . '" height="' . $postrow[$i]['user_height'] . '"/>' : '';
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $postrow[$i]['user_avatar'] . '" alt="" border="0" ' . $user_width . ' ' . $user_height . '/>' : '';
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

admin/admin_users.php
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

		if( $user_avatar_type )
		{
			switch( $user_avatar_type )
			{
				case USER_AVATAR_UPLOAD:
#
#-----[ BEFORE ADD 之前, 加上 ]------------------------------------
#

代碼: 選擇全部

		$user_avatar_width = ( $this_userdata['user_width'] ) ? 'width="' . $this_userdata['user_width'] . '"' : '';
		$user_avatar_height = ( $this_userdata['user_height'] ) ? 'height="' . $this_userdata['user_height'] . '"' : '';
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

$avatar = '<img src="' . $user_avatar . '" alt="" width="' . $user_width . '" height="' . $user_height . '"/>';
#
#-----[ REPLACE WITH 替換 ]----------------------------------------
#

代碼: 選擇全部

$avatar = '<img src="' . $user_avatar . '" alt="" ' . $user_avatar_width . ' ' . $user_avatar_height . '/>';
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

'L_USER_WIDTH_HEIGHT' => $lang['User_Width_Height'], // Virtual_Width_Height_MOD
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

'L_USER_WIDTH_HEIGHT_EXPLAIN' => $lang['User_Width_Height_explain'], // Virtual_Width_Height_MOD 
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/admin/user_edit_body.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

<td class="row1"><span class="gen">{L_USER_WIDTH_HEIGHT}:
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

</span><br /><span class="gensmall">{L_USER_WIDTH_HEIGHT_EXPLAIN}
#
#-----[ OPEN 打開 ]------------------------------------------------
#

代碼: 選擇全部

templates/subSilver/profile_add_body.tpl
#
#-----[ FIND 尋找 ]------------------------------------------------
#

代碼: 選擇全部

<td class="row1"><span class="gen">{L_USER_WIDTH_HEIGHT}:
#
#-----[ AFTER, ADD 之後, 加上 ]------------------------------------
#

代碼: 選擇全部

</span><br /><span class="gensmall">{L_USER_WIDTH_HEIGHT_EXPLAIN}
#
#-----[ 儲存/關閉所有檔案 ]----------------------------------------
#
# 外掛修正結束
主題已鎖定

回到「非官方認證外掛」