Falsche übergabe in der Galerie?!

Begonnen von otti_mania, 16. Mai 2007, 19:23:30

Vorheriges Thema - Nächstes Thema

otti_mania

wenn du ein Zoomfile hasst und dann unten auf die Buttons weiter oder daneben auf den zum letzten Bild klickst bekommst du volgende fehler bei mir:
Über dem Design der kopf.php:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web6/html/ottimania/mod/galerie/bild.php on line 27
Auszug aus der bild.php


\".trim($value).\"\\n\";
   }
   return $sizeopt;
}
}
if (!function_exists(\'PIUpdatePfad\')) {
function PIUpdatePfad($catid) {
   global $serverid, $tab_picat, $tab_pibild;
   $pfad= addslashes(PICatPfad($catid));
   @mysql_query(\"Update $tab_picat set pfad =\'$pfad\' Where id = \'$catid\'\",$serverid);
   @mysql_query(\"Update $tab_pibild set pfad =\'$pfad\' Where catid = \'$catid\'\",$serverid);
}
}
if (!function_exists(\'PIRotateImage\')) {
function PIRotateImage($source,$grad=90) {
   global $serverid, $tab_picat, $tab_pibild, $pset_img;
$imgsize = GetImageSize($source);
   switch($imgsize[2]):
       case 1 : $im = ImageCreateFromGIF($source);
      break;
       case 2 : $im = ImageCreateFromJPEG($source);
      break;
       case 3 : $im = ImageCreateFromPNG($source);
      break;
endswitch;
   $im=ImageRotate($im,$grad,0);
unlink($source);
   ImageJPEG($im,$source,$pset_img[\'imgqual\']);
}
}
if (!function_exists(\'PICatPfad\')) {
function PICatPfad($catid) {
   global $serverid, $tab_picat;
   $pfad=\"\";
   while ( $catid != 0) {
       $sqlbefehl= \"Select subcat,name,id FROM $tab_picat where id=\'$catid\'\";
       $getsubcat  = mysql_query($sqlbefehl, $serverid);
       $subcat = mysql_fetch_array ($getsubcat);
       $catid=$subcat[subcat];
       $pfad= \" / $subcat[name]\".$pfad;
   }
   $pfad= \"Übersicht\".$pfad;
   return $pfad;
}
}
function AccessGalerie($groupid) {
   global $serverid, $tab_group, $tab_usergrp, $tab_user;
   global $user;
   if ( $user[\'id\'] == \"\" ) {
       return 0; }
   else {
       //Vergleicht das die angemeldete UserID auch Rechte hat
       $sqlbefehl = \"Select u.id From $tab_user u
                     Left Join $tab_usergrp ug On ug.userid=u.id
                     Left Join $tab_group g On g.id=ug.grpid
                     Where g.id = \'$groupid\'
                       And u.id = \'$user[id]\'\";
       $getaccess  = mysql_query($sqlbefehl, $serverid);
       echo mysql_error();
       $access = mysql_fetch_array ($getaccess);
   }
   if ( $access[\'id\'] == $user[\'id\'] ) {
       return 1;
   }
   else {
       return 0;
   }
}
 
if (!function_exists(\'formatistring\')) {
function formatistring($post) {
   $post= stripslashes($post);
   //$post= htmlspecialchars($post);
   $post= nl2br($post);
   return $post;
}
}
if (!function_exists(\'CreateImage\')) {
function CreateImage($size,$source,$dest,$border=0) {
  $sourcedate = 0;
  $destdate = 0;
  global $pigdversion, $pagetitle,$piwzfont,$piwzsize,$piwztext;
  global $piwzlogo,$piwztran;
  global $pdir_cache,$pset_img;
  if (file_exists($dest)) {
     clearstatcache();
     $sourceinfo = stat($source);
     $destinfo = stat($dest);
     $sourcedate = $sourceinfo[10];
     $destdate = $destinfo[10];
  }
  if (!file_exists(\"$dest\") or ($sourcedate > $destdate)) {
     $imgsize = GetImageSize($source);
     $width = $imgsize[0];
     $height = $imgsize[1];
  //Grösse generieren
  $new_width = $size;
     $new_height = ceil(($size * $height) / $width );
//Wenn es höher wird
     if( $new_height > $size ) {
        //4:3 Faktor beachten
         $new_height = $size * 0.75;
         $new_width  = ceil( ( ($size * $width) / $height) * 0.75 );
        }
        switch($imgsize[2]):
         case 1 : $im = ImageCreateFromGIF($source);
           break;
         case 2 : $im = ImageCreateFromJPEG($source);
           break;
         case 3 : $im = ImageCreateFromPNG($source);
           break;
        endswitch;
        if ($pigdversion == 2) {
          $new_im = imagecreatetruecolor($new_width,$new_height);
           imagecopyresampled($new_im,$im,0,0,0,0,$new_width,$new_height,ImageSX($im),ImageSY($im));
        }
        else {
            $new_im = ImageCreate($new_width,$new_height);
            ImageCopyResized($new_im,$im,0,0,0,0,$new_width,$new_height,ImageSX($im),ImageSY($im));
        }
        unset($im);
     //Interlaced = 1
     imageinterlace($new_im,0);
        //Text einfügen
        if ( $piwztext == 1 ) {
            $white = imagecolorallocate ($new_im, 255, 255, 255);
            $pos = imagettfbbox ($piwzsize,0,$piwzfont,$pagetitle);
            if ( $pos[2]  199 ) {
            $tempdest=$pdir_cache.\"/tmpimg.tmp\";
            ImageJPEG($new_im,$tempdest,$pset_img[\'imgqual\']);
     //ImageJPEG($new_im,$tempdest,$piqualitaet);
     unset($new_im);
            PImergePix($tempdest,$piwzlogo,$dest,3,$piwztran);
            @unlink($tempdest);
        } else {
            ImageJPEG($new_im,$dest,$pset_img[\'imgqual\']);
     //ImageJPEG($new_im,$dest,$piqualitaet);
     unset($new_im);
        }
     }
}
}
if (!function_exists(formatikom)) {
function formatikom($post) {
   $post= stripslashes($post);
   $post= htmlspecialchars($post);
   $post= nl2br($post);
   //Smileys:
   //str_replace(\"altes-zeichen\",\"neues-zeichen\",\"zeichenkette\");
   $post = str_replace(\":-)\",\"\",$post);
   $post = str_replace(\";-)\",\"\",$post);
   $post = str_replace(\":O\",\"\",$post);
   $post = str_replace(\";-(\",\"\",$post);
   $post = str_replace(\":D\",\"\",$post);
   $post = str_replace(\"8-)\",\"\",$post);
   $post = str_replace(\":-O\",\"\",$post);
   $post = str_replace(\":-(\",\"\",$post);
   $post = str_replace(\"(?)\",\"\",$post);
   $post = str_replace(\"(!)\",\"\",$post);
   return $post;
}
}
if (!function_exists(PImergePix)) {
// $sourcefile = Filename of the picture into that $insertfile will be inserted.
// $insertfile = Filename of the picture that is to be inserted into $sourcefile.
// $targetfile = Filename of the modified picture.
// $transition = Intensity of the transition (in percent)
// $pos = Position where $insertfile will be inserted in $sourcefile
// 0 = middle
// 1 = top left
// 2 = top right
// 3 = bottom right
// 4 = bottom left
// 5 = top middle
// 6 = middle right
// 7 = bottom middle
// 8 = middle left
//
//
// If you need to merge 2 png\'s (or presumably 2 gifs) with different color palettes,
// I have found this is the function to use. Just set pct to 99, and you are rocking.
// With pct set to 100, or imagecopy for that matter, the palette seems to go wonky.
// (It probably just uses the palette of the source image. but don\'t quote me on that).
// handling
//  $sourcefile = \"$upload_dir/\".$bilddaten[\'bild_name\'];
//  $insertfile = \"./pictures/logo.png\";
//  $targetfile = \"./pictures/[bc]\".$bilddaten[\'user\'].\"-\".$_GET[\'bild\'].\".jpg\";
//  $pos        = 4;
//  $transition = 98;
//  //Bild erstellen
//  mergePix($sourcefile,$insertfile, $targetfile, $pos,$transition);
function PImergePix($sourcefile,$insertfile, $targetfile, $pos,$transition){
   global $pset_img;
   //erstmal prüfen, was für files das alles sind
   $file2insert    = GetImageSize($insertfile);
   $file2source    = GetImageSize($sourcefile);
   //[2] = ein Flag je nach Grafik-Typ (1 = GIF, 2 = JPG, 3 = PNG, SWF = 4)
   //wenn source ein GIF ist
   if($file2insert[2] == 1){
       $insertfile_id = imageCreateFromGIF($insertfile);
   }
   //wenn source ein JPG ist
   elseif($file2insert[2] == 2){
       $insertfile_id = imageCreateFromJPEG($insertfile);
   }
   //wenn source ein PNG ist
   elseif($file2insert[2] == 3){
       $insertfile_id = imageCreateFromPNG($insertfile);
   }
   //wenn insert ein GIF ist
   if($file2source[2] == 1){
       $sourcefile_id = imageCreateFromGIF($sourcefile);
   }
   //wenn insert ein JPG ist
   elseif($file2source[2] == 2){
       $sourcefile_id = imageCreateFromJPEG($sourcefile);
   }
   //wenn insert ein PNG ist
   elseif($file2source[2] == 3){
       $sourcefile_id = imageCreateFromPNG($sourcefile);
   }
 
   //Get the resource id´s of the pictures
   //$insertfile_id = imageCreateFromPNG($insertfile);
   //$sourcefile_id = imageCreateFromJPEG($sourcefile);
   //Get the sizes of both pix
   $sourcefile_width=imageSX($sourcefile_id);
   $sourcefile_height=imageSY($sourcefile_id);
   $insertfile_width=imageSX($insertfile_id);
   $insertfile_height=imageSY($insertfile_id);
   //middle
   if( $pos == 0 ){
   $dest_x = ( $sourcefile_width / 2 ) - ( $insertfile_width / 2 );
   $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 );
   }
   //top left
   if( $pos == 1 ){
   $dest_x = 0;
   $dest_y = 0;
   }
   //top right
   if( $pos == 2 ){
   $dest_x = $sourcefile_width - $insertfile_width;
   $dest_y = 0;
   }
   //bottom right
   if( $pos == 3 ){
   $dest_x = $sourcefile_width - $insertfile_width-3;
   $dest_y = $sourcefile_height - $insertfile_height-3;
   }
   //bottom left
   if( $pos == 4 ){
   $dest_x = 0;
   $dest_y = $sourcefile_height - $insertfile_height;
   }
   //top middle
   if( $pos == 5 ){
   $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 );
   $dest_y = 0;
   }
   //middle right
   if( $pos == 6 ){
   $dest_x = $sourcefile_width - $insertfile_width;
   $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 );
   }
   //bottom middle
   if( $pos == 7 ){
   $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 );
   $dest_y = $sourcefile_height - $insertfile_height;
   }
   //middle left
   if( $pos == 8 ){
   $dest_x = 0;
   $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 );
   }
   //The main thing : merge the two pix
   imageCopyMerge($sourcefile_id, $insertfile_id,$dest_x,$dest_y,0,0,$insertfile_width,$insertfile_height,$transition);
   //Create a jpeg out of the modified picture
   imagejpeg ($sourcefile_id,\"$targetfile\",$pset_img[\'imgqual\']);
}
}
function PIShowThumb ($id,$size=100) {
global $pimg_dir_org, $pimg_dir_thumb,$pimg_url_thumb,$serverid,$tab_pibild;
   $sql = \"Select * From $tab_pibild Where id = \'$id\'\";
   $bild = mysql_fetch_array(mysql_query($sql,$serverid));
$sourcefile = $pimg_dir_org . \"/\" . $bild[\'id\'] . \".\" . $bild[\'filetyp\'];
   $thumbfile = $pimg_dir_thumb . \"/\" . $bild[\'id\'] . \"_$size.jpg\";
   if (!file_exists(\"$thumbfile\")) {
       @CreateImage($size, $sourcefile, $thumbfile);
   }
   $thumbfile = $pimg_url_thumb . \"/\" . $bild[id] . \"_$size.jpg\";
   echo \"\";
}
?>

 
 
vieleicht weis ja hierzu wer ne lösung?
Gruß Otti

Gruß Otti




#########WICHTIG###########


if (IQ > Raum - °C) echo $post


   else exit ();


##########################




http://www.ottimania.de\" rel=\"external nofollow\">http://www.ottimania.de/banner1.gif\" alt=\"banner1.gif\">


Powie

diene Bilderdatenbank ist korrupt...... der Dateityp ist nicht mehr drin.

otti_mania

irgendwie weglaube ich das falsch verstanden zu haben:
der bild typ wird doch in der pi_bild in spalte 5 filetyp angegeben oder nicht?
dort steht aber überall ein jpg drinnen.
wemm ich mir die Quelle des dann natürlich auch nicht angezeigten Bildes ansehe scheint mir eher was zu viel übergeben zu werden:
http://ottimania.de/cache/galerie/zoom/56_.jpg\" rel=\"external nofollow\">http://ottimania.de/cache/galerie/zoom/56_.jpg
und es ist immer das selbe bild egal bei welchem Bild ich auf weiter klicke was da unten nicht angezeigt wird.
gruß Otti

Gruß Otti




#########WICHTIG###########


if (IQ > Raum - °C) echo $post


   else exit ();


##########################




http://www.ottimania.de\" rel=\"external nofollow\">http://www.ottimania.de/banner1.gif\" alt=\"banner1.gif\">


otti_mania

Ehm Powie wir haben das Problem gelöst!
Es lag übrigens nicht an einer angeblich KORUPTEN Bilderdatenbank!
K00ni hat zur Lösung des Problems einen Thread eröffnet im Bug Board:
http://www.powie.de/cms/forum/showthread.php?id=22533&from=1179359342#156029\" rel=\"external nofollow\">http://www.powie.de/cms/forum/showthread.php?id=22533&from=1179359342#156029
[ot]
Ich versichere von Eidesstadt das meine Bilderdatenbank nie auch nur einen Cent oder Pfennig angenommen hat!
Wir weisen solche unterstellungen aufs schärfste zurück!
LOL  [/uploads/emoticons/icon_e_surprised.gif.a005678239f11b45b64b526b2c82e9a1.gif\" alt=\":o\" />]   /uploads/emoticons/icon_e_wink.gif.c059000ae48ff64afa53be0962c021f2.gif\" alt=\":wink:\" />
[/ot]

Gruß Otti




#########WICHTIG###########


if (IQ > Raum - °C) echo $post


   else exit ();


##########################




http://www.ottimania.de\" rel=\"external nofollow\">http://www.ottimania.de/banner1.gif\" alt=\"banner1.gif\">


all your base are belong to us / Discord