[外掛]Edit user posts via ACP

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

版主: 版主管理群

主題已鎖定
GeniusKiKi
竹貓忠實會員
竹貓忠實會員
文章: 1086
註冊時間: 2003-10-28 14:50

[外掛]Edit user posts via ACP

文章 GeniusKiKi »

功能:讓管理員可以編輯用戶的發表文章數量
來源:http://www.phpbbhacks.com/viewhack.php?id=263

[php]##########################################################################################
##
## Hack Title: Edit user posts via ACP
## Hack Version: 1.0.3 (ex phpBB 2.0.4)
## Author: Acid
## Support: http://www.phpbbhacks.com/forums
##
## Description: A hack to have the ability to edit the count of
## user_posts per admin panel.
##
## Files to edit: 3
## language/lang_english/lang_admin.php
## admin/admin_users.php
## templates/xxx/admin/user_edit_body.tpl
##
##########################################################################################
##
## Notes:
## First always make a back-up from the files that you're going to edit.
##
##########################################################################################
##
## Versions:
##
## 1.0.3 - added style sheet to post field
## 1.0.2 - fixed a typo
## 1.0.1 - fixed a bug (user_posts will be display in field now ;))
## 1.0 - Release
##
########################################################################################## [/php]

[php]#-----[ ACTION: OPEN ]------------------------------------------
# language/lang_english/lang_admin.php
#
#-----[ FIND (just a quote) ]---------------------------------------------------
#
$lang['User_special_explain'] = '...

#
#-----[ AFTER ADD ]---------------------------------------------------
#
$lang['Set_posts'] = 'User Posts';




#
#-----[ ACTION: OPEN ]------------------------------------------
# admin/admin_users.php
#
#-----[ FIND ]---------------------------------------------------
#
$location = ( !empty($HTTP_POST_VARS['location']) ) ? trim(strip_tags( $HTTP_POST_VARS['location'] ) ) : '';

#
#-----[ AFTER ADD ]---------------------------------------------------
#
$user_posts = ( !empty($HTTP_POST_VARS['user_posts']) ) ? trim(strip_tags( $HTTP_POST_VARS['user_posts'] ) ) : 0;


#
#-----[ FIND ]---------------------------------------------------
#
$location = htmlspecialchars(stripslashes($location));

#
#-----[ AFTER ADD ]---------------------------------------------------
#
$user_posts = htmlspecialchars(stripslashes($user_posts));


#
#-----[ FIND ]---------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
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_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
WHERE user_id = $user_id";

#
#-----[ IN-LINE FIND ]---------------------------------------------------
#
user_from = '" . str_replace("\'", "''", $location) . "'

#
#-----[ AFTER ADD ]---------------------------------------------------
#
, user_posts = '" . str_replace("\'", "''", $user_posts) . "'


#
#-----[ FIND ]---------------------------------------------------
#
$location = htmlspecialchars(stripslashes($location));

#
#-----[ AFTER ADD ]---------------------------------------------------
#
$user_posts = htmlspecialchars(stripslashes($user_posts));


#
#-----[ FIND ]---------------------------------------------------
#
$location = htmlspecialchars($this_userdata['user_from']);

#
#-----[ AFTER ADD ]---------------------------------------------------
#
$user_posts = htmlspecialchars($this_userdata['user_posts']);


#
#-----[ FIND ]---------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="location" value="' . str_replace("\\"", """, $location) . '" />';

#
#-----[ AFTER ADD ]---------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="user_posts" value="' . str_replace("\"", """, $user_posts) . '" />';


#
#-----[ FIND ]---------------------------------------------------
#
'LOCATION' => $location,

#
#-----[ AFTER ADD ]---------------------------------------------------
#
'USER_POSTS' => $user_posts,


#
#-----[ FIND ]---------------------------------------------------
#
'L_LOCATION' => $lang['Location'],

#
#-----[ AFTER ADD ]---------------------------------------------------
#
'L_SET_POSTS' => $lang['Set_posts'],




#
#-----[ ACTION: OPEN ]------------------------------------------
# templates/xxx/admin/user_edit_body.tpl

#
#-----[ FIND ]---------------------------------------------------
#
<tr>
<td class="row1" colspan="2"><span class="gensmall">{L_SPECIAL_EXPLAIN}</span></td>
</tr>

#
#-----[ AFTER ADD ]---------------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_SET_POSTS}</span></td>
<td class="row2"><input class="post" type="text" name="user_posts" value="{USER_POSTS}" size="10" maxlength="10" /></td>
</tr>

##########################################################################################
##########################################################################################
########################################################################################## [/php]

想要懲處灌水會員的時候會很好用
再也不當爛好人...
好人是小白轉型成大白的墊腳石...
主題已鎖定

回到「非官方認證外掛」