<?php

/*

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

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

' 版本编号: hshxsdj 2.0

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

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

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

' 郑重声明:

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

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

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

*/


include "../../include/label.php";

include "../admin_loginstate.php";

@set_time_limit(0);

?>

<?php

SystemPer(11);

if(S_Webmode==1){die("<font color=red>当前网站为动态模式,不能生成!!</font>");}

$Ksid=SafeRequest("ksid","post");

$Jsid=SafeRequest("jsid","post");

if(($Ksid==0)||($Ksid==""))  die("出错了，请填写开始ID！<script language='javascript'>setTimeout('ReadGo();',1000);function ReadGo(){location.href='admin_makehtml.php?action=main';}</script>");

if(($Jsid==0)||($Jsid==""))  die("出错了，请填写结束ID！<script language='javascript'>setTimeout('ReadGo();',1000);function ReadGo(){location.href='admin_makehtml.php?action=main';}</script>");

if($Jsid<=$Ksid)  die("出错了，结束ID应该要比开始ID大！<script language='javascript'>setTimeout('ReadGo();',1000);function ReadGo(){location.href='admin_makehtml.php?action=main';}</script>");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

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

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

<link type="text/css" href="../images/alerts.css" rel="stylesheet" media="screen">

<script type="text/javascript" language="javascript">var tentpath='<?php echo S_SitePath?>';</script>

<script language="javascript" src="../js/jquery.js"></script>

<script language="javascript" src="../js/alerts.js"></script>

</head>

<body>

<?php

  for($Ksid=1;$Ksid<$Jsid;$Ksid++){

          global $db;

          $sql="select * from s_article where S_ID=".$Ksid."";

          $row=$db->getrow($sql);

          if($row){

                  if(file_exists(_CHSHDJ_ROOT_.S_Templateurl."artshow.html")){	

			$Mark_Text=SpanArticleShow($row['S_ID']);

			$spanurl=LinkUrl("s_article",$row['S_ClassID'],1,$row['S_ID']);

			$spanurl=substr($spanurl,strlen(S_SitePath));

			spandir($spanurl);

		 	fwrite(fopen("../../".$spanurl,"wb"),$Mark_Text);

	 	           echo "&nbsp;ID:<font color=red>".$Ksid."</font>-->&nbsp;<font style=font-size:10pt;>生成文章:<font color=red>".$row['S_Name']."</font>成功:<a href=../../".$spanurl." target=_blank>".$spanurl."</a></font><br/>";			

	          }else{

		           die("出错了，".$row['S_Templay']."模板文件不存在！");

                  }

	  }	

   }

    echo "&nbsp;<font style=font-size:10pt;><b>恭喜你！全部文章内容全部生成完毕．．．</b></font><script language='javascript'>setTimeout('ReadGo();',8000);function ReadGo(){location.href='admin_makehtml.php?action=main';}</script>";

    exit();

?>