3v4l.org

run code in 300+ PHP versions simultaneously
<!-- Administration der Fotos> <Beginn--><div id="content_adminfoto"><? if ($debug) $debugpuffer = $debugpuffer."<fieldset><legend>adminalbum.php</legend>";#UploadErors$uploadmsg = array( 0 => "There is no error, the file uploaded with success", 1 => "The uploaded file exceeds the upload_max_filesize directive in php.ini", 2 => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form", 3 => "The uploaded file was only partially uploaded", 4 => "No file was uploaded", 6 => "Missing a temporary folder");if ($admin){ if (!isset($_GET["action"])) $_GET["action"]=""; if ($debug) $debugpuffer = $debugpuffer."<br>switch GET[action]=".$_GET["action"]; switch ($_GET["action"]): case "upload": // fotos hochladen?> <script>javascript:zeige('popUpFotoAdd')</script><? break; case "add": // fotos nach upload hinzufügen /*Dieser Script lädt unsere Datei in das Verzeichniss upload, und nennt die Datei datei.txt. Wichtig: Der Ordner upload muss die Schreibrechte CHMOD(777) besitzen. Außerdem unterstützt nicht jeder Webspace Dateiuploads. Mit folgenden Befehlen können wir Informationen über die Datei sammeln: $_FILES['datei']['name'] Hiermit erhalten wir den Namen der Datei auf dem PC des besuchers. $_FILES['datei']['tmp_name'] Dieser Variable enthält den Namen der Datei auf dem temporären Verzeichnis auf dem Server. $_FILES['datei']['size'] Diese Variable enthält die Größe der Datei in Bytes. $_FILES['datei']['type'] Diese Variable enthält den MIME-Type der Datei. Gif-Dateien haben den Typ: image/gif Man sollte aber lieber den Befehl GetImageSize() benutzen */ $dateityp = GetImageSize($_FILES['datei']['tmp_name']); if ($debug) $debugpuffer = $debugpuffer."<br>dateityp:".$dateityp[2].", Datei:".$_FILES['datei']['tmp_name']; if (($dateityp[2] == 1) OR ($dateityp[2] == 2) OR ($dateityp[2] == 3)) { if ($_FILES['datei']['size'] < 10240000) //=10MB ; 1024 = 1kb /* Zuerst überpüfen wir, on die Datei auch eine Bild-Datei ist. Dies geht mit GetImageSize. Falls man versucht, eine andere Datei hochzuladen, enthält $dateityp[2] den Wert 0. The 0 index is the width of the image in pixels. The 1 index is the height of the image in pixels. The 2 index is a flag for the image type: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(orden de bytes intel), 8 = TIFF(orden de bytes motorola), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. The 3 index contains ' height="yyy" width="xxx" ' Danach überprüfen wir, ob die Datei nicht größer als 100 kb (102400 Byte) ist. Wenn alles in Ordnung ist, wird die Datei hochgeladen.*/ { $get_album_dir_abfrage = 'SELECT * FROM album WHERE id='.$_GET['album']; # if ($debug) $debugpuffer = $debugpuffer."<br>".$get_album_dir; # $get_album_dir_result = mysql_query($get_album_dir) OR DIE ("Error_up: $get_album_dir <br>".mysql_error()); # $get_album_dir_assoc = mysql_fetch_assoc($get_album_dir_result); $get_album_dir = $database->get_row($get_album_dir_abfrage, $object = true);# if (!move_uploaded_file($_FILES['datei']['tmp_name'], $foto_dir."/".$get_album_dir['albumpfad']."/".$_FILES['datei']['name'])) echo "Fehler beim hochladen des Fotos!"; if ($debug) $debugpuffer = $debugpuffer."<br>Das Bild wurde Erfolgreich nach ".$foto_dir."/".$get_album_dir['albumpfad']."/".$_FILES['datei']['name']." hochgeladen"; $max_bildpos_admin = "SELECT max(bildposition) as maxbildposition FROM sfoto WHERE album_id=".$_GET["album"]; # if ($debug) $debugpuffer = $debugpuffer."<br>".$max_bildpos_admin; # $ergebnis_max_bildpos_admin = mysql_query($max_bildpos_admin) OR DIE ("Error_new: $max_bildpos_admin <br>".mysql_error()); # $row_max_bildpos = mysql_fetch_object($ergebnis_max_bildpos_admin); $max_bildpos_abfrage = $database->get_row($max_bildpos_admin, $object = true); # $insert_picture="INSERT INTO foto (bildname, bildkommentar, bildposition, album_id, enabled) VALUES ('".$_FILES['datei']['name']."','',".$max_bildpos_abfrage->maxbildposition." + 1,'".$_GET['album']."','1')";/* $user_data = array( 'bildname' => $_FILES['datei']['name'], 'bildkommentar' => '', 'bildposition' => $max_bildpos_abfrage->maxbildposition." + 1", 'album_id' => $_GET['album'], 'enabled' => 1 ); $database->insert( 'foto', $user_data );*/ # if ($debug) $debugpuffer = $debugpuffer."<br>".$insert_picture; # $ergebnis_insert_picture = mysql_query($insert_picture) OR DIE ("Error_add: $insert_picture <br>".mysql_error()); } else { echo "<font color=red>Das Bild darf nicht größer als 10 MB sein!</font>"; } } else { echo "<font color=red>Bitte nur Bilder im gif, jpg oder png-Format hochladen!</font>"; } if ($debug) $debugpuffer = $debugpuffer."<br>Fehlercode: ".$uploadmsg[$_FILES['datei']['error']]; break; case "remove": // fotos löschen $abfrage_pfad = "SELECT * FROM album WHERE id=".$_GET["album"]; # if ($debug) $debugpuffer = $debugpuffer."<br>".$abfrage_pfad; # $ergebnis_abfrage_pfad = mysql_query($abfrage_pfad) OR DIE ("Error_remove: $abfrage_pfad <br>".mysql_error()); # $row_pfad = mysql_fetch_assoc($ergebnis_abfrage_pfad); $row_pfad = $database->get_row($abfrage_pfad, $object = 1); $abfrage_bildname = "SELECT * FROM foto WHERE id=".$_GET["sel_bild"]; # if ($debug) $debugpuffer = $debugpuffer."<br>".$abfrage_bildname; # $ergebnis_abfrage_bildname = mysql_query($abfrage_bildname) OR DIE ("Error_remove_2: $abfrage_bildname <br>".mysql_error()); # $row_bildname = mysql_fetch_assoc($ergebnis_abfrage_bildname); $row_bildname = $database->get_row($abfrage_bildname, $object = 1); if ($debug) $debugpuffer = $debugpuffer."<br>".$foto_dir."/".$row_pfad['albumpfad']."/".$row_bildname['bildname']; if (!unlink($foto_dir."/".$row_pfad['albumpfad']."/".$row_bildname['bildname'])) echo "<br>löschen fehlgeschlagen!<br>"; else { # $admin_del_bild = "DELETE FROM foto WHERE id=".$_GET["sel_bild"]." AND album_id=".$_GET["album"]; # if ($debug) $debugpuffer = $debugpuffer."<br>admin_del_bild: ".$admin_del_bild; # $ergebnis_admin_del_bild = mysql_query($admin_del_bild) OR DIE ("Error_del: $admin_del_bild <br>".mysql_error()); # if ($debug) $debugpuffer = $debugpuffer." gelöscht!"; $where = array( 'id' => $_GET["sel_bild"], 'album_id' => $_GET["album"] ); $database->delete( 'foto', $where); } break; case "up": // verschieben eines fotos nach oben //checken welche albumpos die neue wäre $bild_pos_check_aktuell = "SELECT * FROM foto WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_aktuell; $ergebnis_bild_pos_check_aktuell = mysql_query($bild_pos_check_aktuell) OR DIE ("Error_down: $bild_pos_check_aktuell <br>".mysql_error()); $row_bild_pos_check_aktuell = mysql_fetch_assoc($ergebnis_bild_pos_check_aktuell); $bild_pos_check_neu = "SELECT * FROM foto WHERE bildposition=".$row_bild_pos_check_aktuell['bildposition']."-1"; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_neu; $ergebnis_bild_pos_check_neu = mysql_query($bild_pos_check_neu) OR DIE ("Error_down: $bild_pos_check_neu <br>".mysql_error()); $row_bild_pos_check_neu = mysql_fetch_assoc($ergebnis_bild_pos_check_neu); if (mysql_num_rows($ergebnis_bild_pos_check_neu) == 0) //wenn nichts vorhanden mit der Albumpos { $bild_up_admin = "UPDATE foto SET bildposition = bildposition - 1 WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } else //wenn vorhanden, vorhandene +1 und aktuelle -1 { $bild_inc = "UPDATE foto SET bildposition = bildposition +1 WHERE bildposition=".$row_bild_pos_check_neu['bildposition']." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_inc; $bild_album_inc = mysql_query($bild_inc) OR DIE ("Error_up: $bild_inc <br>".mysql_error()); $bild_up_admin = "UPDATE foto SET bildposition = bildposition - 1 WHERE id=".$_GET["sel_bild"]." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } break; case "down": // verschieben eines fotos nach unten //checken welche albumpos die neue wäre $bild_pos_check_aktuell = "SELECT * FROM foto WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_aktuell; $ergebnis_bild_pos_check_aktuell = mysql_query($bild_pos_check_aktuell) OR DIE ("Error_down: $bild_pos_check_aktuell <br>".mysql_error()); $row_bild_pos_check_aktuell = mysql_fetch_assoc($ergebnis_bild_pos_check_aktuell); $bild_pos_check_neu = "SELECT * FROM foto WHERE bildposition=".$row_bild_pos_check_aktuell['bildposition']."+1"; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_neu; $ergebnis_bild_pos_check_neu = mysql_query($bild_pos_check_neu) OR DIE ("Error_down: $bild_pos_check_neu <br>".mysql_error()); $row_bild_pos_check_neu = mysql_fetch_assoc($ergebnis_bild_pos_check_neu); if (mysql_num_rows($ergebnis_bild_pos_check_neu) == 0) //wenn nichts vorhanden mit der Albumpos { $bild_up_admin = "UPDATE foto SET bildposition = bildposition + 1 WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } else //wenn vorhanden, vorhandene +1 und aktuelle -1 { $bild_inc = "UPDATE foto SET bildposition = bildposition -1 WHERE bildposition=".$row_bild_pos_check_neu['bildposition']." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_inc; $bild_album_inc = mysql_query($bild_inc) OR DIE ("Error_up: $bild_inc <br>".mysql_error()); $bild_up_admin = "UPDATE foto SET bildposition = bildposition + 1 WHERE id=".$_GET["sel_bild"]." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } break; case "update": // die albumdaten updaten $album_update_admin = "UPDATE album SET titel=\"".$_POST['albumname']."\", dateikommentar=\"".$_POST['albumkommentar']."\", aufnahmedatum=\"".date("Y-m-d",strtotime ($_POST['anfang']))."\", ende=\"".date("Y-m-d",strtotime ($_POST['ende']))."\", enabled=\""; if(($_POST['album_visible'][0]) == 1) $album_update_admin = $album_update_admin."1"; if(($_POST['album_visible'][0]) == 0) $album_update_admin = $album_update_admin ."0"; $album_update_admin = $album_update_admin."\" WHERE id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$album_update_admin; $ergebnis_update_admin = mysql_query($album_update_admin) OR DIE ("Error_update: $album_update_admin <br>".mysql_error()); foreach ($_POST as $key => $value) { if (preg_match("/_f/i", $key)) { $key = substr($key,"2"); $foto_update_admin = "UPDATE foto SET bildkommentar=\"".$value."\" WHERE id=\"".$key."\""; if ($debug) $debugpuffer = $debugpuffer."<br>".$foto_update_admin; $ergebnis_foto_update_admin = mysql_query($foto_update_admin) OR DIE ("Error_update: $foto_update_admin <br>".mysql_error()); } } echo "Update der Datenbank erfolgreich!"; break; default : // nix break; endswitch; if (!empty($_GET["album"])) { $abfrage_admin = "SELECT * FROM album WHERE id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$abfrage_admin; $ergebnis_admin = mysql_query($abfrage_admin) OR DIE ("Error1: $abfrage_admin <br>".mysql_error()); $menge_admin = mysql_num_rows($ergebnis_admin) OR DIE ("Error2: $abfrage_admin <br>".mysql_error()); $row = mysql_fetch_assoc($ergebnis_admin); } // Lade Menulinks aus der Datenbank echo "<h2>Administration der Fotos</h2><hr>"; echo "<form name=\"albumform\" id=\"admincontent_submit\" action=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=update&amp;album=".$_GET["album"]."&amp;".session_id()."\" method=\"post\" accept-charset=\"ISO-8859-1\">"; ?> <table width="100%" border="0" id="content_adminfoto"> <tr> <td class="albumwahl" rowspan="30"><b><? echo $row["titel"];?></b> <ul class="albumwahl"> <li class="albumwahl"><!--input type="submit" class="albumedit_submit" value="Album neu erstellen" title="new" /--><? // Album neu erstellen echo "<a class=\"albumwahl\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=upload&amp;album=".$_GET["album"]."&amp;".session_id()."\" onclick=\"document.albumform.submit();\">Fotos hinzufügen</a>"; echo "</li>"; ?> <li class="albumwahl"><!--input type="submit" class="albumedit_submit" value="Album löschen" title="del" style="background-color : #ff0000;"/--><? // Album löschen echo "<a class=\"albumwahl\" href=\"index.php?modul=_101&amp;section=".$_GET["section"]."&amp;action=del&amp;album=".$row["id"]."&amp;".session_id()."\" style=\"background-color:#ff0000;\">markiertes Album löschen</a>"; echo "</li>"; ?> </ul><br> <p class="albumwahl"><b>Albumname:</b><br><input class="albumwahl" name="albumname" type="text" size="24" maxlength="30" value="<? echo $row['titel'];?>"><br><br> <b>Albumkommentar:</b><br><textarea class="albumwahl" name="albumkommentar" cols="18" rows="3"><? echo $row['dateikommentar'];?></textarea><br> <b>Album sichtbar:</b>&nbsp;<input class="albumwahl_check" type="checkbox" name="album_visible[0]" value="1" <? if ($row['enabled'] == 1) echo "checked";?>><br><br> <b>Album Zeitraum Beginn:</b><br><input class="albumwahl" name="anfang" type="text" size="24" maxlength="30" value="<? echo date("d.m.Y",strtotime ($row["aufnahmedatum"])); ?>"><br><br> <b>Album Zeitraum Ende:</b><br><input class="albumwahl" name="ende" type="text" size="24" maxlength="30" value="<? if ($row["ende"] <> "1970-01-01") echo date("d.m.Y",strtotime ($row["ende"]));?>"><br><br> <input type="hidden" name="albumposition" value="<? echo $row['albumposition'];?>"> <input type="submit"> </p> </td><? if ((!empty($_GET["album"])) AND ($_GET["album"])) { $abfrage_admin = "SELECT * FROM foto WHERE album_id=".$_GET["album"]." ORDER BY bildposition ASC"; $ergebnis_admin = mysql_query($abfrage_admin) OR DIE ("Error3: $abfrage_admin <br>".mysql_error()); $menge_admin = mysql_num_rows($ergebnis_admin); $abfrage_album_pfad = "SELECT * FROM album WHERE id=".$_GET["album"]; $ergebnis_album_pfad = mysql_query($abfrage_album_pfad) OR DIE ("Error4: $abfrage_album_pfad <br>".mysql_error()); $pfad = mysql_fetch_object($ergebnis_album_pfad); $i = 0; while($row_foto = mysql_fetch_object($ergebnis_admin)) { if (!empty($row_foto)) { ?> <td id="content_adminfoto"><?/* move pic up */ echo "<a class=\"bild_del\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=up&amp;sel_bild=".$row_foto->id."&amp;album=".$_GET["album"]."&amp;".session_id()."\"><img src=\"./bilder/arrow_up_winter.png\" height=\"16\" width=\"16\" alt=\"up\"></a>";/* move pic down */ echo "<a class=\"bild_del\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=down&amp;sel_bild=".$row_foto->id."&amp;album=".$_GET["album"]."&amp;".session_id()."\"><img src=\"./bilder/arrow_down_winter.png\" height=\"16\" width=\"16\" alt=\"down\"></a>";/* delete pic */ echo "<a class=\"bild_del\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=remove&amp;sel_bild=".$row_foto->id."&amp;album=".$_GET["album"]."&amp;".session_id()."\"><img src=\"./bilder/close64.png\" height=\"16\" width=\"16\" alt=\"delete\"></a><br>"; echo "<a href=\"index.php?modul=_1&amp;section=4&amp;album=".$_GET["album"]."&amp;img=".$row_foto->id."&amp;diashow=1\">"; echo "<img src=\"".$modulpath."thumbnail.php?thumb=".".".$foto_dir."/".$pfad->albumpfad."/".$row_foto->bildname."&amp;p=".$thumbsize."\" alt=\"".$row_foto->bildname."\" name=\"".$row_foto->bildname."\">"; echo "</a><br>"; echo "<input type=\"text\" value=\"".$row_foto->bildkommentar."\" name=\"_f".$row_foto->id."\" size=\"21\">"; echo "</td>"; $i++; if ($i==3) { echo "</tr><tr class=\"tab_foto\">"; $i = 0; } } } } if ($menge_admin == "0") echo "<td style=\"text-align : center;\">Das Album ist leer.</td>";?> </tr> </table> </form><?}//if ($debug) print_r($_POST);if ($debug) $debugpuffer = $debugpuffer."</fieldset>";?><!-- Administration der Fotos> <Ende-->
Output for git.master, git.master_jit, rfc.property-hooks
<!-- Administration der Fotos> <Beginn--><div id="content_adminfoto"><? if ($debug) $debugpuffer = $debugpuffer."<fieldset><legend>adminalbum.php</legend>";#UploadErors$uploadmsg = array( 0 => "There is no error, the file uploaded with success", 1 => "The uploaded file exceeds the upload_max_filesize directive in php.ini", 2 => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form", 3 => "The uploaded file was only partially uploaded", 4 => "No file was uploaded", 6 => "Missing a temporary folder");if ($admin){ if (!isset($_GET["action"])) $_GET["action"]=""; if ($debug) $debugpuffer = $debugpuffer."<br>switch GET[action]=".$_GET["action"]; switch ($_GET["action"]): case "upload": // fotos hochladen?> <script>javascript:zeige('popUpFotoAdd')</script><? break; case "add": // fotos nach upload hinzufügen /*Dieser Script lädt unsere Datei in das Verzeichniss upload, und nennt die Datei datei.txt. Wichtig: Der Ordner upload muss die Schreibrechte CHMOD(777) besitzen. Außerdem unterstützt nicht jeder Webspace Dateiuploads. Mit folgenden Befehlen können wir Informationen über die Datei sammeln: $_FILES['datei']['name'] Hiermit erhalten wir den Namen der Datei auf dem PC des besuchers. $_FILES['datei']['tmp_name'] Dieser Variable enthält den Namen der Datei auf dem temporären Verzeichnis auf dem Server. $_FILES['datei']['size'] Diese Variable enthält die Größe der Datei in Bytes. $_FILES['datei']['type'] Diese Variable enthält den MIME-Type der Datei. Gif-Dateien haben den Typ: image/gif Man sollte aber lieber den Befehl GetImageSize() benutzen */ $dateityp = GetImageSize($_FILES['datei']['tmp_name']); if ($debug) $debugpuffer = $debugpuffer."<br>dateityp:".$dateityp[2].", Datei:".$_FILES['datei']['tmp_name']; if (($dateityp[2] == 1) OR ($dateityp[2] == 2) OR ($dateityp[2] == 3)) { if ($_FILES['datei']['size'] < 10240000) //=10MB ; 1024 = 1kb /* Zuerst überpüfen wir, on die Datei auch eine Bild-Datei ist. Dies geht mit GetImageSize. Falls man versucht, eine andere Datei hochzuladen, enthält $dateityp[2] den Wert 0. The 0 index is the width of the image in pixels. The 1 index is the height of the image in pixels. The 2 index is a flag for the image type: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(orden de bytes intel), 8 = TIFF(orden de bytes motorola), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. The 3 index contains ' height="yyy" width="xxx" ' Danach überprüfen wir, ob die Datei nicht größer als 100 kb (102400 Byte) ist. Wenn alles in Ordnung ist, wird die Datei hochgeladen.*/ { $get_album_dir_abfrage = 'SELECT * FROM album WHERE id='.$_GET['album']; # if ($debug) $debugpuffer = $debugpuffer."<br>".$get_album_dir; # $get_album_dir_result = mysql_query($get_album_dir) OR DIE ("Error_up: $get_album_dir <br>".mysql_error()); # $get_album_dir_assoc = mysql_fetch_assoc($get_album_dir_result); $get_album_dir = $database->get_row($get_album_dir_abfrage, $object = true);# if (!move_uploaded_file($_FILES['datei']['tmp_name'], $foto_dir."/".$get_album_dir['albumpfad']."/".$_FILES['datei']['name'])) echo "Fehler beim hochladen des Fotos!"; if ($debug) $debugpuffer = $debugpuffer."<br>Das Bild wurde Erfolgreich nach ".$foto_dir."/".$get_album_dir['albumpfad']."/".$_FILES['datei']['name']." hochgeladen"; $max_bildpos_admin = "SELECT max(bildposition) as maxbildposition FROM sfoto WHERE album_id=".$_GET["album"]; # if ($debug) $debugpuffer = $debugpuffer."<br>".$max_bildpos_admin; # $ergebnis_max_bildpos_admin = mysql_query($max_bildpos_admin) OR DIE ("Error_new: $max_bildpos_admin <br>".mysql_error()); # $row_max_bildpos = mysql_fetch_object($ergebnis_max_bildpos_admin); $max_bildpos_abfrage = $database->get_row($max_bildpos_admin, $object = true); # $insert_picture="INSERT INTO foto (bildname, bildkommentar, bildposition, album_id, enabled) VALUES ('".$_FILES['datei']['name']."','',".$max_bildpos_abfrage->maxbildposition." + 1,'".$_GET['album']."','1')";/* $user_data = array( 'bildname' => $_FILES['datei']['name'], 'bildkommentar' => '', 'bildposition' => $max_bildpos_abfrage->maxbildposition." + 1", 'album_id' => $_GET['album'], 'enabled' => 1 ); $database->insert( 'foto', $user_data );*/ # if ($debug) $debugpuffer = $debugpuffer."<br>".$insert_picture; # $ergebnis_insert_picture = mysql_query($insert_picture) OR DIE ("Error_add: $insert_picture <br>".mysql_error()); } else { echo "<font color=red>Das Bild darf nicht größer als 10 MB sein!</font>"; } } else { echo "<font color=red>Bitte nur Bilder im gif, jpg oder png-Format hochladen!</font>"; } if ($debug) $debugpuffer = $debugpuffer."<br>Fehlercode: ".$uploadmsg[$_FILES['datei']['error']]; break; case "remove": // fotos löschen $abfrage_pfad = "SELECT * FROM album WHERE id=".$_GET["album"]; # if ($debug) $debugpuffer = $debugpuffer."<br>".$abfrage_pfad; # $ergebnis_abfrage_pfad = mysql_query($abfrage_pfad) OR DIE ("Error_remove: $abfrage_pfad <br>".mysql_error()); # $row_pfad = mysql_fetch_assoc($ergebnis_abfrage_pfad); $row_pfad = $database->get_row($abfrage_pfad, $object = 1); $abfrage_bildname = "SELECT * FROM foto WHERE id=".$_GET["sel_bild"]; # if ($debug) $debugpuffer = $debugpuffer."<br>".$abfrage_bildname; # $ergebnis_abfrage_bildname = mysql_query($abfrage_bildname) OR DIE ("Error_remove_2: $abfrage_bildname <br>".mysql_error()); # $row_bildname = mysql_fetch_assoc($ergebnis_abfrage_bildname); $row_bildname = $database->get_row($abfrage_bildname, $object = 1); if ($debug) $debugpuffer = $debugpuffer."<br>".$foto_dir."/".$row_pfad['albumpfad']."/".$row_bildname['bildname']; if (!unlink($foto_dir."/".$row_pfad['albumpfad']."/".$row_bildname['bildname'])) echo "<br>löschen fehlgeschlagen!<br>"; else { # $admin_del_bild = "DELETE FROM foto WHERE id=".$_GET["sel_bild"]." AND album_id=".$_GET["album"]; # if ($debug) $debugpuffer = $debugpuffer."<br>admin_del_bild: ".$admin_del_bild; # $ergebnis_admin_del_bild = mysql_query($admin_del_bild) OR DIE ("Error_del: $admin_del_bild <br>".mysql_error()); # if ($debug) $debugpuffer = $debugpuffer." gelöscht!"; $where = array( 'id' => $_GET["sel_bild"], 'album_id' => $_GET["album"] ); $database->delete( 'foto', $where); } break; case "up": // verschieben eines fotos nach oben //checken welche albumpos die neue wäre $bild_pos_check_aktuell = "SELECT * FROM foto WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_aktuell; $ergebnis_bild_pos_check_aktuell = mysql_query($bild_pos_check_aktuell) OR DIE ("Error_down: $bild_pos_check_aktuell <br>".mysql_error()); $row_bild_pos_check_aktuell = mysql_fetch_assoc($ergebnis_bild_pos_check_aktuell); $bild_pos_check_neu = "SELECT * FROM foto WHERE bildposition=".$row_bild_pos_check_aktuell['bildposition']."-1"; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_neu; $ergebnis_bild_pos_check_neu = mysql_query($bild_pos_check_neu) OR DIE ("Error_down: $bild_pos_check_neu <br>".mysql_error()); $row_bild_pos_check_neu = mysql_fetch_assoc($ergebnis_bild_pos_check_neu); if (mysql_num_rows($ergebnis_bild_pos_check_neu) == 0) //wenn nichts vorhanden mit der Albumpos { $bild_up_admin = "UPDATE foto SET bildposition = bildposition - 1 WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } else //wenn vorhanden, vorhandene +1 und aktuelle -1 { $bild_inc = "UPDATE foto SET bildposition = bildposition +1 WHERE bildposition=".$row_bild_pos_check_neu['bildposition']." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_inc; $bild_album_inc = mysql_query($bild_inc) OR DIE ("Error_up: $bild_inc <br>".mysql_error()); $bild_up_admin = "UPDATE foto SET bildposition = bildposition - 1 WHERE id=".$_GET["sel_bild"]." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } break; case "down": // verschieben eines fotos nach unten //checken welche albumpos die neue wäre $bild_pos_check_aktuell = "SELECT * FROM foto WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_aktuell; $ergebnis_bild_pos_check_aktuell = mysql_query($bild_pos_check_aktuell) OR DIE ("Error_down: $bild_pos_check_aktuell <br>".mysql_error()); $row_bild_pos_check_aktuell = mysql_fetch_assoc($ergebnis_bild_pos_check_aktuell); $bild_pos_check_neu = "SELECT * FROM foto WHERE bildposition=".$row_bild_pos_check_aktuell['bildposition']."+1"; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_pos_check_neu; $ergebnis_bild_pos_check_neu = mysql_query($bild_pos_check_neu) OR DIE ("Error_down: $bild_pos_check_neu <br>".mysql_error()); $row_bild_pos_check_neu = mysql_fetch_assoc($ergebnis_bild_pos_check_neu); if (mysql_num_rows($ergebnis_bild_pos_check_neu) == 0) //wenn nichts vorhanden mit der Albumpos { $bild_up_admin = "UPDATE foto SET bildposition = bildposition + 1 WHERE id=".$_GET["sel_bild"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } else //wenn vorhanden, vorhandene +1 und aktuelle -1 { $bild_inc = "UPDATE foto SET bildposition = bildposition -1 WHERE bildposition=".$row_bild_pos_check_neu['bildposition']." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_inc; $bild_album_inc = mysql_query($bild_inc) OR DIE ("Error_up: $bild_inc <br>".mysql_error()); $bild_up_admin = "UPDATE foto SET bildposition = bildposition + 1 WHERE id=".$_GET["sel_bild"]." AND album_id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$bild_up_admin; $bild_up_admin = mysql_query($bild_up_admin) OR DIE ("Error_up: $bild_up_admin <br>".mysql_error()); } break; case "update": // die albumdaten updaten $album_update_admin = "UPDATE album SET titel=\"".$_POST['albumname']."\", dateikommentar=\"".$_POST['albumkommentar']."\", aufnahmedatum=\"".date("Y-m-d",strtotime ($_POST['anfang']))."\", ende=\"".date("Y-m-d",strtotime ($_POST['ende']))."\", enabled=\""; if(($_POST['album_visible'][0]) == 1) $album_update_admin = $album_update_admin."1"; if(($_POST['album_visible'][0]) == 0) $album_update_admin = $album_update_admin ."0"; $album_update_admin = $album_update_admin."\" WHERE id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$album_update_admin; $ergebnis_update_admin = mysql_query($album_update_admin) OR DIE ("Error_update: $album_update_admin <br>".mysql_error()); foreach ($_POST as $key => $value) { if (preg_match("/_f/i", $key)) { $key = substr($key,"2"); $foto_update_admin = "UPDATE foto SET bildkommentar=\"".$value."\" WHERE id=\"".$key."\""; if ($debug) $debugpuffer = $debugpuffer."<br>".$foto_update_admin; $ergebnis_foto_update_admin = mysql_query($foto_update_admin) OR DIE ("Error_update: $foto_update_admin <br>".mysql_error()); } } echo "Update der Datenbank erfolgreich!"; break; default : // nix break; endswitch; if (!empty($_GET["album"])) { $abfrage_admin = "SELECT * FROM album WHERE id=".$_GET["album"]; if ($debug) $debugpuffer = $debugpuffer."<br>".$abfrage_admin; $ergebnis_admin = mysql_query($abfrage_admin) OR DIE ("Error1: $abfrage_admin <br>".mysql_error()); $menge_admin = mysql_num_rows($ergebnis_admin) OR DIE ("Error2: $abfrage_admin <br>".mysql_error()); $row = mysql_fetch_assoc($ergebnis_admin); } // Lade Menulinks aus der Datenbank echo "<h2>Administration der Fotos</h2><hr>"; echo "<form name=\"albumform\" id=\"admincontent_submit\" action=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=update&amp;album=".$_GET["album"]."&amp;".session_id()."\" method=\"post\" accept-charset=\"ISO-8859-1\">"; ?> <table width="100%" border="0" id="content_adminfoto"> <tr> <td class="albumwahl" rowspan="30"><b><? echo $row["titel"];?></b> <ul class="albumwahl"> <li class="albumwahl"><!--input type="submit" class="albumedit_submit" value="Album neu erstellen" title="new" /--><? // Album neu erstellen echo "<a class=\"albumwahl\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=upload&amp;album=".$_GET["album"]."&amp;".session_id()."\" onclick=\"document.albumform.submit();\">Fotos hinzufügen</a>"; echo "</li>"; ?> <li class="albumwahl"><!--input type="submit" class="albumedit_submit" value="Album löschen" title="del" style="background-color : #ff0000;"/--><? // Album löschen echo "<a class=\"albumwahl\" href=\"index.php?modul=_101&amp;section=".$_GET["section"]."&amp;action=del&amp;album=".$row["id"]."&amp;".session_id()."\" style=\"background-color:#ff0000;\">markiertes Album löschen</a>"; echo "</li>"; ?> </ul><br> <p class="albumwahl"><b>Albumname:</b><br><input class="albumwahl" name="albumname" type="text" size="24" maxlength="30" value="<? echo $row['titel'];?>"><br><br> <b>Albumkommentar:</b><br><textarea class="albumwahl" name="albumkommentar" cols="18" rows="3"><? echo $row['dateikommentar'];?></textarea><br> <b>Album sichtbar:</b>&nbsp;<input class="albumwahl_check" type="checkbox" name="album_visible[0]" value="1" <? if ($row['enabled'] == 1) echo "checked";?>><br><br> <b>Album Zeitraum Beginn:</b><br><input class="albumwahl" name="anfang" type="text" size="24" maxlength="30" value="<? echo date("d.m.Y",strtotime ($row["aufnahmedatum"])); ?>"><br><br> <b>Album Zeitraum Ende:</b><br><input class="albumwahl" name="ende" type="text" size="24" maxlength="30" value="<? if ($row["ende"] <> "1970-01-01") echo date("d.m.Y",strtotime ($row["ende"]));?>"><br><br> <input type="hidden" name="albumposition" value="<? echo $row['albumposition'];?>"> <input type="submit"> </p> </td><? if ((!empty($_GET["album"])) AND ($_GET["album"])) { $abfrage_admin = "SELECT * FROM foto WHERE album_id=".$_GET["album"]." ORDER BY bildposition ASC"; $ergebnis_admin = mysql_query($abfrage_admin) OR DIE ("Error3: $abfrage_admin <br>".mysql_error()); $menge_admin = mysql_num_rows($ergebnis_admin); $abfrage_album_pfad = "SELECT * FROM album WHERE id=".$_GET["album"]; $ergebnis_album_pfad = mysql_query($abfrage_album_pfad) OR DIE ("Error4: $abfrage_album_pfad <br>".mysql_error()); $pfad = mysql_fetch_object($ergebnis_album_pfad); $i = 0; while($row_foto = mysql_fetch_object($ergebnis_admin)) { if (!empty($row_foto)) { ?> <td id="content_adminfoto"><?/* move pic up */ echo "<a class=\"bild_del\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=up&amp;sel_bild=".$row_foto->id."&amp;album=".$_GET["album"]."&amp;".session_id()."\"><img src=\"./bilder/arrow_up_winter.png\" height=\"16\" width=\"16\" alt=\"up\"></a>";/* move pic down */ echo "<a class=\"bild_del\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=down&amp;sel_bild=".$row_foto->id."&amp;album=".$_GET["album"]."&amp;".session_id()."\"><img src=\"./bilder/arrow_down_winter.png\" height=\"16\" width=\"16\" alt=\"down\"></a>";/* delete pic */ echo "<a class=\"bild_del\" href=\"index.php?modul=_104&amp;section=".$_GET["section"]."&amp;action=remove&amp;sel_bild=".$row_foto->id."&amp;album=".$_GET["album"]."&amp;".session_id()."\"><img src=\"./bilder/close64.png\" height=\"16\" width=\"16\" alt=\"delete\"></a><br>"; echo "<a href=\"index.php?modul=_1&amp;section=4&amp;album=".$_GET["album"]."&amp;img=".$row_foto->id."&amp;diashow=1\">"; echo "<img src=\"".$modulpath."thumbnail.php?thumb=".".".$foto_dir."/".$pfad->albumpfad."/".$row_foto->bildname."&amp;p=".$thumbsize."\" alt=\"".$row_foto->bildname."\" name=\"".$row_foto->bildname."\">"; echo "</a><br>"; echo "<input type=\"text\" value=\"".$row_foto->bildkommentar."\" name=\"_f".$row_foto->id."\" size=\"21\">"; echo "</td>"; $i++; if ($i==3) { echo "</tr><tr class=\"tab_foto\">"; $i = 0; } } } } if ($menge_admin == "0") echo "<td style=\"text-align : center;\">Das Album ist leer.</td>";?> </tr> </table> </form><?}//if ($debug) print_r($_POST);if ($debug) $debugpuffer = $debugpuffer."</fieldset>";?><!-- Administration der Fotos> <Ende-->

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.2 ms | 445 KiB | 8 Q