Newer
Older
if (!isset($_GET['year_page']))
$yeartitle = DEFAULT_YEAR;
elseif ($_GET['year_page'] == 0)
$yeartitle = "2000 et avant";
else
$yeartitle = $_GET['year_page'];
<h1><img alt="" src="images/puce.png" /> <strong>Videos de '. $yeartitle .'</strong></h1>
</ul></div>
</div>
<div id="right_side">
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /> <strong>Années</strong></h1>
';
$str .= '<li><a href="index.php?html=Videos&year_page=2011" class="texte_link">2011</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2010" class="texte_link">2010</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2009" class="texte_link">2009</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2008" class="texte_link">2008</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2007" class="texte_link">2007</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2006" class="texte_link">2006</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2005" class="texte_link">2005</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2004" class="texte_link">2004</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2003" class="texte_link">2003</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2002" class="texte_link">2002</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=2001" class="texte_link">2001</a></li>';
$str .= '<li><a href="index.php?html=Videos&year_page=0" class="texte_link">2000 et avant</a></li>';
$year_page = $_GET['year_page'];
else
$year_page = DEFAULT_YEAR;
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
$result_prod = getVideosByYearAndTypeAndTendu($year_page, "eptvprod", 2);
$result_bonus = getVideosByYearAndTypeAndTendu($year_page, "eptvbonus", 2);
$result_adm = getVideosByYearAndTypeAndTendu($year_page, "eptv.adm", 2);
}
else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
$result_prod = getVideosByYearAndTypeAndTendu($year_page, "eptvprod", 1);
$result_bonus = getVideosByYearAndTypeAndTendu($year_page, "eptvbonus", 1);
$result_adm = getVideosByYearAndTypeAndTendu($year_page, "eptv.adm", 1);
}
else {
$result_prod = getVideosByYearAndTypeAndTendu($year_page, "eptvprod", 0);
$result_bonus = getVideosByYearAndTypeAndTendu($year_page, "eptvbonus", 0);
$result_adm = getVideosByYearAndTypeAndTendu($year_page, "eptv.adm", 0);
}
if (mysql_num_rows($result_prod))
$str .= dispVideosByType($result_prod, " e p t v p r o d u c t i o n");
if (mysql_num_rows($result_bonus))
$str .= dispVideosByType($result_bonus, " e p t v   b o n u s");
if (mysql_num_rows($result_adm))
$str .= dispVideosByType($result_adm, " e p t v . a d m");
$str = '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#111111">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<tr>
<td>
<b>
<font color="#666666">
'.$video_type.'
</font>
<tr>
<td bgcolor="#282828">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
';
while ($video = mysql_fetch_array($result)) {
$str .= dispWhenTendu($video["video_tendu"]);
$str .= ' <a href="?video=' . $video["video_id"] . ' " class="texte_link"' . '>'.$video["video_name"].'</a></td><td>';
$str .= '<a href="javascript:popup_video_dailymotion(\'?dailymotion='.$video["video_id"].'\')"><img src=\'../images/daily.png\' height=15 border=0 /></a>';
$str .= '</TD><TD>'.date("d/m/Y", strtotime($video["video_date"])).'</TD><TD align=center><strong>'.$video["video_size"].' Mo</strong></TD></TR>';
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
';
// download a video by it's video identifier
function getVideo() {
// get video info
$result = getOneVideo($_GET['video']);
if (mysql_num_rows($result)) {
$video = mysql_fetch_array($result);
// check video and user right
if ($video["video_tendu"] > 0) {
header("Status: 403 Forbidden");
die("Permission refusée.");
}
// check file existance and download
if (file_exists($video["video_path"])) {
header('Content-Description: Video Transfer;');
header('Content-Disposition: attachment; filename="'.basename($video["video_path"]).'";');
header('Content-Type: application/octet-stream;');
header('Content-Transfer-Encoding: binary;');
header('Content-Length: ' . filesize($video["video_path"]).';');
flush();
//We now push by block of 10M to save memory consumption of readfile
//readfile($video["video_path"]);
$fd = fopen($video["video_path"], 'rb');
while (!feof($fd)) {
$buf = fread($fd, 10485760);
echo $buf;
}
fclose($fd);
}
else {
header("Status: 404 Not Found");
die("Le fichier video n'est pas disponible. Contactez le webmaster!!");
}
}
else {
header("Status: 404 Not Found");
die("La vidéo que vous demandez n'existe pas!");
}
}