-
Notifications
You must be signed in to change notification settings - Fork 0
/
mid3TagMp3Music.php
126 lines (114 loc) · 4.15 KB
/
mid3TagMp3Music.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>MP3 music files in this directory (incl. subfolders)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:url" content="https://smolka.lima-city.de/">
<meta name="author" content="Jürgen Smolka">
<script type="text/javascript" src="dhtml.js"></script>
</head>
<body onload="ladenaus();">
<a name="top"></a>
<noscript style="text-align:center;"><h1>Please activate JavaScript</h1></noscript>
<?php
$relpfad = ""; //"./"; //"./test/";
$viewonly = null;
$execute = null;
$artist = "";
$album = "";
$titel = "";
$track = "";
$genre = "";
$comment = "";
$fileTyp = array("mp3");
$dateien = array();
$onlyDir = "";
$batch = "";
include_once("mid3TagMp3.inc.php");
if (isset($_POST["relpfad"]))
$relpfad = $_POST["relpfad"];
if(substr($relpfad, -1, 1) != "/" && strlen($relpfad) > 1)
$relpfad = $relpfad . "/";
if(!empty($_POST["artist"]))
$artist = $_POST["artist"];
if(!empty($_POST["album"]))
$album = $_POST["album"];
if(!empty($_POST["titel"]))
$titel = $_POST["titel"];
if(!empty(@$_POST["track"]) || @$_POST["track"] == 0)
$track = @$_POST["track"];
if(!empty(@$_POST["genre"]) || @$_POST["genre"] == 0)
$genre = @$_POST["genre"];
?>
<form name="id3" method="post" action="<?php echo $_SERVER["PHP_SELF"] ?>" style="margin-left:11%;" onsubmit="ladenein();">
<fieldset style="width:900px;">
<legend><span style="font-weight:700;">Songs</span> (control)</legend>
<p>
(rel)path: <input type="text" name="relpfad" style="width:777px;" value="<?php echo $relpfad ?>" placeholder="./music/" required />
</p>
<p style="display:none">
viewonly: <input type="checkbox" name="viewonly" checked />
</p>
<p>
executeit: <input type="checkbox" name="execute" />
</p>
</fieldset>
<fieldset style="width:900px;">
<legend style="font-weight:700; line-height:133%;">Manual adaption</legend>
<table>
<tr><td>
artist: </td><td><input type="text" name="artist" style="width:767px;" value="<?php echo $artist ?>" />
</td></tr>
<tr><td>
album: </td><td><input type="text" name="album" style="width:767px;" value="<?php echo $album ?>" />
</td></tr>
<tr><td>
title: </td><td><input type="text" name="titel" style="width:767px;" value="<?php echo $titel ?>" />
</td></tr>
<!-- <tr><td>
track: </td><td><input type="text" name="track" style="width:767px;" value="<?php echo $track ?>" />
</td></tr>-->
<tr><td>
<a href="./mid3TagMp3Genre.php" target="genre">genre</a>: </td><td><input type="text" name="genre" style="width:767px;" value="<?php echo $genre ?>" />
</td></tr>
<!-- <tr><td>
comment: </td><td><input type="text" name="comment" style="width:767px;" value="<?php echo $comment ?>" />
</td></tr>-->
</table>
</fieldset>
<p>
<input type="submit" name="submit" value="submit" style="width:930px;" />
</p>
</form>
<p style="margin-left:11%;"><img name="load" src="loading.gif" width="44" height="44" alt="loading"></p>
<script type="text/javascript">
function ladenaus() { document.load.style.display = "none"; }
function ladenein() { document.load.style.display = "block"; }
</script>
<?php
// App-Steuerung
if (isset($_POST["submit"])) {
if(isset($_POST["relpfad"]))
$relpfad = $_POST["relpfad"];
if(isset($_POST["viewonly"]))
$viewonly = $_POST["viewonly"];
if(isset($_POST["execute"]))
$execute = $_POST["execute"];
if(substr($relpfad, -1, 1) != "/" && strlen($relpfad) > 1)
$relpfad = $relpfad . "/";
$batch = scan_dir($relpfad, $fileTyp, TRUE, FALSE, TRUE, $onlyDir, $dateien);
if($batch == false) {
echo '<dir style="margin-left:8%; font-weight:bold;">';
echo '<p style="color:red;">No mp3 files or <u> folder </u> not existent!</p>';
echo "\n <p>$relpfad</p>";
echo '</dir>';
exit();
}
if($viewonly)
$ausgabe = buildSites3($batch);
echo '<dir style="text-align:center;"><p><a href="#top">top</a><br><br></p></dir>';
}
?>
</body>
</html>