Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit 7263223

Browse files
authored
update v0.4.1
1 parent 3ee344f commit 7263223

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

core/system/dir.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function loadFileDir($file, $ROOT, $dirb)
112112
</label> -->
113113
<div class="upload__inner">
114114
<div class="ui_drop">
115-
<form action="core/system/kernel/sys.php?upload__dir=<?php echo loadFileDir(null, false, $dirb);?>" class="dropzone" id="DropzoneFrom">
115+
<form action="core/system/kernel/sys.php?upload__dir=<?php echo loadFileDir(null, true, $dirb);?>" class="dropzone" id="DropzoneFrom">
116116
</form>
117117
</div>
118118
</div>
@@ -200,31 +200,31 @@ function loadFileDir($file, $ROOT, $dirb)
200200
$xnum = 0;
201201
foreach ($all__files as $file) { ?>
202202
<tr>
203-
<td <?php if (mime_content_type($main_path . '/' . $file) == "directory") { ?>class="link-click" data-href="core/system/dir.php?dir=<?php echo loadFileDir($file, false, $dirb);?>" <?php } ?>><span class="material-icons"><?php echo mime_mdicon($main_path . '/' . $file); ?></span></td>
204-
<td <?php if (mime_content_type($main_path . '/' . $file) == "directory") { ?> data-href="core/system/dir.php?dir=<?php echo loadFileDir($file, false, $dirb);?>" <?php } ?> class="link-click mdl-data-table__cell--non-numeric"><?php echo $file; ?></td>
205-
<td <?php if (mime_content_type($main_path . '/' . $file) == "directory") { ?>class="link-click" data-href="core/system/dir.php?dir=<?php echo loadFileDir($file, false, $dirb);?>" <?php } ?>><?php echo mime_content_type($main_path . '/' . $file); ?></td>
203+
<td <?php if (mime_content_type($main_path . '/' . $file) == "directory") { ?>class="link-click" data-href="core/system/dir.php?dir=<?php echo urlencode(loadFileDir($file, false, $dirb));?>" <?php } ?>><span class="material-icons"><?php echo mime_mdicon($main_path . '/' . $file); ?></span></td>
204+
<td <?php if (mime_content_type($main_path . '/' . $file) == "directory") { ?> data-href="core/system/dir.php?dir=<?php echo urlencode(loadFileDir($file, false, $dirb));?>" <?php } ?> class="link-click mdl-data-table__cell--non-numeric"><?php echo $file; ?></td>
205+
<td <?php if (mime_content_type($main_path . '/' . $file) == "directory") { ?>class="link-click" data-href="core/system/dir.php?dir=<?php echo urlencode(loadFileDir($file, false, $dirb));?>" <?php } ?>><?php echo mime_content_type($main_path . '/' . $file); ?></td>
206206
<td>
207207
<?php echo load_file_size($main_path . '/' . $file); ?>
208208
</td>
209209
<td>
210210
<?php
211211
if (strpos(mime_content_type($main_path . '/' . $file), "text/") !== false or strpos(mime_content_type($main_path . '/' . $file), "application/x-empty") !== false) { ?>
212-
<button class="link-click mdl-button mdl-js-button mdl-js-ripple-effect" data-href="core/system/editor.php?dir=<?php echo loadFileDir($file, false, $dirb);?>">
212+
<button class="link-click mdl-button mdl-js-button mdl-js-ripple-effect" data-href="core/system/editor.php?dir=<?php echo urlencode(loadFileDir($file, false, $dirb));?>">
213213
<span class=" material-icons">
214214
edit
215215
</span>
216216
<div class="rippleJS"></div>
217217
</button>
218218
<?php
219-
} elseif (strpos(mime_content_type($main_path . '/' . $file), "video/") !== false) { ?>
220-
<button class="link-click mdl-button mdl-js-button mdl-js-ripple-effect" data-href="core/system/play.php?dir=<?php echo loadFileDir($file, false, $dirb);?>">
219+
} elseif (strpos(mime_content_type($main_path . '/' . $file), "video/") !== false || strpos(mime_content_type($main_path . '/' . $file), "audio/") !== false) { ?>
220+
<button class="link-click mdl-button mdl-js-button mdl-js-ripple-effect" data-href="core/system/play.php?dir=<?php echo urlencode(loadFileDir($file, false, $dirb));?>">
221221
<span class="material-icons">
222222
play_arrow
223223
</span>
224224
<div class="rippleJS"></div>
225225
</button>
226226
<?php } elseif (strpos(mime_content_type($main_path . '/' . $file), "image/") !== false) { ?>
227-
<button class="link-click mdl-button mdl-js-button mdl-js-ripple-effect" data-href="core/system/preview.php?dir=<?php echo loadFileDir($file, false, $dirb);?>">
227+
<button class="link-click mdl-button mdl-js-button mdl-js-ripple-effect" data-href="core/system/preview.php?dir=<?php echo urlencode(loadFileDir($file, false, $dirb));?>">
228228
<span class="material-icons">
229229
perm_media
230230
</span>

core/system/kernel/sys.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
header("Location: ?");
3939
exit();
4040
}
41-
define("VERSION_BKF", "v0.4");
42-
define("VERSION", "0.4");
41+
define("VERSION_BKF", "v0.4.1");
42+
define("VERSION", "0.4.1");
4343
if (UPDATE_CONF == true) {
4444
$_get_update = file_get_contents(UPDATE_SERVER);
4545
if ($_get_update == null) {

core/system/play.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
if ($_GET['dir'] == "/" or $_GET['dir'] == null) {
1414
$main_path = ROOT_DIR . "/";
1515
} else {
16-
$main_path = ROOT_DIR . "/" . $_GET['dir'];
16+
$main_path = ROOT_DIR . "/" . urldecode($_GET['dir']);
1717
}
1818
$dirb = urldecode($_GET['dir']);
1919
if ($dirb == "/") {
@@ -47,12 +47,10 @@ function loadFileDir($file, $ROOT, $dirb)
4747
$res = $rd . $ra . urldecode($file);
4848
return $res;
4949
}
50-
$all__files = scandir(dirname($main_path, 1));
51-
$all__files = array_diff(scandir(dirname($main_path, 1)), array('.', '..'));
52-
if (strpos(mime_content_type($main_path), "video/") === false) {
53-
echo "Error: This file is not an video! >_< - đây khum phải là file video :<";
54-
exit();
55-
}
50+
// if (strpos(mime_content_type($main_path), "video") !== true or strpos(mime_content_type($main_path), "audio") == false) {
51+
// echo "Error: This file is not an video/audio file! >_< - đây khum phải là file video hoặc audio :<";
52+
// exit();
53+
// }
5654
?>
5755
<div class="dir-badge mdl-card mdl-shadow--2dp">
5856
<?php
@@ -92,12 +90,18 @@ function loadFileDir($file, $ROOT, $dirb)
9290
}
9391
} ?>
9492
</div>
93+
<h4 style="margin:20px"><?php echo basename($main_path); ?><p style="color:gray !important;font-weight:bold;margin:7px;float:right;font-size:12px">FILE SIZE: <?php echo load_file_size($main_path); ?></p>
94+
</h4>
9595
<?php
96-
if (strpos(mime_content_type($main_path), "video/") === false) {
97-
echo "Error: This file is not an video! >_< - đây khum phải là file video :<";
98-
} else { ?>
96+
97+
if (strpos(mime_content_type($main_path), "video") !== false) {
98+
?>
9999
<video style="width:100%;border:none" controls autoplay>
100100
<source type="video/mp4" src="<?php echo "/" . $dirb; ?>">
101101
</video>
102-
<?php } ?>
102+
<?php } elseif(strpos(mime_content_type($main_path), "audio") !== false) { ?>
103+
<audio src="<?php echo "/" . $dirb; ?>" controls autoplay></audio>
104+
<?php } else { ?>
105+
this is not an audio/video file :<< đây hum phải là file VIDEO or AUDIO :v
106+
<?php } ?>
103107
<script src="js/page.js"></script>

0 commit comments

Comments
 (0)