hallo zusammen,
ich habe ein galerie-script das aut. thumbs erstellt.
nun möchte ich gerne die thumbnails schwarzweiss haben (graustufen ) und wenn man auf das bild klickt, geht das popup auf mit den normalen farben.
kann mir jemand helfen?
hier die codes:
von index.php
// \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
//
// VARIABLES TO ADAPT
//
// \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
// absolute path to the directory where the graphics are stored
$abs\_directory = "/home/\*\*\*\*\*\*\*";
// webpath of the directory where the graphics are stored
$web\_directory = "http://www.\*\*\*\*\*\*\*\*";
// which graphics to handle (selected by extension, only files supported by gdlib are supported)
$graphicfiles = array("jpg", "png", "JPG");
// table layout, you may adapt it to your wishes, e.g. change the table-size, background-color, ...
$table\_tag ="
„;
$table_trtag =“";
$table_tdtag ="";
$table_columns = 4;
// position of the picture popup-window (from upper left screen corner)
$xpos = 100;
$ypos = 100;
// ***********************************************************************************************
//
// NO MORE CHANGES NEEDED BELOW THIS POINT
//
// ***********************************************************************************************
$files = array();
//
// function to select only specified graphics
//
function check_graphics($file, $graphicfiles)
{ $pos = strpos($file, „.“);
if ($pos)
{ $fileparts = explode(".", $file, 2);
foreach($graphicfiles as $value)
{ if ($value == $fileparts[1])
{ $filetype = true;
break;
}
else $filetype= false;
}
}
else $filetype = false;
if ($filetype) return(true);
else return(false);
} // end func
//
// function to read all graphic-files in the array $files
//
function read_files($abs_directory)
{ global $graphicfiles, $files;
$handle=opendir($abs_directory);
while ($file = readdir ($handle))
{ if ($file != „.“ && $file != „…“)
{ if (check_graphics($file, $graphicfiles)) $files[] = $file;
}
}
closedir($handle);
} // end func
//
// function to create table with thumbnails
//
function create_table($files)
{ global $xpos, $ypos, $abs_directory, $web_directory, $table_tag, $table_trtag, $table_tdtag, $table_columns;
$r ="\n";
$howmanyfiles = sizeof($files);
$filecount =0;
$table_rows = $howmanyfiles / $table_columns;
$rest = $howmanyfiles % $table_columns;
if ($rest != 0) $table_rows +=1;
echo $table_tag.$r;
for ($rowcount=1; $rowcount \n";
if ($filecount \n";
echo " \n";
echo " „;
$filecount++;
}
else echo“ „;
echo „“.$r;
echo " „.““.$r;
}
echo „“.$r;
}
echo „“.$r;
}
// end func
read_files($abs_directory);
create_table($files);
?>
hier die thumnail.php
header ("Content-type: image/jpeg");
$margin = 120;
$im = imagecreatefromjpeg($image);
$width = imagesx($im);
$height = imagesy($im);
$twidth = $margin - 20;
$theight = ($twidth / $width) \* $height;
$im2 = imagecreatetruecolor($twidth,$theight);
imagecopyresized($im2,$im,0,0,0,0,$twidth,$theight,$width,$height);
imagejpeg($im2);
imagedestroy($im);
imagedestroy($im2);
?\>