open($file); //get some infos about the original $origwidth = imagesx($im); $origheight = imagesy($im); //calculation for the new data if($tnx == "dynamic") {$tnx = $origwidth/($origheight/$tny);} if($tny == "dynamic") {$tny = $origheight/($origwidth/$tnx);} //lets make a thumb and resize $im_new = imageCreateTrueColor($tnx, $tny); imagecopyresized($im_new,$im,"0","0","0","0",$tnx,$tny,$origwidth,$origheight); header("Content-type: image/jpg"); Imagejpeg($im_new); } } //need this function to build the general xhtmloutput function page_start($site, $count_pics, $last, $i, $prev, $next, $ppp, $popup_w, $popup_h) { include('http://www.party-san.de/openair/overall_header.php'); echo " \n
$site[pagetitle]
"; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////// echo "
$site[author]
Images: ".($last+1)."...".($i)."/".$count_pics."Page No. ".($last/$ppp+1)." $prev | $next
"; } //need this function to build the general xhtmloutput function page_end($count_pics, $ppp, $prev, $next, $upload) { $pagecount =ceil($count_pics / $ppp); for($i=1;$i<=$pagecount;$i++) { $lastpic = ($ppp*($i-1)); $pages .= "$i|"; } if($upload["show"]=="true") {$upload_show = "upload";} else{$upload_show = " ";} echo "
$upload_showJump to page: $pages | $prev | $next
"; include('http://www.party-san.de/openair/overall_footer.php'); } //collect all images in this directory function read_dir() { $path = dirname(_PATH_TRANSLATED); $cdir = dir($path); while($entry = $cdir->read()) { if((!is_dir($entry)) AND ((strrchr(strtolower($entry),".") == ".jpg") OR (strrchr(strtolower($entry),".") == ".jpeg") OR (strrchr(strtolower($entry),".") == ".png"))) { $images[] = urlencode($entry); } } return $images; } //some setups for the popup $popup_w = $image["width"]; $popup_h = $image["height"]; //Calculation for the right resolution if(!$thumb["width"]){$thumb["width"] = "dynamic";} if(!$thumb["height"]){$thumb["height"] = "dynamic";} if(!$image["width"]){$image["width"] = "dynamic"; $popup_w = $image["height"];} if(!$image["height"]){$image["height"] = "dynamic"; $popup_h = $image["width"];} //OPERATEMODES switch($_GET[mode]) { case thumb: $image_cl = new image_proc; $image_cl->resize(urldecode($_GET[selected]), $thumb["width"], $thumb["height"]); break; case image: $image_cl = new image_proc; $image_cl->resize(urldecode($_GET[selected]), $image["width"], $image["height"]); break; case upload: if($upload["enable"]=="true") { switch($_GET[step]) { //Building the uploadform case 1: if($_POST[upld_pwd] == $upload["pwd"]) { print page_start($site, $count_pics, $last, $i, $prev, $next, $ppp, $popup_w, $popup_h); echo "

Upload

"; if(!$_POST[count_upld] OR ($_POST[count_upld]<1)){$_POST[count_upld] = 5;} for($i=1;$i<=$_POST[count_upld];$i++) { echo "\n"; } echo "
Please be sure, that you have set the directory to mode 777 befor you try to upload something.
You can do this with the most FTP-client by selecting the directory where PicPick is located and the run chmod form the contextmenü.
Picture $i
 
\n"; print page_end($count_pics, $ppp, $prev, $next, $upload); } else{DIE("Bad password! Go back!");} break; //Upload! case 2: if($_POST[upld_pwd] == $upload["pwd"]) { print page_start($site, $count_pics, $last, $i, $prev, $next, $ppp, $popup_w, $popup_h); echo "

Upload

\n"; for($i=1;$i<=$_POST[count_upld];$i++) { if(!empty($HTTP_POST_FILES["image".$i][name]) AND (($HTTP_POST_FILES["image".$i][type] == "image/png") OR ($HTTP_POST_FILES["image".$i][type] == "image/jpeg"))) { $dir = "."; if(@copy($HTTP_POST_FILES["image".$i][tmp_name],"$dir/".$HTTP_POST_FILES["image".$i][name])) { echo "Picture: ".$HTTP_POST_FILES["image".$i][name]; echo "
"; echo "Filesize: ".$HTTP_POST_FILES["image".$i][size]." Byte
"; } else { echo "I got an error with ".$HTTP_POST_FILES["image".$i][name]."
";} } } echo "
Back to the gallery | Upload more\n"; print page_end($count_pics, $ppp, $prev, $next, $upload); } else{DIE("Bad password! Go back!");} break; //Asking how many images should be uploaded and for the password default: print page_start($site, $count_pics, $last, $i, $prev, $next, $ppp, $popup_w, $popup_h); echo "

Upload

How many pictures do you want to upload:Password:
\n"; print page_end($count_pics, $ppp, $prev, $next, $upload); } break; } break; default: if(!$_GET[last]){$i=0;} else { $i=$_GET[last]; $last = $_GET[last]; } $images = read_dir(); $count_pics = count($images); while(($i  \n"; $i++; } //previous, next page... if(($last-$ppp) < 0){$last_prev = 0;} else{$last_prev = $last-$ppp;} if($last == count($images)){$last_next = $last;} else{$last_next= $last+$ppp;} if($last >= $ppp) {$prev = "Prev";} if(count($images) > $last_next) {$next = "Next\n";} //Build the page print page_start($site, $count_pics, $last, $i, $prev, $next, $ppp, $popup_w, $popup_h); print $xhtml_thumbs; print page_end($count_pics, $ppp, $prev, $next, $upload); break; } ?>