0){ return true; }else{ return false; } } /*assertion*/ /****************************************/ /* Functions */ /****************************************/ 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); } } if ( file_exists("config.php")){ include("config.php"); }else{ //generate_header(); error_reporting(0); echo ""; 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(); error_reporting(E_ERROR | E_WARNING | E_PARSE); return; } if ( !check_writable($data_dir)){ //generate_header(); error_reporting(0); echo ""; echo "
"; echo " Welcome to phpAlbum_$phpalbum_version
"; echo "Your data directory $data_dir is eather not existing or not writable
"; echo "Please check for existing of this directory and setup the access rights with CHMOD 777"; echo "
"; generate_footer(); error_reporting(E_ERROR | E_WARNING | E_PARSE); return; } 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 string2store($string){ $str=str_replace("\n","",$string); $str=str_replace("\r","",$str); return $str; } function store2string($string){ $str=str_replace("","\n",$string); return $str; } function pa_html_encode($string){ return str_replace( array ( '&', '"', "'", '<', '>'), array ( '&' , '"', ''' , '<' , '>' ),$string); } function pa_html_decode($string){ return str_replace( array ( '&' , '"', ''' , '<' , '>' ),array ( '&', '"', "'", '<', '>'),$string); } function put_default_quality_settings(){ global $data_dir; /*create default quality settings*/ /*thmb_size:thmb_quality:image_size(0=original):image_quality:description*/ $settings="160|70|0|0|original|1|0\n140|70|700|85|middle|1|1\n100|70|500|85|small|1|0\n"; $file=fopen($data_dir."quality.dat","w"); fwrite($file,$settings); fclose($file); chmod($data_dir."quality.dat",0640); /*to be not possible read it by others*/ } function save_quality_settings(){ global $data_dir; $file=fopen($data_dir."quality.dat","w"); $i=1; while($i<4){ if(isset($_POST['p_q_enabled'.$i])){ $enabled=1; }else{ $enabled=0; } if($_POST['p_q_default']==$i){ $default=1; }else{ $default=0; } if($default==1){$enabled=1;} fwrite($file,$_POST['p_q_thmbs'.$i]."|".$_POST['p_q_thmbq'.$i]."|".$_POST['p_q_pics'.$i]."|".$_POST['p_q_picq'.$i]."|".$_POST['p_q_desc'.$i]."|".$enabled."|".$default."\n"); $i=$i+1; } fclose($file); } /****************************************/ /* SETTINGS */ /****************************************/ function read_settings(){ global $setup_password,$album_dir,$data_dir,$cache_dir,$site_name,$logo_path,$logo_enabled,$site_theme,$return_home_url,$new_dir_indic; global $quality_settings; global $cmd,$var1,$var2; global $logs_enabled,$logs_filename,$logs_exclude,$album_name,$album_dir_name,$cookie_password_hours,$setup_text,$next_text,$previous_text,$disable_bottom_nextprev; global $character_set; global $cache_thumbnails,$cache_resized_photos; global $directory_style,$maximum_photos_per_page,$raster_dir_x,$raster_dir_y,$next_page_text,$previous_page_text,$ftp_server,$ftp_server_photos_dir; global $comments_enabled; global $show_filenames; global $default_sorting; /***********************/ /*read main_setup */ /***********************/ if(!file_exists($data_dir."quality.dat")){ put_default_quality_settings(); } $file=file($data_dir."quality.dat"); foreach($file as $line_num=>$line){ $quality_settings[$line_num]=explode("|",$line); } // var_dump($quality_settings);echo '
'; if(!file_exists($data_dir."main_setup.dat")){ $cmd="setup"; $var1="main"; return; } $file=file($data_dir."main_setup.dat"); $setup_password=substr($file[0],0,strlen($file[0])-1); $album_dir=substr($file[1],0,strlen($file[1])-1); $cache_dir=substr($file[2],0,strlen($file[2])-1); $site_name=substr($file[3],0,strlen($file[3])-1); $logo_enabled=substr($file[4],0,strlen($file[4])-1); $logo_path=substr($file[5],0,strlen($file[5])-1); $site_theme=substr($file[6],0,strlen($file[6])-1); $return_home_url=substr($file[7],0,strlen($file[7])-1); $new_dir_indic=substr($file[8],0,strlen($file[8])-1); if(isset($file[9])){ //version 0.2.4 already stored. $album_name=substr($file[9],0,strlen($file[9])-1); $album_dir_name=substr($file[10],0,strlen($file[10])-1); $cookie_password_hours=substr($file[11],0,strlen($file[11])-1); $setup_text=substr($file[12],0,strlen($file[12])-1); $next_text=substr($file[13],0,strlen($file[13])-1); $previous_text=substr($file[14],0,strlen($file[14])-1); $disable_bottom_nextprev=substr($file[15],0,strlen($file[15])-1); $character_set=substr($file[16],0,strlen($file[16])-1); } if(isset($file[17])){ //version 0.3.0 already stored $directory_style=substr($file[17],0,strlen($file[17])-1); $maximum_photos_per_page=substr($file[18],0,strlen($file[18])-1); $raster_dir_x=substr($file[19],0,strlen($file[19])-1); $raster_dir_y=substr($file[20],0,strlen($file[20])-1); $next_page_text=substr($file[21],0,strlen($file[21])-1); $previous_page_text=substr($file[22],0,strlen($file[22])-1); //ftp-settings $ftp_server=substr($file[23],0,strlen($file[23])-1); $ftp_server_photos_dir=substr($file[24],0,strlen($file[24])-1); } if(isset($file[25])){ $show_filenames=(substr($file[25],0,strlen($file[25])-1)=="true")? true:false; } if(isset($file[26])){ $default_sorting=substr($file[26],0,strlen($file[26])-1); } /***********************/ /*read quality settings*/ /***********************/ /***********************/ /*read comments settings */ /***********************/ if(file_exists($data_dir."comments_setup.dat")){ $file=file($data_dir."comments_setup.dat"); $comments_settings=explode("|",$file[0]); $comments_enabled=($comments_settings[0]=="true")? true:false; } /***********************/ /*read logs settings*/ /***********************/ if(file_exists($data_dir."logs_setup.dat")){ $file=file($data_dir."logs_setup.dat"); $logs_settings=explode("|",$file[0]); $logs_enabled=$logs_settings[0]; $logs_filename=$logs_settings[1]; $logs_exclude=$logs_settings[2]; } /***********************/ /* read theme settings*/ /***********************/ global $theme_params; if(file_exists($data_dir.$site_theme.".dat")){ $file=file($data_dir.$site_theme.".dat"); $theme_settings=explode("|",$file[0]); $num=0; while (isset($theme_settings[$num])){ $theme_params[$num]= $theme_settings[$num]; $num=$num+1; } } if(file_exists($data_dir."cache_setup.dat")){ $file=file($data_dir."cache_setup.dat"); $logs_settings=explode("|",$file[0]); $cache_thumbnails=$logs_settings[0]; $cache_resized_photos=$logs_settings[1]; } } function print_error($error){ echo "
$error
"; } function print_warning($error){ echo "
WARNING:$error
"; } function is_setup_user(){ global $passwd; $passwd_req=get_password_for_cmd("setup",""); if($passwd_req!="" && !strstr($passwd,$passwd_req) ){ return false; }else{ return true; } } function get_password_for_cmd($cmd,$var1){ global $setup_password,$demo_functionality; global $album_dir,$passwd; if (!strcmp($cmd,"setup")){ return $setup_password; } if (!strcmp($cmd,"delcache")){ return $setup_password; } if (!strcmp($cmd,"phpinfo")){ return $setup_password; } if( !strcmp($cmd,"album") || !strcmp($cmd,"image") || !strcmp($cmd,"imageview") || !strcmp($cmd,"thmb")){ $dirs=explode("/",$var1); $dir=""; $sett=get_directory_settings($dir,0); if(strlen($sett[0][1])>0 && !strstr($passwd,$sett[0][1])){ return $sett[0][1]; } foreach($dirs as $num => $file){ $dir=$dir."/".$file; $sett=get_directory_settings($dir,0); // echo $dir." ".$sett[0][1]."
"; if(strlen($sett[0][1])>0 && !strstr($passwd,$sett[0][1])){ return $sett[0][1]; } } } return ""; } function generate_password_page($cmd,$var1="",$var2=""){ $content="
"; if (strlen($var2)>0){ $content.= t("ID_ENTER_PASSWD")."
"; }else{ $content.= t("ID_ENTER_PASSWD").""; } $content.= "
"; $content.= "_"; theme_generate_setup_page($content); } function get_dir_size($dir){ $list = dir($dir); $size=0; while ($filename = $list->read()){ if ($filename == '.' || $filename == '..') continue; $size=$size+filesize($dir.$filename); } return $size; } function is_cachable($text,$var1){ global $cache_thumbnails,$cache_resized_photos; if ($text == "logo" || $text == "dir_logo") return true; if ($text == "theme") return false; if ($text == "image") { if($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($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" ||$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($cache_dir,$cmd,$var1,$var2,$var3,$quality){ //return false; $fn=get_cache_file_name($cache_dir,$cmd,$var1,$var2,$var3,$quality); return file_exists($fn); } function load_from_cache($cache_dir,$cmd,$var1,$var2,$var3,$quality){ $fn=get_cache_file_name($cache_dir,$cmd,$var1,$var2,$var3,$quality); /*$file=fopen($fn,"rb"); $doc=fread($file,filesize($fn)); fclose($file); echo $doc;*/ if($cmd == "thmb" || $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"); } 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 get_data_file_name($var1){ global $data_dir; $filename.=$data_dir."_".str_replace(" ","_",str_replace("/","_",$var1)); return $filename; } function cache_document($cache_dir,$cmd,$var1,$var2,$var3,$quality){ $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) ); if(sent_header()){ /*cache header*/ store_header($filename.".hdr"); } } function generate_header() { global $logo_path,$logo_enabled,$site_name,$site_theme,$theme_params,$phpalbum_version,$character_set; send_header("Content-type: text/html; charset=$character_set"); echo "\n$site_name"; echo ""; //if ( file_exists($logo_path) && $logo_enabled=="true") { //echo "
"; // }else{ // theme_put_logo(); //} } 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 generate_album($album_dir,$var1,$thumb_size,$thumb_quality,$quality,$passwd,$start_with=0){ global $quality_settings,$site_theme,$theme_params,$new_dir_indic,$return_home_url,$album_name,$album_dir_name,$setup_text; global $directory_style,$maximum_photos_per_page,$raster_dir_x,$raster_dir_y; global $show_filenames; global $act_dir_sorting; if ($directory_style=="flowing"){ $number_of_thmbs=$maximum_photos_per_page; }else{ $number_of_thmbs=$raster_dir_x*$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, of yes, i'm sorry :)*/ } /*bugfixing for opera, but shuould by done some other way*/ $is_opera=strstr(strtoupper($_SERVER['HTTP_USER_AGENT']),"OPERA"); if($is_opera){ $inline_style="display: inline-table;"; }else{ $inline_style="display: inline;"; } $dir_settings=get_directory_settings("/".$var1); if(isset($dir_settings[0][5])){ $act_dir_sorting=$dir_settings[0][5]; } $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][4]); }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; } $count=$quality_settings[0][5]+$quality_settings[1][5]+$quality_settings[2][5]; $quality_links=Array(); if($count>1){ $i=0; $first=1; while($i<3){ if($quality_settings[$i][5]==1){ $quality_links[$i]['name']=$quality_settings[$i][4]; $quality_links[$i]['link']="main.php?cmd=setquality&var1=$i&var2=".urlencode($var1); if($quality==$i){ $quality_links[$i]['actual']=1; }else{ $quality_links[$i]['actual']=0; } } $i=$i+1; } } $dir=$album_dir . $var1; /*directory description*/ $dir_long_desc=store2string(pa_html_decode($dir_settings[0][3])); /*openning directories*/ if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if( filetype($dir . $file)=="dir" ) { if($file !="." && $file !=".."){ $sett_all=get_directory_settings($var1.$file,0); $sett=$sett_all[0]; if($sett[6]=="true"){ //visible if(strlen($sett[4])>0){ $name=$sett[4]; }else{ $name=$file; } $file_array=Array("filename"=>$file,"time"=>filectime($dir . $file),"name"=>$name,"desc"=>$sett[2]); $filelist[]=$file_array; } } } } closedir($dh); $directories=Array(); $directories_cnt=0; if(sizeof($filelist)>0){ usort($filelist,"file_array_cmp"); while ( list($key,$file_array)=each($filelist)){ /*visibility*/ $file=$file_array['filename']; $blocked=false; if(strlen(get_password_for_cmd("album",$var1.$file))>0){ if(!strstr($passwd,get_password_for_cmd("album",$var1.$file))){ $blocked=true;}; } if($blocked){ $dir_pic="main.php?cmd=dir_logo&var1=NOTSUP&var2=DIR_PASSWD&var3=".theme_get_id(); $directories[$directories_cnt]['stat']='PASSWD'; }else{ /*test if there is some new images*/ $diff = (time() - filemtime($dir.$file))/60/60; if ($diff < $new_dir_indic ){ $dir_pic="main.php?cmd=dir_logo&var1=NOTSUP&var2=DIR_NEW&var3=".theme_get_id(); $directories[$directories_cnt]['stat']='NEW'; }else{ $dir_pic="main.php?cmd=dir_logo&var1=NOTSUP&var2=DIR&var3=".theme_get_id(); $directories[$directories_cnt]['stat']='NORM'; } } /*defining variable*/ $directories[$directories_cnt]['link']="main.php?cmd=album&var1=".urlencode($var1.$file)."/&var2=".$quality; $directories[$directories_cnt]['logo']=$dir_pic; if($file_array['name']==$file_array['filename']){ /*it is filename and should be converted*/ $directories[$directories_cnt]['name']=conv_out($file_array['filename']); }else{ $directories[$directories_cnt]['name']=pa_html_decode($file_array['name']); } $directories[$directories_cnt]['desc']=pa_html_decode($file_array['desc']); $directories_cnt++; } } } } /*openning files*/ $done_files[]=""; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if( filetype($dir . $file)=="file" || filetype($dir . $file)=="link" ) { $i=1; $img_desc=""; while(isset($dir_settings[$i][0])){ if($dir_settings[$i][0]==$file){ $img_desc=$dir_settings[$i][1]; break; } $i=$i+1; } if(strlen($img_desc)==0){ $img_desc=$file; } $file_array=Array("filename"=>$file,"time"=>filectime($dir . $file),"name"=>$img_desc); $filelist2[]=$file_array; $file_scr[]=$file; } } closedir($dh); if(sizeof($filelist2)>0){ usort($filelist2,"file_array_cmp"); $qq=$quality_settings[$quality][0]."_".$quality_settings[$quality][1]; $thumbnails=Array(); $thumbnails_cnt=0; $cnt=0; if($start_with>(sizeof($filelist2)-1)|| $start_with<0){ $start_with=0; /*just to be sure*/ } while ( list($key,$file_array)=each($filelist2)){ $file=$file_array['filename']; $file_ok=false; if($cnt>=$start_with and $cnt<$start_with+$number_of_thmbs){ if(is_image($file)){ $file_ok=true; $i=1; $img_desc=""; while(isset($dir_settings[$i][0])){ if($dir_settings[$i][0]==$file){ $img_desc=$dir_settings[$i][1]; break; } $i=$i+1; } $style="me3"; /* if(strlen($img_desc)==0){ $img_desc=" "; $style="me4"; }*/ $scr=get_file_for_screenshot($file,$file_scr); if($scr!=""){ $done_files[]=$scr; $thumbnails[$thumbnails_cnt]['thmb']="main.php?cmd=thmb&var1=". urlencode($var1.$file)."&var2=".$qq; $thumbnails[$thumbnails_cnt]['desc']=pa_html_decode($img_desc); if($show_filenames && $thumbnails[$thumbnails_cnt]['desc']==""){ $thumbnails[$thumbnails_cnt]['desc']=conv_out($scr); } $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$scr)."&var2=".$quality; }else{ $thumbnails[$thumbnails_cnt]['thmb']="main.php?cmd=thmb&var1=". urlencode($var1.$file)."&var2=".$qq; $thumbnails[$thumbnails_cnt]['desc']=pa_html_decode($img_desc); if($show_filenames && $thumbnails[$thumbnails_cnt]['desc']==""){ $thumbnails[$thumbnails_cnt]['desc']=conv_out($file); } $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=imageview&var1=".urlencode($var1.$file)."&var2=".$quality; } } if(is_movie($file) && !array_search($file,$done_files)){ $file_ok=true; $scr=get_screanshot_for_file($file,$file_scr); if($scr!=""){ $file_ok=false; /*$thumbnails[$thumbnails_cnt]['thmb']="main.php?cmd=thmb&var1=".urlencode($var1.$scr)."&var2=".$qq."&var3=".theme_get_id(); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$file)."&var2=".$quality; $thumbnails[$thumbnails_cnt]['desc']=$file; */ }else{ $thumbnails[$thumbnails_cnt]['thmb']="main.php?cmd=thmb&var1=[movie]&var2=".$qq."&var3=".theme_get_id(); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$file)."&var2=".$quality; $thumbnails[$thumbnails_cnt]['desc']=conv_out($file); } } if(is_audio($file) && !array_search($file,$done_files)){ $file_ok=true; $scr=get_screanshot_for_file($file,$file_scr); if($scr!=""){ $file_ok=false; /* $thumbnails[$thumbnails_cnt]['thmb']="main.php?cmd=thmb&var1=".urlencode($var1.$scr)."&var2=".$qq."&var3=".theme_get_id(); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$file)."&var2=".$quality; $thumbnails[$thumbnails_cnt]['desc']=$file; */ }else{ $thumbnails[$thumbnails_cnt]['thmb']="main.php?cmd=thmb&var1=[audio]&var2=".$qq."&var3=".theme_get_id(); $thumbnails[$thumbnails_cnt]['link']="main.php?cmd=image&var1=".urlencode($var1.$file)."&var2=".$quality; $thumbnails[$thumbnails_cnt]['desc']=conv_out($file); } } if($file_ok){ $thumbnails[$thumbnails_cnt]['width']=$thumb_size+12+30; $thumbnails[$thumbnails_cnt]['height']=$thumb_size+12+30; $thumbnails_cnt++; } } $cnt++; } } } } if ( sizeof($filelist2)<=$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,$inline_style,$dir_long_desc,$next_start_with,$previous_start_with,$var1,$quality); return true; } function file_array_cmp($a,$b){ global $default_sorting,$act_dir_sorting; if($act_dir_sorting=="default"){ $sorting=$default_sorting; }else{ $sorting=$act_dir_sorting; } switch($sorting){ case "date_asc": if ($a['time'] == $b['time']) { return 0; } return ($a['time'] < $b['time']) ? -1 : 1; break; case "date_desc": if ($a['time'] == $b['time']) { return 0; } return ($a['time'] < $b['time']) ? 1 : -1; break; case "filename_asc": if ($a['filename'] == $b['filename']) { return 0; } return ($a['filename'] < $b['filename']) ? -1 : 1; break; case "filename_desc": if ($a['filename'] == $b['filename']) { return 0; } return ($a['filename'] < $b['filename']) ? 1 : -1; break; case "name_asc": if ($a['name'] == $b['name']) { return 0; } return ($a['name'] < $b['name']) ? -1 : 1; break; case "name_desc": if ($a['name'] == $b['name']) { return 0; } return ($a['name'] < $b['name']) ? 1 : -1; break; default: return 0; } } function get_directory_settings($dir,$full = 1){ global $data_dir,$album_dir; if ($dir=="\\") $dir=""; if(substr($dir,0,1)!="/"){ $dir="/".$dir; } if(substr($dir,-1,1)!="/"){ $dir=$dir."/"; } $file_name=stripslashes($data_dir.str_replace(" ","_",str_replace("/","_",$dir)).".dat"); $settings[0]=$dir; if(file_exists($file_name)){ $file=file($file_name); if(strlen($file)>0){ $params=explode("|",substr($file[0],0,strlen($file[0])-1)); $settings[1]=$params[0]; $settings[2]=$params[1]; $settings[3]=$params[2]; if(strlen($params[5])>0){ /*new settings for 0.3.1.4*/ $settings[4]=$params[3]; /*alias*/ $settings[5]=$params[4]; /*sorting*/ $settings[6]=$params[5]; /*visibility*/ }else{ $settings[4]=""; /*alias*/ $settings[5]="default"; /*sorting*/ $settings[6]="true"; /*visibility*/ } }else{ $settings[1]=""; $settings[2]=""; $settings[3]=""; $settings[4]=""; /*alias*/ $settings[5]="default"; /*sorting*/ $settings[6]="true"; /*visibility*/ } }else{ $settings[1]=""; $settings[2]=""; if(!isset($settings[3])){ $settings[3]=""; } $settings[4]=""; /*alias*/ $settings[5]="default"; /*sorting*/ $settings[6]="true"; /*visibility*/ } $sett[0]=$settings; /*read settings for all photos in this direcotry ..*/ /*first read the settings in the file*/ if($full==1){ $num=1; while(isset($file[$num])){ $files[]=explode("|",substr($file[$num],0,strlen($file[$num])-1)); $num=$num+1; } /*now read the directory for files and try to find something about these in settings*/ if(file_exists($album_dir.$dir)){ if ($dh = opendir($album_dir.$dir)) { while (($file = readdir($dh)) !== false) { if( (filetype($album_dir.$dir ."/". $file)=="file" || filetype($album_dir.$dir ."/". $file)=="link" ) && is_image($file) ){ $files2[]=$file; } } closedir($dh); } } /*consolidate files with settings*/ if(sizeof($files2)>0){ asort($files2); foreach($files2 as $num => $file_name){ /*find file in settings*/ $found=0; $i=0; while(isset($files[$i])){ if($file_name==$files[$i][0]){ $found=1; $sett[]=$files[$i]; break; } $i=$i+1; } if($found==0){ $sett[]=Array($file_name,"",""); } } }/*if */ } return $sett; } 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 get_photos_directories($dir,$filelist){ global $album_dir; $sett=get_directory_settings($dir,0); $filelist[]=$sett[0]; 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 !="..") { $filelist=get_photos_directories($dir.$file."/",$filelist); } } closedir($dh); } } return $filelist; } 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,$thumb_size,$thumb_quality){ global $album_dir,$character_set; $width = $thumb_size; $height = $thumb_size; $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'); } send_header("Content-Disposition: filename=thmb_".conv_out_header(basename($var1),$character_set)." "); if($var1=="[movie]"){$var1="movie.png";} else if($var1=="[audio]"){$var1="audio.png";} else{$var1=$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 ($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, ($thumb_size-$width)/2+5, ($thumb_size-$height)/2+5, 0, 0, $width, $height, $width_orig, $height_orig); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output image_same_type($var1,$image_p,$thumb_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 generate_image($var1,$quality){ global $quality_settings,$album_dir; global $character_set; $var1=stripslashes($var1); $m_time=filemtime($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),$character_set)." "); if( $quality_settings[$quality][2] == 0){ /*$file=fopen($var1,"rb"); $doc=fread($file,filesize($var1)); fclose($file); echo $doc;*/ readfile($album_dir.$var1); return false; }else{ $image_low_size=$quality_settings[$quality][2]; $width=$image_low_size; $height=$image_low_size; // Get new dimensions list($width_orig, $height_orig) = getimagesize($album_dir.$var1); if ($width && ($width_orig < $height_orig)) { $width = ($height / $height_orig) * $width_orig; } else { $height = ($width / $width_orig) * $height_orig; } $image_p = imagecreatetruecolor($width, $height); // Resample $image = imagecreatefrom($album_dir.$var1); //$image_p = imagecreatetruecolor($width, $height); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output image_same_type($var1,$image_p,$quality_settings[$quality][3]); return true; } } 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($album_dir.$var1)." "); send_header("Last-Modified: ".date("D, d M Y H:i:s T",$m_time)." " ); readfile($album_dir.$var1); return false; } } function SendDownloadHeaders($filename,$file_size=0) { $isIE = $isIE6 = 0; if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) { $isIE = 1; } if (strstr($HTTP_USER_AGENT, 'compatible; MSIE 6') !== false && strstr($HTTP_USER_AGENT, 'Opera') === false) { $isIE6 = 1; } if ($isIE) { $filename=rawurlencode($filename); header ("Pragma: public"); header ("Cache-Control: no-store, max-age=0, no-cache, must-revalidate"); // HTTP/1.1 header ("Cache-Control: post-check=0, pre-check=0", false); header ("Cache-Control: private"); //set the inline header for IE, we'll add the attachment header later if we need it header ("Content-Disposition: inline; filename=$filename"); } // Try to pop up the "save as" box // IE makes this hard. It pops up 2 save boxes, or none. // http://support.microsoft.com/support/kb/articles/Q238/5/88.ASP // http://support.microsoft.com/default.aspx?scid=kb;EN-US;260519 // But, according to Microsoft, it is "RFC compliant but doesn't // take into account some deviations that allowed within the // specification." Doesn't that mean RFC non-compliant? // http://support.microsoft.com/support/kb/articles/Q258/4/52.ASP // all browsers need the application/octet-stream header for this header ("Content-Type: application/octet-stream; name=\"$filename\""); // http://support.microsoft.com/support/kb/articles/Q182/3/15.asp // Do not have quotes around filename, but that applied to // "attachment"... does it apply to inline too? header ("Content-Disposition: attachment; filename=\"$filename\""); if ($isIE && !$isIE6) { // This combination seems to work mostly. IE 5.5 SP 1 has // known issues (see the Microsoft Knowledge Base) // This works for most types, but doesn't work with Word files header ("Content-Type: application/download; name=\"$filename\""); // These are spares, just in case. :-) //header("Content-Type: $type0/$type1; name=\"$filename\""); //header("Content-Type: application/x-msdownload; name=\"$filename\""); //header("Content-Type: application/octet-stream; name=\"$filename\""); } else { // another application/octet-stream forces download for Netscape header ("Content-Type: application/octet-stream; name=\"$filename\""); } if ($filesize > 0) { header("Content-Length: $filesize"); } } // end fn SendDownloadHeaders /****************************************/ /* 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 $album_dir,$act_dir_sorting; $tmp="null"; $dirname=dirname($var1); if($dirname=="."){ $dirname=""; }else{ $dirname.="/"; } $dir_settings=get_directory_settings($dirname); $act_dir_sorting=$dir_settings[0][5]; if ($dh = opendir(dirname($album_dir.$var1))) { while (($file = readdir($dh)) !== false) { if($file != "." && $file!=".." && (filetype(dirname($album_dir.$var1)."/".$file)=="file" ||filetype(dirname($album_dir.$var1)."/".$file)=="link") && is_image($file)){ $i=1; $img_desc=""; while(isset($dir_settings[$i][0])){ if($dir_settings[$i][0]==$file){ $img_desc=$dir_settings[$i][1]; break; } $i=$i+1; } if(strlen($img_desc)==0){ $img_desc=$file; } $file_array=Array("filename"=>$file,"time"=>filectime(dirname($album_dir.$var1)."/".$file),"name"=>$img_desc); $file_scr[]=$file; $filelist[]=$file_array; }else{ $dw[]=$file; } } closedir($dh); if(sizeof($filelist)>0) { usort($filelist,'file_array_cmp'); while(list($key,$file_array)=each($filelist)){ $file=$file_array['filename']; if ($file == basename($var1)){ if($tmp!="null"){ $names[]=$dirname.$tmp; }else{ $names[]="null"; } while(list($key,$file_array)=each($filelist)){ $file=$file_array['filename']; if(!get_file_for_screenshot($file,$dw)) break; } //echo "KEY=".$key; //echo "FILE=".$file; if($file_array !== null){ $names[]= $dirname.$file; }else{ $names[]= "null"; } } if(!get_file_for_screenshot($file,$dw)){ $tmp=$file; } } } return $names; } } /****************************************/ /* IMAGE VIEW */ /****************************************/ function generate_image_view($var1,$quality,$var3){ global $quality_settings,$album_dir,$return_home_url,$album_name,$album_dir_name,$next_text,$previous_text,$disable_bottom_nextprev,$show_filenames; $var1=stripslashes($var1); $qq=$quality_settings[$quality][2]."_".$quality_settings[$quality][3]; $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][4]); }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; } $count=$quality_settings[0][5]+$quality_settings[1][5]+$quality_settings[2][5]; $quality_links=Array(); if($count>1){ $i=0; $first=1; while($i<3){ if($quality_settings[$i][5]==1){ $quality_links[$i]['name']=$quality_settings[$i][4]; $quality_links[$i]['link']="main.php?cmd=setquality&var1=$i&var2=".urlencode($var1); if($quality==$i){ $quality_links[$i]['actual']=1; }else{ $quality_links[$i]['actual']=0; } } $i=$i+1; } } /*testing for next and previous image ..*/ list( $prev,$next) = get_next_prev_image($var1); list($iwidth, $iheight, $itype, $iattr) = getimagesize($album_dir.$var1); if($quality_settings[$quality][2]== 0){ $width=$iwidth; $height=$iheight; }else { $image_low_size=$quality_settings[$quality][2]; $width=$image_low_size; $height=$image_low_size; if ($width && ($iwidth < $iheight)) { $width = ($height / $iheight) * $iwidth; } else { $height = ($width / $iwidth) * $iheight; } // $img_size="width=\"".$width."\" height=\"".$height."\""; } if( $prev != "null" ) { $prev_link = "main.php?cmd=imageview&var1=".urlencode($prev)."&var2=".$quality; }else{ $prev_link =""; }; if( $next != "null" ) { $next_link = "main.php?cmd=imageview&var1=".urlencode($next)."&var2=".$quality; }else{ $next_link = ""; }; $image_link="main.php?cmd=image&var1=".urlencode($var1)."&var2=".$qq; $imageview_link="main.php?cmd=imageview&var1=".urlencode($var1)."&var2=".$qq; $sett=get_directory_settings(dirname("/".$var1)); $i=1; $img_desc=""; $img_desc_long=""; while(isset($sett[$i][0])){ if($sett[$i][0]==basename($var1)){ $img_desc=pa_html_decode($sett[$i][1]); if($show_filenames && $img_desc==""){ $img_desc=conv_out(basename($var1)); } $img_desc_long=store2string(pa_html_decode($sett[$i][2])); break; } $i=$i+1; } /* store typed comments*/ if($var3=="save_comment"){ 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-"){ $time=substr($var3,15); delete_comment($var1,$time); } $comments=get_comments($var1); 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); } function approve_comment($var1,$time){ global $data_dir; if(is_setup_user()){ if(file_exists($data_dir."all.comments")){ $file=file($data_dir."all.comments"); $f=fopen($data_dir."all.comments","w"); foreach($file as $line){ if(substr($line,0,strlen($var1."|".$time))!=$var1."|".$time){ fwrite($f,$line); } } fclose($f); } } } function delete_comment($var1,$time){ global $data_dir; if(is_setup_user()){ $fn=get_data_file_name($var1).".comments"; if(file_exists($fn)){ $file=file($fn); $f=fopen($fn,"w"); foreach($file as $line){ if(substr($line,0,strlen($time))!=$time){ fwrite($f,$line); } } fclose($f); } /*deleting from master file*/ if(file_exists($data_dir."all.comments")){ $file=file($data_dir."all.comments"); $f=fopen($data_dir."all.comments","w"); foreach($file as $line){ if(substr($line,0,strlen($var1."|".$time))!=$var1."|".$time){ fwrite($f,$line); } } fclose($f); } } } function save_comment($var1,$text,$name,$email,$time){ global $data_dir; $fn=get_data_file_name($var1).".comments"; if(file_exists($fn)){ $file=file($fn); } $f=fopen($fn,"w"); $t_text=pa_html_encode(stripslashes($text)); $t_text=str_replace("\n","
",$t_text); $t_text=str_replace("\r","",$t_text); fwrite($f,$time."|".pa_html_encode($name)."|".pa_html_encode($email)."|".$t_text."\n"); if(is_array($file)){ foreach($file as $line){ fwrite($f,$line); } } fclose($f); /*write it to all.comments*/ $f=fopen($data_dir."all.comments","a"); fwrite($f,$var1."|".$time."|".pa_html_encode($name)."|".pa_html_encode($email)."|".$t_text."\n"); fclose($f); } function get_comments($var1){ $comments=Array(); $fn=get_data_file_name($var1).".comments"; if(file_exists($fn)){ $file=file($fn); foreach($file as $line){ $tmp=explode("|",$line); $comments[]=Array("time"=>$tmp[0],"name"=>$tmp[1],"email"=>$tmp[2],"text"=>$tmp[3]); } } return $comments; } function get_all_comments(){ global $data_dir; $comments=Array(); $fn=$data_dir."all.comments"; if(file_exists($fn)){ $file=file($fn); foreach($file as $line){ $tmp=explode("|",$line); $comments[]=Array("pic"=>$tmp[0],"time"=>$tmp[1],"name"=>$tmp[2],"email"=>$tmp[3],"text"=>$tmp[4]); } } return $comments; } /****************************************/ /* FOOTER */ /****************************************/ function generate_footer(){ echo "
Powered by PHP Photo Album
"; echo "
whistling dick

whistling dick

main mirpur gay

mirpur gay

material bishop devry big love

bishop devry big love

shoulder sultry hot sluts

sultry hot sluts

column blacks cock

blacks cock

famous tentacle alien hentai

tentacle alien hentai

rope texas wife sex

texas wife sex

several femdom gelding

femdom gelding

perhaps daniel radcliffe having sex

daniel radcliffe having sex

your columbus relationship between church

columbus relationship between church

sell couple seducing teens

couple seducing teens

even sexy naked legs

sexy naked legs

feet male small nipples

male small nipples

door blonde porno sex

blonde porno sex

under facial treatment procedures

facial treatment procedures

gas videl hentai video

videl hentai video

quite porn 3d

porn 3d

river gay sex offenders

gay sex offenders

water oral sex when ttc

oral sex when ttc

low pogo love triangle death

pogo love triangle death

invent platform shoes sex

platform shoes sex

rest the teen mind

the teen mind

heat lesbian sex metacafe

lesbian sex metacafe

death joe reeve gay

joe reeve gay

paragraph swallow piss

swallow piss

hope ketchum teen recreation

ketchum teen recreation

key brooke skye threesome

brooke skye threesome

believe zinc yellow nipples

zinc yellow nipples

look girls with puffy tits

girls with puffy tits

top asian sex index

asian sex index

dress celebs hair beauty

celebs hair beauty

opposite illinois strip club list

illinois strip club list

provide ayda field topless

ayda field topless

often kate nauta nude

kate nauta nude

come rencontres escort

rencontres escort

our philosophy dating homosexuality sexism

philosophy dating homosexuality sexism

place amature teen naked

amature teen naked

am japanese busty

japanese busty

sit christian bereavement counseling cirriculumn

christian bereavement counseling cirriculumn

settle teen wild parties

teen wild parties

market myspace loyouts police wives

myspace loyouts police wives

course canine anal gland cleaning

canine anal gland cleaning

during onion booty nicole

onion booty nicole

original drawn together nude pictures

drawn together nude pictures

she steven day virgin mobile

steven day virgin mobile

us female whipping stories

female whipping stories

soil bald hot pussy

bald hot pussy

spell vilansy tgp

vilansy tgp

children teen pussy hardcore

teen pussy hardcore

level warts from oral sex

warts from oral sex

tail sexy natural breasts

sexy natural breasts

plural silver beaver receipents

silver beaver receipents

brought man whore t shirt

man whore t shirt

observe amature girls naked photos

amature girls naked photos

sign photographer portfolio nude men

photographer portfolio nude men

danger nympho fuck buddy

nympho fuck buddy

serve teacher sex stories

teacher sex stories

burn amuture sex stories

amuture sex stories

ever cock cum cherry pussy

cock cum cherry pussy

suit masturbation with boy

masturbation with boy

thank julie banderas simulates sex

julie banderas simulates sex

broke young redheaded nude guys

young redheaded nude guys

position small teeth vagina

small teeth vagina

division personals women seeking cucks

personals women seeking cucks

who elephant webcam

elephant webcam

result scuba naked pictures

scuba naked pictures

stone naked teenage girls masturbating

naked teenage girls masturbating

company oshean free hardcore

oshean free hardcore

mount milf natural riding

milf natural riding

fish orlando swing club

orlando swing club

before vaginal diameter

vaginal diameter

force lovely shemales tgp

lovely shemales tgp

sense hardcore gay videos

hardcore gay videos

with spring brake nude

spring brake nude

test animal porn free membership

animal porn free membership

reason sandra bullock nipple slips

sandra bullock nipple slips

cost pennslyvania sex laws

pennslyvania sex laws

women breast cancer walk albuquerque

breast cancer walk albuquerque

climb amateur laundry brunette

amateur laundry brunette

family femdom ballkicking

femdom ballkicking

meant major hentai quiz passwords

major hentai quiz passwords

locate sex pics porn 89

sex pics porn 89

protect webcam strip live

webcam strip live

forward transexual alabama

transexual alabama

minute facial orlando florida medi spa

facial orlando florida medi spa

dance big and harry pussy

big and harry pussy

indicate licking pus

licking pus

favor laci white nude photo

laci white nude photo

light pussy for diner

pussy for diner

least tina o brien topless

tina o brien topless

give pharaoh teen

pharaoh teen

rail gay video mpg

gay video mpg

bring confites winnie pooh

confites winnie pooh

learn counseling drug addicts

counseling drug addicts

guess mom wants dick

mom wants dick

equate halloween sluts photos

halloween sluts photos

sea lovely miss october poem

lovely miss october poem

arrive family matters girl naked

family matters girl naked

gray hairy amateur videos

hairy amateur videos

able video prank nude

video prank nude

class matutre nylon women

matutre nylon women

agree viet xxx

viet xxx

class dads naked

dads naked

cover queen s relationship with australia

queen s relationship with australia

send rutgers the den gay

rutgers the den gay

west nudist penis

nudist penis

receive redhead takes masive cock

redhead takes masive cock

imagine daily free porn sites

daily free porn sites

million florida gay marriage bills

florida gay marriage bills

soon naked blck woman

naked blck woman

hold sandr teen model

sandr teen model

base charvel guitar dating

charvel guitar dating

match jaime beaver

jaime beaver

need atonement movie sex scene

atonement movie sex scene

spot gay punk division

gay punk division

cool vaginal cryotherapy

vaginal cryotherapy

general neon genesis evangelion xxx

neon genesis evangelion xxx

magnet hikaru porn star

hikaru porn star

thick sex catawba county

sex catawba county

rule mom who loves cum

mom who loves cum

follow ai shinozaki nude

ai shinozaki nude

property gay blonde twink

gay blonde twink

oh miss nude black pictures

miss nude black pictures

table nude beaches pics

nude beaches pics

don't spring yhomas interracial slut

spring yhomas interracial slut

famous petra secret virgin

petra secret virgin

fact gaper cleaning

gaper cleaning

his roseburg gays

roseburg gays

branch baylee porn

baylee porn

element lesbian latinas orgy

lesbian latinas orgy

evening nz dating directory

nz dating directory

sit men s calvin klein underwear

men s calvin klein underwear

rise ass fuck black women

ass fuck black women

front bhanu priya porn

bhanu priya porn

bed charlotte church topless pics

charlotte church topless pics

woman amatuer facials

amatuer facials

rail emma cornwell nude

emma cornwell nude

tiny femdom gallery free

femdom gallery free

path sex mongers

sex mongers

saw sex recovery time

sex recovery time

compare columbeanu sex

columbeanu sex

mile nude nubbies

nude nubbies

fig hairy pussy purple

hairy pussy purple

though sexy claire sweeney pussy

sexy claire sweeney pussy

second tiny topless thongs

tiny topless thongs

care escort hillingdon

escort hillingdon

and sca lawsuit sex abuse

sca lawsuit sex abuse

piece genevieve nude

genevieve nude

share justine bateman topless video

justine bateman topless video

desert pantyhose mature vintage

pantyhose mature vintage

length slutty escorts

slutty escorts

mine shorthaired porn

shorthaired porn

noun nude girl in godfather

nude girl in godfather

thing flea eggs in vagina

flea eggs in vagina

middle ohio transport sucks

ohio transport sucks

mountain met art nudes

met art nudes

behind hardcore porn video trials

hardcore porn video trials

bone love video eddy texas

love video eddy texas

heavy cum spurting facials

cum spurting facials

if schoolboys gay sex

schoolboys gay sex

particular traction strips

traction strips

exercise hot girls fisting

hot girls fisting

nine pregnant breasts before after

pregnant breasts before after

win innocent teen sluts

innocent teen sluts

metal lesbian first timer

lesbian first timer

support pietra cherniak nude

pietra cherniak nude

like alt slut

alt slut

bear maasai sexuality

maasai sexuality

division beaver bush plane

beaver bush plane

dress twin angels anal

twin angels anal

seven ponderosa nudist resort

ponderosa nudist resort

sail asian fever porn

asian fever porn

clothe ejaculation photo penis

ejaculation photo penis

serve porn cameras

porn cameras

method murfreesboro tn escorts

murfreesboro tn escorts

ocean cat ryan escort

cat ryan escort

warm international teen kissing law

international teen kissing law

clothe womens porn magazines

womens porn magazines

children black pussy bbs

black pussy bbs

will nude phoebe cates

nude phoebe cates

year teen love dating

teen love dating

lead sticky pussy movie goatlist

sticky pussy movie goatlist

level peripheral vestibular dysfunction

peripheral vestibular dysfunction

saw male nude dancers

male nude dancers

divide kingpin mpegs

kingpin mpegs

coat kim kardashian naked photos

kim kardashian naked photos

several italian love sonnets

italian love sonnets

feed go gos sex

go gos sex

young tiny teen rapidshare

tiny teen rapidshare

check janet s nipple

janet s nipple

time bdsm photos needles

bdsm photos needles

job orlando bdsm club

orlando bdsm club

least girls making out topless

girls making out topless

possible tlusty nude photos

tlusty nude photos

path tom brady s underwear

tom brady s underwear

repeat sexy fuck big tits

sexy fuck big tits

bear bdsm in iowa

bdsm in iowa

neighbor hawaiian beaver

hawaiian beaver

gather naked pokemon sex

naked pokemon sex

sight ulaan dating

ulaan dating

horse amber wood milf

amber wood milf

seat fac fbi facial

fac fbi facial

material illinois teen chat rooms

illinois teen chat rooms

glass butt plugged lesbian

butt plugged lesbian

girl philip larkin love mcmxiv

philip larkin love mcmxiv

hot elle canada beauty

elle canada beauty

fat naked yoga sydney

naked yoga sydney

develop anal sex among heterosexuals

anal sex among heterosexuals

process erotic rhythms glyn

erotic rhythms glyn

agree lifestream cholesterol monitor strips

lifestream cholesterol monitor strips

down anla sex

anla sex

copy teen smoking news

teen smoking news

young salma hayek lesbian sean

salma hayek lesbian sean

grew teen porn reagan star

teen porn reagan star

join foot sex free porn

foot sex free porn

smell massive tits on beaches

massive tits on beaches

lake guys showering together

guys showering together

noun st louis massage escort

st louis massage escort

down amateur mpegs

amateur mpegs

nothing gay porn primal pigs

gay porn primal pigs

direct religion romance

religion romance

certain my first hairy pussy

my first hairy pussy

often first porn stars

first porn stars

column blowjobs by japanese

blowjobs by japanese

sun herbal beauty products malta

herbal beauty products malta

language hot uk amateurs

hot uk amateurs

will indian escort in brisbane

indian escort in brisbane

raise muture lady fuck girls

muture lady fuck girls

method hot finish pussy

hot finish pussy

down plastic surgery on pussy

plastic surgery on pussy

band panda porn moviea

panda porn moviea

was holy virgin mary

holy virgin mary

was mature fringe tree

mature fringe tree

ever naughty daydream

naughty daydream

visit definition of cumming

definition of cumming

part virgin pussy mindy

virgin pussy mindy

hand very young pussy fuck

very young pussy fuck

by kristen bdsm

kristen bdsm

general cristna agulara nude

cristna agulara nude

act fable lost sex

fable lost sex

star christian life counseling tanya

christian life counseling tanya

fair brooklyn ny independent escort

brooklyn ny independent escort

watch black women nude pics

black women nude pics

you lesbian strap on porn

lesbian strap on porn

fall multi lingual chatrooms

multi lingual chatrooms

mountain big black daddy porn

big black daddy porn

fraction singapore slut

singapore slut

bar men touching gay hug

men touching gay hug

country sophie marceau sex scene

sophie marceau sex scene

gold children jerking off

children jerking off

new eightteen nude models

eightteen nude models

came harry pussy fucked

harry pussy fucked

full jetsons hentai videos

jetsons hentai videos

kind nude upskirt women 20 30

nude upskirt women 20 30

mark naked coeds videos

naked coeds videos

land sri lanka and dating

sri lanka and dating

during chinese swingers dating

chinese swingers dating

ship double d s strip club

double d s strip club

process calvin klein naked thong

calvin klein naked thong

miss stanton and femdom

stanton and femdom

gun dale evans and cowgirl

dale evans and cowgirl

success vultee vibrator

vultee vibrator

mother extra large condoms

extra large condoms

distant fucking vergins hardcore

fucking vergins hardcore

interest teenage underwear photo shoot

teenage underwear photo shoot

heavy lesbian video rss

lesbian video rss

mark massive cock sex movies

massive cock sex movies

hill cashmere bouquet beauty bar

cashmere bouquet beauty bar

thing mpg for buick lacrosse

mpg for buick lacrosse

moment supreme gay porn

supreme gay porn

suit buzzhumor chicks

buzzhumor chicks

up virual sex games

virual sex games

brown pleasing sex with spouse

pleasing sex with spouse

lift asian pornstar squirt

asian pornstar squirt

close naked nathan

naked nathan

if printable naughty coupons

printable naughty coupons

bear italian game show strip

italian game show strip

two breast implant surgery texas

breast implant surgery texas

port alternative counseling

alternative counseling

pitch naughty texting ideas

naughty texting ideas

element cross dressing bondage

cross dressing bondage

figure rosemari teen bikini

rosemari teen bikini

one oiling tits

oiling tits

wash naked prepubescent dick

naked prepubescent dick

dictionary thick bbw tgp

thick bbw tgp

good nicole kidman voyeur

nicole kidman voyeur

help tricorner knob

tricorner knob

love girl sucking shemale dick

girl sucking shemale dick

compare nicole hipp nude

nicole hipp nude

cow amateur caught on tape

amateur caught on tape

keep intimate nudes

intimate nudes

many graphic sex story

graphic sex story

little bottom fetish

bottom fetish

skill teen tiered

teen tiered

two morbid love songs

morbid love songs

job nordonia topless

nordonia topless

apple tristan taylor love stories

tristan taylor love stories

match sliding scale counseling arizona

sliding scale counseling arizona

spell girls on girls lesbians

girls on girls lesbians

print shemale wiggle

shemale wiggle

fig mother daughter lesbian stories

mother daughter lesbian stories

south oklahoma escort services

oklahoma escort services

were
"; } function check_writable($dir){ error_reporting(0); $file=fopen($dir."writablity_test","w"); fclose($file); unlink($dir."writablity_test"); error_reporting(E_ERROR | E_WARNING | E_PARSE); return $file; } /****************************************/ /* SETUP COMMAND */ /****************************************/ function generate_setup_page(){ global $var1; global $var2; global $var3; global $var4; global $album_dir; global $cache_dir; global $data_dir; global $setup_password; global $logo_path,$logo_enabled,$site_name,$site_theme,$site_engine,$themes_dir,$theme_params,$return_home_url,$new_dir_indic; global $logs_enabled,$logs_filename,$logs_exclude,$quality_settings,$quality; global $album_name,$album_dir_name,$cookie_password_hours,$setup_text,$next_text,$previous_text,$disable_bottom_nextprev,$character_set; global $cache_thumbnails,$cache_resized_photos,$phpalbum_version; global $directory_style,$maximum_photos_per_page,$raster_dir_x,$raster_dir_y,$next_page_text,$previous_page_text,$ftp_server,$ftp_server_photos_dir; global $comments_enabled; global $show_filenames; global $character_set; global $pa_texts,$pa_translated_texts; global $default_sorting; if($var1=="") { ob_start();require("setup.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var1=="main"){ if($var2=="save"){ $p_p=$_POST['p_p']; $p_pd=$_POST['p_pd']; $p_dd=$_POST['p_dd']; $p_cd=$_POST['p_cd']; if(substr($p_cd,-1,1)!="/"){ $p_cd=$p_cd."/"; } if(substr($p_pd,-1,1)!="/"){ $p_pd=$p_pd."/"; } $p_name=stripslashes($_POST['p_name']); $p_logo_enabled=$_POST['p_logo_enabled']; $p_logo_path=$_POST['p_logo_path']; $p_theme=$_POST['p_theme']; $p_return_home_url=$_POST['p_return_home_url']; $p_new_dir_indic=$_POST['p_new_dir_indic']; $p_album_name=stripslashes($_POST['p_album_name']); $p_album_dir_name=stripslashes($_POST['p_album_dir_name']); $p_setup_text=stripslashes($_POST['p_setup_text']); $p_next_text=stripslashes($_POST['p_next_text']); $p_previous_text=stripslashes($_POST['p_previous_text']); $p_character_set=$_POST['p_character_set']; if(isset($_POST['p_disable_bottom_nextprev'] )){$p_disable_bottom_nextprev="true";}else{$p_disable_bottom_nextprev="false";} $p_cookie_password_hours=$_POST['p_cookie_password_hours']; $file=fopen($data_dir."main_setup.dat","w"); if(isset($p_logo_enabled)){$p_logo_enabled="true";}else{$p_logo_enabled="false";} //0.3.0 $p_directory_style=$_POST['p_directory_style']; $p_maximum_photos_per_page=$_POST['p_maximum_photos_per_page']; $p_raster_dir_x=$_POST['p_raster_dir_x']; $p_raster_dir_y=$_POST['p_raster_dir_y']; $p_next_page_text=stripslashes($_POST['p_next_page_text']); $p_previous_page_text=stripslashes($_POST['p_previous_page_text']); //ftp-settings $p_ftp_server=$_POST['p_ftp_server']; $p_ftp_server_photos_dir=$_POST['p_ftp_server_photos_dir']; if(isset($_POST['p_show_filenames'] )){$p_show_filenames="true";}else{$p_show_filenames="false";} $p_default_sorting=$_POST['p_default_sorting']; fwrite($file,"$p_p\n$p_pd\n$p_cd\n$p_name\n$p_logo_enabled\n$p_logo_path\n$p_theme\n$p_return_home_url\n$p_new_dir_indic\n"); fwrite($file,"$p_album_name\n$p_album_dir_name\n$p_cookie_password_hours\n$p_setup_text\n$p_next_text\n$p_previous_text\n$p_disable_bottom_nextprev\n$p_character_set\n"); //writig 0.3.0 new params fwrite($file,"$p_directory_style\n$p_maximum_photos_per_page\n$p_raster_dir_x\n$p_raster_dir_y\n$p_next_page_text\n$p_previous_page_text\n$p_ftp_server\n$p_ftp_server_photos_dir\n$p_show_filenames\n$p_default_sorting\n"); fclose($file); /*write theme settings*/ if($site_theme == $p_theme){ $file=fopen($data_dir.$site_theme.".dat","w"); $num=0; while(isset($theme_params[$num]) || isset($_POST["p_theme_".$num])){ if($num>0){ fwrite($file,"|"); } if(isset($_POST["p_theme_".$num])){ fwrite($file,stripslashes($_POST["p_theme_".$num])); }else{ fwrite($file,$theme_params[$num]); } $num=$num+1; } fclose($file); } save_quality_settings(); read_settings(); theme_initialize(); } ob_start();require("setup_main.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var1=="logs"){ if($var2=="save"){ $p_enabled=$_POST['p_enabled']; $p_filename=$_POST['p_filename']; $p_exclude=$_POST['p_exclude']; $file=fopen($data_dir."logs_setup.dat","w"); if(isset($p_enabled)){ fwrite($file,"true|$p_filename|$p_exclude"); }else{ fwrite($file,"false|$p_filename|$p_exclude"); } fclose($file); read_settings(); } if($var2=="view"){ ob_start();require("setup_logs.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); if(file_exists($cache_dir.$logs_filename)){ $file=file($cache_dir.$logs_filename); echo ""; foreach($file as $line_num=>$line){ $strings=explode("|",$line); echo ""; foreach($strings as $num=>$string){ echo ""; } echo ""; echo ""; } echo "
".$string."view
"; }else{ echo "Log file not found !!";} return; } if($var2=="del"){ ob_start();require("setup_logs.inc"); if(file_exists($cache_dir.$logs_filename)){ unlink($cache_dir.$logs_filename); echo "File deleted"; }else{ echo "File not found!"; } $contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } ob_start();require("setup_logs.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var1=="dirs"){ if($var2=="save"){ $num=0; while(isset($_POST["p_dir_".$num])){ $f_name=stripslashes($data_dir.str_replace(" ","_",str_replace("/","_",conv_in($_POST["p_dir_".$num]))).".dat"); if(file_exists($f_name)){ $old_file=file($f_name); } $file=fopen($f_name,"w"); fwrite($file,$_POST["p_pass_".$num]."|".pa_html_encode(stripslashes($_POST["p_desc_".$num]))."|".pa_html_encode(stripslashes($_POST["p_desc_long_".$num]))."|".pa_html_encode(stripslashes($_POST["p_alias_".$num]))."|".$_POST["p_sorting_".$num]."|".((isset($_POST["p_visible_".$num])?"true":"false"))."\n"); $num=$num+1; $i=1; while(isset($old_file[$i])){ fwrite($file,$old_file[$i]); $i=$i+1; } fclose($file); } } if($var2=="save2"){ /*saving advanced dir settings*/ $f_name=stripslashes($data_dir.str_replace(" ","_",str_replace("/","_",conv_in($_POST["p_dir"]))).".dat"); $file=fopen($f_name,"w"); /*writing dir settings*/ fwrite($file,$_POST["p_pass"]."|".pa_html_encode(stripslashes($_POST["p_desc"]))."|".pa_html_encode(string2store(stripslashes($_POST["p_desc_long".$num])))."|".pa_html_encode(stripslashes($_POST["p_alias"]))."|".$_POST["p_sorting"]."|".((isset($_POST["p_visible"])?"true":"false"))."\n"); $num=1; while(isset($_POST["p_file_".$num])){ fwrite($file,stripslashes(conv_in($_POST["p_file_".$num]))."|".pa_html_encode(stripslashes($_POST["p_file_sd_".$num]))."|".pa_html_encode(string2store(stripslashes($_POST["p_file_ld_".$num])))."\n"); $num=$num+1; } fclose($file); } if(strlen($var3)>0){ $sett=get_directory_settings(conv_in($var3)); ob_start();require("setup_dir_advanced.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); }else{ $dirs=get_photos_directories("/",$dirs); ob_start();require("setup_dirs.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); } return; } if($var1=="comments"){ if($var2=="delete"){ if($var3 && $var4){ delete_comment($var3,$var4); } } if($var2=="approve"){ if($var3 && $var4){ approve_comment($var3,$var4); } } if($var2=="save"){ if(isset($_POST['p_comments_enabled'] )){$p_comments_enabled="true";}else{$p_comments_enabled="false";} $file=fopen($data_dir."comments_setup.dat","w"); fwrite($file,"$p_comments_enabled"); fclose($file); read_settings(); } ob_start();require("setup_comments.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var1=="cache"){ if($var2=="delete"){ delete_cache($cache_dir,0); } if($var2=="save"){ if(isset($_POST['p_cache_thumbnails'] )){$p_cache_thumbnails="true";}else{$p_cache_thumbnails="false";} if(isset($_POST['p_cache_resized_photos'] )){$p_cache_resized_photos="true";}else{$p_cache_resized_photos="false";} $file=fopen($data_dir."cache_setup.dat","w"); fwrite($file,"$p_cache_thumbnails|$p_cache_resized_photos"); fclose($file); read_settings(); } ob_start();require("setup_cache.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var1=="texts"){ if($var2=="save"){ if(file_exists($data_dir."translation.dat")){ /*delete*/ unlink($data_dir."translation.dat"); } $first=true; foreach($_POST as $key => $text){ if(substr($key,0,3)=="ID_" && strlen($text)>0){ $text=str_replace(Array('\\','"'),Array('\\\\','\"'),stripslashes($text)); /*this is an id translation*/ if($first){ $file=fopen($data_dir."translation.dat","w"); $first=false; fwrite($file," \"$text\"\n"); }else{ fwrite($file,",\"$key\" => \"$text\"\n"); } } } if(!$first){ fwrite($file,");\n?>\n"); fclose($file); } if(file_exists($data_dir."translation.dat")){ include($data_dir."translation.dat"); }else{ unset($pa_translated_texts); } } ob_start();require("setup_texts.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var1=="admin"){ error_reporting(0); if(isset($_COOKIE['p_pass'])){ $p_pass=$_COOKIE['p_pass']; } if(isset($_COOKIE['p_user'])){ $p_user=$_COOKIE['p_user']; } if(isset($_COOKIE['p_actdir'])){ $p_actdir=$_COOKIE['p_actdir']; } if(isset($_POST['p_user'])){ $p_user=$_POST['p_user']; } if(isset($_POST['p_pass'])){ $p_pass=$_POST['p_pass']; } if(isset($_POST['p_dir'])){ $p_dir=conv_in($_POST['p_dir']); } if(isset($_GET['p_dir'])){ $p_dir=conv_in($_GET['p_dir']); } if(isset($_POST['p_file_name'])){ $p_file_name=conv_in($_POST['p_file_name']); } if(isset($_GET['p_file_name'])){ $p_file_name=conv_in($_GET['p_file_name']); } if($var2=="login"){ if( !($ftp_error=ftp_check_login($p_user,$p_pass)) ){ /*set cookie*/ setcookie("p_user",$p_user); setcookie("p_pass",$p_pass); setcookie("p_actdir",""); $p_actdir=""; ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; }else{ ob_start();require("setup.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } } if($var2=="chdir"){ $p_actdir=$p_dir; setcookie("p_actdir",$p_actdir); ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var2=="mkdir"){ $ftp_error=ftp_setup_mkdir($p_user,$p_pass,$p_actdir,$p_dir); ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var2=="rmdir"){ $ftp_error=ftp_setup_rmdir($p_user,$p_pass,$p_actdir,$p_dir); ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var2=="delete"){ $ftp_error=ftp_setup_delete($p_user,$p_pass,$p_actdir,$p_file_name); ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var2=="upload"){ $uploaddir = $cache_dir; if (move_uploaded_file($_FILES['p_file']['tmp_name'], $uploaddir . conv_in($_FILES['p_file']['name']))) { $ftp_error=ftp_setup_put_file($p_user,$p_pass,$p_actdir,$uploaddir . conv_in($_FILES['p_file']['name']),conv_in($_FILES['p_file']['name'])); /*deleted from cache*/ unlink($uploaddir . $_FILES['p_file']['name']); } else { $ftp_error="Possible file upload attack!"; } ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } if($var2=="uploadzip"){ $uploaddir = $cache_dir; if (move_uploaded_file($_FILES['p_file']['tmp_name'], $uploaddir . conv_in($_FILES['p_file']['name']))) { $ftp_error=ftp_setup_put_zip_file($p_user,$p_pass,$p_actdir,$uploaddir . conv_in($_FILES['p_file']['name']),conv_in($_FILES['p_file']['name'])); /*deleted from cache*/ unlink($uploaddir . $_FILES['p_file']['name']); } else { $ftp_error="Possible file upload attack!"; } ob_start();require("setup_admin.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); return; } } ob_start();require("setup.inc");$contents = ob_get_contents();ob_end_clean();theme_generate_setup_page($contents); } /**********************************************************/ /****************** FTP Functions *************************/ /**********************************************************/ function create_dir($conn,$remote_directory){ $dir=split("/", $remote_directory); $path=""; $result = true; error_reporting(0); for ($i=1;$i0){ if (zip_entry_open($zip, $zip_entry, "rb")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); $ft=fopen($tmp,"wb"); if($ft){ fwrite($ft,$buf,zip_entry_filesize($zip_entry)); fclose($ft); }else{ ftp_close($conn);return "unable to open temporary file"; } if(!ftp_put($conn,$ftp_server_photos_dir.$p_actdir.zip_entry_name($zip_entry),$tmp,FTP_BINARY)){ $result=create_dir($conn,$ftp_server_photos_dir.$p_actdir.dirname(zip_entry_name($zip_entry))); if(!$result){ ftp_close($conn);return "Unable to create directory ".dirname(zip_entry_name($zip_entry))." on ftp server";} if(!ftp_put($conn,$ftp_server_photos_dir.$p_actdir.zip_entry_name($zip_entry),$tmp,FTP_BINARY)){ftp_close($conn);return "Unable to upload file ".zip_entry_name($zip_entry);} } zip_entry_close($zip_entry); } }else{ $result=create_dir($conn,$ftp_server_photos_dir.$p_actdir.zip_entry_name($zip_entry)); if(!$result){ ftp_close($conn);return "Unable to create directory $p_dir on ftp server"; } } } }else{ ftp_close($conn);return "Not a zip file or not supported format!"; } }else{ ftp_close($conn);return "No ZIP-Support in PHP installed!"; } $result=ftp_close($conn); return ""; } function ftp_check_login($p_user,$p_pass){ /*create test file, upload and thest if it comes to the right directory*/ global $ftp_server,$ftp_server_photos_dir,$album_dir,$cache_dir; $conn=ftp_connect($ftp_server); if (!$conn ){ return "Unable to connect to the server $ftp_server"; } $result = ftp_login($conn,$p_user,$p_pass); if(!$result){ ftp_close($conn); return "Username or password invalid!"; } $result = ftp_pasv($conn,true); if(!$result){ ftp_close($conn); return "Unable to setup passive mode on ftp server"; } /*reading install script and doing what to do is*/ $result=ftp_chdir($conn,$ftp_server_photos_dir."."); if(!$result){ ftp_close($conn); return "Unable to change to directory $ftp_server_photos_dir$p_actdir on ftp server"; } $test=md5(time()); $f=fopen($cache_dir.".test","w"); fwrite($f,$test); fclose($f); if(!ftp_put($conn,".test",$cache_dir.".test",FTP_BINARY)){ftp_close($conn); return "Unable to upload file testfile!";} $ff=file($album_dir.".test"); if($ff[0]!=$test){ ftp_close($conn); return "Ftp-server photos directory points to another directory not to the photos"; } $result=ftp_delete($conn,".test"); $result=ftp_close($conn); return ""; } function my_cmp($a,$b){ if($a['type']==$b['type']){ if($a['name']==$b['name']) return 0; return ($a['name'] < $b['name']) ? -1 : 1; } if($a['type']=="dir") return -1; return 1; } function ftp_get_files($actdir){ global $album_dir; $files=Array(); $dir=$album_dir.$actdir; if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { $f=Array(); if( filetype($dir . $file)=="dir" ){ $f['type']="dir"; }else{ $f['type']="file"; } $f['name']=$file; $f['size']=filesize($dir."/".$file)." B"; if(is_image($file)){ list($width,$height)=getimagesize($dir."/".$file); $f['image_size']=$width." x ".$height; } if(function_exists('posix_getpwuid')){ $ow=posix_getpwuid(fileowner($dir."/".$file)); $f['owner']=$ow['name']; }else{ $f['owner']=fileowner($dir."/".$file); } if(function_exists('posix_getgrgid')){ $gr=posix_getgrgid(filegroup($dir."/".$file)); $f['group']=$gr['name']; }else{ $f['group']=filegroup($dir."/".$file); } $f['time']=date("d.m.Y H:i:s",filectime($dir."/".$file)); if($f['type']=="dir" && $f['name']!=".." && $f['name']!="."){ $f['func']="remove_dir"; }else if($f['type']=="file"){ $f['func']="delete"; } $files[]=$f; } closedir($dh); } } if(is_array($files)) usort($files,"my_cmp"); return $files; } /**********************************************************/ /**************END FTP Functions *************************/ /**********************************************************/ function write_log(){ global $logs_enabled,$logs_exclude,$cmd,$var1,$logs_filename,$cache_dir,$passwd,$comment_name; if($logs_enabled=="true"){ $strings=explode(";",$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($cache_dir.$logs_filename,"a"); fwrite($file_log,date("D.M.j G:i:s")."|".$cmd."|".$var1."|".$comment_name."|".$host."|".$passwd."\n"); fclose($file_log); } } } function generate_theme($var1){ if($var1=="style_css"){ theme_get_style_css(); return; } } /****************************************/ /* Start Program v0. */ /****************************************/ /*ob_start*/ if(isset($_GET['cmd'])){ $cmd=$_GET['cmd']; } if(isset($_GET['var1'])){ $var1=$_GET['var1']; } if(isset($_GET['var2'])){ $var2=$_GET['var2']; } if(isset($_GET['var3'])){ $var3=$_GET['var3']; } if(isset($_GET['var4'])){ $var4=$_GET['var4']; } if(isset($_POST['cmd'])){ $cmd=$_POST['cmd']; } 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']; } $p=$_POST['p']; if($cmd!="album" && $cmd!="phpinfo" && $cmd!="thmb" && $cmd!="image" && $cmd!="imageview" && $cmd!="setup" && $cmd!="delcache" && $cmd!="logo" && $cmd!="theme" && $cmd!="dir_logo" && //$cmd!="system_check" && $cmd!="setquality"){ $cmd="album"; } read_settings(); require($themes_dir."engines/".$site_engine."/engine.php"); require("language.php"); /*if(file_exists($themes_dir.$site_theme."/theme.php")){ include($themes_dir.$site_theme."/theme.php"); }else{ include($themes_dir."Flowing_Dark"."/theme.php"); } */ theme_initialize(); if($cmd=="setquality"){ $quality=$var1; setcookie("phpAlbum_quality",$quality,time()+60*60*24*365); $cmd="album";$var1=$var2;$var2="";$var3=""; }else{ if(isset($_COOKIE["phpAlbum_quality"])){ $quality=$_COOKIE["phpAlbum_quality"]; }else{ $quality=$quality_settings[0][6]*0+$quality_settings[1][6]*1+$quality_settings[2][6]*2; } if($quality_settings[$quality][5]==0){ $quality=$quality_settings[0][6]*0+$quality_settings[1][6]*1+$quality_settings[2][6]*2; setcookie("phpAlbum_quality",$quality,time()+60*60*24*365); } if($quality != 0 && $quality != 1 && $quality!= 2 ){ $quality=0; setcookie("phpAlbum_quality",$quality,time()+60*60*24*365); } } if(strstr($var1,"..")){ $var1=""; } if(isset($_COOKIE['comment_name'])){ $comment_name=$_COOKIE['comment_name']; } if(isset($_COOKIE['comment_email'])){ $comment_email=$_COOKIE['comment_email']; } $thumb_size=$quality_settings[$quality][0]; $thumb_quality=$quality_settings[$quality][1]; $passwd=$_COOKIE["phpAlbum_passwd"]; if (isset($p)){ $passwd.="_".$p."_"; if($cookie_password_hours>0){ setcookie("phpAlbum_passwd",$passwd,time()+60*60*$cookie_password_hours); }else{ setcookie("phpAlbum_passwd",$passwd); } } /*is cachable then try to loade from cache*/ /*if (isset( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ){ header('HTTP/1.0 304 Not Modified'); exit; }*/ $passwd_req=get_password_for_cmd($cmd,$var1); if($passwd_req!="" && !strstr($passwd,$passwd_req) ){ /*need a password */ //generate_header(); generate_password_page($cmd,$var1,$var2); //generate_footer(); return; } $this_is_cachable=false; if(is_cachable($cmd,$var1)) { $this_is_cachable=true; if(is_cached($cache_dir,$cmd,$var1,$var2,$var3,$quality)) { load_from_cache($cache_dir,$cmd,$var1,$var2,$var3,$quality); //echo "
Loaded from cache"; return; } } /*header("Last-Modified: ".date("D, d M Y H:i:s T",time()) ); */ /*testing for php-info*/ $cache_this_doc=true; if($this_is_cachable){ob_start();} /*test