ติดตั้ง reCAPTCHA หน้าลงทะเบียน
1. ติดตั้ง Mod reCAPTCHA for SMF
2. ไปที่ กระดานสนทนา »ศูนย์ดำเนินการระบบ »Security and Moderation »Anti-Spam
ตรงหัวข้อ reCAPTCHA Verification System ให้ใส่ Public Key และ Private Key
ติดตั้ง reCAPTCHA ก่อนโพส
1.ที่ไฟล์ /Themes/default/Post.template.php หาคำว่า
"// Show some useful information such as allowed extensions, maximum size and amount of attachments allowed."
แล้วเพิ่ม
// Start; Recaptcha on Guest Posts
echo'<div class="g-recaptcha" data-sitekey="[Public Key]"></div>';
// End; Recaptcha on Guest Posts
2. ที่ไฟล์ /Themes/default/index.template.php หาคำว่า
"// Here comes the JavaScript bits!" แล้วเพิ่ม
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
3.ที่ไฟล์ /Sources/Post.php หาคำว่า
"// Sneaking off, are we?" แล้วเพิ่ม
//reCAPTCHA
$captcha=$_POST['g-recaptcha-response'];
$ip = $_SERVER['REMOTE_ADDR'];
$secretkey = "[Private Key]";
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretkey."&response=".$captcha."&remoteip=".$ip);
$responseKeys = json_decode($response,true);
if(intval($responseKeys["success"]) !== 1) {
redirectexit('action=post;board=' . $board . '.0');
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น