<?php
include("connect.php");
include("includes/func_flash.php");
$folder=$folderflash;
$action = $_GET['action'];
if(!isset($action)) $action = "home";

IF ($action=="home"){
$m1=$d10;
$m2=$k10;
tpl_header($LANGAUGE[57]);
bar($namelinks1,$LANGAUGE[57],"","");
table($LANGAUGE[57],flash_cats(),1);
tpl_footer();

}ELSEIF ($action=="flash"){
$id = intval($_GET["id"]);

$sql = @mysql_query("select * from flash_cat where id='$id' AND active='1'");
$Row = @mysql_fetch_array($sql);
if (!$Row)
{
error();
exit;
}
$names_cats = text(3,$Row['name_cat']);

tpl_header($names_cats);
bar($namelinks1,$namelinks7,$names_cats,"");
table($names_cats,flashat(),1);
tpl_footer();

}ELSEIF ($action=="flash_show"){

$id = intval($_GET["id"]);

$sql = @mysql_query("select * from flash where id='$id' AND active='1'");
$Row = @mysql_fetch_array($sql);
if (!$Row)
{
error();
exit;
}

$nameflash   = text(3,$Row['name_flash']);
$desinflash  = text(3,$Row['desin_flash']);
$desinflash  = text(3,$Row['desin_flash']);
$url_flash   = text(3,$Row['url_flash']);
$download_f  = text(3,$Row['download_flash']);
$w           = text(3,$Row['w_flash']);
$h           = text(3,$Row['h_flash']);
$visflash    = $Row['vis'];
$catflash    = $Row['cat'];
$d = date("j/n/Y",$Row['date']);

// start size
//if($Row['autosize'] == 1)
//{
//$flainfo = @getimagesize($url_flash);
//$ww = $flainfo[0];
//$hh = $flainfo[1];

//}else{

if($w == "0"){ $ww = "450"; }else{ $ww = "$w"; }
if($h == "0"){ $hh = "400"; }else{ $hh = "$h"; }

//}
// end size

if($download_f == ""){ $dd = "$url_flash"; }else{ $dd = "$download_f"; }

$sql2 = @mysql_query("SELECT * FROM flash_cat where id='$catflash'") or die ("Query failed");
$cats = @mysql_fetch_array($sql2);
$catnamef = text(3,$cats['name_cat']);
if ($htmlorphp=="1"){
$xxx = "<a href='flash_cat-$catflash.html'>$catnamef</a>";
}else{
$xxx = "<a href='flash.php?action=flash&id=$catflash'>$catnamef</a>";
}

$sql3 = @mysql_query("update flash set vis=vis+1 where id='$id'") or die ("Query failed");

$fflash = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"$ww\" height=\"$hh\" id=\"algy_name\">
        <param name=\"movie\" value=\"$url_flash\" />
        <param name=\"quality\" value=\"high\" />
        <param name=\"bgcolor\" value=\"#FFFFFF\" />
        <embed src=\"$url_flash\" quality=\"high\" bgcolor=\"#FFFFFF\" width=\"$ww\" height=\"$hh\" name=\"myMovieName\" align=\"center\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">
        </embed></object>";

$fflash2 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="'.$ww.'" height="'.$hh.'" id="myMovieName">
        <param name="movie" value="'.$url_flash.'" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#FFFFFF" />
        <embed src="'.$url_flash.'" quality="high" bgcolor="#FFFFFF" width="'.$ww.'" height="'.$hh.'" name="myMovieName" align="center" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">

        </embed></object>';
//$F = "<div align='center'><embed width='$ww' height='$hh' src='$url_flash'><noembed>$lang_t41</noembed></div>";
$F = "<div align='center'>$fflash2</div>";
$F .= "<br />";
$F .= "<table class='xtable' width='100%' id='Auber1f5'>
    <tr>
      <td width='35%' class='xtr' align='center'>".$LANGAUGE[119]."</td>
      <td width='30%' class='xtr' align='center'>".$LANGAUGE[120]."</td>
      <td width='20%' class='xtr' align='center'>".$LANGAUGE[83]."</td>
      <td width='15%' class='xtr' align='center'>".$LANGAUGE[84]."</td>
    </tr>
    <tr>
      <td width='35%' class='xtd' align='center'><a href='$dd'>".$LANGAUGE[89]."</a></td>
      <td width='30%' class='xtd' align='center'>$xxx</td>
      <td width='20%' class='xtd' align='center'>$d</td>
      <td width='15%' class='xtd' align='center'>$visflash</td>
    </tr>
  </table>";

tpl_header($nameflash);
bar($namelinks1,$namelinks7,$xxx,$nameflash);

table($nameflash,$F,1);

tpl_footer();
}
?>