Guest User

Untitled

a guest
Feb 20th, 2016
320
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php error_reporting(1);$sort=array(array('key'=>'lname','sort'=>'asc'),array('key'=>'size','sort'=>'asc'));$this_script=basename(__FILE__);$this_folder=str_replace('/'.$this_script,'',$_SERVER['SCRIPT_NAME']);$this_domain=$_SERVER['SERVER_NAME'];$dir_name=explode("/",$this_folder);$file_list=array();$folder_list=array();$total_size=0;$filetype=array('doc'=>array('doc','docs','pdf','pages','key','numbers','xls','ppt'),'text'=>array('txt','rtf','text','nfo','md','markdown'),'audio'=>array('aac','mp3','wav','wma','m4p'),'image'=>array('ai','bmp','eps','gif','ico','jpg','jpeg','png','psd','psp','raw','tga','tif','tiff','icns'),'video'=>array('mv4','bup','mkv','ifo','flv','vob','3g2','bik','xvid','divx','wmv','avi','3gp','mp4','mov','3gpp','3gp2','swf','mpg','mpeg'),'archive'=>array('7z','dmg','rar','sit','zip','bzip','gz','tar','pkg','safariextz','bz2'),'app'=>array('ipa','exe','app'),'script'=>array('js','html','htm','xhtml','jsp','asp','aspx','php','xml','css','plist'));if($handle=opendir('.')){while(false!==($file=readdir($handle))){if($file!="."&&$file!=".."&&$file!=$this_script&&!in_array($file,$ignore_list)){$stat=stat($file);$info=pathinfo($file);$item['name']=$info['filename'];$item['lname']=strtolower($info['filename']);$item['ext']=$info['extension'];$item['lext']=strtolower($info['extension']);if($info['extension']=='')$item['ext']='.';if(in_array($item[lext],$filetype['doc'])){$item['class']='type-document';}elseif(in_array($item[lext],$filetype['text'])){$item['class']='type-text';}elseif(in_array($item[lext],$filetype['audio'])){$item['class']='type-audio';}elseif(in_array($item[lext],$filetype['image'])){$item['class']='type-image';}elseif(in_array($item[lext],$filetype['video'])){$item['class']='type-video';}elseif(in_array($item[lext],$filetype['archive'])){$item['class']='type-archive';}elseif(in_array($item[lext],$filetype['app'])){$item['class']='type-app';}elseif(in_array($item[lext],$filetype['script'])){$item['class']='type-script';}else{$item['class']='type-generic';}$item['bytes']=$stat['size'];$item['size']=bytes_to_string($stat['size'],2);$item['mtime']=$stat['mtime'];if($info['extension']!=''){array_push($file_list,$item);}else{array_push($folder_list,$item);}clearstatcache();}}closedir($handle);}if($folder_list)$folder_list=php_multisort($folder_list,$sort);if($file_list)$file_list=php_multisort($file_list,$sort);function php_multisort($data,$keys){foreach($data as $key=>$row){foreach($keys as $k){$cols[$k['key']][$key]=$row[$k['key']];}}$idkeys=array_keys($data);$i=0;foreach($keys as $k){if($i>0){$sort.=',';}$sort.='$cols['.$k['key'].']';if($k['sort']){$sort.=',SORT_'.strtoupper($k['sort']);}if($k['type']){$sort.=',SORT_'.strtoupper($k['type']);}$i++;}$sort.=',$idkeys';$sort='array_multisort('.$sort.');';eval($sort);foreach($idkeys as $idkey){$result[$idkey]=$data[$idkey];}return $result;}function bytes_to_string($size,$precision=0){$sizes=array(' YB',' ZB',' EB',' PB',' TB',' GB',' MB',' KB',' bytes');$total=count($sizes);while($total--&&$size>1024)$size/=1024;$return['num']=round($size,$precision);$return['str']=$sizes[$total];return $return;}function time_ago($timestamp,$recursive=0){$current_time=time();$difference=$current_time-$timestamp;$periods=array("second","minute","hour","day","week","month","year","decade");$lengths=array(1,60,3600,86400,604800,2630880,31570560,315705600);for($val=sizeof($lengths)-1;($val>=0)&&(($number=$difference/$lengths[$val])<=1);$val--);if($val<0)$val=0;$new_time=$current_time-($difference%$lengths[$val]);$number=floor($number);if($number!=1){$periods[$val].="s";}$text=sprintf("%d %s ",$number,$periods[$val]);if(($recursive==1)&&($val>=1)&&(($current_time-$new_time)>0)){$text.=time_ago($new_time);}return $text;}?><!DOCTYPE html><html><head><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=#ff7f00><meta name=application-name content=citrusui><meta name=author content="Avery Magnotti"><meta name=msapplication-navbutton-color content=#ff7f00><meta name=msapplication-square70x70logo content=//citrusui.me/assets/small.png><meta name=msapplication-square150x150logo content=//citrusui.me/assets/medium.png><meta name=msapplication-square310x310logo content=//citrusui.me/assets/large.png><meta name=msapplication-wide310x150logo content=//citrusui.me/assets/wide.png><meta name=msapplication-TileColor content=#ff7f00><meta name=theme-color content=#ff7f00><meta name=twitter:card content=summary><meta name=twitter:site content=@citrusui><meta name=viewport content="width=device-width,initial-scale=1,user-scalable=no"><meta property=fb:app_id content=1836711199889234><meta property=og:image content=//citrusui.me/logo><meta property=og:image:height content=300><meta property=og:image:width content=300><link rel=apple-touch-icon href=apple-touch-icon><link rel=icon href=//citrusui.me/favicon><link rel=mask-icon href=//citrusui.me/pinicon color=#ff7f00><link rel=sitemap href=//citrusui.me/sitemap><link rel=stylesheet href=//citrusui.me/css/twbs.css><link rel=stylesheet href=//citrusui.me/css/style.css><link rel=stylesheet href=//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css></head><body><div class=container-fluid><h1><a href=https://<?=$this_domain?>><?=$this_domain?></a><? foreach($dir_name as $dir=>$name):?><?if(($name!=' ')&&($name!='')&&($name!='.')&&($name!='/')):?><?$parent='';?><?for($i=1;$i<=$dir;$i++):?><?$parent.=$dir_name[$i].'/';?><?endfor;?> / <a href="/<?=$parent?>"><?=$name?></a><?endif;?><?endforeach;?></h1></div><div class=table-responsive><table class=table><thead><tr><th>Name</th><th>Size</th><th>Date modified</th></tr></thead><tbody><tr><th><?if($folder_list):?><?foreach($folder_list as $item):?><a href=<?=$item['name']?>/><?=$item['name']?></a><?endforeach;?><?endif;?><?if($file_list):?><?foreach($file_list as $item):?><a href=<?=$item['name']?>.<?=$item['ext']?>><?=$item['name']?>.<?=$item['ext']?></a</th><th><?=$item['size']['num']?><?=$item['size']['str']?></th><th><?=time_ago($item['mtime'])?> ago</th></tr></tbody><?endforeach;?><?endif;?></table></div></body></html>
RAW Paste Data