[外掛] 快速砍人1.3.2

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

版主: 版主管理群

主題已鎖定
Mac
百戰天龍馬蓋先
百戰天龍馬蓋先
文章: 2590
註冊時間: 2003-02-02 02:28
來自: MacphpBBMOD
聯繫:

[外掛] 快速砍人1.3.2

文章 Mac »

[php]<?php
###############################################
## Mod Title: Prune users
## Mod Version: 1.3.2
## Author: Niels Chr. Denmark < ncr@db9.dk > (Niels Chr. R鷣) HTTP://MODS.DB9.DK
##
## This mod is for phpBB2!! ver 2.0.3
##
## Description:
## Admin plug-in that makes it posible to delete users who are inactive/haven posted or like
## Makes it posible to make links for deletion of specific users
## a exampel of how to use this is included with the memberlist
## after this, a delete user button is showen in the meberlist
## If you do not want this "delete user button" in the memberlist, then don't
## do the changes to memberlist.php
##
## phpBB2 drop-in mod, that checks for unused accounts for X days
## Script only works while logged in as ADMIN, add the days=X as a extra parameter
## e.g. http://www.yourdomain.com/delete_users. ... in&days=10
## will delete all accounts who have never logged in and are older than 10 days
##
## And zero postes
## e.g. http://www.yourdomain.com/delete_users. ... er&days=10
## will delete all accounts who have never posted and are older than 10 days
##
## You can also delete specific users
## e.g. http://www.yourdomain.com/delete_users. ... user=Niels
## or http://www.yourdomain.com/delete_users. ... el_user=18
## Will delete a specific user either by name or by id, remember that this is NOT case sensetive
## if the user have posted, then his/her posts will be converted to posted by guest, and the users
## name wil still be showen
## There are NO undo function, and the script will not ask for confirmation, however
## the script will always show the name of the deleted users
##
## This mod you can customice your self, if you know a litle about SQL, make a new entry in the lang_admin.php (look how the others look)
## then inside the file admin_prune_users.php, is in the top, a "box" where you can fill with your statements
## and in the file delete_users.php, as the same, fill in both files witch the needed SQL command, and the entry is added
## you may sewlect if a notification email are to send out to the deleted user, to do this
## simply toggle the define('NOTIFY_USERS', true); true/false depending on if a notificatin is to be sendt out
## you can find this in the top of the file delete_users.php
##
## Installation Level: easy
## Installation Time: 1-2 Minutes
## Files To Edit: 2
## memberlist.php
## language/lang_english/lang_admin.php
##
## Included Files: 4
## delete_users.php
## admin/admin_prune_users.php
## language/lang_english/lang_prune_users.php
## templates/subsilver/admin/prune_users_body.tpl
##
## History:
## 0.9.0 - initial BETA
## 1.0.0 - initial release phpBB2 ver 2.0.0.
## 1.0.3 - history started, added admin plug-in module
## 1.0.4 - modifyed admin plug-in, to easyely be moded with more options
## 1.0.5 - now includes the RIGTH template file....sorry
## 1.0.6 - and now it also includes the RIGTH admin_prune_users.php....sorry once more
## 1.0.7 - lang['prune'] is already in use, so changed the name to ['Prune_commands']
## 1.1.0 - imporent update, the delete_users.php file have been updated, if you have used previous versions
## and at the same time have used user permissions on deleted user you should manual inspect your auth_access table
## 1.1.1 - changes to lang_admin.php
## 1.1.1 - confirmed for phpBB2 ver 2.0.2, no changes needed
## 1.1.2 - new version of delete_users.php, witch solve a usue about ' in usernames
## 1.3.0 - language file are now sepperated as a plug-in file
## 1.3.1 - now support email notification of deleted users
## 1.3.2 - corrected different details, reported by my user "jtp10181"
##
##############################################################
## This MOD is released under the GPL License.
## Intellectual Property is retained by the MOD Author(s) listed above
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Authors Notes:
##
## remeber to do the mod to all installed language/templates your board support
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
?>[/php]

包裹下載: http://mods.db9.dk/viewtopic.php?t=21
中文語系: http://phpbb-tw.net/phpbb/viewtopic.php?t=14115

