"; echo "
"; echo " Welcome to phpAlbum $phpalbum_version
"; echo " You have to edit config_change_it.php and rename it to config.php.
"; echo " You have to define data directory, because of security issues it is recommended that this is not data/ but"; echo " something like \"data_Ab6Lkj88KJ/\""; echo "
"; generate_footer(); return; } if ( !is_dir($data_dir)){ echo ""; echo "
"; echo " Welcome to phpAlbum $phpalbum_version
"; echo "Please check your config.php file, the directory $data_dir does not exist
"; echo "
"; generate_footer(); return; } if ( !check_writable($data_dir)){ echo ""; echo "
"; echo " Welcome to phpAlbum $phpalbum_version
"; echo "Your data directory $data_dir is not writable
"; echo "Please change the rights on this directory so php can write in it. (UNIX: CHMOD 777, WINDOWS: setup rights)"; echo "
"; generate_footer(); return; } $pa_setup=Array(); $pa_quality=Array(); $pa_theme=Array(); $pa_lang=Array(); $pa_color_map=Array(); $pa_keywords=Array(); $themes_dir="themes/"; $site_engine="phptemplate"; $act_dir_sorting="default"; /* header buffering */ $sent_header=Array(); /*testing for modules*/ if(function_exists("ftp_login")){ $ftp_support=true; }else{ $ftp_support=false; } if(function_exists("mb_get_info")){ $mbstring=true; $_mb_info=mb_get_info('all'); if(isset($_mb_info['internal_encoding'])){ $int_encoding=$_mb_info['internal_encoding']; }else{ $int_encoding='ISO-8859-1';//default } }else{ $mbstring=false; } //error_reporting(E_WARNING | E_ERROR); $old_error_handler = set_error_handler("userErrorHandler"); //time limit @set_time_limit(0); function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { global $data_dir,$pa_setup; // timestamp for the error entry if(isset($pa_setup['error_logging_enabled'])){ if($pa_setup['error_logging_enabled']=="true"){ $dt = date("y/m/d H:i:s"); // define an assoc array of error string // in reality the only entries we should // consider are E_WARNING, E_NOTICE, E_USER_ERROR, // E_USER_WARNING and E_USER_NOTICE $errortype = array ( E_ERROR => "Error", E_WARNING => "Warning", E_PARSE => "Parsing Error", E_NOTICE => "Notice", E_CORE_ERROR => "Core Error", E_CORE_WARNING => "Core Warning", E_COMPILE_ERROR => "Compile Error", E_COMPILE_WARNING => "Compile Warning", E_USER_ERROR => "User Error", E_USER_WARNING => "User Warning", E_USER_NOTICE => "User Notice" ); // set of errors for which a var trace will be saved //$user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE); if($errno==E_NOTICE){ return; } if(defined("E_STRICT")){ if($errno==E_STRICT){ return; } } $err = "\$phpalbum_Errors[]= Array(\"datetime\" => \"$dt\","; $err .= "\"errornum\" => \"$errno\","; $err .= "\"errortype\" => \"".$errortype[$errno]."\","; $err .= "\"errormsg\" => \"$errmsg\","; $err .= "\"scriptname\" => \"$filename\","; $err .= "\"scriptlinenum\" => \"$linenum\""; $err .= ");"; if(file_exists($data_dir."error.log")){ if(filesize($data_dir."error.log")>1024*1024*2){ unlink($data_dir."error.log"); } } if(substr($errmsg,0,6)!="unlink"){ //ignore unlink errors - not important as it can happen $ff=fopen($data_dir."error.log","a"); fwrite($ff,"\n"); fclose($ff); } }} } function pa_readfile($path){ /*fixed bug where if readfile disabled phpAlbum doesn't work*/ if(!function_exists("readfile")){ $file=fopen($path,"rb"); $doc=fread($file,filesize($path)); fclose($file); echo $doc; }else{ readfile($path); } } function conv_out($string){ global $pa_setup,$mbstring,$pa_lang; if($mbstring){ return mb_convert_encoding($string,$pa_lang["character_set"]); }else{ return $string; } } function prepit($text){ //prepare text from db to be in input type="text" return str_replace('"','"',$text); } function prepdb($text){ //adding slash for all but " $ret=addslashes($text); $ret=str_replace('\"','"',$ret); return $ret; } function conv_in($string){ global $pa_setup,$int_encoding,$mbstring,$pa_lang; if($mbstring){ return mb_convert_encoding($string,$int_encoding,$pa_lang["character_set"]); }else{ return $string; } } function conv_out_header ($string){ global $pa_setup,$mbstring,$pa_lang; if($mbstring){ return mb_encode_mimeheader($string,$pa_lang["character_set"]); }else{ return $string; } } function send_header($text){ global $sent_header; header($text); $sent_header[]=$text; /*store for later use*/ } function store_header($file_name){ global $sent_header; if(is_array($sent_header)){ $f=fopen($file_name,"w"); foreach($sent_header as $header){ fwrite($f,$header."\n"); } fclose($f); } } function resend_header($file_name){ $file=file($file_name); foreach($file as $line){ header(substr($line,0,strlen($line)-1)); } } function sent_header(){ global $sent_header; if(sizeof($sent_header)>0){ return true; }else{ return false; } } /*assertion*/ /****************************************/ /* Functions */ /****************************************/ function UnsharpMask($img, $amount, $radius,$threshold) { //////////////////////////////////////////////////////////////////////////////////////////////// //// //// Unsharp Mask for PHP - version 2.0 //// //// Unsharp mask algorithm by Torstein H?nsi 2003-06. //// thoensi_at_netcom_dot_no. //// Please leave this notice. //// /////////////////////////////////////////////////////////////////////////////////////////////// // $img is an image that is already created within php using // imgcreatetruecolor. No url! $img must be a truecolor image. // Attempt to calibrate the parameters to Photoshop: if ($amount > 500) $amount = 500; $amount = $amount * 0.016; if ($radius > 50) $radius = 50; $radius = $radius * 2; $radius = abs(round($radius)); // Only integers make sense. if ($radius == 0) return $img; $w = imagesx($img); $h = imagesy($img); $imgBlur = imagecreatetruecolor($w, $h); // Gaussian blur matrix: // // 1 2 1 // 2 4 2 // 1 2 1 // ////////////////////////////////////////////////// imagecopy($imgBlur, $img, 0, 0, 0, 0, $w, $h); // background for ($i = 0; $i < $radius; $i++) { if (function_exists('imageconvolution')) { // PHP >= 5.1 $matrix = array( array( 1, 2, 1 ), array( 2, 4, 2 ), array( 1, 2, 1 ) ); imageconvolution($imgCanvas, $matrix, 16, 0); } else { // Move copies of the image around one pixel at the time and merge them with weight // according to the matrix. The same matrix is simply repeated for higher radii. imagecopy ($imgBlur, $img, 0, 0, 1, 1, $w - 1, $h - 1); // up left imagecopymerge ($imgBlur, $img, 1, 1, 0, 0, $w, $h, 50); // down right imagecopymerge ($imgBlur, $img, 0, 1, 1, 0, $w - 1, $h, 33.33333); // down left imagecopymerge ($imgBlur, $img, 1, 0, 0, 1, $w, $h - 1, 25); // up right imagecopymerge ($imgBlur, $img, 0, 0, 1, 0, $w - 1, $h, 33.33333); // left imagecopymerge ($imgBlur, $img, 1, 0, 0, 0, $w, $h, 25); // right imagecopymerge ($imgBlur, $img, 0, 0, 0, 1, $w, $h - 1, 20 ); // up imagecopymerge ($imgBlur, $img, 0, 1, 0, 0, $w, $h, 16.666667); // down imagecopymerge ($imgBlur, $img, 0, 0, 0, 0, $w, $h, 50); // center // During the loop above the blurred copy darkens, possibly due to a roundoff // error. Therefore the sharp picture has to go through the same loop to // produce a similar image for comparison. This is not a good thing, as processing // time increases heavily. // imagecopy ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h); /* imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 33.33333); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 25); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 20 ); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 16.666667); imagecopymerge ($imgBlur2, $imgCanvas2, 0, 0, 0, 0, $w, $h, 50); imagecopy ($imgCanvas2, $imgBlur2, 0, 0, 0, 0, $w, $h); */ } } // Calculate the difference between the blurred pixels and the original // and set the pixels for ($x = 0; $x < $w; $x++) { // each row for ($y = 0; $y < $h; $y++) { // each pixel $rgbOrig = ImageColorAt($img, $x, $y); $rOrig = (($rgbOrig >> 16) & 0xFF); $gOrig = (($rgbOrig >> 8) & 0xFF); $bOrig = ($rgbOrig & 0xFF); $rgbBlur = ImageColorAt($imgBlur, $x, $y); $rBlur = (($rgbBlur >> 16) & 0xFF); $gBlur = (($rgbBlur >> 8) & 0xFF); $bBlur = ($rgbBlur & 0xFF); // When the masked pixels differ less from the original // than the threshold specifies, they are set to their original value. $rNew = (abs($rOrig - $rBlur) >= $threshold) ? max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig)) : $rOrig; $gNew = (abs($gOrig - $gBlur) >= $threshold) ? max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig)) : $gOrig; $bNew = (abs($bOrig - $bBlur) >= $threshold) ? max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig)) : $bOrig; if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew)) { $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); ImageSetPixel($img, $x, $y, $pixCol); } } } return $img; } function imagecreatefrom($file){ if(strtoupper(substr($file,-3,3))=="JPG" || strtoupper(substr($file,-4,4))=="JPEG"){ $image=imagecreatefromjpeg($file); } if(strtoupper(substr($file,-3,3))=="PNG"){ $image=imagecreatefrompng($file); } if(strtoupper(substr($file,-3,3))=="GIF"){ $image=imagecreatefromgif($file); } return $image; } function image_same_type($file,$image,$quality = 100){ if(strtoupper(substr($file,-3,3))=="JPG" || strtoupper(substr($file,-4,4))=="JPEG"){ imagejpeg($image,null,$quality); } if(strtoupper(substr($file,-3,3))=="PNG"){ imagepng($image); } if(strtoupper(substr($file,-3,3))=="GIF"){ imagegif($image); } } function check_gd(){ if(function_exists("gd_info")){ $info=gd_info(); if(strstr($info['GD Version'],"2.")){ return true; }else{ return false; } } return false; } function pa_html_encode($string){ return str_replace( array ( '&', '"', "'", '<', '>'), array ( '&' , '"', ''' , '<' , '>' ),$string); } function pa_html_decode($string){ return str_replace( array ( '&' , '"', ''' , '<' , '>' ),array ( '&', '"', "'", '<', '>'),$string); } /****************************************/ /* SETTINGS */ /****************************************/ function read_settings(){ global $pa_setup,$pa_theme,$pa_color_map,$pa_lang; $rec=db_select_all("setup"); $pa_setup=$rec[0]; $rec=db_select_all("theme","name=='".$pa_setup["site_theme"]."'"); if(count($rec)==0){ //used new theme, never used before db_insert("theme",Array( "name"=>$pa_setup["site_theme"])); $rec=db_select_all("theme","name=='".$pa_setup["site_theme"]."'"); } $pa_theme=$rec[0]; $rec=db_select_all("color_map","id==".$pa_theme["color_map"]); $pa_color_map=$rec[0]; $rec=db_select_all("languages","name=='".$pa_setup["language"]."'"); $pa_lang=$rec[0]; //echo db_get_last_error_text(); } function print_error($error,$par=null){ //echo "
$error
"; if($par){ printf("
".$error."
",$par); }else{ printf("
".$error."
"); } } function print_warning($error){ echo "
WARNING:$error
"; } function is_cachable($text,$var1){ global $pa_setup; if ($text == "logo" || $text == "themeimage") return true; if ($text == "theme") return false; if ($text == "image") { if($pa_setup["cache_resized_photos"]=="true"){ return true;}else{ return false;} } if ($text == "setup") return false; if ($text == "delcache") return false; if ($text == "setquality") return false; if ($text == "album") return false; if ($text == "imageview") return false; if ( strlen($text)==0) return false; if ($text == "thmb"){ if($pa_setup["cache_thumbnails"]=="true"){ return true; }else{ return false; } } return false; } function is_movie($var1){ $t=strtoupper(substr($var1,-3,3)); $t2=strtoupper(substr($var1,-4,4)); if($t=="AVI" ||$t=="MPG"||$t=="3GP"||$t=="MP4" ||$t2=="MPEG" ||$t=="MOV" ||$t=="WMV" ||$t=="VOB") return true; return false; } function is_audio($var1){ $t=strtoupper(substr($var1,-3,3)); if($t=="MP3" ||$t=="WMA" ||$t=="WAV") return true; return false; } function is_image($var1){ $t=strtoupper(substr($var1,-3,3)); $t2=strtoupper(substr($var1,-4,4)); if($t=="GIF" ||$t=="PNG" ||$t=="JPG" ||$t2=="JPEG") return true; return false; } function is_cached($cmd,$var1,$var2,$var3,$quality){ global $pa_setup; $cache_dir=$pa_setup["cache_dir"]; //return false; $fn=get_cache_file_name($cache_dir,$cmd,$var1,$var2,$var3,$quality); return file_exists($fn); } function load_from_cache($cmd,$var1,$var2,$var3,$quality){ global $pa_setup; $cache_dir=$pa_setup["cache_dir"]; $fn=get_cache_file_name($cache_dir,$cmd,$var1,$var2,$var3,$quality); if($cmd == "thmb" || $cmd=="themeimage" || $cmd == "logo" || $cmd == "dir_logo" || $cmd == "image" ){ //$headers=getallheaders();-- not supported by others then apache if (isset( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ){ if ( date("D, d M Y H:i:s T",filemtime($fn)) == $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) { header('HTTP/1.0 304 Not Modified'); exit; } } } if(file_exists($fn.".hdr")){ resend_header($fn.".hdr"); } pa_readfile($fn); } function get_cache_file_name($cache_dir,$cmd,$var1,$var2,$var3,$quality){ $filename=$cache_dir . "cache_"; $filename.=$cmd; $filename.="_".str_replace(" ","_",str_replace("/","_",$var1)); $filename.="_".str_replace(" ","_",str_replace("/","_",$var2)); $filename.="_".str_replace(" ","_",str_replace("/","_",$var3)); $filename.="_".$quality; $filename.=".cache"; return $filename; } function cache_document($cmd,$var1,$var2,$var3,$quality){ global $pa_setup; $cache_dir=$pa_setup["cache_dir"]; $doc=ob_get_contents(); //echo ob_get_length(); $filename=get_cache_file_name($cache_dir,$cmd,$var1,$var2,$var3,$quality); //echo $filename; $file=fopen($filename,"wb"); fwrite($file,$doc); fclose($file); $m_time= filemtime($filename); send_header("Last-Modified: ".date("D, d M Y H:i:s T",$m_time) ); send_header("Cache-Control: public, max-age=" . 3600 * 48); if(sent_header()){ /*cache header*/ store_header($filename.".hdr"); } } function invalidate_object_cache($type){ $rec=db_select_all("object_cache","type=='".$type."'"); if(is_array($rec)){ foreach($rec as $key=>$record){ @unlink($record["file"]); } } db_delete("object_cache","type=='".$type."'"); } function get_cached_object ($type,$var1){ global $pa_setup; $cache_dir=$pa_setup["cache_dir"]; $filename=$cache_dir.$type.str_replace(" ","_",str_replace("/","_",$var1)).".obj"; if(file_exists($filename)){ $string=file_get_contents($filename); return unserialize($string); }else{ return null; } } function cache_object($type,$var1,$obj){ global $pa_setup; $cache_dir=$pa_setup["cache_dir"]; $filename=$cache_dir.$type.str_replace(" ","_",str_replace("/","_",$var1)).".obj"; $str=serialize($obj); $f=fopen($filename,"w"); fwrite($f,$str); fclose($f); db_insert("object_cache",Array("type"=>$type,"file"=>$filename)); } function delete_old_ecards(){ $time=time()-60*60*24*14; db_delete("ecards","created<$time"); } function delete_old_anitspam(){ $time=time()-60*60; db_delete("anti_spam_codes","time<$time"); } function get_file_for_screenshot($scr,$dw){ $scr_base=substr($scr,0,strlen($scr)-4); foreach($dw as $file){ if(!is_image($file)){ if($scr_base==$file || $scr_base."."== substr($file,0,strlen($scr_base."."))){ return $file; } } } return ""; } function get_screanshot_for_file($file,$fl){ foreach($fl as $scr){ if( is_image($scr)){ $scr_base=substr($scr,0,strlen($scr)-4); if($scr_base==$file || $scr_base."." == substr($file,0,strlen($scr_base."."))){ return $scr; } } } return ""; } function get_thmb_standard_link($dir,$file_rec){ global $pa_quality; if($file_rec["type"]=="I"){ $file=$dir.$file_rec["file_name"]; }else if($file_rec["type"]=="V"){ $file=$dir.$file_rec["file_name"]; if($file_rec["screenshot"]==""){ $file="[movie]"; }else{ $file=$dir.$file_rec["screenshot"]; } }else if($file_rec["type"]=="A"){ $file=$dir.$file_rec["file_name"]; if($file_rec["screenshot"]==""){ $file="[audio]"; }else{ $file=$dir.$file_rec["screenshot"]; } } if($pa_quality["thmb_sharp_use"]=='true'){ $sharpen_str="_".$pa_quality["thmb_sharp_amount"]."_".$pa_quality["thmb_sharp_radius"]."_".$pa_quality["thmb_sharp_treshold"]; }else{ $sharpen_str=""; } return "main.php?cmd=thmb&var1=". urlencode($file)."&var2=".$pa_quality["thmb_size"]."_".$pa_quality["thmb_qual"]."_".$pa_quality["square_thumbnails"].$sharpen_str; } function get_thmb_dir_link($file){ global $pa_quality,$pa_theme; if($pa_quality["thmb_sharp_use"]=='true'){ $sharpen_str="_".$pa_quality["thmb_sharp_amount"]."_".$pa_quality["thmb_sharp_radius"]."_".$pa_quality["thmb_sharp_treshold"]; }else{ $sharpen_str=""; } if($pa_theme["dir_logo_style"]=="pic_other_size"){ return "main.php?cmd=thmb&var1=". urlencode($file)."&var2=".$pa_theme["dir_logo_size"]."_".$pa_theme["dir_logo_quality"]."_".$pa_theme["dir_logo_square_thumbnail"].$sharpen_str."_".$pa_color_map["bg_color"]."&var3=DIR"; }else{ return "main.php?cmd=thmb&var1=". urlencode($file)."&var2=".$pa_quality["thmb_size"]."_".$pa_quality["thmb_qual"]."_".$pa_quality["square_thumbnails"].$sharpen_str."_".$pa_color_map["bg_color"]."&var3=DIR"; } } function check_access_to_dirs_groups($groups,$inh_groups){ global $pa_user; if(isset($pa_user["groups"]["superuser"])){ return true; } if((!is_array($groups) || count($groups)==0) && (!is_array($inh_groups) || count($inh_groups)==0)){ return true;} if(is_array($pa_user["groups"])){ if(is_array($groups)){ foreach($groups as $key => $value){ if(isset($pa_user["groups"][$key])){ return true; } } } if(is_array($inh_groups)){ foreach($inh_groups as $key => $value){ if(isset($pa_user["groups"][$key])){ return true; } } } return false; }else{ if(count($groups)>0){ return false; } } return true; } function check_access_to_dir($dir){ global $pa_user; if(isset($pa_user["groups"]["superuser"])){ return true; } $sett_1=get_directory_settings($dir,0); $sett=$sett_1[0]; if((!is_array($sett["groups"]) || count($sett["groups"])==0) && (!is_array($sett["inh_groups"]) || count($sett["inh_groups"])==0)){ return true;} if(is_array($pa_user["groups"])){ if(is_array($sett["groups"])){ foreach($sett["groups"] as $key => $value){ if(isset($pa_user["groups"][$key])){ return true; } } } if(is_array($sett["inh_groups"])){ foreach($sett["inh_groups"] as $key => $value){ if(isset($pa_user["groups"][$key])){ return true; } } } return false; }else{ if(count($sett["groups"])>0){ return false; } } return true; } function get_sorted_file_list($seq_files){ global $act_dir_sorting; switch($act_dir_sorting){ case "date_asc": return db_select_all("files_$seq_files","visible=='true'","file_time"); case "date_desc": return db_select_all("files_$seq_files","visible=='true'","file_time-"); case "filename_asc": return db_select_all("files_$seq_files","visible=='true'","file_name"); case "filename_desc": return db_select_all("files_$seq_files","visible=='true'","file_name-"); case "name_asc": return db_select_all("files_$seq_files","visible=='true'","desc,file_name"); case "name_desc": return db_select_all("files_$seq_files","visible=='true'","desc-,file_name-"); default: return db_select_all("files_$seq_files","visible=='true'",null); } } function get_sorted_dir_list($path){ global $act_dir_sorting; switch($act_dir_sorting){ case "date_asc": return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)","newest_file_time_with_subdirs"); case "date_desc": return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)","newest_file_time_with_subdirs-"); case "filename_asc": return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)","path"); case "filename_desc": return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)","path-"); case "name_asc": return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)","alias,path"); case "name_desc": return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)","alias-,path-"); default: return db_select_all("directory","visibility=='true' && path!='".prepdb($path)."' && translate_directory(dirname(path))=='".prepdb($path)."' && check_access_to_dirs_groups(groups,inh_groups)",null); } } function get_keyword_link($keyword){ return ''.$keyword.''; } function get_keyword_parameter_for_link(){ global $pa_keywords; $strings=trim(implode(" ",$pa_keywords)); if($strings!=""){ return "&keyword=".urlencode($strings); }else{ return ""; } } function generate_albumnew($var1,$start_with){ global $pa_setup,$pa_quality,$pa_theme,$pa_color_map,$pa_keywords,$pa_keywords_unsorted; global $act_dir_sorting; if($start_with=="")$start_with=0; if ($pa_theme["directory_style"]=="flowing"){ $number_of_thmbs=$pa_theme["maximum_photos_per_page"]; }else{ $number_of_thmbs=$pa_theme["raster_dir_x"]*$pa_theme["raster_dir_y"]; } if($number_of_thmbs==0 || $number_of_thmbs<0){ $number_of_thmbs=1000000;/*i hope nobody will make more then million photos in one dir, if yes, i'm sorry :)*/ } $newest_pics=get_newest_photos($var1,$start_with+$number_of_thmbs+1); $cnt=0; $offset=0; foreach($newest_pics as $key => $record){ if($offset>=$start_with){ $thumbnails[$cnt]['thmb']=get_thmb_standard_link(substr($record["path"],1),$record); $thumbnails[$cnt]['desc']=pa_html_decode($record["desc"]); if($pa_theme["show_filenames"]=="true" && $thumbnails[$cnt]['desc']==""){ $thumbnails[$cnt]['desc']=conv_out($record["file_name"]); } $thumbnails[$cnt]['link']="main.php?cmd=imageviewnew&var1=$offset".get_keyword_parameter_for_link(); $thumbnails[$cnt]['width']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_width"]; $thumbnails[$cnt]['height']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_height"]; $thumbnails[$cnt]['view_count']=$record["view_count"]; $thumbnails[$cnt]['vote_count']=$record["vote_count"]; $thumbnails[$cnt]['vote_avg']=$record["vote_avg"]; $thumbnails[$cnt]['comment_count']=$record["comment_count"]; $cnt++; if($cnt==$number_of_thmbs) break; } $offset++; } $qualities=db_select_all("quality","enabled=='true'"); // select all enabled qualities $quality_links=Array(); if(count($qualities)>1){ foreach($qualities as $key=>$val){ $quality_links[]=Array("name"=>$val["name"], "link"=>"main.php?cmd=setquality&var1=".$val["id"]."&var2=albumnew&var3=".urlencode($var1)."&var4=$start_with".get_keyword_parameter_for_link(), "actual" => ($val["id"]==$pa_quality["id"])?1:0 ); } } if ( sizeof($newest_pics)<=$start_with+$number_of_thmbs){ //no next page $next_start_with=-1; }else{ $next_start_with=$start_with+$number_of_thmbs; } if ( $start_with==0){ //no next page $previous_start_with=-1; }else{ $previous_start_with=$start_with-$number_of_thmbs; if($previous_start_with<0){$previous_start_with=0;} } $dir_path[0]['name']=t('ID_NEWEST_PICTURES'); $dir_path[0]['link']="main.php?cmd=albumnew"; $cnt=1; $keywords=""; if(is_array($pa_keywords_unsorted)){ foreach($pa_keywords_unsorted as $key=>$value){ $dir_path[$cnt]['name']=$value; if($keywords!=""){ $keywords.=" ".$value; }else{ $keywords=$value; } $dir_path[$cnt]['link']="main.php?cmd=albumnew&keyword=".$keywords; $cnt++; } } theme_generate_album_page($dir_path,$quality_links,null,$thumbnails,null,null,$next_start_with,$previous_start_with,$var1,"NEW"); return true; } function generate_album($var1,$start_with){ global $pa_setup,$pa_quality,$pa_theme,$pa_color_map,$pa_keywords; global $act_dir_sorting; if($start_with=="")$start_with=0; if ($pa_theme["directory_style"]=="flowing"){ $number_of_thmbs=$pa_theme["maximum_photos_per_page"]; }else{ $number_of_thmbs=$pa_theme["raster_dir_x"]*$pa_theme["raster_dir_y"]; } if($number_of_thmbs==0 || $number_of_thmbs<0){ $number_of_thmbs=1000000;/*i hope nobody will make more then million photos in one dir, if yes, i'm sorry :)*/ } $ss=get_directory_settings("/".$var1,0); $dir_settings=$ss[0]; /*newest pictures*/ $new_thumbnails=Array(); if($dir_settings["show_newest_pictures_count"]>0){ $newest_pics=get_newest_photos($var1,$dir_settings["show_newest_pictures_count"]); $cnt=0; foreach($newest_pics as $key => $record){ $new_thumbnails[$cnt]['thmb']=get_thmb_standard_link($record["path"],$record); $new_thumbnails[$cnt]['desc']=pa_html_decode($record["desc"]); if($pa_theme["show_filenames"]=="true" && $new_thumbnails[$cnt]['desc']==""){ $new_thumbnails[$cnt]['desc']=conv_out($record["file_name"]); } $new_thumbnails[$cnt]['link']="main.php?cmd=imageview&var1=".urlencode(substr($record["path"],1).$record["file_name"]); $new_thumbnails[$cnt]['width']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_width"]; $new_thumbnails[$cnt]['height']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_height"]; $new_thumbnails[$cnt]['view_count']=$record["view_count"]; $new_thumbnails[$cnt]['vote_count']=$record["vote_count"]; $new_thumbnails[$cnt]['vote_avg']=$record["vote_avg"]; $new_thumbnails[$cnt]['comment_count']=$record["comment_count"]; $cnt++; } }else{ $new_thumbnails=null; } if(isset($dir_settings["sorting"])){ $act_dir_sorting=$dir_settings["sorting"]; } //$act_dir_sorting=$dir_settings["sorting"]; if($act_dir_sorting=='default'){ $act_dir_sorting=$pa_setup["default_sorting"]; } $dir_path[0]['name']=t('ID_PHOTO_DIR'); $dir_path[0]['link']="main.php?cmd=album"; $dirs=explode('/',$var1); $act_dir=""; for($i=0;$i0){ $dir_path[$i+1]['name']=pa_html_decode($ss[0]["alias"]); }else{ $dir_path[$i+1]['name']=conv_out($dirs[$i]); } $dir_path[$i+1]['link']="main.php?cmd=album&var1=".urlencode($act_dir); } $qualities=db_select_all("quality","enabled=='true'"); // select all enabled qualities $quality_links=Array(); if(count($qualities)>1){ foreach($qualities as $key=>$val){ $quality_links[]=Array("name"=>$val["name"], "link"=>"main.php?cmd=setquality&var1=".$val["id"]."&var2=album&var3=".urlencode($var1)."&var4=$start_with", "actual" => ($val["id"]==$pa_quality["id"])?1:0 ); } } $dir=$pa_setup["album_dir"] . $var1; /*directory description*/ $dir_long_desc=pa_html_decode($dir_settings["long_desc"]); /*openning directories*/ $dirlist=get_sorted_dir_list($dir_settings["path"]); $directories=Array(); $directories_cnt=0; if(sizeof($dirlist)>0){ while ( list($key,$rec)=each($dirlist)){ /*visibility*/ $file=$rec['file_name']; $blocked=false; /*test if there is some new images*/ $diff = (time() - $rec["newest_file_time_with_subdirs"])/60/60; if ($diff < $pa_setup["new_dir_indic"] ){ $dir_pic="main.php?cmd=themeimage&var1=dir_new.png&var2=".$pa_color_map["bg_color"]; $directories[$directories_cnt]['stat']='NEW'; }else{ $dir_pic="main.php?cmd=themeimage&var1=dir.png&var2=".$pa_color_map["bg_color"]; $directories[$directories_cnt]['stat']='NORM'; } if($pa_theme["dir_logo_style"]=="pic_thmb_size" || $pa_theme["dir_logo_style"]=="pic_other_size"){ $dir_logo=db_select_all("files_".$rec["seq_files"],"use_for_logo=='true' && type=='I'"); if(!$dir_logo){ $dir_logo=db_select_all("files_".$rec["seq_files"],"visible=='true' && type=='I'"); } if($dir_logo){ $dir_pic=get_thmb_dir_link($rec["path"].$dir_logo[0]["file_name"]); }else{ $dir_pic=get_thmb_dir_link("[NOPIC]"); } } /*defining variable*/ $directories[$directories_cnt]['link']="main.php?cmd=album&var1=".urlencode($var1.basename($rec['path']))."/"; $directories[$directories_cnt]['logo']=$dir_pic; if($rec['alias']!=""){ $directories[$directories_cnt]['name']=pa_html_decode($rec['alias']); }else{ /*it is filename and should be converted*/ $directories[$directories_cnt]['name']=conv_out(basename($rec['path'])); } $directories[$directories_cnt]['desc']=pa_html_decode($rec['desc']); $directories[$directories_cnt]['width']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_width"]; $directories[$directories_cnt]['height']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_height"]; $directories_cnt++; } } /*openning files*/ if($start_with<0){ $start_with=0; /*just to be sure*/ } $filelist=get_sorted_file_list($dir_settings["seq_files"]); $qq=$pa_quality["thmb_size"]."_".$pa_quality["thmb_qual"]; $qpic=$pa_quality["photo_size"]."_".$pa_quality["photo_qual"]; $thumbnails=Array(); $thumbnails_cnt=0; if(is_array($filelist)){ $fl=array_slice($filelist,$start_with,$number_of_thmbs); }else{ $fl=Array(); } foreach($fl as $key => $record){ $file=$record['file_name']; if($record["type"]=="I"){ $thumbnails[$thumbnails_cnt]['thmb']=get_thmb_standard_link($var1,$record); $thumbnails[$thumbnails_cnt]['desc']=pa_html_decode($record["desc"]); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=imageview&var1=".urlencode($var1.$file); if($pa_theme["show_filenames"]=="true" && $thumbnails[$thumbnails_cnt]['desc']==""){ $thumbnails[$thumbnails_cnt]['desc']=conv_out($file); } } if($record["type"]=="V"){ $thumbnails[$thumbnails_cnt]['thmb']=get_thmb_standard_link($var1,$record); $thumbnails[$thumbnails_cnt]['desc']=pa_html_decode($record["desc"]); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$file); if($pa_theme["show_filenames"]=="true" && $thumbnails[$thumbnails_cnt]['desc']==""){ $thumbnails[$thumbnails_cnt]['desc']=conv_out($file); } } if($record["type"]=="A"){ $thumbnails[$thumbnails_cnt]['thmb']=get_thmb_standard_link($var1,$record); $thumbnails[$thumbnails_cnt]['desc']=pa_html_decode($record["desc"]); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$file); if($pa_theme["show_filenames"]=="true" && $thumbnails[$thumbnails_cnt]['desc']==""){ $thumbnails[$thumbnails_cnt]['desc']=conv_out($file); } } $thumbnails[$thumbnails_cnt]['width']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_width"]; $thumbnails[$thumbnails_cnt]['height']=$pa_quality["thmb_size"]+$pa_theme["additional_thmb_height"]; $thumbnails[$thumbnails_cnt]['view_count']=$record["view_count"]; $thumbnails[$thumbnails_cnt]['vote_count']=$record["vote_count"]; $thumbnails[$thumbnails_cnt]['vote_avg']=$record["vote_avg"]; $thumbnails[$thumbnails_cnt]['comment_count']=$record["comment_count"]; $thumbnails_cnt++; } if ( sizeof($filelist)<=$start_with+$number_of_thmbs){ //no next page $next_start_with=-1; }else{ $next_start_with=$start_with+$number_of_thmbs; } if ( $start_with==0){ //no next page $previous_start_with=-1; }else{ $previous_start_with=$start_with-$number_of_thmbs; if($previous_start_with<0){$previous_start_with=0;} } /*call theme function to generate page*/ theme_generate_album_page($dir_path,$quality_links,$directories,$thumbnails,$new_thumbnails,$dir_long_desc,$next_start_with,$previous_start_with,$var1); return true; } function translate_directory($dir){ if ($dir=="\\" || $dir==".") $dir=""; if(substr($dir,0,1)!="/"){ $dir="/".$dir; } if(substr($dir,-1,1)!="/"){ $dir=$dir."/"; } return $dir; } function get_directory_settings($dir,$full=1){ global $data_dir,$pa_setup; $dir=translate_directory($dir); if(!is_dir($pa_setup["album_dir"].$dir)){ theme_generate_error_page(); exit(0); } $inh_groups=Array(); if(!db_select_exists("directory","path=='".prepdb($dir)."'")){ // not found, first time visiting directory, do insert if($dir!="/"){ //inheriting directory permissions for new directory. $up_dir=dirname($dir); if(substr($up_dir,-1,1)!="/"){ $up_dir=$up_dir."/"; } $rec=db_select_all("directory","path=='".prepdb($up_dir)."'"); $grps=db_select_all("group"); foreach($grps as $group){ if(isset($rec[0]["groups"][$group["name"]])){ $inh_groups[$group["name"]]=$rec[0]["seq_files"]; }else{ if(isset($rec[0]["inh_groups"][$group["name"]])){ $inh_groups[$group["name"]]=$rec[0]["inh_groups"][$group["name"]]; } } } } $seq_files=db_get_seq_nextval("seq_files"); db_insert("directory",Array("path"=>$dir,"seq_files"=>$seq_files)); db_update("directory","inh_groups=".var_export($inh_groups,true).";","seq_files==".$seq_files); db_create_table("files_$seq_files",Array( "file_name"=>"", "visible"=>"true", "desc"=>"", "long_desc"=>"", "params"=>"", "dir_logo"=>"true", "view_count"=>0, "vote_count"=>0, "vote_avg"=>0, "comment_count"=>0, "use_for_logo"=>"false", "file_time"=>"", "screenshot"=>"", "type"=>"I", "keywords"=>Array() )); db_create_table("comments_$seq_files",Array( "id"=>"", "file_name"=>"", "time"=>"", "name"=>"", "email"=>"", "text"=>"", "visible"=>"true" )); } $rec=db_select_all("directory","path=='".prepdb($dir)."'"); if($full!=1){ return Array($rec[0],null); } $seq_files=$rec[0]["seq_files"]; //continue for files settings $changed=false; //load files from DB $files_db=db_select_all("files_$seq_files",null,true); //load files from Medium $dir_path=substr($dir,1); $files_hd=Array(); if(file_exists($pa_setup["album_dir"].$dir_path)){ if ($dh = opendir($pa_setup["album_dir"].$dir_path)) { while (($file = readdir($dh)) !== false) { if( filetype($pa_setup["album_dir"].$dir_path. $file)=="file" || filetype($pa_setup["album_dir"].$dir_path. $file)=="link" ){ $files_hd[$file]=filemtime($pa_setup["album_dir"].$dir_path. $file); } } closedir($dh); } } $where="";//for deleting files, first screenshots then not existing files //parse screenshots $scr_files=Array(); foreach($files_hd as $fn => $t){ if(is_image($fn)){ if(isset($files_hd[substr($fn,0,strlen($fn)-4)])){ $scr_files[substr($fn,0,strlen($fn)-4)]=$fn; if($where==""){ $where="file_name=='".prepdb($fn)."'"; }else{ $where.=" || file_name=='".prepdb($fn)."'"; } } } } //now delete not existing files from DB if(is_array($files_db)){ foreach($files_db as $key => $record){ if(!isset($files_hd[$record["file_name"]])){ $changed=true; if($where==""){ $where="file_name=='".prepdb($record["file_name"])."'"; }else{ $where.=" || file_name=='".prepdb($record["file_name"])."'"; } }else{ //names from database $files_db_names[$record["file_name"]]=$record["file_time"]; } } } if($where !=""){ db_delete("files_$seq_files",$where); } //reload of db files foreach($files_hd as $fn => $t){ if(isset($scr_files[$fn])){ $screenshot=$scr_files[$fn]; }else{ $screenshot=""; } if(!isset($files_db_names[$fn])){ //file is not in db, insert it as new if(is_image($fn)){ //check if it is a screenshot of some other file, in this case, this file will not be inserted. if(!isset($files_hd[substr($fn,0,strlen($fn)-4)])){ //is not screensot $changed=true; // check for iptc descriptions if needed $short_desc=""; $long_desc=""; $keywords=Array(); if($pa_setup["use_iptc_desc"]=="true"){ list($www,$hhh)=getimagesize($pa_setup["album_dir"].$dir_path.$fn,$info); if (isset($info["APP13"])) { $iptc = iptcparse($info["APP13"]); if(isset($iptc["2#105"])){ $short_desc=$iptc["2#105"][0]; } if(isset($iptc["2#120"])){ $long_desc=str_replace("\r","
",$iptc["2#120"][0]); } if(isset($iptc["2#025"])){ $keywords=$iptc["2#025"]; } } } db_insert("files_$seq_files",Array("file_name"=>$fn,"file_time"=>$t,"desc"=>$short_desc,"long_desc"=>$long_desc,"keywords"=>$keywords)); } }else if(is_movie($fn)){ //check for screenshot $changed=true; db_insert("files_$seq_files",Array("file_name"=>$fn,"file_time"=>$t,"type"=>"V","screenshot"=>$screenshot)); }else if(is_audio($fn)){ //check for screenshot $changed=true; db_insert("files_$seq_files",Array("file_name"=>$fn,"file_time"=>$t,"type"=>"A","screenshot"=>$screenshot)); }else{ //check for screenshot $changed=true; db_insert("files_$seq_files",Array("file_name"=>$fn,"file_time"=>$t,"type"=>"O","screenshot"=>$screenshot)); } }else if ($files_db_names[$fn] != $t){ //timestamp is changed , update the file $short_desc=""; $long_desc=""; $keywords_text=var_export(Array(),true); if(is_image($fn)){ // check for iptc descriptions if needed if($pa_setup["use_iptc_desc"]=="true"){ list($www,$hhh)=getimagesize($pa_setup["album_dir"].$dir_path.$fn,$info); if (isset($info["APP13"])) { $iptc = iptcparse($info["APP13"]); if(isset($iptc["2#105"])){ $short_desc=$iptc["2#105"][0]; } if(isset($iptc["2#120"])){ $long_desc=str_replace("\r","
",$iptc["2#120"][0]); } if(isset($iptc["2#025"])){ $keywords_text=var_export($iptc["2#025"],true); } } } db_update("files_$seq_files","keywords=".$keywords_text.";file_time='".$t."';desc='".$short_desc."';long_desc='".$long_desc."';","file_name=='".prepdb($fn)."'"); }else{ db_update("files_$seq_files","file_time='".$t."'; screenshot='$screenshot';","file_name=='".prepdb($fn)."'"); } }else if( !is_image($fn)){ db_update("files_$seq_files","file_time='".$t."'; screenshot='$screenshot';","file_name=='".prepdb($fn)."'"); } } /*rereading of files*/ if($changed){ $files_db=db_select_all("files_$seq_files"); } if($rec[0]["photo_count"]!=count($files_db)){ db_update("directory","photo_count=".count($files_db).";","path=='".prepdb($dir)."'"); } return Array($rec[0],$files_db); } function get_all_sortings(){ $sorts= Array ( "default"=> "Default", "date_asc"=> "Date - Ascending", "date_desc"=> "Date - Descending", "filename_asc"=> "Filename - Ascending", "filename_desc"=> "Filename - Descending", "name_asc"=> "Name - Ascending", "name_desc"=> "Name - Descending" ); return $sorts; } function add_column_to_array(&$array, $column,$value) { foreach($array as $key => $rec){ $array[$key][$column]=$value; } } function get_newest_photos($dir,$count){ global $pa_user,$pa_keywords,$pa_grants; if ($dir=="\\" || $dir==".") $dir=""; if(substr($dir,0,1)!="/"){ $dir="/".$dir; } if(substr($dir,-1,1)!="/"){ $dir=$dir."/"; } sort($pa_keywords); $obj=get_cached_object("GNP",$dir.$count.md5(implode("_",$pa_keywords).implode("_",array_keys($pa_user["groups"])))); if($obj!=null){ return $obj; } $func=db_create_order_by_function("file_time-,file_name-"); $len=strlen($dir); $sorted=true; $where_clause="substr(path,0,$len)=='".prepdb($dir)."'"; $where_groups=""; if(!isset($pa_user["groups"]["superuser"])){ $where_groups=" && (( (!is_array(groups) ||count(groups)==0 )&& (!is_array(inh_groups) || count(inh_groups)==0) )"; foreach($pa_user["groups"] as $key => $val){ $where_groups.=" || isset(groups['$key']) || isset(inh_groups['$key'])"; } $where_groups.=")"; } $where_clause.=$where_groups; $where_keyword=""; if(is_array($pa_keywords)){ foreach($pa_keywords as $key =>$keyword){ if($where_keyword==""){ $where_keyword="in_array('$keyword',keywords)"; }else{ $where_keyword.=" && in_array('$keyword',keywords)"; } } } if($where_keyword!=""){ $where_clause.= " && (".$where_keyword.")"; } $dirs=db_select_limit(1,$count,"directory",$where_clause,"newest_file_time-"); $newest_files=Array(); //new where for pictures if($where_keyword!=""){ $where_clause="visible=='true' && ".$where_keyword; }else{ $where_clause="visible=='true'"; } if(is_array($dirs)){ foreach($dirs as $dir_rec){ if(count($newest_files)==$count){ if($newest_files[$count-1]["file_time"]>$dir_rec["newest_file_time"]){ //there are no newer files in further directories, so we can break up here break; } } $files=db_select_limit(1,$count,"files_".$dir_rec["seq_files"],$where_clause,"file_time-,file_name-"); add_column_to_array($files,"path",$dir_rec["path"]); if(count($files)>0){ $newest_files=array_merge($newest_files,$files); $sorted=false; if(count($newest_files)>$count){ //sort and slice usort($newest_files,$func); $sorted=true; $newest_files=array_slice($newest_files,0,$count); } } } } if(!$sorted){ usort($newest_files,$func); } unset($func); cache_object("GNP",$dir.$count.md5(implode("_",$pa_keywords).implode("_",array_keys($pa_user["groups"]))),$newest_files); return $newest_files; } function scan_photos_directories($dir,$level=0){ global $pa_setup; $album_dir=$pa_setup["album_dir"]; $sett=get_directory_settings($dir,1); $rec=db_select_all("files_".$sett[0]["seq_files"],null,"file_time-"); if(isset($rec[0])){ $max_file_time=$rec[0]["file_time"]; }else{ $max_file_time=0; } //sumarising keywords $keywords=Array(); if(is_array($rec)){ foreach($rec as $key=>$record){ $keywords=array_unique(array_merge($keywords,$record["keywords"])); } } $keywords_text=var_export($keywords,true); db_update("directory","keywords=".$keywords_text.";newest_file_time='".$max_file_time."';","seq_files==".$sett[0]["seq_files"]); if (is_dir($album_dir.$dir)) { if ($dh = opendir($album_dir.$dir)) { while (($file = readdir($dh)) !== false) { if( filetype($album_dir.$dir.$file)=="dir" && $file!="." && $file !="..") { $time=scan_photos_directories($dir.$file."/",$level+1); if($time>$max_file_time){ $max_file_time=$time; } } } closedir($dh); } } db_update("directory","newest_file_time_with_subdirs='".$max_file_time."';","seq_files==".$sett[0]["seq_files"]); db_commit(true); if($level==0){ //delete not existing directories from db if($dir==""){ //only once and if the whole directory is scanned $rec=db_select_all("directory"); foreach($rec as $record){ if(!file_exists(substr($pa_setup["album_dir"],0,-1).$record["path"])){ db_drop_table("files_".$record["seq_files"]); db_drop_table("comments_".$record["seq_files"]); db_delete("directory","seq_files==".$record["seq_files"]); } } } db_update("directory","photo_count_r=0;"); $rec=db_select_all("directory"); foreach($rec as $record){ if($record["photo_count"]>0){ db_update("directory","photo_count_r+=".$record["photo_count"].";","substr('".prepdb($record["path"])."',0,strlen(path))==path"); } } $t=time(); db_update("setup","last_dir_scan=".$t.";"); $pa_setup["last_dir_scan"]=$t; db_commit(true); //invalidate GNP cache invalidate_object_cache("GNP"); }else{ return $max_file_time; } } function get_themes(){ global $themes_dir; $dir=$themes_dir; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if( filetype($dir . $file)=="dir" && $file!="." && $file !=".." && $file !="engines") { $filelist[]=$file; } } closedir($dh); } } return $filelist; } /****************************************/ /* THMB */ /****************************************/ function generate_thumb($var1,$var3){ global $pa_setup,$pa_quality,$pa_theme; $sharp=true; if($pa_theme["dir_logo_style"]=="pic_other_size" && $var3=="DIR"){ $width = $pa_theme["dir_logo_size"]; $height = $pa_theme["dir_logo_size"]; $square = $pa_theme["dir_logo_square_thumbnail"]; $thmb_quality =$pa_theme["dir_logo_quality"]; }else{ $width = $pa_quality["thmb_size"]; $height = $pa_quality["thmb_size"]; $square = $pa_quality["square_thumbnails"]; $thmb_quality =$pa_quality["thmb_qual"]; } $var1=stripslashes($var1); // Content type if(is_image($var1)){ $mime=get_mime($var1); send_header("Content-type: ".$mime); }else{ send_header('Content-type: image/png'); // for movie.png and video.png } send_header("Content-Disposition: filename=thmb_".conv_out_header(basename($var1),$character_set)." "); if($var1=="[movie]"){$var1="res/movie.png"; $sharp=false;} else if($var1=="[audio]"){$var1="res/audio.png"; $sharp=false;} else if($var1=="[NOPIC]"){$var1="res/nopic.png"; $sharp=false;} else{$var1=$pa_setup["album_dir"].$var1;} // Get new dimensions list($width_orig, $height_orig) = getimagesize($var1); //$image_p = imagecreatetruecolor($width+10, $height+10); //$color=ImageColorAllocate( $image_p, 32, 32, 32 ); //imagefill($image_p,0,0,$color); if($square=="true"){ if ($width_orig < $height_orig) { $src_x=0; $src_y=($height_orig-$width_orig)/2; $height_orig=$width_orig; }else{ $src_y=0; $src_x=($width_orig-$height_orig)/2; $width_orig=$height_orig; } }else{ //keep aspect ratio $src_x=0; $src_y=0; if ($width && ($width_orig < $height_orig)) { $width = ($height / $height_orig) * $width_orig; } else { $height = ($width / $width_orig) * $height_orig; } } // Resample $image=imagecreatefrom($var1); $image_p = imagecreatetruecolor($width, $height); $bgcol=theme_get_bgcolor(); $color = ImageColorAllocate( $image_p,$bgcol[0] ,$bgcol[1] ,$bgcol[2] ); imagefill($image_p,0,0,$color); imagecopyresampled($image_p, $image, 0, 0, $src_x, $src_y, $width, $height, $width_orig, $height_orig); //$image_p=UnsharpMask($image_p,50,1,3); // Output //sharpening if($pa_quality["thmb_sharp_use"]=='true' && $sharp){ $image_p=UnsharpMask($image_p, $pa_quality["thmb_sharp_amount"], $pa_quality["thmb_sharp_radius"],$pa_quality["thmb_sharp_treshold"]); } image_same_type($var1,$image_p,$thmb_quality); } /****************************************/ /* IMAGE */ /****************************************/ function get_mime($var1){ $t=strtoupper(substr($var1,-4,4)); switch($t){ case ".JPG": case "JPEG": return "image/jpeg"; break; case ".GIF": return "image/gif"; break; case ".PNG": return "image/png"; break; default: return ""; break; } } function get_resized_imagesize($var1){ global $pa_setup,$pa_quality; if(file_exists($pa_setup["album_dir"].$var1)){ list($width_orig, $height_orig) = getimagesize($pa_setup["album_dir"].$var1); if( $pa_quality["photo_size"] > 0){ $image_low_size=$pa_quality["photo_size"]; if($pa_quality["resize_if_bigger"]=="true"){ if( ($width_orig <= $image_low_size && $pa_quality["resize_photo_to_fit"]=="width") || ($height_orig <= $image_low_size && $pa_quality["resize_photo_to_fit"]=="height") || ($width_orig <= $image_low_size && $height_orig <= $image_low_size && $pa_quality["resize_photo_to_fit"]=="both") ){ return Array($width_orig,$height_orig,false); } } if($pa_quality["resize_photo_to_fit"]=="both"){ $width=$image_low_size; $height=$image_low_size; // Get new dimensions if ($width_orig < $height_orig) { $width = ($height / $height_orig) * $width_orig; } else { $height = ($width / $width_orig) * $height_orig; } } if($pa_quality["resize_photo_to_fit"]=="width"){ $width=$image_low_size; $height = ($width / $width_orig) * $height_orig; } if($pa_quality["resize_photo_to_fit"]=="height"){ $height=$image_low_size; $width = ($height / $height_orig) * $width_orig; } return Array($width,$height,true); }else{ return Array($width_orig,$height_orig,false); } } } function generate_image($var1,$quality,$original=false){ global $pa_quality,$pa_setup; $var1=stripslashes($var1); $m_time=filemtime($pa_setup["album_dir"].$var1); //$headers=getallheaders(); --not supported by others then apache if (isset( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ){ if ( date("D, d M Y H:i:s T",$m_time) == $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) { send_header('HTTP/1.0 304 Not Modified'); exit; } } if(is_image($var1)){ // Content type send_header("Last-Modified: ".date("D, d M Y H:i:s T",$m_time)); $mime=get_mime($var1); send_header("Content-type: ".$mime); send_header("Content-Disposition: filename=".conv_out_header(basename($var1))." "); list($width_orig, $height_orig) = getimagesize($pa_setup["album_dir"].$var1); list($width,$height,$resize) = get_resized_imagesize($var1); if((!$original) && ($resize || is_file($pa_quality["watermark_file"]))){ if($resize){ $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefrom($pa_setup["album_dir"].$var1); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); }else{ $image_p = imagecreatefrom($pa_setup["album_dir"].$var1); } if(is_file($pa_quality["watermark_file"])){ // should be placed a watermark list($width_wat,$height_wat) = getimagesize($pa_quality["watermark_file"]); $image_w=imagecreatefrom($pa_quality["watermark_file"]); $x_wat=$width/2-$width_wat/2; $y_wat=$height/2-$height_wat/2; if(strstr($pa_quality["watermark_position"],"L")){ $x_wat=0; } if(strstr($pa_quality["watermark_position"],"R")){ $x_wat=$width-$width_wat; } if(strstr($pa_quality["watermark_position"],"U")){ $y_wat=0; } if(strstr($pa_quality["watermark_position"],"D")){ $y_wat=$height-$height_wat; } imagecopy($image_p,$image_w,$x_wat,$y_wat,0,0,$width_wat,$height_wat); } //$image_s=UnsharpMask($image_p, 20, 1,0); image_same_type($var1,$image_p,$pa_quality["photo_qual"]); return true; // cache it }else{ pa_readfile($pa_setup["album_dir"].$var1); return false; //don't cache } } if(!is_image($var1)){ ob_end_clean(); send_header("Content-type: application/download; name=\"".basename($var1)."\""); send_header("Content-Disposition: attachment; filename=\"".basename($var1)."\" "); send_header("Content-Length: ".filesize($pa_setup["album_dir"].$var1)." "); send_header("Last-Modified: ".date("D, d M Y H:i:s T",$m_time)." " ); send_header("Last-Modified: ".date("D, d M Y H:i:s T",$m_time)." " ); pa_readfile($pa_setup["album_dir"].$var1); return false; } } /****************************************/ /* DELTE CACHE */ /****************************************/ function delete_cache($cache_dir,$display=1){ if ($dh = opendir($cache_dir)) { while (($file = readdir($dh)) !== false) { if($file != "." && $file!=".."){ unlink ( $cache_dir . $file); if($display==1) echo "deleting : ".$cache_dir.$file."
"; } } closedir($dh); } } /****************************************/ /* NEXT PREV IMAGE */ /****************************************/ function get_next_prev_image ($var1){ global $pa_setup,$act_dir_sorting; $tmp="null"; $dirname=dirname($var1); if($dirname=="."){ $dirname=""; }else{ $dirname.="/"; } $dir_settings=get_directory_settings($dirname,0); $act_dir_sorting=$dir_settings[0]["sorting"]; if($act_dir_sorting=='default'){ $act_dir_sorting=$pa_setup["default_sorting"]; } $filelist=get_sorted_file_list($dir_settings[0]["seq_files"]); if(is_array($filelist) && sizeof($filelist)>0) { while(list($key,$file_array)=each($filelist)){ $file=$file_array["file_name"]; if ($file == basename($var1)){ if($tmp!="null"){ $names[]=$dirname.$tmp; }else{ $names[]="null"; } } if($tmp==basename($var1)){ $names[]= $dirname.$file; break; } $tmp=$file; } if(sizeof($names)<2){ $names[]="null"; } }else{ $names[]="null"; $names[]="null"; } return $names; } function get_dir_from_photo_var($var){ $dir=dirname($var); if($dir!="."){ $dir="/".dirname($var)."/"; $dir=str_replace("//","/",$dir); }else{ $dir="/"; } return $dir; } function update_stats($for_what,$var,$var2,$var3=null){ global $pa_setup; if($for_what=="imageview"){ $dir=get_dir_from_photo_var($var); $file=basename($var); $rec=db_select_all("directory","path=='". prepdb($dir) ."'"); $set=""; if($var2=="view"){ $set.="view_count=view_count+1;"; } if($var2=="comment"){ if($var3=="add"){ $set.="comment_count=comment_count+1;"; }else{ $set.="comment_count=comment_count-1;"; } } if($var2=="vote"){ $set.="vote_count=vote_count+1;vote_avg=((vote_avg*vote_count)+$var3)/(vote_count+1);"; } db_update("files_".$rec[0]["seq_files"],$set,"file_name=='".prepdb($file)."'"); return; } } function exiftime_to_timestamp($string){ // "YYYY:MM:DD HH:MI:SS" // 0123456789012345678 return mktime( substr($string,11,2), substr($string,14,2), substr($string,17,2), substr($string,5,2), substr($string,8,2), substr($string,0,4)); } function send_ecard($r_name,$r_email,$s_name,$s_email,$text,$var1){ global $pa_setup; if($r_email=="") return t("ID_EMAIL_IS_MANDATORY"); if($r_name=="")$r_name=$r_email; if($s_name=="")$s_name=t("ID_SOMEONE"); $time=time(); $hash=md5($r_name.$r_email.$time); $message=$pa_setup["ecard_text"]; $subject=$pa_setup["ecard_subject"]; $header = 'From: '.$s_email . "\r\n" . 'Reply-To: '.$s_email. "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message=str_replace("#FROM_NAME",$s_name,$message); $message=str_replace("#TO_NAME",$r_name,$message); $message=str_replace("#FROM_EMAIL",$s_email,$message); $message=str_replace("#TO_EMAIL",$r_email,$message); $message=str_replace("#TIME",date("H:i",$time),$message); $message=str_replace("#DATE",date("d.m.Y",$time),$message); $message=str_replace("#ECARD_ADRESS","main.php?cmd=ecardview&var1=$hash#ECARD",$message); $message=str_replace("#IMAGE_ADRESS","main.php?cmd=imageview&var1=".urlencode($var1),$message); $ret=mail($r_email,$subject,$message,$header); db_insert("ecards",Array("uid"=>$hash,"image"=>$var1,"from_name"=>$s_name,"from_email"=>$s_email,"to_name"=>$r_name,"to_email"=>$r_email,"message_text"=>$text,"created"=>$time,"picked_up"=>"false")); if($ret===true){ return t("ID_YOUR_MESSAGE_WAS SENT"); }else{ return t("ID_PROBLEM_SENDING_MESSAGE"); } } /****************************************/ /* IMAGE VIEW */ /****************************************/ function generate_ecard_view($var1){ global $pa_setup; $rec=db_select_all("ecards","uid=='".$var1."'"); if(isset($rec[0])){ $var3="view_ecard"; $var1=$rec[0]["image"]; $time=time(); if($rec[0]["picked_up"]=="false"){ //update ecard as viewed db_update("ecards","picked_up='true';","uid=='".$rec[0]["uid"]."'"); //send email to sender that the ecard was picked up $message=$pa_setup["ecard_picked_text"]; $subject=$pa_setup["ecard_picked_subject"]; $header = 'From: '.$rec[0]["to_email"] . "\r\n" . 'Reply-To: '.$rec[0]["to_email"]. "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message=str_replace("#FROM_NAME",$rec[0]["from_name"],$message); $message=str_replace("#TO_NAME",$rec[0]["to_name"],$message); $message=str_replace("#FROM_EMAIL",$rec[0]["from_email"],$message); $message=str_replace("#TO_EMAIL",$rec[0]["to_email"],$message); $message=str_replace("#TIME",date("H:i",$time),$message); $message=str_replace("#DATE",date("d.m.Y",$time),$message); $message=str_replace("#ECARD_ADRESS","main.php?cmd=ecardview&var1=".$rec[0]["uid"]."#ECARD",$message); $message=str_replace("#IMAGE_ADRESS","main.php?cmd=imageview&var1=".urlencode($var1),$message); mail($rec[0]["from_email"],$subject,$message,$header); } generate_image_view($var1,$quality,$var3,false,$rec[0]); }else{ theme_generate_error_page(); } } function generate_image_view($var1,$quality,$var3,$newest=false,$ecard=null){ global $pa_quality,$pa_setup,$pa_theme,$cmd; $var1_orig=stripslashes($var1); $var1=stripslashes($var1); //computing the $var if this is showing the newest pictures. if ($pa_theme["directory_style"]=="flowing"){ $number_of_thmbs=$pa_theme["maximum_photos_per_page"]; }else{ $number_of_thmbs=$pa_theme["raster_dir_x"]*$pa_theme["raster_dir_y"]; } if($newest===true){ if($var1<0) $var1=0;//just to be sure :) if($var1=="") $var1=0; $position=$var1; $count=$number_of_thmbs; while($count < $position+2){ $count+=$number_of_thmbs; } $newest_objects=get_newest_photos("/",$count+1); $var1=substr($newest_objects[$position]["path"],1).$newest_objects[$position]["file_name"]; } ////////////////////////////////////////////////////////////end newweest $qq=$pa_quality["photo_size"]."_".$pa_quality["photo_qual"]; if(is_file($pa_quality["watermark_file"])){ $qq.="_".$pa_quality["watermark_file"]."_".$pa_quality["watermark_position"]; } if(file_exists($pa_setup["album_dir"].$var1)){ list($width_orig, $height_orig) = getimagesize($pa_setup["album_dir"].$var1,$info); if (isset($info["APP13"])) { if(function_exists("iptcparse")){ $iptc = iptcparse($info["APP13"]); } } $sys_par["width"]=$width_orig; $sys_par["height"]=$height_orig; $sys_par["size"]=filesize($pa_setup["album_dir"].$var1); $sys_par["time"]=filemtime($pa_setup["album_dir"].$var1); $sys_par["name"]=conv_out(basename($var1)); $sys_par["link"]="main.php?cmd=imageorig&var1=".urlencode($var1); // exif stuff if(function_exists("read_exif_data")){ $info= read_exif_data($pa_setup["album_dir"].$var1); //var_dump($info); if(isset($info["FNumber"])){ $f_func=create_function('','$fnum=round('.$info["FNumber"].',1);return $fnum;'); $sys_par["exif_f"]=number_format($f_func(),1); } if(isset($info["FocalLength"])){ $fl_func=create_function('','$fl=round('.$info["FocalLength"].',1);return $fl;'); $sys_par["exif_fl"]=number_format($fl_func(),1); } $sys_par["exif_model"]=$info["Model"]; if(isset($info["ExposureTime"])){ $e_func=create_function('','$fnum='.$info["ExposureTime"].';return $fnum;'); $time=$e_func(); if($time>0.25){ $sys_par["exif_exp_time"]=$time; }else{ $sys_par["exif_exp_time"]="1/".(1/$time); } } $sys_par["exif_iso"]=$info["ISOSpeedRatings"]; if(isset($info["DateTimeOriginal"])){ $sys_par["exif_datetime"]=exiftime_to_timestamp($info["DateTimeOriginal"]); }else{ if(isset($info["DateTime"])){ $sys_par["exif_datetime"]=exiftime_to_timestamp($info["DateTime"]); } } } //var_dump($info); } $dir_path[0]['name']=t('ID_PHOTO_DIR'); $dir_path[0]['link']="main.php?cmd=album&var2=".$quality; $dirs=explode('/',$var1); $act_dir=""; for($i=0;$i0){ $dir_path[$i+1]['name']=pa_html_decode($ss[0]["alias"]); }else{ $dir_path[$i+1]['name']=conv_out($dirs[$i]); } $dir_path[$i+1]['link']="main.php?cmd=album&var1=".urlencode($act_dir)."&var2=".$quality; } $qualities=db_select_all("quality","enabled=='true'"); // select all enabled qualities $quality_links=Array(); if(count($qualities)>1){ foreach($qualities as $key=>$val){ $quality_links[]=Array("name"=>$val["name"], "link"=>"main.php?cmd=setquality&var1=".$val["id"]."&var2=$cmd&var3=".urlencode($var1_orig).get_keyword_parameter_for_link(), "actual" => ($val["id"]==$pa_quality["id"])?1:0 ); } } /*testing for next and previous image ..*/ if($newest===true){ if($position>=1){$prev_link="main.php?cmd=imageviewnew&var1=".($position-1).get_keyword_parameter_for_link();}else{$prev_link="";} if(isset($newest_objects[$position+1])){$next_link="main.php?cmd=imageviewnew&var1=".($position+1).get_keyword_parameter_for_link();}else{$next_link="";} }else{ list( $prev,$next) = get_next_prev_image($var1); if( $prev != "null" ) { $prev_link = "main.php?cmd=imageview&var1=".urlencode($prev); }else{ $prev_link =""; }; if( $next != "null" ) { $next_link = "main.php?cmd=imageview&var1=".urlencode($next); }else{ $next_link = ""; }; } list($width, $height) = get_resized_imagesize($var1); $image_link="main.php?cmd=image&var1=".urlencode($var1)."&var2=".$qq; $imageview_link="main.php?cmd=imageview&var1=".urlencode($var1); $sett_b=get_directory_settings(dirname("/".$var1),0); $sett=$sett_b[0];//dir settings $rec=db_select_all("files_".$sett["seq_files"],"file_name=='".prepdb(basename($var1))."'"); $file=$rec[0]; $img_desc=$file["desc"]; if($pa_theme["show_filenames"]=="true" && $img_desc==""){ $img_desc=conv_out(basename($var1)); } $img_desc_long=$file["long_desc"]; /* store typed comments*/ if(!$var3){ update_stats("imageview",$var1,"view"); } if($var3=="send_ecard"){ $security_checked=true; if($pa_setup["antispam_code_enabled"]=="true"){ $rec=db_select_all("anti_spam_codes","pic_seq==".$_POST["p_code_seq"]); if($rec[0]["code"]==$_POST["p_code_enter"]){ $security_checked=true; }else{ $security_checked=false; } db_delete("anti_spam_codes","pic_seq==".$_POST["p_code_seq"]); } if($security_checked){ send_ecard($_POST["p_recipient_name"],$_POST["p_recipient_email"], $_POST["p_sender_name"],$_POST["p_sender_email"], $_POST["p_your_message"],$var1); } } if($var3=="save_comment"){ $security_checked=true; if($pa_setup["antispam_code_enabled"]=="true"){ $rec=db_select_all("anti_spam_codes","pic_seq==".$_POST["p_code_seq"]); if($rec[0]["code"]==$_POST["p_code_enter"]){ $security_checked=true; }else{ $security_checked=false; } db_delete("anti_spam_codes","pic_seq==".$_POST["p_code_seq"]); } if($security_checked){ if(isset($_POST['p_text'])){ if(strlen($_POST['p_name'])==0){ $p_name="Anonymous"; }else{ $p_name=$_POST['p_name']; } if( isset($_POST['p_name']))setcookie("comment_name",$_POST['p_name'],time()+60*60*24*365); if( isset($_POST['p_email']))setcookie("comment_email",$_POST['p_email'],time()+60*60*24*365); save_comment($var1,$_POST['p_text'],$p_name,$_POST['p_email'],time()); } } } if(substr($var3,0,15)=="delete_comment-"){ $id=substr($var3,15); delete_comment($var1,$id); } $comments=get_comments($var1); /*parameters*/ $rec=db_select_all("photo_param"); if($rec)foreach($rec as $param){ if($sett["show_parameters"]=="default" && $param["default_displayed"]=="true" || isset($sett["show_parameters_custom_id"][$param["id"]]) ){ if($param["type"]=="user"){ if(isset($file["params"][$param["id"]]) && strlen($file["params"][$param["id"]])>0 ){ $parameters[$param["name"]]=$file["params"][$param["id"]]; }elseif(isset($param["default"]) && strlen($param["default"])>0){ $parameters[$param["name"]]=$param["default"]; } } if($param["type"]=="userlov"){ if(isset($file["params"][$param["id"]]) && $file["params"][$param["id"]]>=0 ){ $parameters[$param["name"]]=$param["lov"][$file["params"][$param["id"]]]; }elseif(isset($param["default_lov"]) && $param["default_lov"] >=0){ $parameters[$param["name"]]=$param["lov"][$param["default_lov"]]; } } if($param["type"]=="system"){ /*"dim"=>"Picture dimensions", "siz"=>"File size in KB", "cdt"=>"Creation date of picture", "fnm"=>"Filename", "fnl"=>"Filename with fullsize download link", "dwl"=>"Fullsize download link"*/ switch($param["default_lov"]){ case "siz": $parameters[$param["name"]]=t("ID_SYS_PAR_SIZ",round($sys_par["size"]/1024,1)); break; case "dim": $parameters[$param["name"]]=t("ID_SYS_PAR_DIM",$sys_par["width"],$sys_par["height"]); break; case "fnm": $parameters[$param["name"]]=t("ID_SYS_PAR_FNM",$sys_par["name"]); break; case "fnl": $parameters[$param["name"]]=t("ID_SYS_PAR_FNL",$sys_par["link"],$sys_par["name"]); break; case "dwl": $parameters[$param["name"]]=t("ID_SYS_PAR_DWL",$sys_par["link"]); break; case "cdt": $parameters[$param["name"]]=t("ID_SYS_PAR_CDT",date($pa_setup["date_format"],$sys_par["time"])); break; case "exif_iso": if(isset($sys_par["exif_iso"])) $parameters[$param["name"]]=t("ID_SYS_PAR_EXIF_ISO",$sys_par["exif_iso"]); break; case "exif_f": if(isset($sys_par["exif_f"])) $parameters[$param["name"]]=t("ID_SYS_PAR_EXIF_F",$sys_par["exif_f"]); break; case "exif_fl": if(isset($sys_par["exif_fl"])) $parameters[$param["name"]]=t("ID_SYS_PAR_EXIF_FL",$sys_par["exif_fl"]); break; case "exif_model": if(isset($sys_par["exif_model"])) $parameters[$param["name"]]=$sys_par["exif_model"]; break; case "exif_exp_time": if(isset($sys_par["exif_exp_time"])) $parameters[$param["name"]]=t("ID_SYS_PAR_EXIF_EXP_TIME",$sys_par["exif_exp_time"]); break; case "exif_datetime": if(isset($sys_par["exif_datetime"])){ $parameters[$param["name"]]=date($pa_setup["date_format"],$sys_par["exif_datetime"]); } break; case "iptc_caption": if(isset($iptc["2#120"])){ $parameters[$param["name"]]=$iptc["2#120"][0]; } break; case "iptc_caption_writer": if(isset($iptc["2#122"])){ $parameters[$param["name"]]=$iptc["2#122"][0]; } break; case "iptc_headline": if(isset($iptc["2#105"])){ $parameters[$param["name"]]=$iptc["2#105"][0]; } break; case "iptc_spec_ins": if(isset($iptc["2#040"])){ $parameters[$param["name"]]=$iptc["2#040"][0]; } break; case "iptc_byline": if(isset($iptc["2#080"])){ $parameters[$param["name"]]=$iptc["2#080"][0]; } break; case "iptc_byline_title": if(isset($iptc["2#085"])){ $parameters[$param["name"]]=$iptc["2#085"][0]; } break; case "iptc_credits": if(isset($iptc["2#110"])){ $parameters[$param["name"]]=$iptc["2#110"][0]; } break; case "iptc_source": if(isset($iptc["2#115"])){ $parameters[$param["name"]]=$iptc["2#115"][0]; } break; case "iptc_object_name": if(isset($iptc["2#005"])){ $parameters[$param["name"]]=$iptc["2#005"][0]; } break; case "iptc_date": if(isset($iptc["2#055"])){ $parameters[$param["name"]]=$iptc["2#055"][0]; } break; case "iptc_city": if(isset($iptc["2#090"])){ $parameters[$param["name"]]=$iptc["2#090"][0]; } break; case "iptc_subloc": if(isset($iptc["2#092"])){ $parameters[$param["name"]]=$iptc["2#092"][0]; } break; case "iptc_state": if(isset($iptc["2#095"])){ $parameters[$param["name"]]=$iptc["2#095"][0]; } break; case "iptc_country": if(isset($iptc["2#101"])){ $parameters[$param["name"]]=$iptc["2#101"][0]; } break; case "iptc_otr": if(isset($iptc["2#103"])){ $parameters[$param["name"]]=$iptc["2#103"][0]; } break; case "iptc_category": if(isset($iptc["2#015"])){ $parameters[$param["name"]]=$iptc["2#015"][0]; } break; case "iptc_subcategory": if(isset($iptc["2#020"])){ foreach($iptc["2#020"] as $key=>$value){ if(isset($parameters[$param["name"]])){ $parameters[$param["name"]]=$parameters[$param["name"]]." , ".$value; }else{ $parameters[$param["name"]]=$value; } } } break; case "iptc_priority": if(isset($iptc["2#010"])){ $parameters[$param["name"]]=$iptc["2#010"][0]; } break; case "iptc_keyword": if(isset($iptc["2#025"])){ foreach($iptc["2#025"] as $key=>$value){ if(isset($parameters[$param["name"]])){ $parameters[$param["name"]]=$parameters[$param["name"]]." , ". get_keyword_link($value); }else{ $parameters[$param["name"]]=get_keyword_link($value); } } } break; case "iptc_copyright": if(isset($iptc["2#116"])){ $parameters[$param["name"]]=$iptc["2#116"][0]; } break; } } } } theme_generate_imageview_page($dir_path,$quality_links,$img_desc,$img_desc_long,$next_link,$prev_link,$image_link,$imageview_link,$width,$height,$var3,$comments,$parameters,$ecard); } function approve_comment($var1,$id){ global $pa_grants; if(isset($pa_grants["comments"])){ $dir=get_dir_from_photo_var($var1); $file=basename($var1); $rec=db_select_all("directory","path=='". prepdb($dir) ."'"); $im_rec=db_select_all("comments_".$rec[0]["seq_files"],"id=='".$id."'"); if($im_rec[0]["visible"]!="true"){ db_update("comments_".$rec[0]["seq_files"],"visible='true';","id=='".$id."'"); update_stats("imageview",$var1,"comment","add"); } db_delete("new_comments","id=='".$id."'"); } } function delete_comment($var1,$id){ global $pa_grants; if(isset($pa_grants["comments"])){ $dir=get_dir_from_photo_var($var1); $file=basename($var1); $rec=db_select_all("directory","path=='". prepdb($dir) ."'"); $im_rec=db_select_all("comments_".$rec[0]["seq_files"],"id=='".$id."'"); if($im_rec[0]["visible"]=="true"){ update_stats("imageview",$var1,"comment","del"); } db_delete("comments_".$rec[0]["seq_files"],"id=='".$id."'"); db_delete("new_comments","id=='".$id."'"); } } function save_comment($var1,$text,$name,$email,$time){ global $pa_setup; $t_text=pa_html_encode(stripslashes($text)); $t_text=str_replace("\n","
",$t_text); $t_text=str_replace("\r","",$t_text); $dir=get_dir_from_photo_var($var1); $file=basename($var1); $rec=db_select_all("directory","path=='". prepdb($dir) ."'"); $id=db_get_seq_nextval("comment_id"); $visible_flag=$pa_setup["publish_only_approved_comments"]=="true"?"false":"true"; db_insert("comments_".$rec[0]["seq_files"],Array( "id"=>$id, "file_name"=>$file, "name"=>pa_html_encode($name), "time"=>$time, "email"=>pa_html_encode($email), "text"=>$t_text, "visible"=>$visible_flag )); if($visible_flag=="true"){ update_stats("imageview",$var1,"comment","add"); } $new_comments=db_select_all("new_comments",null,"time",true); if(count($new_comments)>=$pa_setup["comments_approve_queue_size"]){ db_delete("new_comments","id==".$new_comments[0]["id"]); } db_insert("new_comments",Array( "seq_files"=>$rec[0]["seq_files"], "id"=>$id, "pic_link"=>$var1, "file_name"=>$file, "name"=>pa_html_encode($name), "time"=>$time, "email"=>pa_html_encode($email), "text"=>$t_text )); db_commit(); } function get_comments($var1){ $dir=get_dir_from_photo_var($var1); $file=basename($var1); $rec=db_select_all("directory","path=='". prepdb($dir) ."'"); $comments=db_select_all("comments_".$rec[0]["seq_files"],"file_name=='".prepdb($file)."' && visible=='true'","time-"); return $comments; } function get_all_comments(){ global $data_dir; $comments=db_select_all("new_comments",null); return $comments; } /****************************************/ /* FOOTER */ /****************************************/ function generate_footer(){ echo "
Powered by PHP Photo Album
"; echo "
make your own tasty lip balm

