<?php
/**
 *----------------------------------------------------------------------------
 * 版权所有 2010-2016 HuCart.COM，并保留所有权利。
 * 网站地址: http://Www.HuCart.Com;http://Www.HuCart.Com
 * 作者: HuCart.COM
**/
define('HUCART_COM', 'aHR0cDovL3d3dy5odWNhcnQuY29t');

define('ROOT_PATH', str_replace('archiver/index.php', '', str_replace('\\', '/', __FILE__)));

if(!file_exists(ROOT_PATH . 'system/config/HuCart.COM.install.lock'))
{
	header("Location: ../install/\n");
	exit();
}

//无图版，主要针对搜索引擎优化
$GLOBALS['tpl_path'] 			= 'templates/archiver';		    //模板目录
$GLOBALS['cpl_path'] 			= 'compiles/archiver';		   //编译目录
$GLOBALS['cache_path'] 			= '_tmp/archiver';			   //缓存目录

require ROOT_PATH.'system/config/include.ini.php';
require ROOT_PATH.'system/class/class_archiver.php';

$WebConfig = $Helpe -> get_config();

$Templ -> template_dir = ROOT_PATH.$GLOBALS['tpl_path'];	//重新修改模板位置！！

//网站如果设置关闭
if($WebConfig["webclose"]==1)
{
	//var_dump( $WebConfig );
	$this -> view -> assign('webclosevalue',$WebConfig["webclosevalue"]);	//获取配置文件
	$this -> view -> display('close_tpl.html');
	exit('');
}

$contactArray = $this -> helper -> build_contact($WebConfig);

$this -> view ->assign('contactArray',$contactArray);

$this -> view -> assign('getconfig',$WebConfig);	//获取配置文件

$this -> view ->assign('tpl_path',$GLOBALS['tpl_path']);



$getcount = count($_GET);


if( $getcount > 0  and $getcount < 3 )
{
	foreach((array)$_GET as $gkey => $gval)
	{
		if($gkey == 'page' and $gval > 0 )
		{
			$page = $gval;
		}else if( $gkey !='' )
		{
			$actid = $gkey;
		}
	}
}	
if(substr($actid , -5) =='_html' )
{ 
	$stract =  substr($actid,0,-5);
	$actArray = explode("-",$stract);
}
$actval = trim($actArray[0]);
$idval = intval(trim($actArray[1]));

switch ($actval){
    case 'art':
		$Archi -> get_art( $id = $idval , $page );
        break;
    case 'pro':
        $Archi -> get_pro( $id = $idval , $page );
        break;
    case 'vid':
		$Archi -> get_vid( $id = $idval , $page );
        break;
    case 'pic':
	//无图版？？
        $Archi -> get_pic( $id = $idval , $page );
        break;
    case 'ars':
		$Archi -> get_artlist( $id = $idval , $page );
        break;
    case 'prs':
        $Archi -> get_prolist( $id = $idval , $page );
        break;
    case 'vis':
		$Archi -> get_vidlist( $id = $idval , $page );
        break;
    case 'pis':
	//无图版？？
        $Archi -> get_piclist( $id = $idval , $page );
        break;
    default:
        $Archi -> index();
		break;
}


require ROOT_PATH.'system/class/class_close.php';

?>