View file dl/load_txt.php

File size: 2.61Kb
<?php
#********************************** AgS MOD DOWNLOAD CENTR SEA *************************************#
#***************************************************************************************************#
#  /||||||||||||||| *********************  /||||||||||||||| *********************  /||||||||||||||| #
# | ||||||||||||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# | |||||/////||||| ********************* | |||||/////////  ********************* | |||||/////////  #
# | |||||   | ||||| ****** E-MAIL ******* | |||||           ****** WAP/WEB ****** | |||||           #
# | |||||   | ||||| *** [email protected] *** | |||||           * http://ags.h2m.ru * | ||||||||||||||| #
# | |||||   | ||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# | |||||   | ||||| ********************* | |||||/////||||| ********************* |///////////||||| #
# | ||||||||||||||| ****** SKYPE ******** | |||||   | ||||| ***** MOD AUTHOR ****           | ||||| #
# | |||||////|||||| ***** agrizz15 ****** | |||||   | ||||| ***** Agris Cišs ****  /||||||||||||||| #
# | |||||   | ||||| ********************* | ||||||||||||||| ********************* | ||||||||||||||| #
# |/////    |/////  ********************* |///////////////  ********************* |///////////////  #
#***************************************************************************************************#
#********************************* MOD by AgS in 2010 @ LATVIA *************************************#


require_once"system/start.php";
require_once"system/config.php";
require_once"system/db.php";

include_once"system/lib.pclzip.php";


/* Izdzēšam pēc dienam */
	$d = @opendir($setup['dir_zip']);
while($f = @readdir($d)) {
	if($f != '.' && $f != '..') {
	if(time() - filectime($setup['dir_zip'].'/'.$f) > $setup['del_autozip']*86400) {//PĒC LAIKA!
unlink($setup['dir_zip'].'/'.$f); }
}} @closedir($f);




$id = intval($_GET['id']);
$d = mysql_fetch_row(mysql_query('SELECT TRIM(`path`) FROM `'.$MY_pre.'faili` WHERE `id` = '.$id.' LIMIT 1'));

if(file_exists($d[0])){
mysql_query('UPDATE `'.$MY_pre.'faili` SET `loads`=`loads`+1, `timeload`='.$time.' WHERE `id`='.$id);
$tmp = $setup['dir_zip'].'/'.basename($d[0]).'.zip';

if(!file_exists($tmp)){

$zip = new PclZip($tmp);

function cb($p_event, &$p_header){
$p_header['stored_filename'] = basename($p_header['filename']);
return 1;
}

$zip->create($d[0], PCLZIP_CB_PRE_ADD, 'cb');
chmod($tmp,0644);}

header('Location: '.$tmp, true, 301);

/* Ziņa īpašiem cilvēkiem */
}else{
echo $mudaki.'</body></html>';
}

?>