make your own tasty lip balm

four michelle obama patriotism

michelle obama patriotism

said spy upskert

spy upskert

step alex gaskarth

alex gaskarth

visit engains

engains

science mapleleaf dental

mapleleaf dental

fun biofuel heating conversion

biofuel heating conversion

direct spirit filled churches in munich

spirit filled churches in munich

steam le soliel

le soliel

sight convicts and african cichlids together

convicts and african cichlids together

meant concert venues in clearwater florida

concert venues in clearwater florida

seat retraining for the disabled iowa

retraining for the disabled iowa

fall new york marathon jacket

new york marathon jacket

numeral cystic hygroma excision

cystic hygroma excision

lay millie matheny of virginia obituary

millie matheny of virginia obituary

age piccolo kevin chicago houlihan

piccolo kevin chicago houlihan

mile 55th space weather squadron

55th space weather squadron

order miranda furiture

miranda furiture

repeat chikan subway

chikan subway

until john hindmarsh goderich

john hindmarsh goderich

age anesthesia technician jobs

anesthesia technician jobs

kind loic le ribaut

loic le ribaut

against forclosed modular homes missoula

forclosed modular homes missoula

plant gpx kcl8806dtsil

gpx kcl8806dtsil

mountain dentures gurnee

dentures gurnee

safe timothy lawhorn summerville

timothy lawhorn summerville

either noahs ark wis dells

noahs ark wis dells

near transcabo transportation

transcabo transportation

measure toys for a deaf toddler

toys for a deaf toddler

happy lightweight low amp rv air conditioner

lightweight low amp rv air conditioner

bar canon mp960 bluetooth

canon mp960 bluetooth

pick aspen cto brace

aspen cto brace

dream memoral oranment

memoral oranment

company danica mckellar married

danica mckellar married

yellow olga sochi nurse

olga sochi nurse

skill outhere brothers don t stop wiggle wiggle

outhere brothers don t stop wiggle wiggle

protect jobmaster warez

jobmaster warez

straight king feng fu woodworking tools

king feng fu woodworking tools

which evensong responses rose

evensong responses rose

old san quentin inmate search

san quentin inmate search

pose mismatched bodybuilder comparisons

mismatched bodybuilder comparisons

experiment riverview lodge dryden ont

riverview lodge dryden ont

like anne zeron

anne zeron

watch incredimail letters with actual window program

incredimail letters with actual window program

fruit fixing amana ice maker

fixing amana ice maker

rock liver cist

liver cist

than humorous epitaphs from colonial times

humorous epitaphs from colonial times

company knights of the olde code dragonheart

knights of the olde code dragonheart

for hudson s bay blanket cincinnati

hudson s bay blanket cincinnati

still myspacd e

myspacd e

held busways coach timetable

busways coach timetable

speed dilsheimer

dilsheimer

safe jean m krochmal

jean m krochmal

develop metroflog proxy

metroflog proxy

say hookah hash

hookah hash

color demondre

demondre

class seatac airport cargo terminal

seatac airport cargo terminal

steam ge logicmaster software download

ge logicmaster software download

reach milliken report emerging markets real estate

milliken report emerging markets real estate

sister benicar hct

benicar hct

ship infant toddler symptom checklist

infant toddler symptom checklist

oil bar girls ao nang thailand

bar girls ao nang thailand

suggest microirrigation

microirrigation

well ethan allen sub model

ethan allen sub model

noise wedding chapels pigeon fordge tennesee

wedding chapels pigeon fordge tennesee

column anmed area center

anmed area center

radio chris brown exclusiv

chris brown exclusiv

still let go vanessa hudgens song lyrics

let go vanessa hudgens song lyrics

voice gentoo alias login username

gentoo alias login username

spot all luxury villas in las terrenas

all luxury villas in las terrenas

face p 38 lightning bone yard

p 38 lightning bone yard

industry bosch relays 30 amp

