<?php
include("connect.php");
include("includes/function-video.php");
$folder=$foldervideo;
$action = $_GET['x'];
if(!isset($action)) $action = "home";

IF ($action=="home"){
$m1=$d14;
$m2=$k14;
tpl_header($LANGAUGE[278]);
echo bar($namelinks1,$LANGSITE[278],"","");
table($LANGAUGE[278],video_category(),1);
tpl_footer();

}ELSEIF ($action=="category"){
$id = intval($_GET["id"]);
$id = clean_value($id);
$sql = @mysql_query("select * from videocategory where id='$id' AND active='1'");
$Row = @mysql_fetch_array($sql);
if (!$Row)
{
error();
exit;
}
$Row['name'] = text(3,$Row['name']);

$m1 = $Row['name'];
$m2 = str_replace(" ",",",$Row['name']);

tpl_header($Row['name']);

echo bar($namelinks1,$namelinks15,$Row['name'],"");

table($Row['name'],video_content($id),1);

tpl_footer();

}ELSEIF ($action=="show"){
$id = intval($_GET["id"]);
$id = clean_value($id);
$sql = @mysql_query("select * from videocontent where id='$id' AND active='1'");
$Row = @mysql_fetch_array($sql);
if (!$Row)
{
error();
exit;
}

$sqlupdate = mysql_query("update videocontent set visitor=visitor+1 where id='$id' AND active='1'") or die ("Query failed");

$Row['name'] = text(3,$Row['name']);
$Row['url'] = text(3,$Row['url']);
$Row['textcode'] = text(2,$Row['textcode']);
$d = date("j/n/Y",$Row['date']);

$m1 = $Row['name'];
$m2 = str_replace(" ",",",$Row['name']);

if($Row['selectcode']==1){
$rrr = $Row['textcode'];
$dow = '';
}else{
$rrr = embed($Row['url'],370,250);
$dow = '<div>'.$LANGAUGE[282].' : <a href="'.$Row['url'].'">'.$LANGAUGE[89].'</a></div>';
}

$boxinfo = '<div>'.$LANGAUGE[279].' : '.$Row['name'].'</div>
<div>'.$LANGAUGE[280].' : '.$d.'</div>
<div>'.$LANGAUGE[281].' : '.$Row['visitor'].'</div>
'.$dow.'
<div align="center">'.$rrr.'</div>';

$sqlcc = @mysql_query("select * from videocategory where id='".$Row['cat']."'");
$Rowcc = @mysql_fetch_array($sqlcc);
if ($htmlorphp=="1"){
$links = "video-cats-".$Rowcc['id'].".html";
}else{
$links = "video.php?x=category&id=".$Rowcc['id']."";
}

tpl_header($Row['name']);

echo bar($namelinks1,$namelinks15,"<a href='".$links."'>".$Rowcc['name']."</a>",$Row['name']);

table($Row['name'],$boxinfo,1);

tpl_footer();
}
?>