DoubleT Posted December 5, 2008 Report Share Posted December 5, 2008 Tātad skatījos lazda2, jancis38 un Lil_Netii pamācības un pēc tām man nekas neizdevās, bet mazliet tās apvienojot un izmainot ieguvu ideālu iznākumu. Tātad pirmais ieejam jūsu servera mapē ( manā gadījumā X:/serveris/cstrike ) un izveidojam tur jaunu mapi demo Tad atveram ar hltv.cfg kurš atrodas jūsu servera mapē ( X:/serveris ) un apakšā pierakstam record demo/nosaukums connect IP vārdu nosaukums un IP vietā gan jau zinat kas jāraksta tālāk dodamies uz jūsu web mapi ( manā gadījumā C:/xampp/htdocs/vhosts/ksh ) un izveidojam demo.php ar tekstu : <?php function zipcompressfile($source,$destination,$filename,$level=false) { $dest=$destination.$filename.'.zip'; $mode='wb'.$level; $error=false; 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 = 'X:/Serveris/cstrike/demo/'; // Folder with .dem files $dl_dir = 'C:/xampp/htdocs/vhosts/ksh/demo/'; // 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); } include 'lv.php'; $available_dates = array(); $all_files = array(); foreach (glob("demo/nosaukums-*.zip") as $filename) { if (preg_match('/^demo\/nosaukums\-\d{10}\-[a-zA-Z0-9_\-\.]{1,200}\.zip$/', $filename)) { $parts = explode("-", $filename); $date = $parts[1]; $map = $parts[2]; $mapparts = explode(".", $map); $map = $mapparts[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); $size = filesize($filename); $ymd = $year.'-'.$month.'-'.$day; if (!in_array($ymd, $available_dates)) { if ($ymd >= date('y-m-d', time() - 504800)) { $available_dates[] = $ymd; } } $all_files[] = array( 'filename' => $filename, 'map' => $map, 'date' => $ymd, 'fulldate' => '20'.$year.'-'.$month.'-'.$day.' '.$hour.':'.$minute, 'size' => $size ); } } rsort($available_dates); $date_to_match = ''; if (empty($_GET['date'])) { if (!empty($available_dates[0])) { $date_to_match = $available_dates[0]; } } elseif ($_GET['date'] >= date('y-m-d', time() - 604800)) { $date_to_match = $_GET['date']; } $files_to_show = array(); foreach($all_files as $v) { if ($v['date'] == $date_to_match) { $files_to_show[] = $v; } } ?> <html> <head> <title>Demo files</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/JavaScript"> <!-- function jump(select_obj) { if (select_obj.value != '') { document.getElementById('form1').submit(); } } //--> </script> </head> <body> <table width="400" border=0 cellspacing=0 cellpadding=0 align="center"> <tr> <td align="left"> <form id="form1"> <select name="date" onchange="jump(this)" size="1"> <option value=""><?php echo $web_lang['hltv_chose_date'];?></option> <?php foreach ($available_dates as $v) { ?> <option <?php echo (!empty($_GET['date']) && $_GET['date'] == $v) ? 'selected="selected"' : ''; ?> value="<?php echo $v; ?>"><?php echo $v; ?></option> <?php } ?> </select> </form> </td> </tr> </table> <br> <table width="400" border=0 cellspacing=0 cellpadding=0 align="center"> <tr> <td width="150" align="left"><?php echo $web_lang['hltv_name'];?></td><td width="50"><?php echo $web_lang['hltv_size'];?></td><td width="150"><?php echo $web_lang['hltv_date'];?></td> </tr> <?php foreach ($files_to_show as $v) { ?> <tr> <td><a href="<?php echo $v['filename']; ?>"><?php echo $v['map']; ?></a></td> <td><?php echo $v['size'] ?></td> <td><?php echo $v['fulldate']; ?></td> </tr> <?php } ?> </table> </body> </html> tālāk sākam šo kodu saprast un rediģēt šīs rindiņas: $demo_dir = 'X:/Serveris/cstrike/demo/'; // Folder with .dem files $dl_dir = 'C:/xampp/htdocs/vhosts/ksh/demo/'; // Folder, where to put compressed files izmainam pēc jūsu vajadzībām ( pirmā rindiņa norāda kur ir .dem faili, bet otrā kur tiks glabāti .zip arhīvi ) tālak šīs rindiņas: foreach (glob("demo/nosaukums-*.zip") as $filename) { if (preg_match('/^demo\/nosaukums\-\d{10}\-[a-zA-Z0-9_\-\.]{1,200}\.zip$/', $filename)) { nomainam vārdu demo abās rindiņās uz mapi kur jums ir zip arhīvi, bet vārda nosaukums vietā nosaukumu kuru rakstījāt hltv.cfg failā. tālāk izveidojam lv.php <? $web_lang['hltv_name'] = "Mape"; $web_lang['hltv_date'] = "Datums"; $web_lang['hltv_chose_date'] = "Izvēlieties datumu"; $web_lang['hltv_size'] = "Izmērs(Kb)"; ?> un dodamies visu pārbaudīt Ieslēdzam HLTV pagaidam, pagaidam kamēr nerāda Started recording blablabla tad rakstam stop ( lai apturētu ierakstu ) un dodamies uz demo mapi ( man X:/Serveris/cstrike/demo ) un skatamies vai .dem fails tur ir ... ja ir viss kārtībā, ja nav daram visu no sākuma skatoties ar abām acīm ( vaļā ) ... Tālāk dodamies http://tavaleetalapa.lv/demo.php un skatamies vai izpildījās kompresācija un ir pieejams .zip arhīvs ja ir tad kliedzam URRRRĀA un sakam paldies DoubleT ;]] ja nav tad emm nu viss no sākuma... lapas HTML daļu varam mainīt, ja to mākam lai lapa saplūstu ar jūsu pārējo lapu utt. Link to comment Share on other sites More sharing options...
ry. Posted December 5, 2008 Report Share Posted December 5, 2008 (edited) Iepriekšējām pamācībām nebija nevainas, viss gāja. Bet nu paldies tāpat, vismaz parādijās gribēšana uztaisīt hltv savam serverim Edited December 5, 2008 by ry. Link to comment Share on other sites More sharing options...
Kz. Posted December 5, 2008 Report Share Posted December 5, 2008 DoubleT ši pamacībā ir ļoti laba, salidzinājumā ar citām kur māca kā: ielikt hltv ! Paldies ceru, ka noderēs Link to comment Share on other sites More sharing options...
DoubleT Posted December 5, 2008 Author Report Share Posted December 5, 2008 Paldies ceru, ka noderēs Vienmēr laipni Link to comment Share on other sites More sharing options...
hakeris132 Posted December 5, 2008 Report Share Posted December 5, 2008 Malacis redzu, ka esi pacenties , protams, ceru ka pats rakstiji. Link to comment Share on other sites More sharing options...
-ScH1Zo^ Posted December 5, 2008 Report Share Posted December 5, 2008 Malacis DoubleT Link to comment Share on other sites More sharing options...
DoubleT Posted December 5, 2008 Author Report Share Posted December 5, 2008 , protams, ceru ka pats rakstiji. pats pats ;]] Link to comment Share on other sites More sharing options...
lazda2 Posted December 6, 2008 Report Share Posted December 6, 2008 Malacis! Cik sapratu tu esi apkopojis visu no a liidz z ? Vareeji to garo kodu labaak ielikt paste.php.lv bet nu tas taa. Btw. Ja kadam demo neierakstaas tajaa mapee kur vajag vienkaarši izveidojat jaunu failu ar nosaukumu director.cfg mapee kur atrodas hltv. Nu vismaz man taa bija. Link to comment Share on other sites More sharing options...
DoubleT Posted December 7, 2008 Author Report Share Posted December 7, 2008 man arī nav director.cfg HLTV konsolē vēl rāda ka nav atrasts bet tik un tā rakstās ;]] Link to comment Share on other sites More sharing options...
xgames Posted December 7, 2008 Report Share Posted December 7, 2008 ka var izdarit lai tas HLTV saplustu ar majaslapu???? Link to comment Share on other sites More sharing options...
hakeris132 Posted December 7, 2008 Report Share Posted December 7, 2008 ieinstalet appserv lol ja tu visu dari ka te rakstits tad vins pats sapludis ar tavu majas lapu. Link to comment Share on other sites More sharing options...
xgames Posted December 7, 2008 Report Share Posted December 7, 2008 es jau visu izdariju ka te ir teikts bet nau sapludis!!! Link to comment Share on other sites More sharing options...
DeimoN Posted December 7, 2008 Report Share Posted December 7, 2008 Piemeeram, php fusion elementaari integreet demo.php ieksh lapas, vajag tikai demo.php faila augshaa un apakshaa pierakstiit nepecieshamos require_once. Pats arii intereses peec pameginaaju sho visu dabuut gatavu, ja neskaita, ka kaut kas nav kaartiiba ar charset'u un to, ka ta demo.php lapa neatjaunojas ar demo failiem (taa, kaa man ir loti minimaalas php zinaashanas, nezinu, kas tur iisti notiek..), viss ok ^^ Link to comment Share on other sites More sharing options...
Recommended Posts