bosch relays 30 amp

am decostar 51 bulbs

decostar 51 bulbs

week indivisable t

indivisable t

lie hotels caledon ontario peel ontario

hotels caledon ontario peel ontario

word brighton peek a boo handbag

brighton peek a boo handbag

busy annona bicolor

annona bicolor

score amoebic dysentry metronidazole

amoebic dysentry metronidazole

serve sheehan pipeline construction

sheehan pipeline construction

teach alan kohll

alan kohll

electric who married martha curtis in 1759

who married martha curtis in 1759

life history of greenevers nc

history of greenevers nc

son eric berge rock falls il

eric berge rock falls il

slave stars on 45 chords tabs

stars on 45 chords tabs

plant kawaski in muskegon mi

kawaski in muskegon mi

settle puritan and genesta mystic ct

puritan and genesta mystic ct

wood paul nichols arnprior ontario

paul nichols arnprior ontario

paper sun visor decal

sun visor decal

serve mary lou carasco

mary lou carasco

king eagle optics 7x32 denali

eagle optics 7x32 denali

wall presbyterian church lincolnwood illinois

presbyterian church lincolnwood illinois

ten surrogater

surrogater

foot nefratiti

nefratiti

pair rob van der gali n

rob van der gali n

on jared coffin house nantucket

