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

Commit 53f2aa8

Browse files
authored
last changes and last code...
1 parent e989e1b commit 53f2aa8

File tree

3 files changed

+58
-12
lines changed

3 files changed

+58
-12
lines changed

core/system/dir.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
$main_path = ROOT_DIR . "/" . $_GET['dir'];
88
}
99
$dirb = urldecode($_GET['dir']);
10-
if ($dirb == "/") {
11-
$dirb = "";
10+
if ($dirb == "/" or $dirb == null) {
11+
$dirb = null;
1212
}
1313
} else {
1414
$main_path = ROOT_DIR . "/";
@@ -40,6 +40,12 @@ function loadFileDir($file, $ROOT, $dirb)
4040
$res = $rd . $ra . urldecode($file);
4141
return $res;
4242
}
43+
if($dirb == null) {
44+
$loadCurrentDir = null;
45+
} else {
46+
$loadCurrentDir = "?dir=" . $dirb;
47+
}
48+
4349
?>
4450

4551
<script src="js/function.js"></script>
@@ -345,11 +351,11 @@ function load_uploader() {
345351
submitButton.addEventListener("click", function() {
346352
myDropzone.processQueue();
347353
});
348-
this.on("complete", function(file) {
349-
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
350-
cload("core/system/dir.php?dir=<?php echo loadFileDir(null, false, $dirb);?>");
351-
}
352-
});
354+
// this.on("complete", function(file) {
355+
// if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
356+
// cload("core/system/dir.php<?php echo $loadCurrentDir; ?>");
357+
// }
358+
// });
353359
},
354360

355361
});
@@ -389,7 +395,7 @@ function load_uploader() {
389395
data: {
390396
cre_new_dir: file,
391397
cre_new_dir_dir: "<?php echo loadFileDir(null, true, $dirb);?>",
392-
cre_new_dir_last_dir: "<?php echo loadFileDir(null, true, $dirb);?>"
398+
cre_new_dir_last_dir: "<?php echo loadFileDir(null, false, $dirb);?>"
393399
},
394400
beforeSend: function() {
395401
$(".progress").css("display", "block");

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.1");
42-
define("VERSION", "0.4.1");
41+
define("VERSION_BKF", "v0.4.2");
42+
define("VERSION", "0.4.2");
4343
if (UPDATE_CONF == true) {
4444
$_get_update = file_get_contents(UPDATE_SERVER);
4545
if ($_get_update == null) {

core/system/play.php

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function loadFileDir($file, $ROOT, $dirb)
5252
// exit();
5353
// }
5454
?>
55+
<script src="plugins/jstag/jsmediatags.min.js"></script>
5556
<div class="dir-badge mdl-card mdl-shadow--2dp">
5657
<?php
5758
if (isset($dirb) && $dirb !== "/") {
@@ -97,10 +98,49 @@ function loadFileDir($file, $ROOT, $dirb)
9798
if (strpos(mime_content_type($main_path), "video") !== false) {
9899
?>
99100
<video style="width:100%;border:none" controls autoplay>
100-
<source type="video/mp4" src="<?php echo "/" . $dirb; ?>">
101+
<source type="video/mp4" src="<?php echo "http://" . $_SERVER['SERVER_NAME'] . BASEDIR . "/" . $dirb; ?>">
101102
</video>
102103
<?php } elseif(strpos(mime_content_type($main_path), "audio") !== false) { ?>
103-
<audio src="<?php echo "/" . $dirb; ?>" controls autoplay></audio>
104+
<div id="audioInfo" style="display: none;">
105+
<img src="assets/music-album.svg" id="artwork">
106+
<div class="i4">
107+
<p id="title"><span class="material-icons">list_alt</span>Title: </p>
108+
<p id="artist"><span class="material-icons">person</span>Artist: </p>
109+
<p id="album"><span class="material-icons">album</span>Album: </p>
110+
</div>
111+
</div>
112+
<audio src="<?php echo "http://" . $_SERVER['SERVER_NAME'] . BASEDIR . "/" . $dirb; ?>" controls autoplay></audio>
113+
<div id="nonArtwork">Icons made by <a href="https://www.flaticon.com/authors/prettycons" title="prettycons">prettycons</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>
114+
<script>
115+
$('document').ready(function() {
116+
var encode = function(d,a,e,b,c,f) {
117+
c="";
118+
for(a=e=b=0;a<4*d.length/3;f=b>>2*(++a&3)&63,c+=String.fromCharCode(f+71-(f<26?6:f<52?0:f<62?75:f^63?90:87))+(75==(a-1)%76?"\r\n":""))a&3^3&&(b=b<<8^d[e++]);
119+
for(;a++&3;)c+="=";
120+
return c
121+
};
122+
var jsmediatags = window.jsmediatags;
123+
jsmediatags.read("<?php echo "http://" . $_SERVER['SERVER_NAME'] . BASEDIR . "/" . $dirb; ?>", {
124+
onSuccess: function(result) {
125+
var mediaTitle = result.tags.title;
126+
var mediaArtist = result.tags.artist;
127+
var mediaAlbum = result.tags.album;
128+
var mediaArtwork = result.tags.picture;
129+
if(mediaTitle || mediaArtist) {
130+
$('#audioInfo').css("display","flex");
131+
$('#audioInfo #title').append(mediaTitle);
132+
$('#audioInfo #artist').append(mediaArtist);
133+
$('#audioInfo #album').append(mediaAlbum);
134+
if(mediaArtwork !== "undefined") {
135+
const { data, format } = mediaArtwork;
136+
$('#audioInfo #artwork').attr("src", "data:" + format + ";base64," + encode(data));
137+
$('#nonArtwork').css("display", "none");
138+
}
139+
}
140+
}
141+
});
142+
});
143+
</script>
104144
<?php } else { ?>
105145
this is not an audio/video file :<< đây hum phải là file VIDEO or AUDIO :v
106146
<?php } ?>

0 commit comments

Comments
 (0)