Skip to content

Commit 05c2e29

Browse files
authored
Add files via upload
1 parent d6545d7 commit 05c2e29

2 files changed

Lines changed: 62 additions & 21 deletions

File tree

mid3TagMp3Music.php

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
"http://www.w3.org/TR/html4/loose.dtd">
33
<html>
44
<head>
5+
<title>MP3 music files in this directory (incl. subfolders)</title>
56
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6-
<title>Musik-mp3-Dateien in diesem Verzeichnis (inkl. Unterverzeichnisse)</title>
7+
<meta property="og:url" content="https://smolka.lima-city.de/">
8+
<meta name="author" content="Jürgen Smolka">
9+
<script type="text/javascript" src="dhtml.js"></script>
710
</head>
811

9-
<body>
12+
<body onload="ladenaus();">
13+
<a name="top"></a>
14+
<noscript style="text-align:center;"><h1>Please activate JavaScript</h1></noscript>
1015
<?php
11-
$relpfad = "./"; //"./test/";
16+
$relpfad = ""; //"./"; //"./test/";
1217
$viewonly = null;
1318
$execute = null;
1419

@@ -42,13 +47,13 @@
4247

4348
?>
4449

45-
<form method="post" action="<?php echo $_SERVER["PHP_SELF"] ?>" style="margin-left:11%;">
50+
<form name="id3" method="post" action="<?php echo $_SERVER["PHP_SELF"] ?>" style="margin-left:11%;" onsubmit="ladenein();">
4651
<fieldset style="width:900px;">
4752
<legend><span style="font-weight:700;">Songs</span> (control)</legend>
4853
<p>
49-
(rel)path: <input type="text" name="relpfad" style="width:777px;" value="<?php echo $relpfad ?>" required />
54+
(rel)path: <input type="text" name="relpfad" style="width:777px;" value="<?php echo $relpfad ?>" placeholder="./music/" required />
5055
</p>
51-
<p>
56+
<p style="display:none">
5257
viewonly: <input type="checkbox" name="viewonly" checked />
5358
</p>
5459
<p>
@@ -71,7 +76,7 @@
7176
track: </td><td><input type="text" name="track" style="width:767px;" value="<?php echo $track ?>" />
7277
</td></tr>-->
7378
<tr><td>
74-
genre: </td><td><input type="text" name="genre" style="width:767px;" value="<?php echo $genre ?>" />
79+
<a href="./mid3TagMp3Genre.php" target="genre">genre</a>: </td><td><input type="text" name="genre" style="width:767px;" value="<?php echo $genre ?>" />
7580
</td></tr>
7681
<!-- <tr><td>
7782
comment: </td><td><input type="text" name="comment" style="width:767px;" value="<?php echo $comment ?>" />
@@ -82,6 +87,11 @@
8287
<input type="submit" name="submit" value="submit" style="width:930px;" />
8388
</p>
8489
</form>
90+
<p style="margin-left:11%;"><img name="load" src="loading.gif" width="44" height="44" alt="loading"></p>
91+
<script type="text/javascript">
92+
function ladenaus() { document.load.style.display = "none"; }
93+
function ladenein() { document.load.style.display = "block"; }
94+
</script>
8595

8696
<?php
8797
// App-Steuerung
@@ -96,12 +106,16 @@
96106
$batch = scan_dir($relpfad, $fileTyp, TRUE, FALSE, TRUE, $onlyDir, $dateien);
97107

98108
if($batch == false) {
99-
echo "Verzeichnis existiert nicht <br />\n$relpfad";
100-
//echo $relpfad;
109+
echo '<dir style="margin-left:8%; font-weight:bold;">';
110+
echo '<p style="color:red;">No mp3 files or <u>&nbsp;folder&nbsp;</u> not existent!</p>';
111+
echo "\n <p>$relpfad</p>";
112+
echo '</dir>';
101113
exit();
102114
}
115+
103116
if($viewonly)
104117
$ausgabe = buildSites3($batch);
118+
echo '<dir style="text-align:center;"><p><a href="#top">top</a><br><br></p></dir>';
105119
}
106120
?>
107121

mid3TagMp3Transfer.php

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
"http://www.w3.org/TR/html4/loose.dtd">
33
<html>
44
<head>
5+
<title>Copy &amp; Edit of ID3 tags</title>
56
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6-
<title>Copy of ID3 tags</title>
7+
<meta property="og:url" content="https://smolka.lima-city.de/">
8+
<meta name="author" content="Jürgen Smolka">
9+
<script type="text/javascript" src="dhtml.js"></script>
710
</head>
811

912
<?php
@@ -12,6 +15,8 @@
1215
// (abc01.mp3 ==> dummy:X01-00.mp3 ==> abc00.mp3)
1316
$quelle = "";
1417
$ziel = "";
18+
$noquelle = "";
19+
$noziel = "";
1520
$viewonly = "";
1621
$apicture = "";
1722
$Xpicture = "";
@@ -24,6 +29,7 @@
2429
$tags = "";
2530
$para = "";
2631
$paras = "";
32+
$pflag = "";
2733
$array = null;
2834
$shellBefehl = "";
2935

@@ -37,7 +43,7 @@
3743
$Xpicture = "checked";
3844
if(isset($_POST["execute"]))
3945
$execute = $_POST["execute"];
40-
if(isset($_POST["kopie"]))
46+
if(isset($_POST["kopie"]) && $quelle != $ziel)
4147
$Xkopie = $_POST["kopie"];
4248
if(isset($_POST["befehl"]))
4349
$befehl = $_POST["befehl"];
@@ -50,13 +56,16 @@
5056
$shellBefehl = "mid3v2 -l '$quelle'";
5157
exec($shellBefehl, $var);
5258
$tags = $var;
53-
// print_r($var);
59+
//print_r($var);
60+
//var_dump($var);
61+
if(!is_file($quelle) || !file_exists($quelle)) $noquelle = 'true';
5462
$shellBefehl = "";
5563
$var = "";
5664

5765
$shellBefehl = "mid3v2 -l '$ziel'";
5866
exec($shellBefehl, $var);
5967
// print_r($var);
68+
if(!is_file($ziel) || !file_exists($ziel)) $noziel = 'true';
6069
$shellBefehl = "";
6170
$var = "";
6271

@@ -66,6 +75,7 @@
6675

6776
foreach($tags as $tag) {
6877
if(strstr($tag, "=")) {
78+
if(strstr($tag, "APIC=")) $pflag = "P";
6979
if(strstr($tag, "APIC=") || strstr($tag, "TLEN=") || strstr($tag, "unrepresentable data"))
7080
continue;
7181

@@ -116,8 +126,8 @@
116126
$paras = trim($paras);
117127
$paras = str_replace(" '' ", " ' ' ", $paras); // TPE1=' ' anstatt =''
118128

119-
if($paras != "" || $paras != 0)
120-
$shellBefehl = "mid3v2 $paras '$ziel'";
129+
//if($paras != "" || $paras != 0)
130+
$shellBefehl = "mid3v2 $paras '$ziel'";
121131
$befehl = $shellBefehl;
122132
}
123133
//print ("\n<br>mid3cp '$quelle' '$ziel'");
@@ -131,34 +141,35 @@
131141
exec("mid3cp '$quelle' '$ziel'");
132142
}
133143
exec($befehl, $var);
134-
//print_r($var);
135144
$shellBefehl = "";
136145
$var = "";
137146
}
138147
}
139148
?>
140149

141150
<body>
142-
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" style="margin-left:11%;">
151+
<noscript style="text-align:center;"><h1>Please activate JavaScript</h1></noscript>
152+
<form name="id3" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" style="margin-left:11%;">
143153
<fieldset style="width:900px;">
144154
<legend><span style="font-weight:700;">Files</span></legend>
145155
<p>
146-
source: <input type="text" name="quelle" style="width:777px;" value="<?php echo $quelle; ?>" required />
156+
source: <input type="text" name="quelle" style="width:777px;" value="<?php echo $quelle; ?>" placeholder="./artist/album/title.mp3" required />
147157
</p>
148158
<p>
149-
target: &nbsp;<input type="text" name="ziel" style="width:777px;" value="<?php echo $ziel; ?>" required />
159+
target: &nbsp;<input type="text" name="ziel" style="width:777px;" value="<?php echo $ziel; ?>" placeholder="./artist/album/title.mp3 &nbsp;(x01-00.mp3 may be used here)" required />
150160
</p>
151-
<p>
161+
<p style="display:none">
152162
viewonly: <input type="checkbox" name="viewonly" checked />
153163
</p>
154164
<p>
155165
add Pic.: &nbsp; <input type="checkbox" name="apicture" <?php echo $Xpicture; ?> />
166+
<?php if($pflag == "P") echo '&nbsp; <img src="pic.jpg" width="22" height="22" alt="pic present!" title="dummy pic"> Picture present!'; ?>
156167
</p>
157168
<p>
158169
copy first: <input type="checkbox" name="kopie" checked /> &nbsp; [edit after full copy (esp. w/ APIC, LINK ...)]
159170
</p>
160171
<p>
161-
executeit: &nbsp;<input type="checkbox" name="execute" /> &nbsp; [edit textarea beforehand]
172+
executeit: &nbsp;<input type="checkbox" name="execute" /> &nbsp; [edit textarea beforehand] (list of <a href="./mid3TagMp3Frames.php" target="frame">tags/frames</a>)
162173
</p>
163174
</fieldset>
164175

@@ -169,11 +180,27 @@
169180
</p>
170181
</form>
171182
<?php
183+
if($noquelle || $noziel) {
184+
echo '<dir style="margin-left:8%; font-weight:bold;">';
185+
if($noquelle)
186+
echo '<p style="color:red;">No source file found!</p>';
187+
if($noziel)
188+
echo '<p style="color:red;">No target file found!</p>';
189+
echo '</dir>';
190+
exit();
191+
}
192+
172193
if(isset($_POST["submit"])) {
173-
echo('<dir style="margin-left:11%;">');
194+
echo('<dir style="margin-left:8%;">');
174195
if($Xkopie) { echo("\n<br>'copy first' was $Xkopie <br>\n"); }
175196
else { echo("\n<br>'copy first' was off <br>\n"); }
176197
echo('</dir>');
198+
echo("<br>\n");
199+
echo('<script type="text/javascript">');
200+
echo('if(document.id3.quelle.value == document.id3.ziel.value)');
201+
echo(' clearCheck("name", "kopie", 0);');
202+
echo('</script>');
203+
echo("<br>\n");
177204
}
178205
?>
179206
</body>

0 commit comments

Comments
 (0)