jared coffin house nantucket

chair what kind oxy cleans rust

what kind oxy cleans rust

seed lapeyrouse maison bleu

lapeyrouse maison bleu

grow using peroxide in the laundry

using peroxide in the laundry

tube lentz lighting

lentz lighting

sun trolly downtown sacramento to west sacramento

trolly downtown sacramento to west sacramento

property multi strand turquoise necklace

multi strand turquoise necklace

line td27 nissan motor info

td27 nissan motor info

joy jeep liberty clinometer

jeep liberty clinometer

more reel works air hose reel

reel works air hose reel

cut cordova camp church

cordova camp church

kind photos of peterbuilt or freightliner trucks

photos of peterbuilt or freightliner trucks

watch chetola resort in blowing rock nc

chetola resort in blowing rock nc

run sql server 2000 varify physical filepath

sql server 2000 varify physical filepath

cry sunday river ski and memorabilia

sunday river ski and memorabilia

go jts auto sales inc

jts auto sales inc

rope animal kingdon disney world

animal kingdon disney world

mile stephen k hayes fraud

stephen k hayes fraud

matter using road signs in efl

using road signs in efl

want crescentic shelf osteotomy

crescentic shelf osteotomy

arm jamaal redd newark

jamaal redd newark

plan jack salter royal oak mi

jack salter royal oak mi

problem king richard sterling flatware pattern towle

king richard sterling flatware pattern towle

did shenzhen to yihang

shenzhen to yihang

science ruth ellen benedict

ruth ellen benedict

crowd mrsa and impetigo

mrsa and impetigo

call oracle failed login attempts updatew

oracle failed login attempts updatew

pass mexican respice

mexican respice

afraid josh kelley amazing lyrics

josh kelley amazing lyrics

my clearfield jefferson mental health mental retardation

clearfield jefferson mental health mental retardation

surface vsx 1016txv k

vsx 1016txv k

help doom 32x rom emulator

doom 32x rom emulator

mountain vineyard wall mural

vineyard wall mural

study 7311 huntington square ln huntington square

7311 huntington square ln huntington square

possible timeline for b b king

timeline for b b king

major death notice brenda lint

death notice brenda lint

circle san antonio northside isd

san antonio northside isd

half obit oddity

obit oddity

protect ak1025 mp3

ak1025 mp3

and erin althen

erin althen

other matthew conway nashville

matthew conway nashville

open carco group

carco group

term narcotics anonymous jehovahs witness

narcotics anonymous jehovahs witness

temperature sony ericsson 600i cell phone

sony ericsson 600i cell phone

develop santhera pharmaceuticals

santhera pharmaceuticals

forward grassi lakes hiking trail

grassi lakes hiking trail

oh vw air cooled carborators

vw air cooled carborators

figure mannatech angie rhoades blog

mannatech angie rhoades blog

cotton captain bideo

captain bideo

smell family hotels st augastine fl

family hotels st augastine fl

boy large slice toasters

large slice toasters

between royaltek rbt 2001 batteries

royaltek rbt 2001 batteries

general progreso mexico beaches

progreso mexico beaches

next beehive waxing carlsbad

beehive waxing carlsbad

temperature ontario rabbitries

ontario rabbitries

fun tacconelli s pizza

tacconelli s pizza

leg help 1960 kurtzman

help 1960 kurtzman

did hazelnut nougat cream recipe

hazelnut nougat cream recipe

kind filippi obituaries

filippi obituaries

thin resiliant wallboard

resiliant wallboard

select apartments for rent in chehalis wa

apartments for rent in chehalis wa

represent small infant testical

small infant testical

steam stolen vidioes

stolen vidioes

with sabek

sabek

she berks county history 1803

berks county history 1803

lot enigma browser review helpful found users

enigma browser review helpful found users

front remove bios password on toshiba satellite

remove bios password on toshiba satellite

foot pancake cafes werribee vic

pancake cafes werribee vic

train dnr glenwood

dnr glenwood

some cadilac vehicles

cadilac vehicles

watch family realty connersville

family realty connersville

dear infant passing stool

infant passing stool

a electromedical ga

electromedical ga

block animal rights scientific research cosmetics lawsuits

animal rights scientific research cosmetics lawsuits

mean south aftrican mastiff

south aftrican mastiff

under olympus e 10 polarizing filter

olympus e 10 polarizing filter

house wan mat saman

wan mat saman

sheet lamb 1body parts

lamb 1body parts

people maurice walker entertainment

maurice walker entertainment

sharp preserve golf course saddlebrook

preserve golf course saddlebrook

inch packer certified haccp transportation

packer certified haccp transportation

imagine andy vanosdale s blog

andy vanosdale s blog

tie ebay ptz camera

ebay ptz camera

drop varible drag in flight

varible drag in flight

sail 2n5401

2n5401

down ann garza seabrook

ann garza seabrook

blue sir john napier logarithms

sir john napier logarithms

fair services program manager tasks wbs sow

services program manager tasks wbs sow

radio sheet metal machinist jobs

sheet metal machinist jobs

select photos of hargnies france

photos of hargnies france

stop pictures of a tiki hut

pictures of a tiki hut

guess maddie cornet

maddie cornet

experiment ashville north carolina antique malls

ashville north carolina antique malls

row hor dourve recipes

hor dourve recipes

ball white cream pearl gold cocktail ring

white cream pearl gold cocktail ring

fast solid oak bedroom 4146

solid oak bedroom 4146

oh invermere employment

invermere employment

soldier tater burke

tater burke

yet birthday of pam golding

birthday of pam golding

afraid darke county ohio emergency scanner frequencies

darke county ohio emergency scanner frequencies

sat fluoroquinolones and increase in lfts

fluoroquinolones and increase in lfts

laugh wootz steel

wootz steel

he horsepower ratings 2003 dodge cummins diesel

horsepower ratings 2003 dodge cummins diesel

left newton new jersey fleemarket

newton new jersey fleemarket

favor resipies useing rice flower

resipies useing rice flower

picture dps velocity fcp incite avid

dps velocity fcp incite avid

think hanohano pronounced

hanohano pronounced

my death obit for parkersburg wv

death obit for parkersburg wv

bit pantsuit plus short sleeve

pantsuit plus short sleeve

guess seiken 3 walkthrough

seiken 3 walkthrough

wall weapons boresighting

weapons boresighting

found envelope printery

envelope printery

century discount tweezerman cuticle

discount tweezerman cuticle

this banca nationala a romanien

banca nationala a romanien

paragraph joy screw compressor

joy screw compressor

most addictive ingrediant lip balm

addictive ingrediant lip balm

neck green cory catfish diet

green cory catfish diet

drop hassan 419 scam

hassan 419 scam

at shenanigans restaurant jantzen beach

shenanigans restaurant jantzen beach

crowd peter polzer hamburg

peter polzer hamburg

allow hotel hispania mallorca

hotel hispania mallorca

strange cwk music

cwk music

fig ruud seer heat pumps

ruud seer heat pumps

down katzenjammer promotions

katzenjammer promotions

led beginner crochet afghan

beginner crochet afghan

divide bellingham kennels

bellingham kennels

person knappogue irish whiskey

knappogue irish whiskey

have metco realty texas

metco realty texas

offer renzy davenport washington srtate

renzy davenport washington srtate

plane tennessee dana corp boiler explosions

tennessee dana corp boiler explosions

when msra staph photo

msra staph photo

wash josalyn snyder

josalyn snyder

hat orphanages nightlight california russian

orphanages nightlight california russian

history sugar in diesal fuel tank

sugar in diesal fuel tank

buy pultrusion training manual

pultrusion training manual

late cyberliteracy

cyberliteracy

share lamy joy calligraphy pen

lamy joy calligraphy pen

send gerber wall mount kitchen faucet

gerber wall mount kitchen faucet

rise tacy bingham

tacy bingham

wide grandview speedway drivers

grandview speedway drivers

duck jake buttrick

jake buttrick

appear bemco mattress

bemco mattress

white color words in crayon for primary

color words in crayon for primary

mile breyer horse barn plans

breyer horse barn plans

year merv griffin totie fields

merv griffin totie fields

cold dana thomas house pictures

dana thomas house pictures

snow nortels revenues percent zafirovski india company

nortels revenues percent zafirovski india company

send vista ridge mall tx

vista ridge mall tx

center 105 1 golden oldies

105 1 golden oldies

plane brandman lung cancer

brandman lung cancer

mountain xbox invalid media type

xbox invalid media type

run pei wei coupons

pei wei coupons

party fessio ave maria dismissed

fessio ave maria dismissed

air vestibular schwannoma diagnosis and medical treatment

vestibular schwannoma diagnosis and medical treatment

sun ratel serbia

ratel serbia

port rose throated becard

rose throated becard

stood root hd1 0 filesystem type unknown

root hd1 0 filesystem type unknown

success cholestoral in seafood

cholestoral in seafood

proper bubba gump s butter sauce recipe

bubba gump s butter sauce recipe

remember hooker furniture preston ridge

hooker furniture preston ridge

see sankyo jikki simulations

sankyo jikki simulations

hurry auto buffer polisher discount

auto buffer polisher discount

surface anderson brothers developement pewaukee

anderson brothers developement pewaukee

make romika shoes about us

romika shoes about us

late codicil olympia

codicil olympia

river petronzio sculpture

petronzio sculpture

shoulder spelling words fifth gade

spelling words fifth gade

had progs and punters

progs and punters

pitch fundamentals of genetics worksheets

fundamentals of genetics worksheets

cloud aikido seiichi sugano

aikido seiichi sugano

arm jeffrey strawser

jeffrey strawser

rail cape town newlands forest

cape town newlands forest

think video controller acer 5100 xp driver

video controller acer 5100 xp driver

wire 1977 wimboldon

1977 wimboldon

