Add custom profile fields to 'inactive users' list
Posted: Fri Aug 17, 2012 8:43 pm
I use a "custom profile field" as a spam-fighting technique, in conjunction with requiring Admin approvals of all accounts.
First, enable custom profile fields.
Then, add a custom profile field as a required field to the user registration form. I ask users for a reason for joining the forum, but this does not seem to the the best technique (as they can just type in asdf).
The biggest problem is that it used to take way too many clicks to filter out the spam. Previously, I had to navigate to Users and Groups, click on Inactive Members, open each member in a new tab, and for each member, open up the "Profile" sub-screen to see what they specified during their registration. Needless to say, this was an insane amount of work.
This is how to list the custom profile field response in the Inactive Members list (see attachment). I will be expanding on the useful but no longer up-to-date article at https://www.phpbb.com/community/viewtopic.php?f=46&t=1722745
References:
https://www.phpbb.com/community/viewtopic.php?f=71&t=2159973
https://www.phpbb.com/community/viewtopic.php?f=71&t=655245
I am not going to start a new thread because this is the message which will pop up in searches of this forum, first.
The information above needs to be modified for phpBB3 (3.0.8). The changes are:
* NOTE: Only use a proper editor such as Notepad++ to edit these files. Do not use Notepad or WordPad!*
* My custom profile field is called "reason" *
* Backup files and database before making any changes. You can edit these files by either downloading them with software such as FileZilla first and then editing on your computer, saving, and then uploading them back. You can also edit them right in FileZilla if you set Notepad++ to open .php and .html files by default. Or, you might be able to edit these files right in phpBB3 *
1) Go to includes/functions_admin.php and find:
Replace with
Remember to change 'reason' to the name of YOUR custom profile field name.
2) Go to includes/acp/acp_inactive.php and find:
On a line below, add
Remember to change 'reason' to the name of YOUR custom profile field name.
3) Go to adm/style/acp_inactive.html and find:
And add the following below:
Then, in the same file find:
And add below the following:
4) Go to language/en/common.php and find
And add below:
Save and / or upload all files. Then, log into ACP, and on General, click to Purge the Cache (last item on the list), and click Run Now. If necessary, hit ctrl+F5 afterwards. Now, navigate to Inactive Members list, and you should see the contents of your custom profile field listed there.
Note: if you do not see the value of custom profile field, remember to set the board settings correctly, and modify instructions above for the name of YOUR custom profile field!
Drop me a note if you are still having difficulty.
First, enable custom profile fields.
Then, add a custom profile field as a required field to the user registration form. I ask users for a reason for joining the forum, but this does not seem to the the best technique (as they can just type in asdf).
The biggest problem is that it used to take way too many clicks to filter out the spam. Previously, I had to navigate to Users and Groups, click on Inactive Members, open each member in a new tab, and for each member, open up the "Profile" sub-screen to see what they specified during their registration. Needless to say, this was an insane amount of work.
This is how to list the custom profile field response in the Inactive Members list (see attachment). I will be expanding on the useful but no longer up-to-date article at https://www.phpbb.com/community/viewtopic.php?f=46&t=1722745
The post below will be an adaptation of the useful information before on how to include custom profile fields into the inactive members list.ffa wrote:I would like to use custom profile fields.
References:
https://www.phpbb.com/community/viewtopic.php?f=71&t=2159973
https://www.phpbb.com/community/viewtopic.php?f=71&t=655245
I am not going to start a new thread because this is the message which will pop up in searches of this forum, first.
The information above needs to be modified for phpBB3 (3.0.8). The changes are:
* NOTE: Only use a proper editor such as Notepad++ to edit these files. Do not use Notepad or WordPad!*
* My custom profile field is called "reason" *
* Backup files and database before making any changes. You can edit these files by either downloading them with software such as FileZilla first and then editing on your computer, saving, and then uploading them back. You can also edit them right in FileZilla if you set Notepad++ to open .php and .html files by default. Or, you might be able to edit these files right in phpBB3 *
1) Go to includes/functions_admin.php and find:
Code: Select all
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
WHERE user_type = ' . USER_INACTIVE .
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . "
ORDER BY $sort_by";
$result = $db->sql_query_limit($sql, $limit, $offset);
Code: Select all
$sql = 'SELECT u.* , pfd.pf_reason
FROM ' . USERS_TABLE . ' u
INNER JOIN ' . PROFILE_FIELDS_DATA_TABLE . ' pfd ON pfd.user_id = u.user_id WHERE user_type = ' . USER_INACTIVE .
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . "
ORDER BY $sort_by";
$result = $db->sql_query_limit($sql, $limit, $offset);
2) Go to includes/acp/acp_inactive.php and find:
Code: Select all
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&sr=posts") : '',
Code: Select all
'ANSWER' => $row['pf_reason'],
3) Go to adm/style/acp_inactive.html and find:
Code: Select all
<th>{L_USERNAME}</th>
Code: Select all
<th>{L_ANSWER}</th>
Then, in the same file find:
Code: Select all
<td style="vertical-align: top;">
{inactive.USERNAME_FULL}
<!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
</td>
Code: Select all
<td style="vertical-align: top;">{inactive.ANSWER}</td>
4) Go to language/en/common.php and find
Code: Select all
'USERNAME' => 'Username',
Code: Select all
'ANSWER' => 'Answer:',
Save and / or upload all files. Then, log into ACP, and on General, click to Purge the Cache (last item on the list), and click Run Now. If necessary, hit ctrl+F5 afterwards. Now, navigate to Inactive Members list, and you should see the contents of your custom profile field listed there.
Note: if you do not see the value of custom profile field, remember to set the board settings correctly, and modify instructions above for the name of YOUR custom profile field!
Drop me a note if you are still having difficulty.