Open
/includes/acp/acp_prune.php and find (will occur twice):
Code: Select all
$user_ids = $usernames = array();
$this->get_prune_users($user_ids, $usernames);
Change to:
Code: Select all
/*** 2010-10-23 BEGIN AmigoJack
Additional details to be displayed ***/
$aDetail=
$user_ids = $usernames = array();
//$this->get_prune_users($user_ids, $usernames);
$this->get_prune_users($user_ids, $usernames, $aDetail);
/*** 2010-10-23 END ***/
Find:
Code: Select all
if (confirm_box(true))
{
$user_ids = $usernames = array();
$this->get_prune_users($user_ids, $usernames);
After, add:
Code: Select all
/*** 2011-05-17 BEGIN AmigoJack
Only leave those which are checked ***/
$aCheck= request_var( 'user_id_check', array( 0 ) );
foreach( $user_ids as $k1=> $v1 ) if( !in_array( $v1, $aCheck ) ) {
unset( $user_ids[$k1] );
unset( $usernames[$v1] );
}
/*** 2011-05-17 END ***/
Find:
Code: Select all
'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '',
After, add:
Code: Select all
/*** 2010-10-23 BEGIN AmigoJack
Additional details to be displayed ***/
'ID'=> $user_id,
'USERPOSTS'=> $aDetail[$user_id]['user_posts'],
'U_USERPOSTS'=> $auth-> acl_get( 'u_search' )? append_sid( "{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id. '&sr=posts' ): '',
'USERTOPICS'=> $aDetail[$user_id]['user_topics'],
'U_USERTOPICS'=> $auth-> acl_get( 'u_search' )? append_sid( "{$phpbb_root_path}search.$phpEx", 'author_id=' . $user_id. '&sr=topics' ): '',
'USERJOINED'=> $user-> format_date( $aDetail[$user_id]['user_regdate'], FALSE, FALSE ),
'ACTIVE'=> $user-> format_date( $aDetail[$user_id]['user_lastvisit'], FALSE, FALSE ),
'LASTPOST'=> $user-> format_date( $aDetail[$user_id]['user_lastpost_time'], FALSE, FALSE ),
/*** 2010-10-23 END ***/
Find:
Code: Select all
'deleteposts' => request_var('deleteposts', 0),
After, add:
Code: Select all
/*** 2010-12-17 BEGIN AmigoJack
Find banned users ***/
'banned'=> request_var( 'banned', 0 ),
/*** 2010-12-17 END ***/
Find:
Code: Select all
function get_prune_users(&$user_ids, &$usernames)
Replace with:
Code: Select all
function get_prune_users(&$user_ids, &$usernames
/*** 2010-10-23 BEGIN AmigoJack
Additional details to be displayed ***/
, &$aDetail
/*** 2010-10-23 END ***/
)
Find:
Code: Select all
$where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
After, add:
Code: Select all
/*** 2010-12-17 BEGIN AmigoJack
Find banned users ***/
$aBanned= array();
if( request_var( 'banned', 0 ) ) {
// Find all users banned by name or e-mail-address
$sql= 'SELECT u.user_id
FROM '. BANLIST_TABLE. ' b INNER
JOIN '. USERS_TABLE. ' u ON ( ( b.ban_userid= u.user_id and b.ban_userid> 0 ) or ( b.ban_email= u.user_email and b.ban_email<> \'\' ) )
WHERE b.ban_userid> 0 or b.ban_email<> \'\'';
$result= $db-> sql_query( $sql );
while( $row= $db-> sql_fetchrow( $result ) ) $aBanned[]= $row['user_id'];
$db-> sql_freeresult( $result );
// Add filter of found user IDs
$where_sql.= ' AND '. $db-> sql_in_set( 'user_id', $aBanned, FALSE, TRUE );
}
/*** 2010-12-17 END ***/
Find:
Code: Select all
// Do not prune founder members
$sql = 'SELECT user_id, username
FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . '
AND user_type <> ' . USER_FOUNDER . "
$where_sql";
Replace with:
Code: Select all
// Do not prune founder members
/*** 2010-08-06 BEGIN AmigoJack
Prevent members from being pruned and get more details ***/
$sql = 'SELECT user_id, username, user_regdate, user_posts, user_topics, user_lastvisit, user_lastpost_time
FROM ' . USERS_TABLE . '
WHERE user_id <> ' . ANONYMOUS . '
AND user_type <> ' . USER_FOUNDER. "
AND user_neverprune= 0
$where_sql";
/*** 2010-08-06 END ***/
Find:
Code: Select all
$usernames[$row['user_id']] = $row['username'];
After, add:
Code: Select all
/*** 2010-10-23 BEGIN AmigoJack
Additional details to be displayed ***/
$aDetail[$row['user_id']]= $row;
/*** 2010-10-23 END ***/
Open
/adm/style/acp_prune_users.html and find:
Code: Select all
<dl>
<dt><label for="count">{L_POSTS}:</label></dt>
<dd><select name="count_select">{S_COUNT_OPTIONS}</select> <input type="text" id="count" name="count" /></dd>
</dl>
After, add:
Code: Select all
<dl>
<dt><label for="banned">{L_BANNED}:</label><br /><span>{L_BANNED_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="banned" value="1" /> {L_YES}</label>
<label><input type="radio" class="radio" id="banned" name="banned" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
Open
/adm/style/confirm_body_prune.html and find:
Code: Select all
<br />
<!-- BEGIN users -->
» <a href="{users.U_PROFILE}">{users.USERNAME}</a><!-- IF users.U_USER_ADMIN --> [<a href="{users.U_USER_ADMIN}">{L_USER_ADMIN}</a>]<!-- ENDIF --><br />
<!-- END users -->
Replace with:
Code: Select all
<br /><table><thead><tr>
<th>{L_USERNAME}</th>
<th>{L_POSTS}</th>
<th>{L_TOPICS}</th>
<th>{L_JOINED}</th>
<th>{L_LAST_ACTIVE}</th>
<th>{L_LAST_POST}</th>
</tr></thead><tbody>
<!-- BEGIN users --><tr>
<td><input type="checkbox" name="user_id_check[]" value="{users.ID}" checked="checked" /> <a href="<!-- IF users.U_USER_ADMIN -->{users.U_USER_ADMIN}<!-- ELSE -->{users.U_PROFILE}<!-- ENDIF -->">{users.USERNAME}</a></td>
<td style="text-align: right;"><a href="{users.U_USERPOSTS}">{users.USERPOSTS}</a></td>
<td style="text-align: right;"><a href="{users.U_USERTOPICS}">{users.USERTOPICS}</a></td>
<td>{users.USERJOINED}</td>
<td>{users.ACTIVE}</td>
<td>{users.LASTPOST}</td>
</tr><!-- END users -->
</tbody></table>
<p class="small">
<a href="#" onclick="marklist('confirm', 'user_id_check', true); return false;">{L_MARK_ALL}</a> •
<a href="#" onclick="marklist('confirm', 'user_id_check', false); return false;">{L_UNMARK_ALL}</a>
</p>
Open
/language/*/acp/prune.php and find:
After, add:
Code: Select all
/*** 2010-12-17 BEGIN AmigoJack
Find banned user(name)s ***/
'BANNED'=> 'Banned',
'BANNED_EXPLAIN'=> 'Also find users which are currently banned by username or by e-mail-address.',
/*** 2010-12-17 END ***/
The column
phpbb_users.user_topics
is another addition (copies the behaviour of user_posts accordingly and everywhere) and
phpbb_users.user_neverprune
behaves like a boolean, which can be set in the ACP users overview only. Yes I know, the code doesn't follow the
phpBB guidelines.