color dusty schulz fargo nd

dusty schulz fargo nd

too ladies diamonds watches reasonably priced

ladies diamonds watches reasonably priced

mind spanish manchego cheese

spanish manchego cheese

corn schaumann eilsleben

schaumann eilsleben

brown panasonic dmc fz5 battery charger

panasonic dmc fz5 battery charger

mountain corey emmert

corey emmert

garden heeman greenhouses website

heeman greenhouses website

never stihl esales

stihl esales

the pre schools in norwalk ct

pre schools in norwalk ct

eye icom ic 2200h

icom ic 2200h

sudden mastervolt usa

mastervolt usa

decimal used drum carders

used drum carders

and israelism vs christianity

israelism vs christianity

gas speial operations

speial operations

dress trex pmt 6600

trex pmt 6600

question 1989 coleman tent trailer

1989 coleman tent trailer

necessary the nut factory van beuren studios

the nut factory van beuren studios

else apex center 72nd ave aravda colorado

apex center 72nd ave aravda colorado

cost pali lilly crib

pali lilly crib

press mark higgins fun lake inc

mark higgins fun lake inc

mountain tyrolean traverse with stokes

tyrolean traverse with stokes

decimal val and linda lownes

val and linda lownes

yellow alec baldwin basinger voice mail

alec baldwin basinger voice mail

miss resorts at elkhart lake wi

resorts at elkhart lake wi

drink when is taurine dangerous

when is taurine dangerous

held fable bowerstone tavern cellar

fable bowerstone tavern cellar

ask replace waterbed mattress with regular mattress

replace waterbed mattress with regular mattress

string car rentals eastpoint florida

car rentals eastpoint florida

old rapcity tha basement

rapcity tha basement

ocean heidi roeber

heidi roeber

own knbn tv

knbn tv

lady black dirt devil featherlite upright vacuum

black dirt devil featherlite upright vacuum

brown overton tx funeral records

overton tx funeral records

their christy bradley weilbacher

christy bradley weilbacher

free no mercy sherman s fury

no mercy sherman s fury

paint meteors asteroids student model

meteors asteroids student model

corner generic uptempo folk song lyrics

generic uptempo folk song lyrics

log kingston 2gb red micro sd

kingston 2gb red micro sd

winter ford mondeo england homepage

ford mondeo england homepage

tube canon bjc 5100 printer driver download

canon bjc 5100 printer driver download

teach kajn

kajn

train nuvico cameras

nuvico cameras

note woolpack hotel victoria australia

woolpack hotel victoria australia

coast portable hyperbaric chamber construction material

portable hyperbaric chamber construction material

material jeff pister

jeff pister

fell hp pavilion dv9700t 2 5 reviews

hp pavilion dv9700t 2 5 reviews

stead bes blackberry vmware compatibility

bes blackberry vmware compatibility

gentle trip trogen

trip trogen

crop mcneely us navy retired

mcneely us navy retired

foot wedding photographers in selma alabama

wedding photographers in selma alabama

nature sacral bone cyst

sacral bone cyst

open gofl channel

gofl channel

way 5 11 hrt boot ad

5 11 hrt boot ad

hill jake peavy arrested

jake peavy arrested

they craigslist phillippines

craigslist phillippines

many frost ridge campground leroy ny

frost ridge campground leroy ny

print motela in whiteville nc

motela in whiteville nc

liquid dells pharmacy houston

dells pharmacy houston

solution vcu and scrub pants

vcu and scrub pants

death sofc seal

sofc seal

lie roy lichtenstein leaflet

roy lichtenstein leaflet

early roels maarten

roels maarten

listen wine mercaptans test copper iowa state

wine mercaptans test copper iowa state

else 5 star hotels gulf shores alabama

5 star hotels gulf shores alabama

wire barbara rezabek

barbara rezabek

thing hans noordermeer

hans noordermeer

garden online notory renewal

online notory renewal

learn illyaas

illyaas

until auto wreckers creemore ontario

auto wreckers creemore ontario

and vandel in amsterdam

vandel in amsterdam

high belize heavy oil

belize heavy oil

cause solaris mercy anniversary dinner

solaris mercy anniversary dinner

enough or dmv 1502 sw 6th ave

or dmv 1502 sw 6th ave

star birth date of janis oliver gill

birth date of janis oliver gill

tiny luis vela monroe wa landscaping

luis vela monroe wa landscaping

board pirate captain john littlepage

pirate captain john littlepage

special half price mama mia tickets vegas

half price mama mia tickets vegas

old handbook bmw 735

handbook bmw 735

food mypace gens

mypace gens

fast t afia

t afia

winter edina city fire permit

edina city fire permit

drop drift laundry detergent

drift laundry detergent

fraction green dress with turquoise rickrack

green dress with turquoise rickrack

broke lesson plans miss rosie lucille clifton

lesson plans miss rosie lucille clifton

metal random acts of kindness campaign

random acts of kindness campaign

than m83726 28

m83726 28

stand olean new york enviromental conservation

olean new york enviromental conservation

measure appleway toyota spokane washington

appleway toyota spokane washington

lady modem pci ven 10b9

modem pci ven 10b9

north un security council resolution delisting 2006

un security council resolution delisting 2006

duck sutter health sacramento sierra

sutter health sacramento sierra

travel school punishment in the elizabethan era

school punishment in the elizabethan era

sea asa hyatt facebook

asa hyatt facebook

forward micro tilt adjustment telecaster

micro tilt adjustment telecaster

shout narcicus

narcicus

seat columbian immigration laws

columbian immigration laws

knew ge smarthome keypad controlled door alarm

ge smarthome keypad controlled door alarm

iron holliday inn lusaka

holliday inn lusaka

suggest andy kim rock me gently video

andy kim rock me gently video

band aedst australian eastern daylight saving time

aedst australian eastern daylight saving time

seed neon roap

neon roap

fresh cara summers rapidshare

cara summers rapidshare

duck ncar and gate group

ncar and gate group

nation ac60 power supply

ac60 power supply

rest horoscopes walther

horoscopes walther

produce truth aquatics vision

truth aquatics vision

smile coastal plain raceway jacksonville nc

coastal plain raceway jacksonville nc

street the kabalah learning centre peru

the kabalah learning centre peru

crease
pose

pose

down she

she

chord moment

moment

radio bad

bad

dry or

or

famous time

time

sugar less

less

element bit

bit

ago section

section

skill moon

moon

were like

like

basic sleep

sleep

climb come

come

company continent

continent

near three

three

note stood

stood

last mind

mind

kind broad

broad

only person

person

develop some

some

receive put

put

check settle

settle

stood appear

appear

soldier saw

saw

two field

field

learn reply

reply

decide slip

slip

view print

print

danger trade

trade

bring create

create

party act

act

do atom

atom

similar form

form

consider mean

mean

office flow

flow

more rich

rich

invent noun

noun

eat camp

camp

draw bank

bank

complete indicate

indicate

talk sight

sight

port spell

spell

soon real

real

how red

red

discuss mother

mother

spread won't

won't

box flat

flat

run sharp

sharp

black weather

weather

shell surprise

surprise

us good

good

miss share

share

and thousand

thousand

round stand

stand

steam design

design

consonant wait

wait

gas collect

collect

support close

close

expect left

left

whether rain

rain

box it

it

consonant last

last

tree earth

earth

part ship

ship

if spread

spread

fact numeral

numeral

heavy match

match

nation throw

throw

gun insect

insect

letter hunt

hunt

cow good

good

clean card

card

square
kasia teen model

kasia teen model

me east coast swing songs

east coast swing songs

depend marble look cabinet knobs

marble look cabinet knobs

has georgeous cunts

georgeous cunts

operate teen charged in pa

teen charged in pa

original eat pray love spoliers

eat pray love spoliers

lie guildwars hentai

guildwars hentai

melody polio sex

polio sex

happen masterbation soft erection

masterbation soft erection

he illegally nude teens

illegally nude teens

main lesbian porne

lesbian porne

guide christiano ronaldo in underwear

christiano ronaldo in underwear

stretch suck his chick

suck his chick

set softcore boobs

softcore boobs

master teen age suicide

teen age suicide

discuss naked ronnie

naked ronnie

score hereford amateur operatic

hereford amateur operatic

stick silvina luna pussy

silvina luna pussy

call sex with other couples

sex with other couples

matter xxx wives

xxx wives

log foot pantie hose fetish

foot pantie hose fetish

radio breast files 3

breast files 3

we jazzmin booty

jazzmin booty

string household masturbation objects

household masturbation objects

basic arab escorts

arab escorts

quiet femdom hand job

femdom hand job

pair stereo porn images

stereo porn images

a nude chineese escorts

nude chineese escorts

throw nature teens

nature teens

cat blonde fitness model

blonde fitness model

coat buttfucking milfs

buttfucking milfs

forest judy taylor nude

judy taylor nude

poor see woman squirt

see woman squirt

door ascensia microfill test strips

ascensia microfill test strips

dress sword edged blonde

sword edged blonde

new vancouver korean singles

vancouver korean singles

least gay teen boy video

gay teen boy video

complete dogpile pichunter

dogpile pichunter

track can virgins get pregnant

can virgins get pregnant

wind honda odyessey mpg

honda odyessey mpg

pound giant pussy pic

giant pussy pic

must army wife amateur video

army wife amateur video

current famly guy nude

famly guy nude

simple lesbian girls locker room

lesbian girls locker room

general gay vancouver canada

gay vancouver canada

market audio books torrent romance

audio books torrent romance

noise certified butts

certified butts

sail fayetteville ga sex

fayetteville ga sex

next neal group bdsm bbw

neal group bdsm bbw

of fat anal orgy

fat anal orgy

egg seductive model

seductive model

lone usga us amateur

usga us amateur

family busty ms cajun

busty ms cajun

skill effective online dating

effective online dating

continue anal escort budapest

anal escort budapest

example israel webcams

israel webcams

language ebony porn star list

ebony porn star list

bought blonde hair extentions

blonde hair extentions

about worlds most erotic lingerie

worlds most erotic lingerie

person chick lit domestic violence

chick lit domestic violence

salt big cocks websites

big cocks websites

hold nudist rv campgrounds ca

nudist rv campgrounds ca

test lovely rag

lovely rag

don't black thick boobs

black thick boobs

come catholic and gay marriage

catholic and gay marriage

opposite powerpuff girls having sex

powerpuff girls having sex

magnet brudal sex

brudal sex

enter hardcore sex mpegs

hardcore sex mpegs

color ford escort tier shaft

ford escort tier shaft

could kety teen nude video

kety teen nude video

complete adelaide miss nude pageant

adelaide miss nude pageant

rub tila lesbian sex

tila lesbian sex

twenty patricia velasquez nude

patricia velasquez nude

wild ranpha nude

ranpha nude

eye busty pornstar nurse

busty pornstar nurse

happy video of breast exams

video of breast exams

solution tiny striped snake

tiny striped snake

die eunuchs porn

eunuchs porn

her torture and bondage

torture and bondage

let women nude art picks

women nude art picks

way oovoo dating

oovoo dating

hunt tranny on girl pics

tranny on girl pics

glad muslim teen sex

muslim teen sex

mouth naked idol pics

naked idol pics

farm love during cholera

love during cholera

notice norway hardcore sex

norway hardcore sex

nothing blacks on asians xxx

blacks on asians xxx

natural collage mature forums

collage mature forums

after mature women seduce

mature women seduce

spread online fiction lesbian

online fiction lesbian

written carrollton ga sex

carrollton ga sex

shout isabella lesbian teen hunter

isabella lesbian teen hunter

coat ryan carnes shirtless

ryan carnes shirtless

case naughty america ass masterpiece

naughty america ass masterpiece

success halloween blonde

halloween blonde

select nasty nats

nasty nats

band amateur cam es

amateur cam es

wheel teen bikinix

teen bikinix

above weightwatchers chick

weightwatchers chick

fine steps to have masturbation

steps to have masturbation

by organized sex organization

organized sex organization

low betty xxx

betty xxx

circle jenny buchanon intimates

jenny buchanon intimates

know ghetto booty 6

ghetto booty 6

market capri styles ebony

capri styles ebony

subtract the lesbian code song

the lesbian code song

forward nude igrls

nude igrls

thought nudist teen sisters

nudist teen sisters

feed spanking boys underpants

spanking boys underpants

bought hardcore femdom

hardcore femdom

chair matyre porn

matyre porn

heart chunky mature 9 video

chunky mature 9 video

plan jizz in a cup

jizz in a cup

play porn pics posh

porn pics posh

path gsd studs

gsd studs

phrase binder clips on nipples

binder clips on nipples

sent boobs mature

boobs mature

reach amatuer beaver

amatuer beaver

song fat ebony hoes

fat ebony hoes

probable buffie tha bodies pussy

buffie tha bodies pussy

paragraph teen skye model

teen skye model

perhaps porn japanese babes

porn japanese babes

plant heather gangbang

heather gangbang

main mature escorts in london

mature escorts in london

year hot mature vedio

hot mature vedio

language fantasys michigan strip clubs

fantasys michigan strip clubs

yellow porn post tube

porn post tube

war tiffany dildo movie

tiffany dildo movie

mother puny dick

puny dick

want watch me naked

watch me naked

visit pussy licking women

pussy licking women

current breast enhancing swim wear

breast enhancing swim wear

ago relationship astrology

relationship astrology

tie frost penetration new hampshire

frost penetration new hampshire

indicate teen free stuff safe

teen free stuff safe

rock nice azz tits

nice azz tits

dress pussy closet

pussy closet

tail erotic breast expansion stories

erotic breast expansion stories

animal kari wuhrer breasts

kari wuhrer breasts

fig hi5 raunchy

hi5 raunchy

first ultrasound facials

ultrasound facials

go exotic thai pussy

exotic thai pussy

earth teen free stuff safe

teen free stuff safe

noon farmyard fansites sex

farmyard fansites sex

stead vaginal discharge in pregnancy

vaginal discharge in pregnancy

supply hentai love free

hentai love free

except 60477 sex offenders

60477 sex offenders

bone slut cum in mouth

slut cum in mouth

six lebian kiss

lebian kiss

feet virtual pets puppy love

virtual pets puppy love

brought dog peeing infection

dog peeing infection

hill lesbian sex slaves

lesbian sex slaves

gather donna lisa xxx

donna lisa xxx

down bdsm taking as concubine

bdsm taking as concubine

black artstic nudes

artstic nudes

love men suck horse cock

men suck horse cock

direct steve winwood higher love

steve winwood higher love

separate thick latina amateurs

thick latina amateurs

