Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimer committed Oct 10, 2020
1 parent d6545d7 commit 05c2e29
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 21 deletions.
32 changes: 23 additions & 9 deletions mid3TagMp3Music.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@
"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">
<title>Musik-mp3-Dateien in diesem Verzeichnis (inkl. Unterverzeichnisse)</title>
<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>
<body onload="ladenaus();">
<a name="top"></a>
<noscript style="text-align:center;"><h1>Please activate JavaScript</h1></noscript>
<?php
$relpfad = "./"; //"./test/";
$relpfad = ""; //"./"; //"./test/";
$viewonly = null;
$execute = null;

Expand Down Expand Up @@ -42,13 +47,13 @@

?>

<form method="post" action="<?php echo $_SERVER["PHP_SELF"] ?>" style="margin-left:11%;">
<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 ?>" required />
(rel)path: <input type="text" name="relpfad" style="width:777px;" value="<?php echo $relpfad ?>" placeholder="./music/" required />
</p>
<p>
<p style="display:none">
viewonly: <input type="checkbox" name="viewonly" checked />
</p>
<p>
Expand All @@ -71,7 +76,7 @@
track: </td><td><input type="text" name="track" style="width:767px;" value="<?php echo $track ?>" />
</td></tr>-->
<tr><td>
genre: </td><td><input type="text" name="genre" style="width:767px;" value="<?php echo $genre ?>" />
<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 ?>" />
Expand All @@ -82,6 +87,11 @@
<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
Expand All @@ -96,12 +106,16 @@
$batch = scan_dir($relpfad, $fileTyp, TRUE, FALSE, TRUE, $onlyDir, $dateien);

if($batch == false) {
echo "Verzeichnis existiert nicht <br />\n$relpfad";
//echo $relpfad;
echo '<dir style="margin-left:8%; font-weight:bold;">';
echo '<p style="color:red;">No mp3 files or <u>&nbsp;folder&nbsp;</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>';
}
?>

Expand Down
51 changes: 39 additions & 12 deletions mid3TagMp3Transfer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Copy &amp; Edit of ID3 tags</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Copy of ID3 tags</title>
<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>

<?php
Expand All @@ -12,6 +15,8 @@
// (abc01.mp3 ==> dummy:X01-00.mp3 ==> abc00.mp3)
$quelle = "";
$ziel = "";
$noquelle = "";
$noziel = "";
$viewonly = "";
$apicture = "";
$Xpicture = "";
Expand All @@ -24,6 +29,7 @@
$tags = "";
$para = "";
$paras = "";
$pflag = "";
$array = null;
$shellBefehl = "";

Expand All @@ -37,7 +43,7 @@
$Xpicture = "checked";
if(isset($_POST["execute"]))
$execute = $_POST["execute"];
if(isset($_POST["kopie"]))
if(isset($_POST["kopie"]) && $quelle != $ziel)
$Xkopie = $_POST["kopie"];
if(isset($_POST["befehl"]))
$befehl = $_POST["befehl"];
Expand All @@ -50,13 +56,16 @@
$shellBefehl = "mid3v2 -l '$quelle'";
exec($shellBefehl, $var);
$tags = $var;
// print_r($var);
//print_r($var);
//var_dump($var);
if(!is_file($quelle) || !file_exists($quelle)) $noquelle = 'true';
$shellBefehl = "";
$var = "";

$shellBefehl = "mid3v2 -l '$ziel'";
exec($shellBefehl, $var);
// print_r($var);
if(!is_file($ziel) || !file_exists($ziel)) $noziel = 'true';
$shellBefehl = "";
$var = "";

Expand All @@ -66,6 +75,7 @@

foreach($tags as $tag) {
if(strstr($tag, "=")) {
if(strstr($tag, "APIC=")) $pflag = "P";
if(strstr($tag, "APIC=") || strstr($tag, "TLEN=") || strstr($tag, "unrepresentable data"))
continue;

Expand Down Expand Up @@ -116,8 +126,8 @@
$paras = trim($paras);
$paras = str_replace(" '' ", " ' ' ", $paras); // TPE1=' ' anstatt =''

if($paras != "" || $paras != 0)
$shellBefehl = "mid3v2 $paras '$ziel'";
//if($paras != "" || $paras != 0)
$shellBefehl = "mid3v2 $paras '$ziel'";
$befehl = $shellBefehl;
}
//print ("\n<br>mid3cp '$quelle' '$ziel'");
Expand All @@ -131,34 +141,35 @@
exec("mid3cp '$quelle' '$ziel'");
}
exec($befehl, $var);
//print_r($var);
$shellBefehl = "";
$var = "";
}
}
?>

<body>
<form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" style="margin-left:11%;">
<noscript style="text-align:center;"><h1>Please activate JavaScript</h1></noscript>
<form name="id3" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" style="margin-left:11%;">
<fieldset style="width:900px;">
<legend><span style="font-weight:700;">Files</span></legend>
<p>
source: <input type="text" name="quelle" style="width:777px;" value="<?php echo $quelle; ?>" required />
source: <input type="text" name="quelle" style="width:777px;" value="<?php echo $quelle; ?>" placeholder="./artist/album/title.mp3" required />
</p>
<p>
target: &nbsp;<input type="text" name="ziel" style="width:777px;" value="<?php echo $ziel; ?>" required />
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 />
</p>
<p>
<p style="display:none">
viewonly: <input type="checkbox" name="viewonly" checked />
</p>
<p>
add Pic.: &nbsp; <input type="checkbox" name="apicture" <?php echo $Xpicture; ?> />
<?php if($pflag == "P") echo '&nbsp; <img src="pic.jpg" width="22" height="22" alt="pic present!" title="dummy pic"> Picture present!'; ?>
</p>
<p>
copy first: <input type="checkbox" name="kopie" checked /> &nbsp; [edit after full copy (esp. w/ APIC, LINK ...)]
</p>
<p>
executeit: &nbsp;<input type="checkbox" name="execute" /> &nbsp; [edit textarea beforehand]
executeit: &nbsp;<input type="checkbox" name="execute" /> &nbsp; [edit textarea beforehand] (list of <a href="./mid3TagMp3Frames.php" target="frame">tags/frames</a>)
</p>
</fieldset>

Expand All @@ -169,11 +180,27 @@
</p>
</form>
<?php
if($noquelle || $noziel) {
echo '<dir style="margin-left:8%; font-weight:bold;">';
if($noquelle)
echo '<p style="color:red;">No source file found!</p>';
if($noziel)
echo '<p style="color:red;">No target file found!</p>';
echo '</dir>';
exit();
}

if(isset($_POST["submit"])) {
echo('<dir style="margin-left:11%;">');
echo('<dir style="margin-left:8%;">');
if($Xkopie) { echo("\n<br>'copy first' was $Xkopie <br>\n"); }
else { echo("\n<br>'copy first' was off <br>\n"); }
echo('</dir>');
echo("<br>\n");
echo('<script type="text/javascript">');
echo('if(document.id3.quelle.value == document.id3.ziel.value)');
echo(' clearCheck("name", "kopie", 0);');
echo('</script>');
echo("<br>\n");
}
?>
</body>
Expand Down

0 comments on commit 05c2e29

Please sign in to comment.