Error("Bild konnte nicht eingefügt werden"); } } } // Bild löschen if (isset($_GET['Remove']) && isset($_GET['ID'])) { // Ein Bild Löschen ZapContent($_GET['ID'], "Bild"); } // Eigene Galerie im Editiermodus anzeigen include "Content/NewImage.php"; $Bilder = DBQ("SELECT * FROM " . DBTabPictures . " WHERE BesitzerID='" . $_SESSION['ID'] . "' ORDER BY ID"); set_include_path("Content/Templates/"); include "Content/MyImageList.php"; } else { $Array = DBQ("SELECT ID,Titel,Skaliert,Thumbnail,Dateiname FROM " . DBTabPictures . " ORDER BY Time"); if (is_array($Array) && count($Array) > 0) { if (isset($_GET['Page'])) { $Page = $_GET['Page']; $StartWert = ($Page - 1) * MAXITEMSINLIST; } else { $Page = 1; $StartWert = 0; // Wenn wir auf Seite 1 sind, beginnen wir mit dem ersten Bild. } $CL = InitContentList("Bilder", count($Array), $Page, "Bilder"); if ($CL != 0) { $x = $StartWert; do { $Bild = $Array[$x]; $CLValues = array('Titel' => $Bild['Titel'], 'Link' => '?Bilder&Bild=' . $Bild['ID'], 'Skaliert' => $Bild['Skaliert'], 'Thumbnail' => $Bild['Thumbnail'], 'Inhalt' => $Bild['Dateiname']);
*/ /* This file is part of Banbury. Banbury is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License. Banbury is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ # set_include_path('../php'); // Das machen wir erst wenn wir fertig sind ... require '../php/Includes.php'; require '../php/Functions.php'; initDBConnection(); ## Startet eine Session session_start(); $PendingUsers = DBQ("SELECT Nickname,Mail,Time FROM " . DBTabKeys); $PendingUsersTable = QueryToTable($PendingUsers); $RegisteredUsers = DBQ("SELECT ID,Nickname,Anmeldung,Mail FROM " . DBTabUsers); $RegisteredUsersTable = QueryToTable($RegisteredUsers); echo "Pending Users (" . count($PendingUsers) . ")"; echo $PendingUsersTable; echo "Registered Users"; echo "(" . count($RegisteredUsers) . ")"; echo $RegisteredUsersTable;
} $Show['Nickname'] = 1; // Nickname muss angezeigt werden $Update = aArrayIntoString($Show); // Array zu String DBU(DBTabProfiles, "ID='" . $_SESSION['ID'] . "'", $Update); // Anzeigestatus speichern if ($_FILES['Profilbild']['size'] > 0) { // Profilbild speichern CreateThumbnail(120, $_FILES['Profilbild'], AvatarVerzeichnis . "/" . $_SESSION['Nickname'] . ".jpg"); } } // Anzeigen des eigenen Profils im Editiermodus ... $Array = DBQ("SELECT * FROM " . DBTabUsers . " WHERE ID='" . $_SESSION['ID'] . "'"); $Array = $Array[0]; $Show = DBQ("SELECT * FROM " . DBTabProfiles . " WHERE ID='" . $_SESSION['ID'] . "'"); if (is_array($Show)) { $Show = $Show[0]; } if (is_array($Show)) { reset($Show); while ($key = key($Show)) { $current = current($Show); if ($current == 1) { $current = 'checked="checked"'; } else { $current = ''; } $Show[$key] = $current; next($Show); }
} next($Show); } extract($Array, EXTR_OVERWRITE); $Profil = ' <a href="?Profil/&Edit">Bearbeiten</a><br /> <img src="' . AvatarVerzeichnis . "/" . $_SESSION['Nickname'] . '.jpg" alt="Profilbild" align="left" /> ' . $Nickname . '<br /> ' . $Vorname . ' ' . $Name . '<br /> ' . $PLZ . ' ' . $Wohnort . '<br /> ' . $Geburtstag . ' ' . $Webseite . '<br clear="all" /> ' . $Kurzprofil . ''; $Galerie = '<strong>Meine Galerie</strong> <a href="?Bilder/&Edit">Bearbeiten</a>'; ob_start(); restore_include_path(); require "Bilder/Content/MyImageList.php"; $Galerie .= ob_get_contents(); ob_end_clean(); $Freunde = '<strong>Freunde</strong>'; $Reviews = '<strong>Reviews</strong>'; $Hardware = '<strong>Hardware</strong>'; $Software = '<strong>Software</strong>'; $Anzeigen = '<strong>Anzeigen</strong>'; $Reihenfolge = DBQ("SELECT Sorted FROM " . DBTabUsers . " WHERE ID=" . $_SESSION['ID']); $Reihenfolge = explode(",", $Reihenfolge[0]['Sorted']); // Ausgabe der definierten Reihenfolge ... foreach ($Reihenfolge as $Object) { echo "<div id=\"" . $Object . "\" class=\"ObjektBox\">\n"; echo ${$Object}; echo "\n</div>\n\n"; }
<?php /* This file is part of Banbury. Banbury is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License. Banbury is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ $Bilder = DBQ("SELECT * FROM " . DBTabPictures . " WHERE BesitzerID='" . $_SESSION['ID'] . "' ORDER BY ID"); if (is_array($Bilder) && count($Bilder) > 0) { foreach ($Bilder as $Bild) { echo '<br />'; echo '<a href="' . BilderVerzeichnis . "/Skaliert/" . $Bild['Skaliert'] . '" rel="lightbox"><img src="' . BilderVerzeichnis . "/Thumbnails/" . $Bild['Thumbnail'] . '" alt="' . $Bild['Titel'] . '" title="' . $Bild['Titel'] . '" /></a>'; echo '<a href="?Bilder/&Bild=' . $Bild['ID'] . '">' . $Bild['Titel'] . '</a> '; if (isset($_GET['Edit'])) { echo '<a href="?Bilder/&Edit&Remove&ID=' . $Bild['ID'] . '">Löschen</a>'; } echo '<br />'; } }
function Inforahmen($ID) { $Name = "System"; $Werte = "Computer"; $Einheit = ""; $Tag = DBQ("SELECT * FROM " . DBTabTags . " WHERE ID='" . $ID . "'"); $Tag = $Tag[0]; while ($key = key($Tag)) { if (current($Tag) != "") { ${$key} = current($Tag); } if (current($Tag) == "various") { ${$key} = ""; } next($Tag); } set_include_path("Content/Templates/"); require "PODInforahmen.php"; }
<?php /* * Created on Jul 27, 2007 * * Diese Datei sorgt dafür, dass die Admins bestimmte Aufgaben erledigen können. */ # set_include_path('../php'); // Das machen wir erst wenn wir fertig sind ... require '../php/Includes.php'; require '../php/Functions.php'; $db = mysql_connect(DBHost . ":" . DBPort, DBUser, DBPass) or (require "../Content/DBConnectError.php"); $db_selected = mysql_select_db(DBName, $db) or die("Auswahl der Datenbank fehlgeschlagen"); ## Startet eine Session session_start(); $PendingUsers = DBQ("SELECT Nickname,Mail,Time FROM Schluessel"); $PendingUsersTable = QueryToTable($PendingUsers); $RegisteredUsers = DBQ("SELECT ID,Nickname,Anmeldung,Mail FROM Users"); $RegisteredUsersTable = QueryToTable($RegisteredUsers); echo "Pending Users (" . count($RegisteredUsers) . ")"; echo $PendingUsersTable; echo "Registered Users"; echo "(" . count($RegisteredUsers) . ")"; echo $RegisteredUsersTable;
$Values .= ",'" . $Array[0]['Nickname'] . "'"; $Values .= ",'" . date("Y-m-d H:i:s", time()) . "'"; $Values .= ",'" . $Array[0]['Mail'] . "'"; DBIN("USERS", "ID,Passwort,Nickname,Anmeldung,Mail", $Values); DBIN("USERS", "ID,Passwort,Nickname,Anmeldung,Mail", $Values); DBIN("Profile", "ID,Nickname,Name,Vorname,PLZ,Wohnort,Profilbild,Kurzprofil,Kontakt,Galerie,Geburtstag", $NewID . ',1,0,0,0,0,0,0,0,0,0'); DBD("Schluessel", "Wert='" . $_GET['UserKey'] . "'"); include "Content/Willkommen1.html"; } else { include "Content/InternerFehler.html"; } } else { ## Benutzer erstellen Schritt 1 if (isset($_POST['Nickname']) && isset($_POST['Passwort1']) && isset($_POST['Passwort2']) && isset($_POST['Mail'])) { $Array = DBQ("SELECT 'Nickname' FROM " . DBTabUsers . " WHERE Nickname='" . $_POST['Nickname'] . "'"); $Array2 = DBQ("SELECT 'Nickname' FROM " . DBTabKeys . " WHERE Nickname='" . $_POST['Nickname'] . "'"); if (is_array($Array)) { ## Wenn der Nickname schon vergeben ist ... include "Content/UserExists.html"; } elseif (is_array($Array2)) { ## Wenn der Benutzername bereits reserviert ist ... include "Content/UserReserved.html"; } else { if (sha1($_POST['Passwort1']) != sha1($_POST['Passwort2'])) { ## Passwort Schreibfehler überprüfen include "Content/PasswortFehler.html"; } elseif (!eregi("^[a-z0-9]+([-_\\.]?[a-z0-9])+@[a-z0-9]+([-_\\.]?[a-z0-9])+\\.[a-z]{2,4}\$", $_POST['Mail'])) { ## Falsche EMail-Adressen filtern include "Content/EMailFehler.html"; } else { $Key = sha1(addslashes($_POST['Mail']) . time() . addslashes($_POST['Nickname']));
/// KOMMENTARE LÖSCHEN HIER EINFUEGEN WENN BEREIT!!! unlink(BilderVerzeichnis . "/Thumbnails/" . $Bild['Thumbnail']); unlink(BilderVerzeichnis . "/Orginale/" . $Bild['Dateiname']); DBD("Bilder", "ID=" . $_GET['ID']); } else { restore_include_path(); include "Content/NotAllowed.html"; } } include "Content/NewImage.php"; $Bilder = DBQ("SELECT * FROM Bilder WHERE BesitzerID='" . $_SESSION['ID'] . "'"); include "Content/ImageList.php"; } else { // Profil anzeigen $Array = DBQ("SELECT * FROM USERS WHERE ID='" . $_SESSION['ID'] . "'"); $Array = $Array[0]; $Show = DBQ("SELECT * FROM Profile WHERE ID='" . $_SESSION['ID'] . "'"); $Show = $Show[0]; $Bilder = DBQ("SELECT * FROM Bilder WHERE BesitzerID='" . $_SESSION['ID'] . "'"); reset($Show); while ($key = key($Show)) { $current = current($Show); if ($current != 1) { $Array[$key] = ""; } next($Show); } extract($Array, EXTR_OVERWRITE); include "Content/Praesentation.php"; } }
function ZapContent($ID, $Type) { global $_SESSION; switch ($Type) { case "Bild": $Bild = DBQ("SELECT * FROM " . DBTabPictures . " WHERE ID='" . $ID . "'"); if (isset($Bild[0]) && $Bild[0]['BesitzerID'] == $_SESSION['ID']) { $Bild = $Bild[0]; $Kommentare = DBD(DBTabComments, "ZuID='" . $ID . "' AND ZuType='Bilder'"); // Kommentare löschen unlink(BilderVerzeichnis . "/Thumbnails/" . $Bild['Thumbnail']); // Thumbnail löschen unlink(BilderVerzeichnis . "/Skaliert/" . $Bild['Skaliert']); // Skalierte Version lösschen unlink(BilderVerzeichnis . "/Orginale/" . $Bild['Dateiname']); // Orginal löschen DBD(DBTabPictures, "ID=" . $ID); // Datenbankeintrag löschen } else { Error("Aktion nicht zugelassen!"); } break; default: return false; } return true; }
function DBD($Table, $ID) { DBQ("DELETE FROM {$Table} WHERE {$ID} "); }
$Values .= ",'" . $Array[0]['Nickname'] . "'"; $Values .= ",'" . date("Y-m-d H:i:s", time()) . "'"; $Values .= ",'" . $Array[0]['Mail'] . "'"; DBIN("USERS", "ID,Passwort,Nickname,Anmeldung,Mail", $Values); DBIN("USERS", "ID,Passwort,Nickname,Anmeldung,Mail", $Values); DBIN("Profile", "ID,Nickname,Name,Vorname,PLZ,Wohnort,Profilbild,Kurzprofil,Kontakt,Galerie,Geburtstag", $NewID . ',1,0,0,0,0,0,0,0,0,0'); DBD("Schluessel", "Wert='" . $_GET['UserKey'] . "'"); include "Content/Willkommen1.html"; } else { include "Content/InternerFehler.html"; } } else { ## Benutzer erstellen Schritt 1 if (isset($_POST['Nickname']) && isset($_POST['Passwort1']) && isset($_POST['Passwort2']) && isset($_POST['Mail'])) { $Array = DBQ("SELECT 'Nickname' FROM USERS WHERE Nickname='" . $_POST['Nickname'] . "'"); $Array2 = DBQ("SELECT 'Nickname' FROM Schluessel WHERE Nickname='" . $_POST['Nickname'] . "'"); $Array = array_merge($Array, $Array2); if (is_array($Array) && count($Array) > 0) { ## Wenn der Nickname schon vergeben ist ... include "Content/UserExists.html"; } else { if (sha1($_POST['Passwort1']) != sha1($_POST['Passwort2'])) { ## Passwort Schreibfehler überprüfen include "Content/PasswortFehler.html"; } elseif (!eregi("^[a-z0-9]+([-_\\.]?[a-z0-9])+@[a-z0-9]+([-_\\.]?[a-z0-9])+\\.[a-z]{2,4}\$", $_POST['Mail'])) { ## Falsche EMail-Adressen filtern include "Content/EMailFehler.html"; } else { $Key = sha1($_POST['Mail'] . time() . $_POST['Nickname']); ## Freischaltschlüssel erstellen $Values = "'" . $_POST['Nickname'] . "'";
<?php $Pics = array_keys($_GET); if (isset($Pics[1])) { $Array = DBQ("SELECT * FROM Bilder WHERE ID='" . $Pics[1] . "'"); $Array = $Array[0]; $Bild = "<img src=\"Bilder/Orginale/" . $Array['Dateiname'] . "\" />"; $Titel = $Array['Titel']; include "Content/Bild.php"; }