sign
just just stick nature nature cat complete complete cold sing sing think men men then surface surface compare cotton cotton consonant dark dark sound bank bank after apple apple animal imagine imagine fair small small hair half half flow go go sat shall shall brother product product made bad bad favor syllable syllable quart line line have know know course matter matter near example example some condition condition whether pass pass face out out element people people step noun noun we key key less notice notice flat lift lift stead mean mean operate dream dream trip house house bird with with process feed feed soft off off flower century century result ready ready certain nine nine large possible possible grow deep deep door does does some vary vary in pay pay cool hold hold shoulder too too track paragraph paragraph include general general bank island island skin work work fire still still run moment moment were young young talk mass mass fig level level plain name name color shoe shoe summer record record circle love love corner
shemales seducing married men shemales seducing married men prepare adulterous love adulterous love age southampton anal owo southampton anal owo tell sex slave cunt sex slave cunt path chicks fuckedby old men chicks fuckedby old men tone sex videos nl free sex videos nl free unit sbbw porn sbbw porn record gree online escort service gree online escort service distant teen beach nips teen beach nips over alaskan underwear alaskan underwear country vista webcam philps driver vista webcam philps driver miss lesbian xxx pictures lesbian xxx pictures choose ass tits fuck ass tits fuck figure wtf mpegs wtf mpegs touch cartoon hardcore fucking girls cartoon hardcore fucking girls case huge tits working out huge tits working out game teen earrings teen earrings three counseling in higher education counseling in higher education water chubby ebs chubby ebs these cartoon slave sex cartoon slave sex or breast exam youtube breast exam youtube name mother in law sex mother in law sex a suction erection suction erection prove dog vaginal discharge blood dog vaginal discharge blood water sensitive breasts and thc sensitive breasts and thc art the monkeys paw breast the monkeys paw breast language whole porn lesbian whole porn lesbian smell cake toppers gay cake toppers gay late virgin mobile unlock virgin mobile unlock port secret amateur vbideos secret amateur vbideos dream football butts nice football butts nice tie eden gay men eden gay men which wwe hardcore sex wwe hardcore sex true . aidon escort aidon escort indicate emma watson naked foto s emma watson naked foto s door dating for vampires dating for vampires done discount children wetsuit discount children wetsuit point lucy pinder pron lucy pinder pron you clyde barrow gay prison clyde barrow gay prison several beauty salons near northridge beauty salons near northridge several erotic batman stories erotic batman stories instant jiggle jugs tits jiggle jugs tits moon tall teen boutique tall teen boutique plan prevata brown booties prevata brown booties fall nell mcandrew nude pics nell mcandrew nude pics test hidden camera voyer porn hidden camera voyer porn smell wonder woman sex stories wonder woman sex stories blue nude brittany spears nude brittany spears loud anal ass fucking avi s anal ass fucking avi s self horny road construction women horny road construction women surprise ake tits ake tits heard jessica james pictures nude jessica james pictures nude thank 97 9 kiss ny 97 9 kiss ny at funny stuff with porn funny stuff with porn dance only blonde porn only blonde porn strong funny naked fat women funny naked fat women page chords love mr trnder chords love mr trnder track nude photographs of rachel nude photographs of rachel mother rough gay sex avis rough gay sex avis your licking my master licking my master vowel definition erectile dysfunction definition erectile dysfunction represent estella warren sex scene estella warren sex scene cause dutch nudists dutch nudists drop like a slut lyrics like a slut lyrics steel neon genisis evangelion hentai neon genisis evangelion hentai correct natural facial cleanser recipe natural facial cleanser recipe blue marron hentai marron hentai day jenna s beaver clearance jenna s beaver clearance then midget orgy midget orgy exact safe sex statistics usa safe sex statistics usa nothing milf wankers milf wankers ask lesbo pron lesbo pron excite bdsm suck bdsm suck human pussy pictures porn pussy pictures porn study groupie love g unit groupie love g unit oxygen young puffy nipples gallery young puffy nipples gallery sign fantasy sleep sex free fantasy sleep sex free evening fingering save target as fingering save target as every unusual object sex unusual object sex sign animated sex porn animated sex porn person hot nude yoga hot nude yoga swim gay cameron escort gay cameron escort share porn movies library porn movies library shall porn video clip granny porn video clip granny smile handjob hard handjob hard silent chubby chat chubby chat stand black porn swomen black porn swomen square science fiction romance readers science fiction romance readers keep self blowjob pics self blowjob pics steam weird naked indian weird naked indian pair teens and marijuna teens and marijuna cell q hardcore sex q hardcore sex way dad fucks mary dad fucks mary excite love city pan dragons love city pan dragons ride mpg to wmv converter mpg to wmv converter count sasha dejavu strip club sasha dejavu strip club back crossdress resources crossdress resources found weenie girls weenie girls help cauterized cunt cauterized cunt join midget s having sex midget s having sex coat trailers milf seekers trailers milf seekers animal halloween movie graphic nudity halloween movie graphic nudity engine beautiful naked italian brunettes beautiful naked italian brunettes team scripted romance scripted romance floor voyeurism hotels voyeurism hotels stone ashton taylor bondage ashton taylor bondage quart snowmaiden sex snowmaiden sex steam sex dwar mp3 sex dwar mp3 position oahu bang bus oahu bang bus cover punjabi love shayari punjabi love shayari print de desnudas foto latinas de desnudas foto latinas dictionary em porn em porn perhaps reality teen fucking reality teen fucking develop kelly sedam nude kelly sedam nude fact women s pussy pictures women s pussy pictures moon hard gay s wife hard gay s wife about hott korean sex hott korean sex say power distribution strip power distribution strip color gay kuwaitis gay kuwaitis full bat in the pussy bat in the pussy capital cumberland falls nude pics cumberland falls nude pics him neil larsen jungle love neil larsen jungle love race natalie portman sex videos natalie portman sex videos like bite the slut s nipples bite the slut s nipples quick pleasure bent pleasure bent slave married and looking wives married and looking wives picture asian beaver black asian beaver black train candle wax on pussys candle wax on pussys clean pussy eating clips pussy eating clips man ass fucked dvd ass fucked dvd visit russian news papers personals russian news papers personals chord casandra townsend nude casandra townsend nude corner todler porn todler porn line sex toy homemade sex toy homemade major black lace big tits black lace big tits will tight teen jeans pic tight teen jeans pic six pam dawber and nude pam dawber and nude money old senior porn old senior porn bear zetta nude zetta nude child lesbian activize clubs nyc lesbian activize clubs nyc spread amature swallow xxx amature swallow xxx road chicks on motorcycle wallpaper chicks on motorcycle wallpaper phrase first time doggy sex first time doggy sex sky breast augmentation devices breast augmentation devices who hentai villi hentai villi up views on topless beaches views on topless beaches time zodiac love capatability zodiac love capatability in embarrassed naked vidios embarrassed naked vidios east mrs kenya beauty pageant mrs kenya beauty pageant talk mpg 94 f 250 diesel mpg 94 f 250 diesel together tits oiled cum tits oiled cum settle teenage dating sites teenage dating sites history feet fetish hardcore videos feet fetish hardcore videos charge naughty sex coupons naughty sex coupons low beatiful chocolate booty beatiful chocolate booty box beauty salon oakland ca beauty salon oakland ca cloud pinoy horny stories pinoy horny stories degree cz bdsm cz bdsm until north carolina sex offerenders north carolina sex offerenders lone rapidshare orgy tracks 2 rapidshare orgy tracks 2 is rate drunk teen babes rate drunk teen babes forward keira davidson nude keira davidson nude apple teen sheer top teen sheer top spend angelina jolee sex video angelina jolee sex video strange incontri webcam gratuita incontri webcam gratuita key japaneese whores japaneese whores object booty booty rocking everywhere booty booty rocking everywhere list 72 virgins boys 72 virgins boys inch male celbrities naked male celbrities naked nature rosario nude rosario nude above what are love handles what are love handles finger coeds pissing coeds pissing surface reno strip club stiptease reno strip club stiptease pound daytona and tits daytona and tits woman shaved chicks shaved chicks green beaver rv parts beaver rv parts molecule child nudist images child nudist images there phoebe cates naked phoebe cates naked skill blonde by choice blonde by choice hour gay rubber lovers gay rubber lovers some krista archives sex stories krista archives sex stories total christian chatroom websites christian chatroom websites molecule wet pussy hunters wet pussy hunters whole
"; } function check_writable($dir){ $file=fopen($dir."writablity_test","w"); fclose($file); // unlink($dir."writablity_test"); return $file; } function write_log(){ global $pa_setup,$cmd,$var1,$passwd,$pa_user; if($pa_setup["logs_enabled"]=="true"){ $strings=explode(";",$pa_setup["logs_exclude"]); $found="false"; $host=gethostbyaddr($_SERVER['REMOTE_ADDR']); foreach($strings as $num=>$string){ if(strlen($string)>0) if(strstr($host,$string))$found="true"; } if($found=="false"){ $file_log=fopen($pa_setup["cache_dir"].$pa_setup["logs_filename"],"a"); fwrite($file_log,date("D.M.j G:i:s")."|".$cmd."|".$var1."|".$pa_user["name"]."|".$host."|\n"); fclose($file_log); } } } function generate_theme($var1){ if($var1=="style_css"){ theme_get_style_css(); return; } } function install_database(){ global $data_dir,$phpalbum_version,$init_album_dir,$init_cache_dir,$init_ftp_server,$init_ftp_photos_dir; require("install_db.php"); } /****************************************/ /* Start Program v0. */ /****************************************/ /* foreach($_POST as $key=>$value){ $_POST[$key]=stripslashes($value); } */ if(isset($_GET['cmd'])){ $cmd=$_GET['cmd']; } if(isset($_GET['keyword'])){ $pa_keywords=explode(" ",$_GET['keyword']); foreach($pa_keywords as $key=>$value){ if(strlen(trim($value))==0){ unset($pa_keywords[$key]); } } $pa_original_keywords=$_GET['keyword']; $pa_keywords_unsorted=$pa_keywords; } if(isset($_GET['var1'])){ $var1=stripslashes($_GET['var1']); } if(isset($_GET['var2'])){ $var2=stripslashes($_GET['var2']); } if(isset($_GET['var3'])){ $var3=stripslashes($_GET['var3']); } if(isset($_GET['var4'])){ $var4=stripslashes($_GET['var4']); } if(isset($_POST['cmd'])){ $cmd=$_POST['cmd']; } if(isset($_POST['keyword'])){ $pa_keywords=explode(" ",$_POST['keyword']); } if(isset($_POST['var1'])){ $var1=$_POST['var1']; } if(isset($_POST['var2'])){ $var2=$_POST['var2']; } if(isset($_POST['var3'])){ $var3=$_POST['var3']; } if(isset($_POST['var4'])){ $var4=$_POST['var4']; } if($cmd!="album" && $cmd!="albumnew" && $cmd!="phpinfo" && $cmd!="thmb" && $cmd!="imageorig" && $cmd!="image" && $cmd!="imageview" && $cmd!="ecardview" && $cmd!="imageviewnew" && $cmd!="setup" && $cmd!="delcache" && $cmd!="logo" && $cmd!="theme" && $cmd!="themeimage" && $cmd!="antispampic" && //$cmd!="system_check" && $cmd!="setquality"){ $cmd="album"; } require("phpdatabase.php"); /*if(!db_startup_database("album",$data_dir)){ install_database(); }*/ if(!db_startup_database("album",$data_dir)){ db_create_database("album",$data_dir); install_database(); } db_set_auto_commit(false); $pa_db_version=db_select_all("phpalbum_version"); if(!isset($pa_db_version[0]) || $pa_db_version[0]["version"]!=$phpalbum_version){ include "upgrade_db.php"; } read_settings(); require($themes_dir."engines/".$site_engine."/engine.php"); require("language.php"); if($cmd=="setquality"){ if(!($rec=db_select_all("quality","id=='$var1'"))){ //setted quality not found $rec=db_select_all("quality","default=='true'"); } $pa_quality=$rec[0]; setcookie("phpAlbum_quality",$pa_quality["id"],time()+60*60*24*365); $cmd=$var2;$var1=$var3;$var2="";$var3=""; if(isset($var3)){ $var2=$var3;} if(isset($var4)){ $var3=$var4;} }else{ if(isset($_COOKIE["phpAlbum_quality"])){ if(!($rec=db_select_all("quality","id=='".$_COOKIE["phpAlbum_quality"]."'"))){ //setted quality not found $rec=db_select_all("quality","default=='true'"); } }else{ $rec=db_select_all("quality","default=='true'"); } $pa_quality=$rec[0]; } if(strstr($var1,"..")){ $var1=""; } if(isset($_GET["logout"])){ setcookie("userid","",time()-60*60*24*365); setcookie("userpassword","",time()-60*60*24*365); }else{ if(isset($_COOKIE['userid'])){ $userid=$_COOKIE['userid']; } if(isset($_COOKIE['userpassword'])){ $userpassword=$_COOKIE['userpassword']; } } if(isset($_POST["p_username"])){ $username=$_POST["p_username"]; $userpassword=md5($_POST["p_userpassword"]); $rec=db_select_all("user","name=='".$username."' && password=='".$userpassword."'"); if(isset($rec[0])){ $pa_user=$rec[0]; if(!isset($_POST["p_storepassword"])){ setcookie("userid",$pa_user["id"]); setcookie("userpassword",$userpassword); }else{ setcookie("userid",$pa_user["id"],time()+60*60*24*365); setcookie("userpassword",$userpassword,time()+60*60*24*365); } }else{ $pa_user=Array("name"=>"guest","groups"=>Array("guest"=>"1")); } }else{ $rec=db_select_all("user","id=='".$userid."' && password=='".$userpassword."'"); if(isset($rec[0])){ $pa_user=$rec[0]; $comment_name=$pa_user["name"]; $comment_email=$pa_user["email"]; }else{ $pa_user=Array("name"=>"guest","groups"=>Array("guest"=>"1")); $comment_name=$_COOKIE["comment_name"]; $comment_email=$_COOKIE["comment_email"]; } } //take all groups where the user is a member //and merge the grants to be easy to check it later if needed $where=""; foreach($pa_user["groups"] as $key => $value){ if($where ==""){ $where = $where . "name=='".$key."'"; }else{ $where = $where . " || name=='".$key."'"; } } $rec=db_select_all("group",$where); $pa_grants=Array(); if(is_array($rec)){ foreach($rec as $record){ if(is_array($record["grants"])){ $pa_grants =array_merge($pa_grants,$record["grants"]); } } } /*security check, either if it is disabled for actual user or it is not visible.*/ /*if accessed trough direct link it will be redirected to show the root directory*/ if($cmd=="album"){ $pa_dir_settings = get_directory_settings($var1,0); if(!check_access_to_dir($var1) || $pa_dir_settings[0]["visibility"]=="false"){ $var1=""; // show the root directory. $var2=""; $var3=""; $cmd="album"; } }else if($cmd=="imageview" || $cmd=="thmb" || $cmd=="image"){ $pa_dir_settings = get_directory_settings(dirname($var1),0); if(!check_access_to_dir(dirname($var1)) || $pa_dir_settings[0]["visibility"]=="false"){ $var1=""; // show the root directory. $var2=""; $var3=""; $cmd="album"; } } $this_is_cachable=false; if(is_cachable($cmd,$var1)) { $this_is_cachable=true; if(is_cached($cmd,$var1,$var2,$var3,$quality)) { load_from_cache($cmd,$var1,$var2,$var3,$quality); //echo "
Loaded from cache"; return; } } /*full-scanning directories evry 1 day*/ if($pa_setup["last_dir_scan"] 0) { ob_end_flush(); } } ?>