diff --git a/README.md b/README.md index fd27d4f..8a9fadc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SGD Projekt -### Version 1 +### Version 2 hier wird das SGD Projekt hochgeladen und verwaltet \ No newline at end of file diff --git a/projekt_v2/bildspeichern.php b/projekt_v2/bildspeichern.php new file mode 100644 index 0000000..8050d12 --- /dev/null +++ b/projekt_v2/bildspeichern.php @@ -0,0 +1,85 @@ + + + + + + Bild speichern + + + + 100000) || + (filesize($_FILES['datei']['tmp_name']) + > 100000)) { + echo "Die Dateigröβe ist auf " . + "100.000 Byte beschränkt.
" . + "Verkleinern Sie das Bild bitte mit " . + "einem geeigneten Grafikprogramm.
"; + } + else if (($_FILES['datei']['type'] != "image/png") + && ($_FILES['datei']['type'] != "image/pjpeg") + && ($_FILES['datei']['type'] != "image/jpeg")) { + echo "Es dürfen nur Bilddateien vom Typ" . + " PNG oder JPEG hochgeladen werden.
"; + } else if (!empty($_FILES['datei']['name'])) { + $dateiname = $_SESSION["name"] . time(); + if ($_FILES['datei']['type'] != "image/png") { + $dateiname .= ".jpg"; + } else { + $dateiname .= ".png"; + } + $_SESSION["dateiname"] = $dateiname; + if (move_uploaded_file( + $_FILES['datei']['tmp_name'], + 'images/' . $dateiname)) { + @include ("db.inc.php"); + + if ($stmt = $pdo -> prepare( + "SELECT userid, id_mitglied FROM mitglieder")) { + $stmt -> execute(); + while ($row = $stmt -> fetch()) { + if ($_SESSION["name"] == $row["userid"]) { + $_SESSION["id_mitglied"] = $row["id_mitglied"]; + break; + } + } + + } + if ($stmt = $pdo -> prepare( + "INSERT INTO fragen" . + " (bild, zusatzinfos, id_mitglied) " . + " VALUES (:bild, :zusatzinfos, :userid)")) { + if ($stmt -> execute( + array( + ':bild' => $_SESSION["dateiname"], + ':zusatzinfos' => $_POST["zusatzinfos"], + ':userid' => $_SESSION["id_mitglied"] + ) + + )) { + $dat = "upload_ok.php"; + } else { + $dat = "upload_fehler.php"; + } + header("Location: $dat"); + } + } + } + echo "
Zur Homepage"; + } + } +} +$obj = new Bildspeichern(); +$obj -> datup(); +?> + + \ No newline at end of file diff --git a/projekt_v2/captchagenerieren.php b/projekt_v2/captchagenerieren.php new file mode 100644 index 0000000..3a5271a --- /dev/null +++ b/projekt_v2/captchagenerieren.php @@ -0,0 +1,44 @@ + diff --git a/projekt_v2/fonts/Anorexia.ttf b/projekt_v2/fonts/Anorexia.ttf new file mode 100644 index 0000000..453eeb0 Binary files /dev/null and b/projekt_v2/fonts/Anorexia.ttf differ diff --git a/projekt_v2/fonts/arial.ttf b/projekt_v2/fonts/arial.ttf new file mode 100644 index 0000000..886789b Binary files /dev/null and b/projekt_v2/fonts/arial.ttf differ diff --git a/projekt_v2/fonts/tahoma.ttf b/projekt_v2/fonts/tahoma.ttf new file mode 100644 index 0000000..3146f53 Binary files /dev/null and b/projekt_v2/fonts/tahoma.ttf differ diff --git a/projekt_v2/index.php b/projekt_v2/index.php index d5c40ba..9465269 100644 --- a/projekt_v2/index.php +++ b/projekt_v2/index.php @@ -29,12 +29,12 @@ class MeineAusnahme extends Exception{}; try { if (isset($_SESSION["login"]) && ($_SESSION["login"] == "true")) { - if (@include("navmitglieder.php"));{ + if (!@include("navmitglieder.php")){ throw new MeineAusnahme(); } } else { - if (@include("nav.php"));{ + if (!@include("nav.php")){ throw new MeineAusnahme(); } } @@ -43,7 +43,7 @@ class MeineAusnahme extends Exception{}; die("

