<?php
include('./core/t.fun.php');
include('./data/config.php');
include('./core/db.fun.php');
include('./core/page.fun.php');

$nav = $_SERVER["PATH_INFO"];
$str = substr($nav,1,12);

$info = id_info($str);
if(!check_code($str)){die('page:erreo_code_Invalid!');}
if($info == false){die('page:error_Nofile_or_ID_Invalid!');}

$file = file_info($str);

$tag['<#name#>']   = $info['name'];
$tag['<#size#>']   = size_info($file['size']);
$tag['<#type#>']   = $file['type'];
$tag['<#up#>']     = date('Y-m-d',$file['up']);
$tag['<#dt#>']     = date('Y-m-d',$file['dt']);
$tag['<#down#>']   = $file['down'];
$tag['<#id#>']     = $str;
$tag['<#fileimg#>']=get_img($file['type']);
$id   = $str;
$tag['<#des#>']  = $file['des'];
$tag['<#status#>']  = ($file['status']=='0' ? 'block' : 'none' ); //如果没有被举报，则显示，举报过后将不显示
$tag['<#link#>']     = $config['url'].'/t.php/'.$id.'.html';

$time     = time();
$downlink = $config['url'].'/d.php?c='.$id.$time;


if($info['locked']=='0'){
if($info['pro'] == 1){$passcon =  '
<form action="'.$config['url'].'/pd.php" method="post">
输入密码下载
<input name="po" type="text" id="po"/>
<input name="id" type="hidden" id="id" value="'.$id.'"/>
<input name="" type="submit" value="下载" />
</form>';$filetype = '密保文件：';
}else{$passcon = '<a href="'.$downlink.'">高速下载</a>';$filetype = '下载地址：';}
}
else{
	  $passcon='<p style="color:red;">&nbsp;&nbsp;此文件已锁定 暂无法下载！</p>';
	}
$tag['<#showtype#>'] = $filetype;
$tag['<#password#>'] = $passcon;

$tag['<#url#>']        = $config['url'];
$tag['<#sitename#>']   = $config['sitename'];
$tag['<#description#>']= $config['description'];
$tag['<#keywords#>']   = $config['keywords'];
$tag['<#beian#>']      = $config['beian'];
$tag['<#tongji#>']     = stripslashes($config['tongji']);
echo html_mod('t',$tag);
?>