<?php

/*

'**************************************************************************************************

' 软件名称: 黑色幻想舞曲管理系统CMS2.0

' 版本编号: hshxsdj 2.0

' 官方网站: http://www..hshxs.com

' 官方论坛：http://bbs.hshxs.com

' 版权所有: 黑色幻想开发团队    噬己翼(QQ:532917920)

' 郑重声明:

'    1、任何个人或组织不得在未经授权的情况下删除、修改、拷贝本软件及其他副本上一切关于版权的信息；

'    2、黑色幻想网络事业部保留此软件的法律追究权利

'**************************************************************************************************

*/

include "../include/conn.php";

include "../include/function.php";

include "admin_version.php";

include "admin_loginstate.php";

$f=SafeRequest("f","auto");

$activepath=SafeRequest("activepath","auto");

?>

<html>

<head>

<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>

<title>模板管理器</title>

<link  href="images/style.css" rel="stylesheet" type="text/css" />

</head>

<body leftmargin='0' topmargin='0'>

<SCRIPT language='JavaScript'>

function nullLink()

{

	return;

}

function ReturnValue(reimg)

{

	window.opener.document.<?php echo $f?>.value=reimg;

	if(document.all) window.opener=true;

  window.close();

}

</SCRIPT>

<table width='100%' border='0' cellpadding='0' cellspacing='1' class="tb_style" align="center">

   <tr bgcolor='#FFFFFF'>

      <td colspan='3'>

<!-- 开始文件列表  -->

           <table width='100%' border='0' cellspacing='0' cellpadding='2'>

                <tr bgcolor="#CCCCCC">

			<td width="40%" align="center" class="td_border"><strong>点击名称选择文件</strong></td>

			<td width="15%" align="center" class="td_border"><strong>模版名称</strong></td>

			<td width="15%" align="center" class="td_border"><strong>文件大小</strong></td>

			<td width="30%" align="center" class="td_border"><strong>最后修改时间</strong></td>

                </tr>



                <tr>

			<td colspan='3' class="td_title">&nbsp;<img src=images/dir2.gif border=0 width=16 height=16 align=absmiddle>当前目录: <?php echo S_SitePath.S_Templateurl?></td>

                </tr>

<?php

		$path = "../".S_Templateurl;

		if(file_exists($path) && is_dir($path))

		{

			$d = dir($path); 

			while(false !== ($v = $d->read()))

			{

				if($v == "." || $v == "..")

				{

					continue; 

				}

				$file = $d->path."\\".$v; 

				if(is_dir($file))

				{

   				echo "<a href='?action=templist&path=".$path."&dir=$v'>[$v]</a><br />";

				}

			}

			$d->rewind();

?>

	

<?php		

			while(false !== ($v = $d->read()))

			{

				

				if($v == "." || $v == "..")

				{

					continue; 

				}

				$file = $d->path . $v; 

				if(is_dir($file))

				{

					continue;

				}

				if(is_file($file))

				{

?>

                <tr>

			<td class="td_border" height="25">&nbsp;<a href="javascript:ReturnValue('<?php echo $v?>');"><?php echo $v?></a></td>

			<td class="td_border"><?php echo getTemplateType($v);?></td>

			<td class="td_border"><?php echo round(filesize($file)/1204,2)."Kb"?></td>

			<td align='center' class="td_border"><?php echo date('Y-m-d H:i:s',filemtime($file))?></td>

                </tr>

<?php					

				}

			}

?>

           </table>

<?php	

		$d->close();

		}

function getTemplateType($filename){

	switch(strtolower($filename)){

		case 'index.html':

			$getTemplateType="网站首页";

			break;

		case "head.html":

			$getTemplateType="网站顶部";

			break;

		case "bottom.html":

			$getTemplateType="网站底部";

			break;

		case "allmap.html":

			$getTemplateType="网站地图";

			break;

		case "search.html":

			$getTemplateType="音乐搜索";

			break;

		case "topic.html":

			$getTemplateType="网站专题";

			break;

		case "arttopic.html":

			$getTemplateType="文章专题";

			break;

		case "vodtopic.html":

			$getTemplateType="舞曲专题";

			break;

		case "artlist.html":

			$getTemplateType="文章列表";

			break;

		case "list.html":

			$getTemplateType="舞曲列表";

			break;

		case "artshow.html":

			$getTemplateType="文章内容";

			break;

		case "play.html":

			$getTemplateType="舞曲播放";

			break;

		case "spplay.html":

			$getTemplateType="视频播放";

			break;

		case "gbook.html":

			$getTemplateType="留言模板";

			break;

		case "artindex.html":

			$getTemplateType="文章首页";

			break;

		case "vodindex.html":

			$getTemplateType="舞曲首页";

			break;	

		case "loginuser.html":

			$getTemplateType="会员登陆";

			break;	

		case "logininfo.html":

			$getTemplateType="会员信息";

			break;	

		Case "dj_news.html";

			$getTemplateType="最新舞曲";

			break;	

		Case "dj_hits.html";

			$getTemplateType="年度排行";

			break;	

		Case "dj_yhits.html";

			$getTemplateType="每月排行";

			break;	

		Case "dj_zhits.html";

			$getTemplateType="每周排行";

			break;	

		Case "dj_rhits.html";

			$getTemplateType="每日排行";

			break;	

		Case "dj_xhits.html";

			$getTemplateType="下载排行";

			break;	

		Case "dj_shits.html";

			$getTemplateType="收藏排行";

			break;	

		Case "dj_dhits.html";

			$getTemplateType="被顶排行";

			break;	

		Case "dj_chits.html";

			$getTemplateType="被踩排行";

			break;	

		Case "dj_5x.html";

			$getTemplateType="推荐舞曲";

			break;	

		Case "dj_play.html";

			$getTemplateType="正在听舞曲";

			break;	

		Case "down.html";

			$getTemplateType="下载页面";

			break;	

		Case "splist.html";

			$getTemplateType="视频栏目";

			break;	

		Case "playsong.html";

			$getTemplateType="连播页面";

			break;	

		default:

			if(stristr($filename,'.gif') or stristr($filename,'.jpg') or stristr($filename,'.png')){

				$getTemplateType="图片文件";

				}

			elseif(stristr($filename,'.css')){

				 $getTemplateType="样式文件";

				}

			elseif(stristr($filename,'.js')){

				$getTemplateType="脚本文件";

				}	

			else{

				$getTemplateType="其它文件";

				}

	}

	return $getTemplateType;

}	

?>

      </td>

   </tr>

</table>

</body>

</html>