[add] count video in download queue
This commit is contained in:
parent
5d35d493e8
commit
3d9d30a889
|
@ -1,6 +0,0 @@
|
||||||
<?php
|
|
||||||
require 'inc/topMenu.php';
|
|
||||||
|
|
||||||
|
|
||||||
n_print($CONFIG);
|
|
||||||
?>
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
if ($_SESSION['log'] !== true) {
|
||||||
|
die ;
|
||||||
|
}
|
||||||
|
require 'inc/topMenu.php';
|
||||||
|
if (!empty($ci['ac']) && $ci['ac'] === 'viewQueue' && $_SESSION['log'] === true) {
|
||||||
|
$getQueue = getQueue();
|
||||||
|
echo 'You have ',$getQueue,' video in download queue.';
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'login') {
|
||||||
<input type="hidden" name="op" value="2"/>
|
<input type="hidden" name="op" value="2"/>
|
||||||
<input type="hidden" name="ac" value="login"/>
|
<input type="hidden" name="ac" value="login"/>
|
||||||
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
||||||
<input type="hidden" name="token" value="', genToken(), '"/>
|
<input type="hidden" name="token" value="', $token, '"/>
|
||||||
<input type="submit" />
|
<input type="submit" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>';
|
</form>';
|
||||||
|
@ -25,7 +25,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'newDir') {
|
||||||
<input type="hidden" name="op" value="1"/>
|
<input type="hidden" name="op" value="1"/>
|
||||||
<input type="hidden" name="ac" value="newDir" />
|
<input type="hidden" name="ac" value="newDir" />
|
||||||
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
||||||
<input type="hidden" name="token" value="', genToken(), '"/>
|
<input type="hidden" name="token" value="', $token, '"/>
|
||||||
<input type="submit"/>
|
<input type="submit"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>';
|
</form>';
|
||||||
|
@ -41,7 +41,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'renDir') {
|
||||||
<input type="hidden" name="op" value="1"/>
|
<input type="hidden" name="op" value="1"/>
|
||||||
<input type="hidden" name="ac" value="renDir" />
|
<input type="hidden" name="ac" value="renDir" />
|
||||||
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
||||||
<input type="hidden" name="token" value="', genToken(), '"/>
|
<input type="hidden" name="token" value="', $token, '"/>
|
||||||
<input type="submit"/>
|
<input type="submit"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>';
|
</form>';
|
||||||
|
@ -66,7 +66,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'addVideo') {
|
||||||
<input type="hidden" name="op" value="1"/>
|
<input type="hidden" name="op" value="1"/>
|
||||||
<input type="hidden" name="ac" value="addVideo" />
|
<input type="hidden" name="ac" value="addVideo" />
|
||||||
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
||||||
<input type="hidden" name="token" value="', genToken(), '"/>
|
<input type="hidden" name="token" value="', $token, '"/>
|
||||||
<input type="submit"/>
|
<input type="submit"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>';
|
</form>';
|
||||||
|
@ -80,7 +80,7 @@ if (!empty($ci['ac']) && $ci['ac'] === 'addThumbnail') {
|
||||||
<input type="hidden" name="op" value="1"/>
|
<input type="hidden" name="op" value="1"/>
|
||||||
<input type="hidden" name="ac" value="addThumbnail" />
|
<input type="hidden" name="ac" value="addThumbnail" />
|
||||||
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
<input type="hidden" name="bc" value="'.$ci['bc'].'" />
|
||||||
<input type="hidden" name="token" value="', genToken(), '"/>
|
<input type="hidden" name="token" value="', $token, '"/>
|
||||||
<input type="submit"/>
|
<input type="submit"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>';
|
</form>';
|
||||||
|
@ -137,7 +137,7 @@ if (!empty($listCurrentFile) && $ci['ac'] !== 'view') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
if (!empty($ci['ac']) && $ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
||||||
$_SESSION['video'] = $videoInfo['hash'];
|
$_SESSION['video'] = $videoInfo['hash'];
|
||||||
if (!empty($videoInfo)) {
|
if (!empty($videoInfo)) {
|
||||||
if (empty($videoInfo['title'])) {
|
if (empty($videoInfo['title'])) {
|
||||||
|
@ -163,7 +163,6 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
||||||
echo '</video>';
|
echo '</video>';
|
||||||
}
|
}
|
||||||
if ($_SESSION['log'] === true) {
|
if ($_SESSION['log'] === true) {
|
||||||
$token = genToken();
|
|
||||||
echo '<div id="toolbar">
|
echo '<div id="toolbar">
|
||||||
<a href="?ac=view&op=3&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '"><img src="images/useThumbnail.svg" alt="Use this thumbnail for folder thumbnail" title="Use this thumbnail for folder thumbnail"/></a>
|
<a href="?ac=view&op=3&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '"><img src="images/useThumbnail.svg" alt="Use this thumbnail for folder thumbnail" title="Use this thumbnail for folder thumbnail"/></a>
|
||||||
<a href="?ac=view&op=4&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '"><img src="images/delete.svg" alt="Delete this video" title="Delete this video"/></a>
|
<a href="?ac=view&op=4&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '"><img src="images/delete.svg" alt="Delete this video" title="Delete this video"/></a>
|
||||||
|
@ -188,7 +187,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Url</th>
|
<th>Url</th>
|
||||||
<td><a href="', htmlentities($videoInfo['url']), '">', $videoInfo['url'], '</a></td>
|
<td><a href="', htmlentities($videoInfo['url']), '">', $videoInfo['url'], '</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Duration</th>
|
<th>Duration</th>
|
||||||
|
@ -201,7 +200,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
||||||
<th>Via</th>
|
<th>Via</th>
|
||||||
<td>';
|
<td>';
|
||||||
if (!empty($videoInfo['via'])) {
|
if (!empty($videoInfo['via'])) {
|
||||||
echo '<a href="', htmlentities($videoInfo['via']), '">', $videoInfo['via'], '</a>';
|
echo '<a href="', htmlentities($videoInfo['via']), '">', $videoInfo['via'], '</a>';
|
||||||
} else {
|
} else {
|
||||||
echo '';
|
echo '';
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<label>Password (verification)</label>
|
<label>Password (verification)</label>
|
||||||
<input type="password" name="passwordVerif" required/>
|
<input type="password" name="passwordVerif" required/>
|
||||||
<input type="hidden" name="install" value="install"/>
|
<input type="hidden" name="install" value="install"/>
|
||||||
<input type="hidden" name="token" value="<?php echo genToken(); ?>"/>
|
<input type="hidden" name="token" value="<?php echo $token; ?>"/>
|
||||||
<input type="submit" />
|
<input type="submit" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
|
@ -1,15 +1,20 @@
|
||||||
<h1 id="title"><a href="index.php">SoViGall <span>Share your videos ..... in webm</span></a></h1>
|
<h1 id="title"><a href="index.php">SoViGall <span>Share your videos ..... in webm</span></a></h1>
|
||||||
|
|
||||||
<ul id="topMenu">
|
|
||||||
<?php
|
<?php
|
||||||
if ($_SESSION['log'] === true) {
|
if ($_SESSION['log'] === true) {
|
||||||
echo '
|
echo '
|
||||||
<li><a href="?ac=newDir&bc=', $ci['bc'], '">New directory</a></li>
|
<ul class="topMenu">
|
||||||
<li><a href="?ac=renDir&bc=', $ci['bc'], '">Rename directory</a></li>
|
<li><a href="?ac=viewQueue&token=',$token,'">Download queue</a></li>
|
||||||
<li><a href="?ac=addVideo&bc=', $ci['bc'], '">Add video</a></li>
|
</ul>
|
||||||
<li><a href="?ac=addThumbnail&bc=', $ci['bc'], '">Add thumbnail</a></li>';
|
<ul class="topMenu">
|
||||||
|
<li><a href="?ac=newDir&bc=', $ci['bc'], '">New directory</a></li>
|
||||||
|
<li><a href="?ac=renDir&bc=', $ci['bc'], '">Rename directory</a></li>
|
||||||
|
<li><a href="?ac=addVideo&bc=', $ci['bc'], '">Add video</a></li>
|
||||||
|
<li><a href="?ac=addThumbnail&bc=', $ci['bc'], '">Add thumbnail</a></li>
|
||||||
|
</ul>';
|
||||||
} else {
|
} else {
|
||||||
echo '<li><a href="?ac=login&bc=', $ci['bc'], '">Login</a></li>';
|
echo '<ul class="topMenu">
|
||||||
|
<li><a href="?ac=login&bc=', $ci['bc'], '">Login</a></li>
|
||||||
|
</ul>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
|
21
index.php
21
index.php
|
@ -161,9 +161,9 @@ function n_print($data, $name = '') {
|
||||||
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
|
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
|
||||||
echo '
|
echo '
|
||||||
<legend style="border:1px solid orange;padding: 1px;background-color:#eee;color:orange;">
|
<legend style="border:1px solid orange;padding: 1px;background-color:#eee;color:orange;">
|
||||||
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
|
', basename($aBackTrace[0]['file']), ' ligne => ', $aBackTrace[0]['line'], '
|
||||||
</legend>';
|
</legend>';
|
||||||
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
||||||
echo '
|
echo '
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<br />';
|
<br />';
|
||||||
|
@ -251,6 +251,15 @@ function listCurrentDir($breadcrumb) {
|
||||||
return glob("*", GLOB_ONLYDIR);
|
return glob("*", GLOB_ONLYDIR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getQueue() {
|
||||||
|
$allHash = glob("tmp/*.hash");
|
||||||
|
if ($allHash) {
|
||||||
|
return count($allHash);
|
||||||
|
} else {
|
||||||
|
return '0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function makeBreadcrumb($bc, $fullListDir) {
|
function makeBreadcrumb($bc, $fullListDir) {
|
||||||
$bcToArray = str_split($bc, 8);
|
$bcToArray = str_split($bc, 8);
|
||||||
$nbBc = count($bcToArray);
|
$nbBc = count($bcToArray);
|
||||||
|
@ -426,6 +435,13 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {
|
||||||
}
|
}
|
||||||
$defineThumb = defineThumb($ci['bc'], $ci['file']);
|
$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';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
@ -437,6 +453,7 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php
|
<?php
|
||||||
|
$token = genToken();
|
||||||
if (!isset($page) && empty($page)) {
|
if (!isset($page) && empty($page)) {
|
||||||
require 'inc/content.php';
|
require 'inc/content.php';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -27,19 +27,18 @@ body {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#topMenu {
|
.topMenu {
|
||||||
margin: 0px;
|
margin: 0.5em 0;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
display: inline-block;
|
|
||||||
border-radius: 0.2em;
|
border-radius: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#topMenu li {
|
.topMenu li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 0.3em;
|
padding: 0.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#topMenu a {
|
.topMenu a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
Loading…
Reference in New Issue