Image2Food - Sag mir was ich daraus kochen kann

Das soziale, multimediale Netzwerk für Kochideen

Leider gibt es ein Problem mit der Webseite. - Wir arbeiten daran mit Hochdruck. Besuchen Sie uns in kürze wieder enu

"); + Wir arbeiten daran mit Hochdruck. Besuchen Sie uns in kürze wieder erneut

"); } ?> @@ -59,6 +59,8 @@ class MeineAusnahme extends Exception{}; function besucher() { if (isset($_SESSION["login"]) && ($_SESSION["login"] == "true")){ echo "

Mitgliederbereich


Sie sind Angemeldet
"; + @include("uploadformular.inc.php"); + echo "Vorschau"; } elseif (isset($_SESSION["login"]) && ($_SESSION["login"] == "false")){ echo "
Sie können sich jetzt zum Mitgliederbereich anmelden.
"; } elseif (isset($_COOKIE['Image2Food'])){ diff --git a/projekt_v2/lib/css/stil.css b/projekt_v2/lib/css/stil.css new file mode 100644 index 0000000..50b8724 --- /dev/null +++ b/projekt_v2/lib/css/stil.css @@ -0,0 +1,337 @@ +// Elemente und Universalselektor +* { + margin: 0; + padding: 0; + border: 0; + outline: 0; + vertical-align: baseline; + background: transparent; +} +body { + background: #145D05; + color: white; +} +h1, h2, h3, h4, h5 { + display: block; + text-align: center; + margin: 15px; + padding: 5px; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +a { + color: white; + background: #6C0610; + text-decoration: none; + display: inline-block; + min-width: 85px; + height: 20px; + text-align: center; + margin: 5px; + padding: 5px; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +form { + background: white; + color: #145D05; + margin: 5px; + padding: 10px; + border-style: inset; + border-width: 3pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 5px 5px #888; + -webkit-box-shadow: 5px 5px 5px #888; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +textarea { + margin: 10px; + padding: 10px; + border-style: solid; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 5px 5px #888; + -webkit-box-shadow: 5px 5px 5px #888; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +input { + margin: 5px; + padding: 2px; + border-style: solid; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 5px 5px #888; + -webkit-box-shadow: 5px 5px 5px #888; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +// Klassen +.hlink { + + text-decoration: none; + display: inline-block; + height: 35px; + text-align: center; + margin: 5px; + padding: 5px; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +.spezielleUeber { + background: white; + color: #145D05; + font-size: 110%; +} +.reg_label { + display: inline-block; + width: 200px; +} +a:hover { + color: #145D05; + background: white; +} +.hlink:hover { + color: white; + background: #6C0610; +} +.thumb { + width: 120px; + height: 160px; + display: inline-block; + margin: 10px; + padding: 10px; + overflow: hidden; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +.fehlermeldung { + color: #6C0610; +} + +.captcha { + width: 200px; + margin: 10px; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +.detailbildcontainer { + height: 250px; + width: 250px; + margin: 3px; +} +.detailbild { + max-height: 320px; + max-width: 320px; + padding: 3px; +} +.vorschauinfos { + color: #145D05; + background: white; + margin: 5px; + padding: 15px; + width: 650px; + max-height: 150px; + overflow: scroll; + border-style: inline; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} +.hlink_klein { + + text-decoration: none; + height: 18px; + width: 110px; + text-align: center; + margin: 2px; + padding: 2px; + font-size: 12px; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; +} +.hlink_nix { + color: white; + background: #145D05; + text-decoration: none; + display: inline-block; + min-width: 85px; + height: auto; + text-align: center; + margin: 5px; + padding: 5px; + text-decoration: none; + text-align: left; + margin: 2px; + padding: 2px; + font-size: 0px; + border-style: none; + border-width: 0pt; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-radius: 0px; + -moz-box-shadow: 0px 0px 0px #888; + -webkit-box-shadow: 0px 0px 0px #888; + box-shadow: 0px 0px 0px #888; +} +.thumb_bild { + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + border-style: dotted; + border-width: 1pt; + opacity: 0.9; + color: #888; +} +.thumb_bild:hover { + border-style: groove; + color: white; + opacity: 1; + -moz-box-shadow: 2px 2px 3px #888; + -webkit-box-shadow: 2px 2px 3px #888; + box-shadow: 2px 2px 3px #888; +} +.rezepttab { + + width: 950px; + margin: 5px; +} + + +// IDs +#detailbereich { + height: 550px; + width: 98%; + margin: auto; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; + overflow-x: scroll; +} +#vorschauber { + height: 300px; + width: 98%; + margin: auto; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 2px 3px #888; + -webkit-box-shadow: 5px 2px 3px #888; + box-shadow: 5px 2px 3px #888; + overflow-x: scroll; +} +#nav { + width: 1000px; + height: 40px; + margin: auto; + padding: 10px; +} +#content { + width: 1000px; + margin: auto; + padding: 20px; + border-style: groove; + border-width: 1pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +#indextext { + text-align: justify; + background: white; + color: #145D05; + margin: 5px; + padding: 10px; + border-style: inset; + border-width: 3pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 5px 5px #888; + -webkit-box-shadow: 5px 5px 5px #888; + box-shadow: 5px 5px 5px #888; +} +#meldung { + position: relative; + top: -200px; + margin: 0 auto; + opacity: 0.7; + visibility: hidden; + background: white; + color: #6C0610; + width: 450px; + min-height: 40px; + padding: 20px; + border-style: inset; + border-width: 3pt; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 5px 5px 5px #888; + -webkit-box-shadow: 5px 5px 5px #888; + box-shadow: 5px 5px 5px #888; +} + +#rezeptformular { + width: 950px; + margin: 3px; +} +#detailinfo { + vertical-align: top; + padding: 5px; + margin: 20px; +} + diff --git a/projekt_v2/login.inc.php b/projekt_v2/login.inc.php index a61fbc4..3a36afe 100644 --- a/projekt_v2/login.inc.php +++ b/projekt_v2/login.inc.php @@ -9,5 +9,10 @@
+ Captcha
+ + * + +
\ No newline at end of file diff --git a/projekt_v2/login.php b/projekt_v2/login.php index 88f5ab8..a545b15 100644 --- a/projekt_v2/login.php +++ b/projekt_v2/login.php @@ -58,6 +58,7 @@ session_start(); $p = new Plausi(); $anmelden += $p->nutzerdatentest($_POST['userid']); $anmelden += $p->nutzerdatentest($_POST['pw']); + $anmelden += $p->captchatest($_POST['captcha']); // Testausgaben für den derzeitigen Stand des Projekts echo "Die Eingaben:
"; diff --git a/projekt_v2/plausi.inc.php b/projekt_v2/plausi.inc.php index 7999206..3932dd0 100644 --- a/projekt_v2/plausi.inc.php +++ b/projekt_v2/plausi.inc.php @@ -60,5 +60,12 @@ class Plausi { } } + + public function captchatest($wert) { + $fehler = 0; + if ($_SESSION['captchacode'] != $wert) { + return ++$fehler; + } + } } ?> \ No newline at end of file diff --git a/projekt_v2/uploadformular.inc.php b/projekt_v2/uploadformular.inc.php new file mode 100644 index 0000000..e1b9e54 --- /dev/null +++ b/projekt_v2/uploadformular.inc.php @@ -0,0 +1,8 @@ +

Wählen Sie eine Datei zum Upload aus

+
+
+ +
+ +
\ No newline at end of file diff --git a/projekt_v2/vorschaubilder.php b/projekt_v2/vorschaubilder.php new file mode 100644 index 0000000..acca203 --- /dev/null +++ b/projekt_v2/vorschaubilder.php @@ -0,0 +1,74 @@ + + + + Vorschau + + + +

Vorschau

+ "; + + } + } + closedir($verzeichnis); + } + + } + + $obj = new Thumb(); + + $obj -> thumbnail_erstellen(); + $obj -> thumbnail_anzeigen(); + ?> + + \ No newline at end of file