引用 | 編輯
香吉士
2009-09-30 18:52 |
樓主
|
||
x0
【插件資訊】插件名稱:限制灌水(重複回帖限制) 適用版本:7.0 語言編碼:通用 插件作者:pole1010 版權所屬:pole1010 原帖連結:http://www.alan888.com/Discuz/thread-166655-1-3.html 支持網站:http://www.pole1010.ec168host.com/index.php 【插件說明】 從6.0演變過來的,經檢測後證明6.1是有效的...* 7.0略修 1.打開 include/newreply.inc.php 查找:複製程式 $attachment = empty($attachments) ? 0 : ($imageexists ? 2 : 1); 在下面增加: 複製程式 // ********************* 重複回帖檢測 ***************************** $repeatlevel = 2; // 重複回帖的驗證級別 $chk_sql = "SELECT COUNT(*) FROM {$tablepre}posts WHERE "; $chk_term = ""; switch($repeatlevel) { case 1: $chk_term = "subject='{$subject}'"; break; case 2: $chk_term = "message='{$message}'"; break; case 3: $chk_term = "subject='{$subject}' AND message='{$message}'"; break; case 4: $chk_term = "subject='{$subject}' AND message='{$message}' AND authorid='{$discuz_uid}'"; break; } if($chk_term) { $chk_num = $db->result($db->query($chk_sql . $chk_term), 0); if($chk_num > 0) { showmessage('請不要重複回帖,這很浪費資源的。請返回。'); } } // ********************* 重複回帖檢測 ***************************** 關於回帖的重複檢測級別, 直接修改 $repeatlevel 參數就行了。下面是當這個變量的值為1~4的時候所代表的級別: 1 - 標題與數據庫裡的記錄一致即算重複 x0
|