to zrob sprawdzanie przed dodawaniem do listy z ignorowaniem.
[phpbb]
#
#--[ OTWÓRZ ]--
#
/viewtopic.php
#
#--[ ZNAJDŹ ]--
#
//Ignore Toggling
if ($mode == 'ignore')
{
$sql = "INSERT INTO " . IGNORE_TABLE . " (user_id, ignored_id) VALUES (" . $userdata[user_id] . ", " . $ignoree_id . ")" ;
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error setting ignore user', '', __LINE__, __FILE__, $sql);
}
}
else if ($mode == 'unignore')
{
$sql = "DELETE FROM " . IGNORE_TABLE . " WHERE user_id = " . $userdata[user_id] . " && ignored_id = " . $ignoree_id;
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error unsetting ignore user', '', __LINE__, __FILE__, $sql);
}
}
#
#--[ ZAMIEŃ NA ]--
#
//Ignore Toggling
if ($mode == 'ignore')
{
$sql = "SELECT user_id, user_level FROM " . USERS_TABLE . " WHERE user_id = $ignoree_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error cheking user_level of ignore user', '', __LINE__, __FILE__, $sql);
}
$ignored_ul = $db->sql_fetchrow($result);
if ( $ignored_ul['user_level'] == 0 )
{
$sql = "INSERT INTO " . IGNORE_TABLE . " (user_id, ignored_id) VALUES (" . $userdata[user_id] . ", " . $ignoree_id . ")" ;
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error setting ignore user', '', __LINE__, __FILE__, $sql);
}
}
}
else if ($mode == 'unignore')
{
$sql = "DELETE FROM " . IGNORE_TABLE . " WHERE user_id = " . $userdata[user_id] . " && ignored_id = " . $ignoree_id;
if ( !($db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error unsetting ignore user', '', __LINE__, __FILE__, $sql);
}
}
#
#--[ ZAPISZ, ZAMKNIJ ]--
#[/phpbb]
Autor postu otrzymał pochwałę