Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
<?php
include("cfg.php");
$ordner = ORDNER;
$tabelle = TABELLE;
$handle = opendir($ordner);
if(!isset($_GET['file'])){ // ---------- Alles was hiernach ist, erscheint nicht mehr, nachdem man auf den Link geclickt hat.
?>
<h2>Downloads</h2>
<center>
<p>Zum Downloaden auf den Songnamen klicken. Neues Fenster öffnet sich.</p>
<br />
</center>
<table style="border:0px dotted #000000;" align="center" width="100%">
<tr>
<th>Titel</th>
<th>Release</th>
<th></th>
<th>Tracklist</th>
</tr>
<?php
while(($file = readdir($handle)) !== FALSE){
if($file != '.' && $file !='..'){
$sql = mysql_query("SELECT * FROM `".$tabelle."` WHERE `titel`='".mysql_real_escape_string($file)."'");
if(mysql_num_rows($sql)<1){
$file_temp = preg_replace("/(\')+/", "\'",$file);
$entry = mysql_query("INSERT INTO `".$tabelle."` ( `id` , `titel` , `datum` , `clicks`, `zeit`, `filesize`)VALUES (NULL , '".$file_temp."', '".date ("Y.m.d", filemtime($ordner."/".$file))."' , '0', '".date("H:i", filemtime($ordner."/".$file))."','".filesize($ordner."/".$file)."') ") or die("Momentan besteht ein Fehler in der Datenbank, bitte haben sie einen Moment Geduld, es wird daran gearbeitet.");
}
}
}
$sql2 = mysql_query("SELECT * FROM `".$tabelle."` ORDER BY `datum` DESC ,`zeit` DESC");
while($row = mysql_fetch_assoc($sql2) ){
$an = 0;
$file = $row['titel'];
$file = preg_replace("/(\\\'){1}+/","'",$file);
if(!file_exists($ordner."/".$file)){
;
$del = mysql_query("DELETE FROM `".$tabelle."` WHERE `titel`='".mysql_real_escape_string($file)."'");
$an = 1;
}
if($an!=1){
$yahr = substr($row['datum'],0,4);
$monat = substr($row['datum'],5,2);
$tag = substr($row['datum'],8,2);
$titel = $row['titel'];
$titel = preg_replace("/(\ß)+/","%DF",$titel);
?>
<tr align="center">
<td align="left"><a href="content.php?file=<?php echo $titel; ?>" title="Zum Downloaden klicken" target="_blank"><?php echo substr($row['titel'],0,strlen($row['titel'])-4); ?></a></td>
<td><?php
if( $tag == "00" && $monat == "00" && $yahr == "0000"){
echo "unbekannt";
}elseif( $tag == "00" && $monat == "00" && $yahr != "0000"){
echo $yahr;
} else {
echo $tag.".".$monat.".".$yahr; }?></td>
<td><?php echo $row['cmnt']; ?></td>
<script type="text/javascript">
function oeffnefenster (url) {
fenster = window.open(url, "fenster1", "width=800,height=600,status=yes,scrollbars=yes,resizable=yes");
fenster.focus();
}
</script>
<td><?php if(!empty($row['tracklist'])) { ?>
<a href="./tracklist/<?php echo $row['tracklist']; ?>.html" alt="Tracklist im Pop-Up öffnen" title="Tracklist im Pop-Up öffnen" onclick="oeffnefenster('./tracklist/<?php echo $row['tracklist']; ?>.html'); return false"><img src="../img/link_icon.gif" border="0" /></a>
<?php } ?></td>
</tr>
<?php
}
}
?>
</table>
<?php
} else {
$file = substr($_SERVER['QUERY_STRING'],5,strlen($_SERVER['QUERY_STRING'])-4);
$sql = mysql_query("SELECT * FROM `".$tabelle."` WHERE `titel`='".mysql_real_escape_string(urldecode($file))."'");
$row = mysql_fetch_assoc($sql);
/*$file = preg_replace("/(\%20)+/"," ",$file);
$file = preg_replace("/(\%DF)+/","ß",$file);
$file = preg_replace("/(\%FC)+/","ü",$file);
$file = preg_replace("/(\%C4)+/","Ä",$file);
$file = preg_replace("/(\%D6)+/","Ö",$file);
$file = preg_replace("/(\%DC)+/","Ü",$file);
$file = preg_replace("/(\%E4)+/","ä",$file);
$file = preg_replace("/(\%F6)+/","ö",$file);*/
$filesize = $row['filesize'];
$filesize /= 1000000;
$filesize = explode(".",$filesize);
$filefront = $filesize[0];
$fileback = substr($filesize[1],0,2);
?>
<?php include("../head.php"); ?>
<script type="text/javascript">
function openURL (url) {
fenster = window.open(url, "Musik", "width=100%,height=400,status=yes,scrollbars=yes,resizable=no,target=_blank");
fenster.focus();
}
</script>
<h1>Download</h1>
<p align="right"><a href="/kontakt.php">Song nicht mehr online? Probleme? Schreib den Support an.</a></p>
<p align="right"><a href="/hilfe.php">Sind die Downloads wirklich kostenlos und legal? Klick hier.</a></p>
<br />
<? include ("../google2.php"); ?>
<br />
<div style="margin-top:10px; text-decoration:none;">
<center>
<h3><a href="<?php echo ORDNER."/".utf8_decode($file); ?>" title="Klick zum Download" onClick="openURL('load.php?file=<?php echo urlencode($file); ?>');"><img src="/img/download.jpg" border"0" alt="Download" title="Download"><br />
<?php echo urldecode($file); ?></a><br />
</h3>
<?php echo $row['cmnt']==''?'':'<b>Kommentar:</b> '.$row['cmnt']."<br />"; ?><?php echo "Dateigröße: ".$filefront.".".$fileback." MB";?>
</center>
<?php include("../d.php"); ?>
<?php include("../footer.php"); ?>
</div>
<?php
}
?>
<td align="left">
<a href="content.php?file=<?php echo $titel; ?>" title="Zum Downloaden klicken" target="_blank">
<?php if (substr($row['titel'], -4) == ".rar"): ?>
<img src="pfadzumicon/rar.png" alt="Rar-Datei">
<? endif ?>
<?php echo substr($row['titel'],0,strlen($row['titel'])-4); ?>
</a>
</td>
<td align="left"><object type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" width="15" height="15">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="mp3=mp3s/<?php echo $file; ?>&width=14&height=14&showslider=0&buttonwidth=14&volumewidth=0&volumeheight=0&bgcolor1=6DBFFB&bgcolor2=6DBFFB&slidercolor1=&buttoncolor=000000&buttonovercolor=6DBFFB" />
</object> <a href="content.php?file=<?php echo $titel; ?>" title="Zum Downloaden klicken" target="_blank"> <?php echo substr($row['titel'],0,strlen($row['titel'])-4); ?>
<?php if (substr($row['titel'], -4) == ".rar"): ?>
<img src="../img/rar.gif" alt="RAR-Datei" title="RAR-Datei muss entpackt werden">
<? endif ?>
</a></td>
<?php if(!$var){(substr($row['titel'], -4) == ".rar") echo "<object data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" type="application/x-shockwave-flash" width="15" height="15" align="absmiddle">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="mp3=mp3s/<?php echo $file; ?>&width=14&height=14&showslider=0&buttonwidth=14&volumewidth=0&volumeheight=0&bgcolor1=6DBFFB&bgcolor2=6DBFFB&slidercolor1=&buttoncolor=000000&buttonovercolor=6DBFFB" />
</object>"; ?>
<td align="left"><object data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" type="application/x-shockwave-flash" width="15" height="15" align="absmiddle">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="mp3=mp3s/<?php echo $file; ?>&width=14&height=14&showslider=0&buttonwidth=14&volumewidth=0&volumeheight=0&bgcolor1=6DBFFB&bgcolor2=6DBFFB&slidercolor1=&buttoncolor=000000&buttonovercolor=6DBFFB" />
</object> <a href="content.php?file=<?php echo $titel; ?>" title="Zum Downloaden klicken" target="_blank"> <?php echo substr($row['titel'],0,strlen($row['titel'])-4); ?>
<?php if (substr($row['titel'], -4) == ".rar"): ?>
<img src="../img/rar.gif" alt="RAR-Datei" title="RAR-Datei muss entpackt werden">
<? endif ?>
</a></td>
<?php if (substr($row['titel'], -4) == ".rar"): ?>
<td align="left"><?php if (substr($row['titel'], -4) == ".mp3"): ?>
<object data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" type="application/x-shockwave-flash" width="15" height="15" align="absmiddle">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="mp3=mp3s/<?php echo $file; ?>&width=14&height=14&showslider=0&buttonwidth=14&volumewidth=0&volumeheight=0&bgcolor1=6DBFFB&bgcolor2=6DBFFB&slidercolor1=&buttoncolor=000000&buttonovercolor=6DBFFB" />
</object>
<? endif ?>
<?php if (substr($row['titel'], -4) == ".rar"): ?>
<img src="../img/rar.gif" alt="RAR-Datei" title="RAR-Datei muss entpackt werden">
<? endif ?>
<a href="content.php?file=<?php echo $titel; ?>" title="Zum Downloaden klicken" target="_blank"><?php echo substr($row['titel'],0,strlen($row['titel'])-4); ?></a> <?php if(!empty($row['tracklist'])) { ?>
<a href="./tracklist/<?php echo $row['tracklist']; ?>.html" alt="Tracklist im Pop-Up öffnen" title="Tracklist im Pop-Up öffnen" onclick="oeffnefenster('./tracklist/<?php echo $row['tracklist']; ?>.html'); return false"><img src="../img/tracklist.gif" border="0" /></a>
<?php } ?></td>
<?php if (substr($row['titel'], -4) == ".mp3", ".wma"): ?>
Genau. Entwerder ein OR oder das Kürzel || (2x pipes).Der zeigt den Player an, wenn die Dateiendung ".mp3" ist. Wie kann ich noch eine weitere Angabe machen, ohne dass ich Syntaxfehler bekomme oder es nicht funktioniert?
Ich mag noch ".wma" hinzufügen.
Edit: Hm, egal. Der Player spielt sowieso kein wma ab.
Würde mich trotzdem interessieren, wie man in dieser Zeile mehrere Angaben machen kann.
Statt einem Komma ein "or" dazwischen, schätze ich.
<?php if(!empty($row['youtube'])) { ?> Youtube <?php } ?>
<!-- Bezüglich meiner Frage unten -->
<?php if (substr($row['titel'], -4) == ".mp3" || substr($row['titel'], -4) == ".MP3"): ?>
<object data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" type="application/x-shockwave-flash" width="15" height="15" align="absmiddle">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars" value="mp3=mp3s/<?php echo $file; ?>&width=14&height=14&showslider=0&buttonwidth=14&volumewidth=0&volumeheight=0&bgcolor1=6DBFFB&bgcolor2=6DBFFB&slidercolor1=&buttoncolor=000000&buttonovercolor=6DBFFB" />
</object>
<? endif ?>
<?php
if(! empty($youtube)) {
// Führe alles aus was zwischen { und } steht
}
?>
if(youtube gesetzt) {
Zeige Überschrift und Video
} else {
Zeige alternativen Player
}
<?php if(!empty($row['youtube'])) { ?> Hier kommt Youtube, wenn vorhanden <?php } ?>
//Wenn Youtube aber nicht vorhanden, dann soll der Player hierunter erscheinen. Also if, else.
<?php if (substr($row['titel'], -4) == ".mp3" || substr($row['titel'], -4) == ".MP3"): ?> Hier der Player. Dieser soll angezeigt werden, wenn kein 'youtube' da ist. Also wenn youtube empty ist. Dann erscheint dieser Text hier.
</object>
<? endif ?>
<?php
// Wenn Youtube
if (! empty($row['youtube'])) {
?>
Youtube
<?php
// Wenn kein Youtube
} else {
// Wenn kein Youtube und mp3 oder MP3 Player einbinden
if (substr($row['titel'], -4) == ".mp3" || substr($row['titel'], -4) == ".MP3"){
?>
<object data="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" type="application/x-shockwave-flash" width="15" height="15" align="absmiddle">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3_maxi.swf" /><param name="bgcolor" value="#ffffff" /><param name="FlashVars" value="mp3=mp3s/<?php echo $file; ?>&width=14&height=14&showslider=0&buttonwidth=14&volumewidth=0&volumeheight=0&bgcolor1=6DBFFB&bgcolor2=6DBFFB&slidercolor1=&buttoncolor=000000&buttonovercolor=6DBFFB" />
</object>
<?php
}
}
?>