Файл: modules/video/select.php
Строк: 20
<?php
require_once '../../incfiles/core.php';
require_once '../../incfiles/func.php';
require_once '../../incfiles/auth.php';
require_once '../../incfiles/user.php';
if (empty($user_id)) go(URL);
if (!empty($_GET['from']) && is_numeric($_GET['from']) && !empty($_GET['fid']) && is_numeric($_GET['fid']) && !empty($_GET['target']))
{
$from = abs(intval($_GET['from']));
$fid = abs(intval($_GET['fid']));
/* $arr_pl = mysql_fetch_array(mysql_query("SELECT * FROM `audioplaylist` WHERE `user_id` = '".$user_id."' LIMIT 1"));
$arr_pl_lists = implode(",", array(substr(str_replace("||",",",$arr_pl['tracks']),1,-1)));*/
if ($_GET['target'] == 'group_wall' || $_GET['target'] == 'group_forum') $result1 = mysql_query("SELECT * FROM `groups` WHERE `id` = '".$from."' LIMIT 1");
else $result1 = mysql_query("SELECT * FROM `users` WHERE `id` = '".$from."' LIMIT 1");
$result2 = mysql_query("SELECT * FROM `video` WHERE `id` = '".$fid."' LIMIT 1");
if (mysql_num_rows($result1) == true && mysql_num_rows($result2) == true)
{
$arr_video = mysql_fetch_array(mysql_query("SELECT * FROM `video` WHERE `id` ='".$fid."' LIMIT 1"));
}
else go(URL);
}
else go(URL);
if (mysql_result(mysql_query("SELECT COUNT(`id`) FROM `wall_cache` WHERE `user_id` = '".$user_id."' LIMIT 1"),0) == false) mysql_query("INSERT INTO `wall_cache` SET `user_id` = '".$user_id."'");
$arr_wall_cache = mysql_fetch_array(mysql_query("SELECT * FROM `wall_cache` WHERE `user_id` = '".$user_id."' LIMIT 1"));
if ($_GET['target'] == 'wall' || $_GET['target'] == 'group_wall' || $_GET['target'] == 'group_forum')
{
if ($arr_wall_cache['count_video'] < 10) mysql_query("UPDATE `wall_cache` SET `video` = '".$arr_wall_cache['video']."|".$arr_video['id']."|', count_video=count_video+1 WHERE `user_id` = '".$user_id."' LIMIT 1");
$arr_group = mysql_fetch_array(mysql_query("SELECT * FROM `groups` WHERE `id` = '".$from."' LIMIT 1"));
if ($arr_group['access_wall'] == 3) go(URL.'/groups/wall/add.php?id='.$from);
if ($_GET['target'] == 'group_forum') go(URL.'/groups/forum/new.php?id='.$from);
else go(URL.'/'.($_GET['target']=='group_wall'?'groups/':'').'?id='.$from);
}
?>