[PHP & MySQL] Thubnail problem...

Black Katrin
Also ich hab n Code wo verkleinert (BilderZunge raus ) und eignedlich dachte ich man kann es doppelt verkleinern lassen... nur ich hab das nie gebraucht, bis heute... dem entsprechend bin ich mir nimmer 100% sicher wies ging, und so wie ich dachte das es geht, geht es eben nicht!

Code:
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
$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$imgA0000$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$imgA0000$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";
echo thumb_popup($from$to1800800TRUE);


Ich dachte es war einfach n $to2 machen und das zweite von den 800 bezieht sich dann darauf.. falsch gedacht so gehts nit... weiss es zufäligerweise jemand?
Black Katrin
das es eben nicht funktioniert?Augenzwinkern kommt ne fehler meldung das in Zeile 41, 42, 43 ein Fehler wäre.
Black Katrin
Edit: doch nit-.- war ja klar...
moment eben

so also... 1. stand es auch schon voher da das es nit klappen will schlaumeier-.-
2. kA was du mit E_ALL meinst, bin keine gelernte PHP Kennerin

und zur fehler meldung:

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/www/web271/html/page/mitglieder/bilder_neu2.php on line 69

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/www/web271/html/page/mitglieder/bilder_neu2.php on line 71

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/www/web271/html/page/mitglieder/bilder_neu2.php on line 72
Bild hochgeladen

und nochmal der genaue Code:
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
<?php
include("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$imgA0000$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$imgA0000$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$to2800800100100TRUE);


$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!';}

?>


Edit zum letzten mal jetzt aber...
miss_trinity
php:
1:
echo thumb_popup($from$to1$to2800800100100TRUE);

Das funktioniert leider nicht. Du siehst ja oben den funktionenaufruf:
php:
1:
function thumb_popup($file$save$width$height$prop TRUE) {


Da haste genau 5 Parameter zur übergabe, dann dürfen auch nur 5 übergeben werden und nicht (**zähl**) 8 geschockt

Da ich blond bin **sieheavatar** versteh ich irgendwie (noch) nicht was du doppelt verkleinern möchtest...

Aber wenn du die Funktion einfach zweimal hintereinader aufrufst dann stimmts vom Code her
php:
1:
2:
echo thumb_popup($from$to1800800TRUE);
echo thumb_popup($from$to2100100TRUE);
Black Katrin
ich versuchs malAugenzwinkern
der code selber is mir ne nummer zu hoch... arrays und ähnliches will ich einfach nit verstehnZunge raus aber naja... hofentlich klappts so

Edit: geht danke!smile