From dd5b961b5566ffe876c438ccb7fdad987e9fb040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Sat, 6 Mar 2010 03:54:56 +0000 Subject: [PATCH] include javascript into default eptv page dailymotion link is now functionnal --- include/dailymotion.php | 21 +++++++++++++-------- include/functions_sql.php | 3 ++- include/home.php | 6 ++++-- include/script.js | 7 +++++++ include/section.php | 3 +-- index.php | 2 +- 6 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 include/script.js diff --git a/include/dailymotion.php b/include/dailymotion.php index 169a062..7a49083 100644 --- a/include/dailymotion.php +++ b/include/dailymotion.php @@ -1,13 +1,18 @@ EPTV - Dailymotion Publication
+function getDailymotion() { + // get video indentifier + $result = getOneVideo($_GET['dailymotion']); + if (mysql_num_rows($result)) { + $video = mysql_fetch_array($result); + echo 'EPTV - Dailymotion - '.$video["video_name"].'
'; + } + else + die("No video found with this identifier!"); return; } ?> \ No newline at end of file diff --git a/include/functions_sql.php b/include/functions_sql.php index da54b7c..45fdf76 100644 --- a/include/functions_sql.php +++ b/include/functions_sql.php @@ -42,8 +42,9 @@ function getAllEdito(){ function getOneVideo($vid_id){ + $vid_id = mysql_real_escape_string($vid_id); $query = "select * from $DB.videos_db WHERE video_id = '$vid_id'"; - return $result = mysql_query($query); + return mysql_query($query); } diff --git a/include/home.php b/include/home.php index aa77e5b..6cd6b47 100644 --- a/include/home.php +++ b/include/home.php @@ -113,8 +113,10 @@ function dispHomeLastVideos(){ $str .= ' 
  • '.$video["video_name"].''; if ($video["video_path_daily"]) { - $str .= '    - '; + $str .= '   '; + $str .= ''; + $str .= ''; + $str .= ''; } $str .= '   '.$video["video_size"].' Mo'; } diff --git a/include/script.js b/include/script.js new file mode 100644 index 0000000..6d72fd1 --- /dev/null +++ b/include/script.js @@ -0,0 +1,7 @@ + diff --git a/include/section.php b/include/section.php index c439119..267131b 100644 --- a/include/section.php +++ b/include/section.php @@ -38,6 +38,7 @@ function dispHeader() { echo ''; + include 'script.js'; echo ''; } @@ -47,8 +48,6 @@ function dispBody() { echo ''; echo '
    '; echo '
    '; - echo ''; - echo ''; dispMenu(); echo '
    '; dispSection(); diff --git a/index.php b/index.php index 46058d1..5a08a3c 100644 --- a/index.php +++ b/index.php @@ -49,7 +49,7 @@ if ($_GET['video']) // Dailymotion playback if ($_GET['dailymotion']) - return getDailymotion($_GET['dailymotion']); + return getDailymotion(); // Display section getSection(); -- GitLab