diff --git a/admin/admin_home.php b/admin/admin_home.php
index dd07912108b010df7070256a9b65837288a455c7..bca30f8bd9989fe8a66988819fa2eba828244809 100644
--- a/admin/admin_home.php
+++ b/admin/admin_home.php
@@ -376,19 +376,6 @@ $str = '
echo $str;
-
-
-
-
-
}
-
-
-
-
-
-
?>
-
-
diff --git a/include/home.php b/include/home.php
index 6cd6b4702f5501453b589468f943f240abccdb03..182ab5ced6b3d1400f429ef74f16e588e786698c 100644
--- a/include/home.php
+++ b/include/home.php
@@ -110,7 +110,7 @@ function dispHomeLastVideos(){
// DISP LAST VIDEOS BY TENDU
$str .= dispWhenTendu($video["video_tendu"]);
- $str .= '
'.$video["video_name"].'';
+ $str .= ' '.$video["video_name"].' | ';
if ($video["video_path_daily"]) {
$str .= ' ';
diff --git a/include/videos.php b/include/videos.php
index 91369cc32210a6bd632df11aa50ce319874a4dae..d5c61c2f073af23ac7d0c1ca64e4f86ab857aeff 100644
--- a/include/videos.php
+++ b/include/videos.php
@@ -51,11 +51,8 @@ function dispVideosMenu(){
$str .= '2002';
$str .= '2001';
$str .= 'avant';
- $str .= ' Pour visualiser nos videos: Click-droit, telecharger...
- Nous vous conseillons le lecteur VLC disponible sous Windows/Mac/Linux.
- ';
$str .= '';
- return ($str);
+ return $str;
}
@@ -121,7 +118,7 @@ function dispVideosByType($result, $video_type) {
while ($video = mysql_fetch_array($result)) {
$str .= dispWhenTendu($video["video_tendu"]);
- $str .= ' '.$video["video_name"].' | ';
+ $str .= ' '.$video["video_name"].' | ';
if ($video["video_path_daily"])
$str .= '';
@@ -146,4 +143,39 @@ function dispVideosByType($result, $video_type) {
}
+// 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();
+ readfile($video["video_path"]);
+ }
+ 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!");
+ }
+}
+
?>
|