1.3.2 修正了一些 BUG,希望能夠 "正常" 的刪除自訂時間的用戶了
(我還沒更新,所以不知道在 2.0.4 上這個問題解決了沒有)

~Mac
最後由 Mac 於 2003-05-13 01:58 編輯,總共編輯了 2 次。
+ 關於 phpBB 使用問題請在版面發問,私人訊息提供其他不相干或是隱私的事情聯絡之用。

phpBB 官網 | 竹貓星球 | MacphpBBMOD | 我的服務
頭像
shihchieh
竹貓忠實會員
竹貓忠實會員
文章: 509
註冊時間: 2002-10-07 13:02

文章 shihchieh »

時間正確了,phpbb204確定能用^^

131升級至132~

代碼: 選擇全部

# 
#-----[ OPEN ]------------------------------------------ 
# 
memberlist.php

# 
#-----[ FIND  ]------------------------------------------ 
#

.(($userdata['user_level']==ADMIN)?'<a href="' . append_sid("delete_users.$phpEx?mode=user_id&del_user=$user_id") . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . ' '.$username.'" title="' . $lang['Delete'] . ' '.$username.'" border="0" /></a>&':'')

# 
#-----[ REPLACE ]------------------------------------------ 
#

.(($userdata['user_level']==ADMIN)?'<a href="' . append_sid("delete_users.$phpEx?mode=user_id&del_user=$user_id") . '"><img 

src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . ' '.$username.'" title="' . $lang['Delete'] . ' '.$username.'" border="0" /></

a>&':'')

# 
#-----[ COPY ]------------------------------------------ 
# 
delete_users.php

# 
#-----[ COPY ]------------------------------------------ 
# 
language/your_lang/lang_prune_users.php

# 
#-----[ COPY ]------------------------------------------ 
# 
language/your_lang/email/delete_users.tpl

# 
#-----[ COPY ]------------------------------------------ 
# 
admin/admin_prune_users.php

# 
#-----[ COPY ]------------------------------------------ 
# 
templates/your_temp/admin/prune_users_body.tpl
---
Do you fear death ?
動機不明
喝咖啡的綠皮猴
喝咖啡的綠皮猴
文章: 1179
註冊時間: 2002-03-06 20:37
來自: GOP (重啟)

文章 動機不明 »

在 2.0.4 上面可跑
但是時間仍然不準.... @@"

請各位管理員們在刪除超過{規定時間}內未上站的會員 <- 這一點上要小心比對後再執行!!


--------
例:

選擇超過半年未上線的會員 <- 準備刪除的名單 =.=+
經檢查後卻發現,有些人最近才來過,照理應不在名單之中,可是程式卻把他們也列進來了
下刀前要注意,別被會員罵囉... ;-)
非官方外掛問題區公告: [必看]請配合發問格式及明確主題發問(2006 02/24更新)
七點要求:
1. 發問前先搜尋,確定沒有重複後再發表
2. 主題要明確
3. 依照發問格式
4. 禁連續推文
5. 請盡量減少使用地方性語言
6. 解決問題後請修改第一篇主題,並感謝曾經幫過你的前輩們 ^^
7. 請不要將檔案內容完整貼出喔! 只要提供問題行及上下各五行就可以了
sorry
星球普通子民
星球普通子民
文章: 29
註冊時間: 2002-04-29 06:23

[教學]快速砍人MOD 1.3.2 遇上問題時修正方法

文章 sorry »

說明 : 快速砍人MOD 1.3.2 遇上問題時修正方法
中文化 : 風笑痴(鐵心論壇)
原發表文章 : 快速砍人1.3.2 by Mac

昨天裝1.3.2, 發現如果你的論壇會員有數千以上, 這個MOD在後台使用時會有各種的問題出現. 到了作者發表頁查看得到以下解決方案 :

1. 解決一次顯示太多會員\r

打開 admin/admin_prune_users.php
尋找 :

代碼: 選擇全部

$default [0] 
這段碼會出現多次, 可自行決定哪個部分要改. 改成 =xxx 就可以, xxx 是數字如200就是一次只顯示200個.

甚至不顯示也可以 :

打開 admin_prune.php

尋找並移除

