Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function fsize($file) {
- $fmod = filesize($file);
- if ($fmod < 0) $fmod += 2.0 * (PHP_INT_MAX + 1);
- $i = 0;
- $myfile = fopen($file, "r");
- while (strlen(fread($myfile, 1)) === 1) {
- fseek($myfile, PHP_INT_MAX, SEEK_CUR);
- $i++;
- }
- fclose($myfile);
- if ($i % 2 == 1) $i--;
- return ((float)($i) * (PHP_INT_MAX + 1)) + $fmod;
- }
- if ($handle = opendir('diskuser/Sonic3R')) //aici pun public in loc de Sonic3R si alte alea
- {
- $path="images/files/nou/";
- $imagine="";
- while (false !== ($file = readdir($handle))) {
- //echo "$file\n";
- if ($file != "." && $file != "..")
- {
- $file = strtolower($file) ;
- $exts = explode(".", $file) ;
- $n = count($exts)-1;
- $exts = $exts[$n];
- //echo $exts;
- switch($exts)
- {
- case "php":{$imagine=$path."php.png";break;}
- case "html":{$imagine=$path."html.png";break;}
- case "js":{$imagine=$path."js.png";break;}
- case "air":{$imagine=$path."air.png";break;}
- case "asp":{$imagine=$path."asp.png";break;}
- case "h":{$imagine=$path."header_c++.png";break;}
- case "c":{$imagine=$path."c.png";break;}
- case "cpp":{$imagine=$path."c++.png";break;}
- case "cs":{$imagine=$path."csharp.png";break;}
- case "css":{$imagine=$path."css.png";break;}
- case "as":{$imagine=$path."as.png";break;}
- case "fla":{$imagine=$path."flash.png";break;}
- case "flv":{$imagine=$path."flash.png";break;}
- case "fs":{$imagine=$path."fsharp.png";break;}
- case "vjp":{$imagine=$path."j++.png";break;}
- case "class":{$imagine=$path."class.png";break;}
- case "java":{$imagine=$path."java.png";break;}
- case "jsp":{$imagine=$path."jsp.png";break;}
- case "pas":{$imagine=$path."pascal.png";break;}
- case "pl":{$imagine=$path."perl.png";break;}
- case "psd":{$imagine=$path."psd.png";break;}
- case "py":{$imagine=$path."python.png";break;}
- case "rb":{$imagine=$path."ruby.png";break;}
- case "sql":{$imagine=$path."sql.png";break;}
- case "swf":{$imagine=$path."swf.png";break;}
- case "xml":{$imagine=$path."xml.png";break;}
- case "apk":{$imagine=$path."android.png";break;}
- case "dmg":{$imagine=$path."ios.png";break;}
- case "7z":{$imagine=$path."7z.png";break;}
- case "arj":{$imagine=$path."arj.png";break;}
- case "bz2":{$imagine=$path."bz2.png";break;}
- case "gz":{$imagine=$path."gz.png";break;}
- case "rar":{$imagine=$path."rar.png";break;}
- case "sit":{$imagine=$path."sit.png";break;}
- case "tar":{$imagine=$path."tar.png";break;}
- case "zip":{$imagine=$path."7z.png";break;}
- case "pdf":{$imagine=$path."pdf.png";break;}
- case "xls":{$imagine=$path."excel.png";break;}
- case "xlsx":{$imagine=$path."excel.png";break;}
- case "pst":
- case "ost":
- case "pab":
- case "oab":
- case "msg":{$imagine=$path."outlook.png";break;}
- case "ppt":
- case "pptx":{$imagine=$path."powerpoint.png";break;}
- case "pub":{$imagine=$path."publisher.png";break;}
- case "doc":
- case "docx":{$imagine=$path."word.png";break;}
- case "adp":
- case "adp":
- case "accdp":
- case "accdr":
- case "mdb":
- case "mda":
- case "mdf":
- case "mde":
- case "accde":
- case "mam":
- case "maq":
- case "mar":
- case "mat":
- case "maf":
- case "ade":{$imagine=$path."access.png";break;}
- case "grv":{$imagine=$path."groove.png";break;}
- case "xsn":{$imagine=$path."infopath.png";break;}
- case "one":{$imagine=$path."onenote.png";break;}
- case "csv":{$imagine=$path."csv.png";break;}
- case "png":{$imagine=$path."png.png";break;}
- case "tiff":{$imagine=$path."tiff.png";break;}
- case "gif":{$imagine=$path."gif.png";break;}
- case "jpg":{$imagine=$path."jpg.png";break;}
- case "jpeg":{$imagine=$path."jpg.png";break;}
- case "inf":{$imagine=$path."inf.png";break;}
- case "bat":{$imagine=$path."bat.png";break;}
- default:{$imagine=$path."others.png";break;}
- }
- $marime=fsize($file);
- //echo $file." <img src='".$imagine."' width='80' height='80'/>";
- echo "<div class='file'><img src='".$imagine."' width='55' height='55'/><br/>".$file."<p class='info' style='display:none'>".$marime."</p></div>";
- }
- }
- closedir($handle);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement