[外掛]Double Post Control MOD

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

版主: 版主管理群

主題已鎖定
依夢兒
竹貓忠實會員
竹貓忠實會員
文章: 2013
註冊時間: 2002-11-20 00:07

[外掛]Double Post Control MOD

文章 依夢兒 »

介紹
一個很實用的小外掛,可以避免網友在發表文章的時候,因為不小心多按一次「送出」,造成重覆發文的現象。
也可以勸導那一些喜歡以「公式化」的回文方式來回覆文章的「灌水魔人」不要再繼續灌水。


原文
http://ikrontik.adamhurst.com/download-file-12.html


安裝

代碼: 選擇全部

##############################################################
## MOD Title: Double Post Control MOD
## MOD Author: Kinetix < webmaster@ikrontik.tk > (N/A) http://www.ikrontik.tk
## MOD Description: This MOD effectively stops users from posting the same message
##                  twice in a row.
## MOD Version: 1.1.0
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: 2: includes/functions_post.php
##                   language/lang_english/lang_main.php
## Included Files: 0
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ 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/
##############################################################
## Author Notes: None.
##
##############################################################
## MOD History:  1.0.0 Initial Release
##               1.1.0 Posts with BBCode were not double post checked (uid).
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

# IMPORTANT: Some FIND commands only contain partial lines.  Unless the script calls for an
# "IN-LINE ADD," always add new segments of code on separate lines.  Also, before an In-Line
# Find, you'll often see a FIND.  These FINDS are there to help you locate the lines where
# In-Line FIND will work.
#
#-----[ 開啟 ]------------------------------------------
#
includes/functions_post.php
#
#-----[ 尋找 ]------------------------------------------
#
		//
		// Flood control
		//
		$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
		$sql = "SELECT MAX(post_time) AS last_post_time
			FROM " . POSTS_TABLE . "
			WHERE $where_sql";
		if ($result = $db->sql_query($sql))
		{
			if ($row = $db->sql_fetchrow($result))
			{
				if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
				{
					message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
				}
			}
		}
#
#-----[ 之後, 加上 ]------------------------------------------
#


		//
		// Double Post Control
		//
		$lastposttime = intval($row['last_post_time']);
		if($mode != 'editpost')
		{
			$sql = "SELECT pt.post_text, pt.bbcode_uid
				FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
				WHERE $where_sql AND p.post_time = $lastposttime AND pt.post_id = p.post_id
				LIMIT 1";
			if ($result = $db->sql_query($sql))
			{
				if ($row = $db->sql_fetchrow($result))
				{
					// Update BBCode to current UID
					$row['post_text'] = str_replace(":" . $row['bbcode_uid'] . "]", ":" . $bbcode_uid . "]", $row['post_text']);
					if ($row['post_text'] == $post_message)
					{
						message_die(GENERAL_MESSAGE, $lang['Double_Post_Error']);
					}
				}
				$db->sql_freeresult($result);
			}
		}
#
#-----[ 開啟 ]------------------------------------------
#
language/lang_chinese_traditional_taiwan/lang_main.php
#
#-----[ 尋找 ]------------------------------------------
#
$lang['Flood_Error'] = '嚴禁惡意的快速發文攻擊, 請稍後再試';
#
#-----[ 之後, 加上 ]------------------------------------------
#
$lang['Double_Post_Error'] = '嚴禁重複發表相同內容的文章';
#
#-----[ 存檔/結束 ]------------------------------------------
#
# EoM
有任何關於 phpBB 或是架站的問題,請在論壇上公開發表出來,大家一起討論。
請不要丟私人訊息問我,因為私訊是用來聊私事的。
這樣作對於解決您的問題一點幫助也沒有,也很沒有效率,小弟我一概謝絕。



搜尋是一種美德,在發問之前,請多加利用頂端的文章搜尋功能,搜尋可能的關鍵字。
確定您想問的問題找不到答案後,再發問。
主題已鎖定

回到「非官方認證外掛」