Jump to content
GIGN Forum

Hltv Ka Uzlikt!


Recommended Posts

Kompresācīja.

<?
  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);  
     }
?>

Mājas lapa

<?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);
}
?>

hltv.cfg

record "../../AppServ/www/demo/demo_nosaukums"

connect "tavs_ip vai dns"

Link to comment
Share on other sites

taa es to pamaaciibu apskatiijos a kuraa vietaa jaabaaz shitas te kods ???

3) Then you need a script to show your zip files for downloading:

Code:

<html>

<head>

<meta http-equiv="Content-Language" content="en">

<title>HLTV Demos</title>

</head>

<body bgcolor="#000000">

<p align='center'>

<?php

if ($handle = opendir('D:/WebServer/www/zips/')) { // dir with .zip files

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 "<div align='center'>

<table cellpadding='0' cellspacing='0' width='500' bgcolor='#000000'>

<!-- MSTableType='layout' -->

<tr>

<td width='173' height='21' valign='top'>

<font color='#FFFFFF' face='Verdana' size='1'>$day.$month.$year $hour:$minute</li>

</font></td>

<td width='256' height='21' valign='top'>

<font color='#FFFFFF' face='Verdana' size='1'>$name</font></td>

<td width='296' height='21' valign='top'> <a href='zips/$file'>

<font color='#FFFFFF' face='Verdana' size=1>download</font></a></td>

</tr>

</table>

</div>";

}

}

closedir($handle);

}

?>

</body>

</html>

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...