Unofficial modifications
nieoficjalne modyfikacje for?w phpBB by Przemo

Modyfikacje mniejsze - Moderator moze usuwac swoje warny

Dlugi - Pon 01 Maj, 2006
Temat postu: Moderator moze usuwac swoje warny
Zmien w pliku warnings.php


znajdz:
Kod
if ( $userdata['user_id'] == $row['modid'] && $can_add || $can_edit )
{
$delete_img = ($admin) ? '&nbsp;<a href="' . append_sid("warnings.$phpEx?mode=delete&amp;id=$id&amp;userid=$userid&amp;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&amp;id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a>' . $delete_img . '';
}

zamien na:
Kod
if ( $userdata['user_id'] == $row['modid'] && $can_add || $can_edit )
{
$delete_img = ($admin || $mod) ? '&nbsp;<a href="' . append_sid("warnings.$phpEx?mode=delete&amp;id=$id&amp;userid=$userid&amp;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&amp;id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a>' . $delete_img . '';
}


znajdz:
Kod
if ( $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:
Kod
if ( $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:
Kod
if ( $admin )
{
$l_action = $lang['action'];
$action_url = '<a href="' . append_sid("warnings.$phpEx?mode=edit&amp;id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a>&nbsp;<a href="' . append_sid("warnings.$phpEx?mode=delete&amp;id=$id&amp;userid=$userid&amp;sid=" . $userdata['session_id'] . "") . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>';
}

zamien na:
Kod
if ( $admin || $mod )
{
$l_action = $lang['action'];
$action_url = '<a href="' . append_sid("warnings.$phpEx?mode=edit&amp;id=$id") . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['edit_mini'] . '" title="' . $lang['edit_mini'] . '" border="0" /></a>&nbsp;<a href="' . append_sid("warnings.$phpEx?mode=delete&amp;id=$id&amp;userid=$userid&amp;sid=" . $userdata['session_id'] . "") . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete'] . '" title="' . $lang['Delete'] . '" border="0" /></a>';
}


znajdz:
Kod
if ( $mode == 'delete' && $admin )

zamien na:
Kod
if ( $mode == 'delete' && ( $admin || $mod ))


Powered by phpBB modified by Przemo © 2003 phpBB Group