Файл: vsime.com/system/functions/is_friend.php
Строк: 21
<?
function is_friend ($user_id, $ank_id, $ok=0)
{
global $dbi;
$user = profile($user_id);
$ank = profile($ank_id);
if ($ok == 0)
{
if (mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `friends` WHERE ((`id_user` = '$user[id]' AND `id_ank` = '$ank[id]') OR (`id_user` = '$ank[id]' AND `id_ank` = '$user[id]')) AND `ok` = '1'"))!=0)return true;
else return false;
} else {
if (mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `friends` WHERE `id_user` = '$user[id]' AND `id_ank` = '$ank[id]' AND `ok` = '0'"))!=0)return true;
else return false;
}
}
?>