Файл: vsime.com/system/functions/layki.php
Строк: 4
<?
function layki($id, $table)
{
global $user, $dbi;
@mysqli_query($dbi, "ALTER TABLE `$table` ADD `layki` TEXT");
$layk = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `$table` WHERE `id` = '$id'"));
$array = explode("|", $layk['layki']);
if (!in_array($user['id'], $array))
{
mysqli_query($dbi, "UPDATE `$table` SET `layki` = '".($layk['layki']==NULL?"|$user[id]|":"$layk[layki]$user[id]|")."' WHERE `id` = '$layk[id]'");
} else {
mysqli_query($dbi, "UPDATE `$table` SET `layki` = '".str_replace("|$user[id]|", '', $layk['layki'])."' WHERE `id` = '$layk[id]'");
}
}
?>