1:
|
<?phpinclude("config.inc.php");$verbindung=mysql_connect($dbhost,$dbuser,$dbpasswd); if($_COOKIE['code'] != ""){$code=$_COOKIE["code"];$user1 = "SELECT * FROM mitglieder_login WHERE code='$code'";$user2=mysql_db_query($db,$user1,$verbindung);$zahl = mysql_num_rows($user2);if($zahl!="1"){header("location:index.php?section=login"); die;}else{echo"";}}else{ header("location:index.php?section=login");die;}$aktiv = time();$aktiv2 = date("d.m.y", $aktiv);while($row = mysql_fetch_object($user2)){$user = $row->nick;}$eintrag = "UPDATE mitglieder_online SET wann='$aktiv', wo='bilder' WHERE user='$user'";$eintragen = mysql_db_query($db,$eintrag,$verbindung);?><?php $area = $_POST['area']; $titel = $_POST['titel']; $text = $_POST['text']; $wort1 = $_POST['wort1']; $wort2 = $_POST['wort2']; $wort3 = $_POST['wort3']; $wort4 = $_POST['wort4']; $wort5 = $_POST['wort5'];$neuname = "$area-$user-$titel-$aktiv.jpg";$datei=$_FILES['Datei']['tmp_name'];$move=move_uploaded_file($_FILES['Datei']['tmp_name'], "upload/".$neuname);if($move){function thumb_popup($file, $save, $width, $height, $prop = TRUE) { if(!function_exists("show_popup")) { function show_popup($original, $thumb) { $infos = @getimagesize($original); $w = $infos[0] + 40; $h = $infos[1] + 40; $infos_th = @getimagesize($thumb); } } if(!file_exists($save) || @filemtime($thumb)< @filemtime($file)) { @unlink($save); $infos = @getimagesize($file); if($prop) { $iWidth = $infos[0]; $iHeight = $infos[1]; $iRatioW = $width / $iWidth; $iRatioH = $height / $iHeight; if ($iRatioW < $iRatioH) { $iNewW = $iWidth * $iRatioW; $iNewH = $iHeight * $iRatioW; } else { $iNewW = $iWidth * $iRatioH; $iNewH = $iHeight * $iRatioH; } } else { $iNewW = $width; $iNewH = $height; } if($infos[2] == 2) { // Bild ist vom Typ jpg $imgA = imagecreatefromjpeg($file); $imgB = imagecreatetruecolor($iNewW,$iNewH); imagecopyresampled($imgB, $imgA, 0, 0, 0, 0, $iNewW, $iNewH, $infos[0], $infos[1]); imagejpeg($imgB, $save); return show_popup($file, $save); } elseif($infos[2] == 3) { // Bild ist vom Typ png $imgA = imagecreatefrompng($file); $imgB = imagecreatetruecolor($iNewW, $iNewH); imagecopyresampled($imgB, $imgA, 0, 0, 0, 0, $iNewW, $iNewH, $infos[0], $infos[1]); imagepng($imgB, $save); return show_popup($file, $save); } else { return FALSE; } } else { return show_popup($file, $save); }}$from = "upload/$neuname";$to1 = "bilder/$neuname";$to2 = "bilder/klein/$neuname";echo thumb_popup($from, $to1, $to2, 800, 800, 100, 100, TRUE);$eintrag = "INSERT INTO galerie_bilder (id_area, url, titel, text, nick, wort1, wort2, wort3, wort4, wort5) VALUES ('$area', '$neuname', '$titel', '$text', '$user', '$wort1', '$wort2', '$wort3', '$wort4', '$wort5')";$eintragen = mysql_db_query($db,$eintrag,$verbindung);echo "<table border=0 cellpadding=4 cellspacing=1 width='200' id='table' align='center'> <tr class='tabletitle'> <td>Bild hochgeladen</b></td> </tr> <tr class='tablea'> <td><img src='bilder/$neuname' height='100'></td> </tr> <tr class='tablea'> <td><a href="?section=bilder">Galerie</a></td> </tr></table></form> ";}else{echo'Der Upload war leider <u>nicht</u> erfogreich!';}?> |