Dlugi Wysłany: Pon 01 Maj, 2006 |
|
|
Zmien w pliku warnings.php
znajdz: Kodif ( $userdata['user_id'] == $row['modid'] && $can_add || $can_edit )
{
$delete_img = ($admin) ? ' <a href="' . append_sid("warnings.$phpEx?mode=delete&id=$id&userid=$userid&sid=" . $userdata['session_id']) . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>' : '';
$l_action = $lang['action'];
$action_url = '<a href="' . append_sid("warnings.$phpEx?mode=edit&id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a>' . $delete_img . '';
}
zamien na: Kodif ( $userdata['user_id'] == $row['modid'] && $can_add || $can_edit )
{
$delete_img = ($admin || $mod) ? ' <a href="' . append_sid("warnings.$phpEx?mode=delete&id=$id&userid=$userid&sid=" . $userdata['session_id']) . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>' : '';
$l_action = $lang['action'];
$action_url = '<a href="' . append_sid("warnings.$phpEx?mode=edit&id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a>' . $delete_img . '';
}
znajdz: Kodif ( $mode == 'delete' && $admin )
{
if ( $HTTP_GET_VARS['sid'] != $userdata['session_id'] )
{
message_die(GENERAL_ERROR, 'Invalid_session');
}
$sql = "SELECT userid
FROM " . WARNINGS_TABLE . "
WHERE id = " . intval($id) . "
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query warnings table', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$sql = "DELETE FROM " . WARNINGS_TABLE . "
WHERE id = " . intval($id) . "";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete from warnings table', '', __LINE__, __FILE__, $sql);
}
else
{
zamien na: Kodif ( $mode == 'delete' && ($admin || $mod) )
{
if ( $HTTP_GET_VARS['sid'] != $userdata['session_id'] )
{
message_die(GENERAL_ERROR, 'Invalid_session');
}
$sql = "SELECT userid, modid
FROM " . WARNINGS_TABLE . "
WHERE id = " . intval($id) . "
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query warnings table', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
if ($mod && $row['modid'] != $userdata['user_id'])
{
message_die(GENERAL_ERROR, $lang['Not_Authorised'], '');
}
$sql = "DELETE FROM " . WARNINGS_TABLE . "
WHERE id = " . intval($id) . "";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete from warnings table', '', __LINE__, __FILE__, $sql);
}
else
{
znajdz: Kodif ( $admin )
{
$l_action = $lang['action'];
$action_url = '<a href="' . append_sid("warnings.$phpEx?mode=edit&id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a> <a href="' . append_sid("warnings.$phpEx?mode=delete&id=$id&userid=$userid&sid=" . $userdata['session_id'] . "") . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>';
}
zamien na: Kodif ( $admin || $mod )
{
$l_action = $lang['action'];
$action_url = '<a href="' . append_sid("warnings.$phpEx?mode=edit&id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a> <a href="' . append_sid("warnings.$phpEx?mode=delete&id=$id&userid=$userid&sid=" . $userdata['session_id'] . "") . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>';
}
znajdz: Kodif ( $mode == 'delete' && $admin )
zamien na: Kodif ( $mode == 'delete' && ( $admin || $mod )) |
|