From 3d9d30a889c5c291b0fddc9f24e81cb467e07a5a Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Thu, 1 Aug 2013 14:08:43 +0200 Subject: [PATCH] [add] count video in download queue --- inc/addVideo.php | 6 ------ inc/admin.php | 9 +++++++++ inc/content.php | 17 ++++++++--------- inc/install.php | 2 +- inc/topMenu.php | 21 +++++++++++++-------- index.php | 21 +++++++++++++++++++-- style.css | 9 ++++----- 7 files changed, 54 insertions(+), 31 deletions(-) delete mode 100644 inc/addVideo.php create mode 100644 inc/admin.php diff --git a/inc/addVideo.php b/inc/addVideo.php deleted file mode 100644 index a2d2c10..0000000 --- a/inc/addVideo.php +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/inc/admin.php b/inc/admin.php new file mode 100644 index 0000000..ce6516a --- /dev/null +++ b/inc/admin.php @@ -0,0 +1,9 @@ + - + '; @@ -25,7 +25,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'newDir') { - + '; @@ -41,7 +41,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'renDir') { - + '; @@ -66,7 +66,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'addVideo') { - + '; @@ -80,7 +80,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'addThumbnail') { - + '; @@ -137,7 +137,7 @@ if (!empty($listCurrentFile) && $ci['ac'] !== 'view') { } } echo ''; -if ($ci['ac'] === 'view' && !empty($listCurrentFile)) { +if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) { $_SESSION['video'] = $videoInfo['hash']; if (!empty($videoInfo)) { if (empty($videoInfo['title'])) { @@ -163,7 +163,6 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) { echo ''; } if ($_SESSION['log'] === true) { - $token = genToken(); echo '
Use this thumbnail for folder thumbnail Delete this video @@ -188,7 +187,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) { Url - ', $videoInfo['url'], ' + ', $videoInfo['url'], ' Duration @@ -201,7 +200,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) { Via '; if (!empty($videoInfo['via'])) { - echo '', $videoInfo['via'], ''; + echo '', $videoInfo['via'], ''; } else { echo ''; } diff --git a/inc/install.php b/inc/install.php index 8b93427..15677ad 100644 --- a/inc/install.php +++ b/inc/install.php @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/inc/topMenu.php b/inc/topMenu.php index 0a2bbe5..2c55800 100644 --- a/inc/topMenu.php +++ b/inc/topMenu.php @@ -1,15 +1,20 @@

SoViGall Share your videos ..... in webm

- \ No newline at end of file +?> \ No newline at end of file diff --git a/index.php b/index.php index b363e11..52812cc 100644 --- a/index.php +++ b/index.php @@ -161,9 +161,9 @@ function n_print($data, $name = '') {
'; echo ' - ', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], ' + ', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], ' '; - echo '
',   htmlentities(print_r($data, 1)), '
'; + echo '
',      htmlentities(print_r($data, 1)), '
'; echo '

'; @@ -251,6 +251,15 @@ function listCurrentDir($breadcrumb) { return glob("*", GLOB_ONLYDIR); } +function getQueue() { + $allHash = glob("tmp/*.hash"); + if ($allHash) { + return count($allHash); + } else { + return '0'; + } +} + function makeBreadcrumb($bc, $fullListDir) { $bcToArray = str_split($bc, 8); $nbBc = count($bcToArray); @@ -426,6 +435,13 @@ if (isset($ci['ac']) && !empty($ci['ac'])) { } $defineThumb = defineThumb($ci['bc'], $ci['file']); } + if ($ci['ac'] === 'viewQueue') { + verifToken($ci['token']); + if ($_SESSION['log'] !== true) { + die('Tinker say : Pew Pew Pew Pew Pew Pew Pew Pew Pew Pew Pew Pew'); + } + $page = 'admin'; + } } ?> @@ -437,6 +453,7 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {