Code: Select all
#-----[ FIND ]------------------------------------------
#
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
class="{postrow.ROW_CLASS}">
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{postrow.DELETE_USER_IMAGE}
Code: Select all
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">{postrow.DELETE_USER_IMAGE}<span class="name"><a name="{postrow.U_POST_ID}">
rauz242 wrote: Does that mean this should be the final result?
Code: Select all
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">{postrow.DELETE_USER_IMAGE}<span class="name"><a name="{postrow.U_POST_ID}">
Bob Hansen wrote: Have not seen clear answer to these questions?
1. Can this be modified to allow Moderators to use this?
2. Can this be modified to prevent Admins from being deleted?
3. Can this be modified to delete all posts from the account being deleted?
If YES to any of the above, can you please provide the code we need to do that?
Thanks for listening.
Knotty_Log wrote:angelp1ay wrote:One of your tags is cutting off half way through before its attributes and they are being spewed out as text. Search for the code the is being displayed and check that code around that area is correct.
Search where?
angelp1ay wrote:Bob Hansen wrote:Have not seen clear answer to these questions?
2. Can this be modified to prevent Admins from being deleted?
I might have a go at writing code for the first two of your suggestions this coming weekend...
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
delete_user.php
#
#-----[ FIND ]------------------------------------------
#
//
// Start Delete (code borrowed from admin_users.php)
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
# Think this bit can be shortened a little...
# Don't think I really need the 2nd if statement to wrap its contents
#
$sql = "SELECT user_level
FROM " . USERS_TABLE . "
WHERE user_id = " . $user_id . "
LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$user_level = $row['user_level'];
$db->sql_freeresult($result);
}
#
#-----[ FIND ]------------------------------------------
#
//
// Start Delete (code borrowed from admin_users.php)
//
if( $userdata['user_id'] != $user_id )
{
#
#-----[ REPLACE WITH ]---------------------------------------------
#
//
// Start Delete (code borrowed from admin_users.php)
//
if( $userdata['user_id'] != $user_id && $user_level != 1 )
#
#-----[ FIND ]------------------------------------------
#
else
{
message_die(GENERAL_ERROR, 'Cannot_delete_self');
}
#
#-----[ REPLACE WITH ]---------------------------------------------
#
elseif ($userdata['user_id'] == $user_id)
{
message_die(GENERAL_ERROR, 'Cannot_delete_self');
}
elseif ($user_level == 1) // left in to be more explicit
{
message_die(GENERAL_ERROR, 'Cannot_delete_admin');
}
else // left in as default
{
message_die(GENERAL_ERROR, 'Cannot_delete_self');
}
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Cannot_delete_self'] = 'Cannot delete yourself';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Cannot_delete_admin'] = 'You cannot delete admin accounts using this function';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Knotty_Log wrote:Knotty_Log wrote:angelp1ay wrote:One of your tags is cutting off half way through before its attributes and they are being spewed out as text. Search for the code the is being displayed and check that code around that area is correct.
Search where?
Knot sure where to look here (memberlist.php) or what I am looking for
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
memberlist.php
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $username) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Delete User MOD
if ( $userdata['user_level'] == ADMIN && $user_id != ANONYMOUS )
{
$temp_url = append_sid("delete_user.$phpEx?" . POST_USERS_URL . "=$user_id&file=memberlist&sid=" . $userdata['session_id']);
$delete_user_img = ' <a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . sprintf($lang['Delete_user'], $username) . '" title="' . sprintf($lang['Delete_user'], $username) . '" border="0" /></a>';
$delete_user = ' <a href="' . $temp_url . '">' . sprintf($lang['Delete_user'], $username) . '</a>';
}
else
{
$delete_user_img = '';
$delete_user = '';
}
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center"><span class="gen"><a href="{memberrow.U_VIEWPROFILE}" class="gen">{memberrow.USERNAME}</a></span></td>
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{memberrow.USERNAME}</a></span>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
{memberrow.DELETE_USER_IMAGE}
angelp1ay wrote:Bob Hansen wrote:Have not seen clear answer to these questions?
1. Can this be modified to allow Moderators to use this?
I might have a go at writing code for the first two of your suggestions this coming weekend...
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
delete_user.php
#
#-----[ FIND ]------------------------------------------
#
if ( $userdata['user_level'] != ADMIN )
#
#-----[ REPLACE WITH ]---------------------------------------------
#
if ( $userdata['user_level'] != ADMIN && $userdata['user_level'] != MOD )
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
// Delete User MOD
if ( $userdata['user_level'] == ADMIN && $poster_id != ANONYMOUS )
#
#-----[ REPLACE WITH ]---------------------------------------------
#
// Delete User MOD
if (( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) && $poster_id != ANONYMOUS )
#
#-----[ OPEN ]------------------------------------------
#
memberlist.php
#
#-----[ FIND ]------------------------------------------
#
// Delete User MOD
if ( $userdata['user_level'] == ADMIN && $user_id != ANONYMOUS )
#
#-----[ REPLACE WITH ]---------------------------------------------
#
// Delete User MOD
if (( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) && $user_id != ANONYMOUS )
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
// Delete User MOD
if ( $userdata['user_level'] == ADMIN && $profiledata['user_id'] != ANONYMOUS )
#
#-----[ REPLACE WITH ]---------------------------------------------
#
// Delete User MOD
if (( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )&& $profiledata['user_id'] != ANONYMOUS )
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Code: Select all
Critical Error
FIND FAILED: In file [templates/subSilver/viewtopic_body.tpl] could not find:
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a>
MOD script line #154
Code: Select all
<!-- BEGIN postrow -->
<tr>
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.POSTER_AVATAR}<br /><br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}</span><br /></td>