註冊: 以問答方式防止廣告機器人侵入

phpBB 3 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群譯文組

版面規則
請注意!您的提問必須遵守發問格式,違者砍文。
主題已鎖定
Barlos
星球公民
星球公民
文章: 56
註冊時間: 2009-06-18 11:24

註冊: 以問答方式防止廣告機器人侵入

文章 Barlos »

##### 以下為 '基本的發問格式' #####
●主機作業系統:Linux
●快速架站程式:
●免費空間連結:
●您的上網方式:
●您安裝的程式:Apache + php + MySql
●您的 phpBB 版本:phpBB 3.05
●您的 domain (網域名稱) : intranet
●您的 phpBB 連結網址:
##### 以上為 '基本的發問格式' #####

●安裝外掛:以問答方式防止廣告機器人侵入

我在下面網址看到有人寫出一個 php 的網頁, 來做"以問答方式防止廣告機器人侵入"
http://www.ezdiy.org/forum/viewtopic.php?id=384

因為很單純, 也很有效, 比起圖形與在使用者的欄位內自設"如果你不是機器人, 請輸入一個介於 ?? 到 ?? 的數目字" 的問答有效.

代碼: 選擇全部

<?php
/*
作者: coolhd @ http://www.ezdiy.org
功能: 以問答的方式來防止 SpamBot 訊息侵入
版本: v1.1
*/

$question = array();

/*****問題與答案編輯區*********************************************************************/
/* $question[N][0] = '題目'; */
/* $question[N][1] = '答案1'; */
/* $question[N][2] = '答案2'; */

$question[0][0] = '請問 5 加 3 等於多少 ?';
$question[0][1] = '8';
$question[0][2] = 'eight';

$question[1][0] = '請問在英文單字 Free 裡面有幾個英文字母 e ?';
$question[1][1] = '2';
$question[1][2] = 'two';

$question[2][0] = 'x 加上 6 等於 9, 那麼請問 x 應該是多少 ?';
$question[2][1] = '3';
$question[2][2] = 'three';

$question[3][0] = '請問 25 減去 10 等於多少 ?';
$question[3][1] = '15';

$question[4][0] = '請問本站的網址是什麼(不包含 http://) ?';
$question[4][1] = 'www';

$question[5][0] = '請寫出 BLUE 這個英文單字的小寫。';
$question[5][1] = 'blue';

/*************************************************************************************/
session_start();

//顯示驗證欄位
function human_check_field() {
	global $pun_user, $question;
	
	$human_check_field = '';
	if ($pun_user['is_guest']) {
		$_SESSION['human_id'] = session_id();
		$question_index = rand(0,count($question)-1);
		$ask_question = $question[$question_index][0];
		$answer_counts = count($question[$question_index]);
		
		$question_answers = array();
		for($i=1; $i < $answer_counts; $i++) {
			$question_answers[] = $question[$question_index][$i];
		}
		
		$_SESSION['question_answers'] = $question_answers;
		
		$human_check_field = '
			<div class="inform">
				<fieldset>
					<legend>驗證</legend>
					<div class="infldset">
						請您回答底下問題。<br /><br />
						問題:&nbsp;<strong>'.$ask_question.'</strong><br />
						答案:&nbsp;<input type="text" size="30" maxlength="100" name="human_check_answer" value="" />
					</div>
				</fieldset>
			</div>';
	}
	echo $human_check_field;
}

//執行驗證檢查
function human_check() {
	global $question;
	
	if (!isset($_SESSION['human_id'])) {
		message('請正確地完成欄位填寫 !');
	}
	
	if (isset($_POST['human_check_answer'])) {
		$human_check_answer = strip_tags(trim($_POST['human_check_answer']));
	} else {
		$human_check_answer = null;
	}
	
	$human_check_pass = (in_array($human_check_answer, $_SESSION['question_answers'])) ? true : false;
	
	if ($human_check_pass == false) {
		message('您輸入的驗證答案錯誤 !');
	}
	
	unset($_SESSION['human_id']);
	unset($_SESSION['question_answers']);
}

?>
這邊請問需要在風格內 (Prosilver & Subsilver2) 內的 ucp_register.html 修改在哪邊?
Barlos
星球公民
星球公民
文章: 56
註冊時間: 2009-06-18 11:24

Re: 註冊: 以問答方式防止廣告機器人侵入

文章 Barlos »

有人有建議嗎?
阿維
竹貓忠實會員
竹貓忠實會員
文章: 868
註冊時間: 2003-02-23 13:36
來自: 台南市

Re: 註冊: 以問答方式防止廣告機器人侵入

文章 阿維 »

只要你會翻譯這個外掛就適合你使用 :-)
viewtopic.php?f=132&t=52383
提供代客維護 phpBB 3.0.x 以及外掛/風格升級或安裝的服務,如需委託,請與我聯絡,謝謝! ;)
我的 Skype 帳號:gpxjordan
Barlos
星球公民
星球公民
文章: 56
註冊時間: 2009-06-18 11:24

Re: 註冊: 以問答方式防止廣告機器人侵入

文章 Barlos »

您好,

您提供的需要增加資料庫, 步驟也較為繁雜.

