[add] admin can delete video
This commit is contained in:
parent
df7bb53581
commit
0e68b3f1eb
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
@ -165,7 +165,8 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
|||
if ($_SESSION['log'] === true) {
|
||||
$token = genToken();
|
||||
echo '<div id="toolbar">
|
||||
<a href="?ac=view&op=3&bc=', $ci['bc'], '&file=', $ci['file'], '&token=', $token, '">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>
|
||||
</div>';
|
||||
}
|
||||
echo '<table>
|
||||
|
|
24
index.php
24
index.php
|
@ -161,9 +161,9 @@ function n_print($data, $name = '') {
|
|||
<fieldset style="border: 1px solid orange; padding: 5px;color:#1E1915; background-color: #fff;">';
|
||||
echo '
|
||||
<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>';
|
||||
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
||||
echo '<pre style="color:#1E1915;">', htmlentities(print_r($data, 1)), '</pre>';
|
||||
echo '
|
||||
</fieldset>
|
||||
<br />';
|
||||
|
@ -226,6 +226,19 @@ function addVideo($ci, $fullListFile) {
|
|||
file_put_contents($GLOBALS['config']['LISTFILE'], "<?php\n\$fullListFile=".var_export($fullListFile, true).";\n?>");
|
||||
}
|
||||
|
||||
function deleteVideo($bc, $file) {
|
||||
$path = $GLOBALS['config']['VIDEODIR'].'/'.chunk_split($bc, 8, '/');
|
||||
$pathAndFile = $path.$file;
|
||||
if (file_exists($pathAndFile) && !is_dir($pathAndFile) && $file === $_SESSION['video'].'.jpg') {
|
||||
$listFile = (glob($path.$_SESSION['video']."*"));
|
||||
foreach ($listFile as $value) {
|
||||
unlink($value);
|
||||
}
|
||||
} else {
|
||||
return 'Error, cannot delete this file.';
|
||||
}
|
||||
}
|
||||
|
||||
function updateFileTitle($hash, $title) {
|
||||
global $fullListFile;
|
||||
$fullListFile[$hash]['title'] = $title;
|
||||
|
@ -399,6 +412,13 @@ if (isset($ci['ac']) && !empty($ci['ac'])) {
|
|||
verifToken($ci['token']);
|
||||
$addThumbnail = addThumbnail($ci['bc']);
|
||||
}
|
||||
if ($ci['ac'] === 'view' && !empty($ci['op']) && (int)$ci['op'] === 4) {
|
||||
verifToken($ci['token']);
|
||||
if ($_SESSION['log'] !== true) {
|
||||
die('Tinker say : You can keep your magic, I have laser beams! ');
|
||||
}
|
||||
$deleteVideo = deleteVideo($ci['bc'], $ci['file']);
|
||||
}
|
||||
if ($ci['ac'] === 'view' && !empty($ci['op']) && (int)$ci['op'] === 3) {
|
||||
verifToken($ci['token']);
|
||||
if ($_SESSION['log'] !== true) {
|
||||
|
|
30
style.css
30
style.css
|
@ -42,7 +42,7 @@ body {
|
|||
margin: 0;
|
||||
padding: 0.4em;
|
||||
border-radius: 0.2em;
|
||||
background-color: #000;
|
||||
background-color: #141414;
|
||||
}
|
||||
|
||||
#breadcrumb {
|
||||
|
@ -78,7 +78,7 @@ body {
|
|||
}
|
||||
|
||||
.dir, .video {
|
||||
background-image: url("folder.svg");
|
||||
background-image: url("images/folder.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 48px;
|
||||
position: absolute;
|
||||
|
@ -89,11 +89,11 @@ body {
|
|||
}
|
||||
|
||||
.video {
|
||||
background-image: url("video.svg");
|
||||
background-image: url("images/video.svg");
|
||||
}
|
||||
|
||||
.fulldir {
|
||||
background-image: url("folder.svg");
|
||||
background-image: url("images/folder.svg");
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: auto 170px;
|
||||
|
@ -112,17 +112,24 @@ body {
|
|||
#viewFile table {
|
||||
width: 60%;
|
||||
margin: 0 auto;
|
||||
border : 0.4em solid #2c2c2c;
|
||||
padding:0;
|
||||
border-radius:0.2em;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#viewFile table tr:nth-child(even) {
|
||||
background-color: #332A23;
|
||||
background-color: #2c2c2c;
|
||||
}
|
||||
|
||||
#viewFile th {
|
||||
padding: 0.3em 0.4em 0.3em 0.3em;
|
||||
text-align: right;
|
||||
min-width: 30%;
|
||||
}
|
||||
|
||||
#viewFile td {
|
||||
padding: 0.3em 0.3em 0.3em 0.4em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
@ -146,4 +153,17 @@ input[type="file"] {
|
|||
|
||||
video {
|
||||
width: 55%;
|
||||
}
|
||||
|
||||
#toolbar {
|
||||
border-radius: 0.2em;
|
||||
background-color: #141414;
|
||||
width: auto;
|
||||
margin: 0 auto 1.1em auto;
|
||||
height : 2.3em;
|
||||
}
|
||||
|
||||
#toolbar img {
|
||||
height:2em;
|
||||
width : 2em;
|
||||
}
|
Loading…
Reference in New Issue