代碼: 選擇全部

   for($i = 0; $i < $user_count; $i++) 
   { 
      $style_color = ($user__list[$i]['user_level'] == ADMIN )?'style="color:#' . $theme['fontcolor3'] . '"':(( $user__list[$i]['user_level'] == MOD )?'style="color:#' . $theme['fontcolor2'] . '"':''); 
      $list[$n] .= ' <a href="' . append_sid($phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $user_list[$i]['user_id']) . '"' . $style_color .'><b>' . $user_list[$i]['username'] . '</b></a>'; 
   } 
2. 關掉刪除會員後會發信通知會員的功能, 這會令刪除過程快許多, 也避免了當email server有問題時產生的錯誤.

打開MOD裡的 delete_users.php

尋找\r

代碼: 選擇全部

define('NOTIFY_USERS', true);
替換成

代碼: 選擇全部

define('NOTIFY_USERS', false); 
3. 修改每次刪除多少個會員的數量

打開MOD裡的delete_users.php

尋找

代碼: 選擇全部

 
if(!$result = $db->sql_query('SELECT user_id , username, user_email, user_lang ' . $sql . ' ORDER BY username')) 
替換成

代碼: 選擇全部

if(!$result = $db->sql_query('SELECT user_id , username, user_email, user_lang ' . $sql . ' ORDER BY username LIMIT 800'))
打開MOD裡的 admin_prune_users.php

尋找\r

代碼: 選擇全部

$sql[$n]='SELECT DISTINCT user_id , username, user_level '.$sql[$n].' AND user_regdate<"'.(time()-(86400*$days [$n])).'" ORDER BY username';
替換成

代碼: 選擇全部

$sql[$n]='SELECT DISTINCT user_id , username, user_level '.$sql[$n].' AND user_regdate<"'.(time()-(86400*$days [$n])).'" ORDER BY username LIMIT 800';
註 : 以上兩處這樣設是每次刪800個, 以我的經驗就要調成每次刪200個左右才不會出錯誤頁. 請根據你的情況自行決定.

以上修改若有進一步問題可以參考作者原文
http://mods.db9.dk/viewtopic.php?t=1763
圖檔 PHPBB2.05+PLUS1.2
不要想你在此可以得到甚麼, 想想你可以對此有甚麼貢獻
Mowd
竹貓忠實會員
竹貓忠實會員
文章: 326
註冊時間: 2002-06-26 01:17
來自: 台北
聯繫:

文章 Mowd »

根據今天搜尋文章後找到解決時間不準的方法,感謝倉木麻衣會員提供:
==========================================

這個問題個人前幾天也有遇到過
後來發現時間會不太正確的原因是它使用user_lastvisit 欄位去判斷\r
事實上~這個欄位必須在user下回登入時才會被更新\r
主要是用來與目前登入時間比對~用以列出有多少未讀文章
使用者真正的登出時間可由user_sesion_time這個欄位得出\r
個人將比對的時間欄位換成user_session_time後~就能正常運作
不會再出現該使用者明明在一二星期前來訪過~卻被判斷成超過60天未登入\r
改法大致如下

#
#-----[ OPEN ]---------------------------------------------
#

代碼: 選擇全部

admin/admin_prune_users.php
#
#-----[ FIND ]---------------------------------------------
#

代碼: 選擇全部

$sql [3] = ' AND user_lastvisit<'.(time()-86400*60); 
#
#-----[ REPLACE WITH ]---------------------------------------------
#

代碼: 選擇全部

$sql [3] = ' AND user_session_time<'.(time()-86400*60); 
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
真慘~
之前講到要修改的那個檔案(admin/admin_prune_users.php)
只是列出符合條件的使用者而已\r
還要記得改 delete_users.php 檔才行
否則一樣會砍錯人*.* (剛才才發現..被刪掉的人數與列出的人數不符)
#
#-----[ OPEN ]---------------------------------------------
#

代碼: 選擇全部

delete_users.php
#
#-----[ FIND ]---------------------------------------------
#

代碼: 選擇全部

user_lastvisit<'.(time()-86400*60)
#
#-----[ REPLACE WITH ]---------------------------------------------
#

代碼: 選擇全部

user_session_time<'.(time()-86400*60)
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
主題已鎖定

回到「非官方認證外掛」