至於 ezdiy.org 那個, 只需要找到可以放入程式碼的地方; 執行到那邊, 沒有通過, 就會停住.

感謝.
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8538
註冊時間: 2004-04-30 01:54
來自: Taiwan

Re: 註冊: 以問答方式防止廣告機器人侵入

文章 心靈捕手 »

Barlos 寫:##### 以下為 '基本的發問格式' #####
●主機作業系統:Linux
●快速架站程式:
●免費空間連結:
●您的上網方式:
●您安裝的程式:Apache + php + MySql
●您的 phpBB 版本:phpBB 3.05
●您的 domain (網域名稱) : intranet
●您的 phpBB 連結網址:
##### 以上為 '基本的發問格式' #####

●安裝外掛:以問答方式防止廣告機器人侵入

我在下面網址看到有人寫出一個 php 的網頁, 來做"以問答方式防止廣告機器人侵入"
http://www.ezdiy.org/forum/viewtopic.php?id=384

因為很單純, 也很有效, 比起圖形與在使用者的欄位內自設"如果你不是機器人, 請輸入一個介於 ?? 到 ?? 的數目字" 的問答有效.

代碼: 選擇全部

<?php
/*
作者: coolhd @ http://www.ezdiy.org
功能: 以問答的方式來防止 SpamBot 訊息侵入
版本: v1.1
*/

$question = array();

/*****問題與答案編輯區*********************************************************************/
/* $question[N][0] = '題目'; */
/* $question[N][1] = '答案1'; */
/* $question[N][2] = '答案2'; */

$question[0][0] = '請問 5 加 3 等於多少 ?';
$question[0][1] = '8';
$question[0][2] = 'eight';

$question[1][0] = '請問在英文單字 Free 裡面有幾個英文字母 e ?';
$question[1][1] = '2';
$question[1][2] = 'two';

$question[2][0] = 'x 加上 6 等於 9, 那麼請問 x 應該是多少 ?';
$question[2][1] = '3';
$question[2][2] = 'three';

$question[3][0] = '請問 25 減去 10 等於多少 ?';
$question[3][1] = '15';

$question[4][0] = '請問本站的網址是什麼(不包含 http://) ?';
$question[4][1] = 'www';

$question[5][0] = '請寫出 BLUE 這個英文單字的小寫。';
$question[5][1] = 'blue';

/*************************************************************************************/
session_start();

//顯示驗證欄位
function human_check_field() {
	global $pun_user, $question;
	
	$human_check_field = '';
	if ($pun_user['is_guest']) {
		$_SESSION['human_id'] = session_id();
		$question_index = rand(0,count($question)-1);
		$ask_question = $question[$question_index][0];
		$answer_counts = count($question[$question_index]);
		
		$question_answers = array();
		for($i=1; $i < $answer_counts; $i++) {
			$question_answers[] = $question[$question_index][$i];
		}
		
		$_SESSION['question_answers'] = $question_answers;
		
		$human_check_field = '
			<div class="inform">
				<fieldset>
					<legend>驗證</legend>
					<div class="infldset">
						請您回答底下問題。<br /><br />
						問題:&nbsp;<strong>'.$ask_question.'</strong><br />
						答案:&nbsp;<input type="text" size="30" maxlength="100" name="human_check_answer" value="" />
					</div>
				</fieldset>
			</div>';
	}
	echo $human_check_field;
}

//執行驗證檢查
function human_check() {
	global $question;
	
	if (!isset($_SESSION['human_id'])) {
		message('請正確地完成欄位填寫 !');
	}
	
	if (isset($_POST['human_check_answer'])) {
		$human_check_answer = strip_tags(trim($_POST['human_check_answer']));
	} else {
		$human_check_answer = null;
	}
	
	$human_check_pass = (in_array($human_check_answer, $_SESSION['question_answers'])) ? true : false;
	
	if ($human_check_pass == false) {
		message('您輸入的驗證答案錯誤 !');
	}
	
	unset($_SESSION['human_id']);
	unset($_SESSION['question_answers']);
}

?>
這邊請問需要在風格內 (Prosilver & Subsilver2) 內的 ucp_register.html 修改在哪邊?
1. 印象中, 您 (自述) 論壇是架在 NB, 怎麼也會受 "機器人註冊" 的干擾呢?
2. 您提供的程式是適用 PunBB, 未必適用 phpBB.
更何況, 您都不曉得怎麼用, 如何知道它 "因為很單純, 也很有效, 比起圖形與在使用者的欄位內自設"如果你不是機器人, 請輸入一個介於 ?? 到 ?? 的數目字" 的問答有效."?
3. 最新 3.0.5 版 phpBB 在確認代碼的功能上已經增進許多.
4. 個人以為: 根本不必用外掛, 只要善用 "自訂個人資料欄位" 即可有效防止廣告機器人註冊.
參考資料:
http://phpbb-tw.net/phpbb/viewtopic.php?f=176&t=51667
http://phpbb-tw.net/phpbb/viewtopic.php?f=174&t=51671

P.S.
抱歉! 鎖定.
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「[3.0.x] 外掛問題討論」