<?php
if(!defined("FORMS")){
	echo "<pre>Access denied!";
	exit();
}
$descr		= ($_REQUEST['autobr2']==1) ? nl2br($_REQUEST['text2']) : $_REQUEST['text2'];
$end_t		= explode(".", $_REQUEST['date15']);
$end_top	= mktime($_REQUEST['e_date_top_hour'],$_REQUEST['e_date_top_minute'],0,$end_t[1],$end_t[0],$end_t[2]);
$hitsperday = (is_numeric($_REQUEST['hits_perday'])) ? $_REQUEST['hits_perday'] : 0;
$hitstoday	= (is_numeric($_REQUEST['hits_today'])) ? $_REQUEST['hits_today'] : 0;
$hits		= (is_numeric($_REQUEST['hits'])) ? $_REQUEST['hits'] : 0;

if($hitstoday > $hits) $hits = $hitstoday;



if( filesize($_FILES['files']['tmp_name']) >2 ){
	if(file_exists($path . $_FILES['files']['name'])){
		@unlink($path . $_FILES['files']['name']);
	}
	$fupload_name = str_replace(" ", "",$_FILES['files']['name']);
	if(!@move_uploaded_file($_FILES['files']['tmp_name'], $path . $fupload_name)){
		@move_uploaded_file($_FILES['files']['tmp_name'], $path2 . $fupload_name);
	}
	@chmod (BASEDIR . 'uploads/files/' . $fupload_name, 0777);
}
if($fupload_name!=""){
	$sqllocal = " ,dlurl_local = '$fupload_name'";
	$sqllocal_new = " ,'$fupload_name'";
	$sqllocal_file = $fupload_name;
}

if($_REQUEST['url_man']!=""){
	if($fupload_name==""){
		$manu_file = str_replace("uploads/files/", "", $_REQUEST['url_man']);
		$sqllocal = " ,dlurl_local = '$manu_file'";
		$sqllocal_new = " ,'$manu_file'";
		$sqllocal_file = $manu_file;
	}
}


if( ($sqllocal_file=="") && ($sqllocal=="") ) {
	$sqllocal = " ,dlurl_local = ''";
	$sqllocal_new = " ,''";
}

if( ($_REQUEST['size_man2'] > 10) && ($_REQUEST['size_man2'] != $size) && ($fupload_name=="") ) {
	$size = $_REQUEST['size_man2'];
}

$size = ($_REQUEST['size_man2']!='') ? $_REQUEST['size_man2'] : $_REQUEST['size_man'];


if( ($fupload_name!="") || ($manu_file!="")) {
	$rurl = "";
	}else{
	$rurl = $_REQUEST['url'];
}

?>