Wednesday, May 9, 2018

How I helped myself screen registrations at my PHPBB forum

I get a lot of spam registrations at my PHPBB forum. So I asked new users to tell a little about themselves like this:

1.
In Administration Control Panel, Users and Groups, Custom profile fields, I added an "about" field asking new registrants to tell about themselves. It looks like this on the registration page.


2.
In this file
includes/ucp/ucp_register.php
I added a line for ABOUT here:
 $messenger->assign_vars(array(
  'ABOUT'  => request_var('pf_about', ''),
  'USERNAME'   => htmlspecialchars_decode($data['username']),
  'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id",
  'U_ACTIVATE'  => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
 );

3.
In this file
language/en/email/admin_activate.txt
I added a message to myself using the ABOUT template variable like this:
Subject: Activate user account
"{USERNAME}" just registered at the CNM Forum and said this about themself:{ABOUT}
That's all. Now those spam registrations take me only a second to triage and delete. Robots aren't that smart yet!

No comments: