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

Commit

Permalink
update v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
michioxd committed Jul 27, 2021
1 parent 3ee344f commit 7263223
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
16 changes: 8 additions & 8 deletions core/system/dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function loadFileDir($file, $ROOT, $dirb)
</label> -->
<div class="upload__inner">
<div class="ui_drop">
<form action="core/system/kernel/sys.php?upload__dir=<?php echo loadFileDir(null, false, $dirb);?>" class="dropzone" id="DropzoneFrom">
<form action="core/system/kernel/sys.php?upload__dir=<?php echo loadFileDir(null, true, $dirb);?>" class="dropzone" id="DropzoneFrom">
</form>
</div>
</div>
Expand Down Expand Up @@ -200,31 +200,31 @@ function loadFileDir($file, $ROOT, $dirb)
$xnum = 0;
foreach ($all__files as $file) { ?>
<tr>
<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>
<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>
<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>
<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>
<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>
<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>
<td>
<?php echo load_file_size($main_path . '/' . $file); ?>
</td>
<td>
<?php
if (strpos(mime_content_type($main_path . '/' . $file), "text/") !== false or strpos(mime_content_type($main_path . '/' . $file), "application/x-empty") !== false) { ?>
<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);?>">
<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));?>">
<span class=" material-icons">
edit
</span>
<div class="rippleJS"></div>
</button>
<?php
} elseif (strpos(mime_content_type($main_path . '/' . $file), "video/") !== false) { ?>
<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);?>">
} elseif (strpos(mime_content_type($main_path . '/' . $file), "video/") !== false || strpos(mime_content_type($main_path . '/' . $file), "audio/") !== false) { ?>
<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));?>">
<span class="material-icons">
play_arrow
</span>
<div class="rippleJS"></div>
</button>
<?php } elseif (strpos(mime_content_type($main_path . '/' . $file), "image/") !== false) { ?>
<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);?>">
<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));?>">
<span class="material-icons">
perm_media
</span>
Expand Down
4 changes: 2 additions & 2 deletions core/system/kernel/sys.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
header("Location: ?");
exit();
}
define("VERSION_BKF", "v0.4");
define("VERSION", "0.4");
define("VERSION_BKF", "v0.4.1");
define("VERSION", "0.4.1");
if (UPDATE_CONF == true) {
$_get_update = file_get_contents(UPDATE_SERVER);
if ($_get_update == null) {
Expand Down
26 changes: 15 additions & 11 deletions core/system/play.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if ($_GET['dir'] == "/" or $_GET['dir'] == null) {
$main_path = ROOT_DIR . "/";
} else {
$main_path = ROOT_DIR . "/" . $_GET['dir'];
$main_path = ROOT_DIR . "/" . urldecode($_GET['dir']);
}
$dirb = urldecode($_GET['dir']);
if ($dirb == "/") {
Expand Down Expand Up @@ -47,12 +47,10 @@ function loadFileDir($file, $ROOT, $dirb)
$res = $rd . $ra . urldecode($file);
return $res;
}
$all__files = scandir(dirname($main_path, 1));
$all__files = array_diff(scandir(dirname($main_path, 1)), array('.', '..'));
if (strpos(mime_content_type($main_path), "video/") === false) {
echo "Error: This file is not an video! >_< - đây khum phải là file video :<";
exit();
}
// if (strpos(mime_content_type($main_path), "video") !== true or strpos(mime_content_type($main_path), "audio") == false) {
// echo "Error: This file is not an video/audio file! >_< - đây khum phải là file video hoặc audio :<";
// exit();
// }
?>
<div class="dir-badge mdl-card mdl-shadow--2dp">
<?php
Expand Down Expand Up @@ -92,12 +90,18 @@ function loadFileDir($file, $ROOT, $dirb)
}
} ?>
</div>
<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>
</h4>
<?php
if (strpos(mime_content_type($main_path), "video/") === false) {
echo "Error: This file is not an video! >_< - đây khum phải là file video :<";
} else { ?>

if (strpos(mime_content_type($main_path), "video") !== false) {
?>
<video style="width:100%;border:none" controls autoplay>
<source type="video/mp4" src="<?php echo "/" . $dirb; ?>">
</video>
<?php } ?>
<?php } elseif(strpos(mime_content_type($main_path), "audio") !== false) { ?>
<audio src="<?php echo "/" . $dirb; ?>" controls autoplay></audio>
<?php } else { ?>
this is not an audio/video file :<< đây hum phải là file VIDEO or AUDIO :v
<?php } ?>
<script src="js/page.js"></script>

0 comments on commit 7263223

Please sign in to comment.