public function get_related_videos($video_id)
{
global $config , $servers;
$video_info = $this->get_video_info($video_id);
$keyword = trim($video_info['video_keywords']);
$keyword = mysql_clean($keyword);
#echo $keyword;
$tag = new Tags($keyword, $video_id, '', '0||0');
$tags = $tag->get_tags();
unset($tag);
#echo "<pre>";print_r($tags);echo "</pre>";
$related_vid = array();
#for ($i = 0; $i < count($tags); $i ++)
#{
# $sql = "SELECT tv.vid FROM
# `tag_video` AS tv,
# `tags` AS t WHERE
# tv.tag_id=t.id AND
# t.tag='" . mysql_clean($tags[$i]) . "'
# GROUP BY tv.vid";
# $result = mysql_query($sql) or mysql_die($sql);
#
# while ($tmp_array = mysql_fetch_assoc($result))
# {
# $tmp = $tmp_array['vid'];
# if (! in_array($tmp, $related_vid))
# {
# $related_vid[] = $tmp;
# }
# }
# unset($tmp_array);
#}
#echo count($related_vid);
#if (count($related_vid) < 2)
#{
$sql = "SELECT `video_id` FROM `videos` WHERE
`video_user_id`='" . (int) $video_info['video_user_id'] . "' AND
`video_channels` LIKE '".$video_info['video_channels']."' AND
`video_type`='public' AND
`video_active`=1 AND
`video_approve`=1
ORDER BY `video_id` DESC";
$result = mysql_query($sql) or mysql_die($sql);
while ($tmp_array = mysql_fetch_assoc($result))
{
if (! in_array($tmp_array['video_id'], $related_vid))
{
$related_vid[] = $tmp_array['video_id'];
}
}
#}
# Find Position Of Curent Video in related_vid array
Bookmarks