artur007 Posted January 23, 2007 Report Share Posted January 23, 2007 visu izmekleju, nekur neatradu, nu tak kaa var ielikt hltv demkas webaa? Link to comment Share on other sites More sharing options...
RuSh* Posted January 23, 2007 Report Share Posted January 23, 2007 Comression scripts! <? function zipcompressfile($source,$destination,$filename,$level=false) { $dest=$destination.$filename.'.zip'; $mode='wb'.$level; $error=false; echo $source.$filename.' -> '.$dest.'<br>'; if($fp_out=gzopen($dest,$mode)) { if($fp_in=fopen($source.$filename,'rb')) { while(!feof($fp_in)) { gzwrite($fp_out,fread($fp_in,1024*512)); } fclose($fp_in); } else { $error=true; } gzclose($fp_out); } else $error=true; if($error) return false; else return $dest; } $demo_dir = 'D:/AppServ/www/recorded_demos/'; // Folder with .dem files $dl_dir = 'D:/AppServ/www/compressed_demos/'; // Folder, where to put compressed files $handle = opendir($demo_dir); if ($handle) { while (false !== ($fails = readdir($handle))) { if ( preg_match("/(.*).dem/", $fails, $demo) ) { zipcompressfile($demo_dir, $dl_dir, $fails); } } closedir($handle); } ?> View scripts: <?php if ($handle = opendir('D:/AppServ/www/compressed_demos/')) { while (false !== ($file = readdir($handle))) { if (strlen($file) > 4) { $gabali = explode("-", $file); $date = $gabali[1]; $mape = $gabali[2]; $mapesgabali = explode(".", $mape); $name = $mapesgabali[0]; $year = substr($date,0,2); $month = substr($date,2,2); $day = substr($date,4,2); $hour = substr($date,6,2); $minute = substr($date,8,2); echo "<center>$day.$month.$year $hour:$minute $name <a href=\"http://yourweb.com/compressed_demos/$file\">Download</a></br></center>"; } } closedir($handle); } ?> Link to comment Share on other sites More sharing options...
artur007 Posted January 23, 2007 Author Report Share Posted January 23, 2007 tnx, es neko nesapratu, kur tas jaaliek vareetu paskaidrot? Link to comment Share on other sites More sharing options...
rigaslauvas Posted January 23, 2007 Report Share Posted January 23, 2007 tava weba ja neko nezini no html tad nez Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now