Файл: vsime.com/system/functions/in_comm.php
Строк: 18
<?
function in_comm($user_id, $comm_array=array()) {
global $comm;
$ank = profile($user_id);
if ($ank['id']) {
if (@$comm_array['id']) {
if (mysqli_result("SELECT COUNT(*) FROM `comm` WHERE `id` = '".(@$comm_array['id'])."'")) {
if (mysqli_result("SELECT COUNT(*) FROM `comm_users` WHERE `id_comm` = '$comm_array[id]' AND `id_user` = '$ank[id]' AND `invite` = '0' AND `activate` = '1'"))return true;
else return false;
} else return false;
} elseif (isset($comm)) {
if (mysqli_result("SELECT COUNT(*) FROM `comm` WHERE `id` = '".(@$comm['id'])."'")) {
if (mysqli_result("SELECT COUNT(*) FROM `comm_users` WHERE `id_comm` = '$comm[id]' AND `id_user` = '$ank[id]' AND `invite` = '0' AND `activate` = '1'"))return true;
else return false;
} else return false;
} else return false;
} else return false;
}
?>