<?php
	$ajax_comment_file = DEDETEMPLATE.'/default/ajaxfeedback.htm';
	$duoshuoPlugin = Duoshuo_Dedecms::getInstance();
	$tag_replaced =  false;
	
	if(file_exists($ajax_comment_file)){
		$comment_content = file_get_contents($ajax_comment_file);
		
		if(strpos($comment_content, Duoshuo_Dedecms::$commentTag)!==false){
			$tag_replaced = true;
		}
	}
?>
<!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=<?php echo $cfg_soft_lang; ?>" />
<title>多说评论管理</title>
<script language="javascript" src="../plus/duoshuo/js/jquery-1.7.2.min.js"></script>
<link href="<?php echo CSSPATH;?>/base.css" rel="stylesheet" type="text/css" />
</head>
<body background="<?php echo IMAGEPATH;?>/allbg.gif" leftmargin="8" topmargin="8">
<div style="position:absolute;top:20%;left:50%;width:600px;margin-left:-300px;">
	<table border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6" style="margin-bottom:6px">
		<tr align="center">
			<td align="center" width="100%" height="28" background="<?php echo IMAGEPATH;?>/tbg.gif" style="padding-left:10px;">
				<div style="float:left">
					<b>自动替换原始评论框</b>
				</div>
			</td>
		</tr>
		<tr bgcolor="#FFFFFF" height="26">
			<td style="padding-left:10px;">
				<div style="float:left">
					<?php if(!$tag_replaced):?>
					<form action="duoshuo.php" name="replaceCommentTag" method="post">
						<input name="action" type="hidden" value="replaceCommentTag"/>
						<p>自动替换将会备份/templets/default/ajaxfeedback.htm为/templets/default/ajaxfeedback.back.htm，并将<b><?php echo Duoshuo_Dedecms::$commentTag;?> </b>写入新的/templets/default/ajaxfeedback.htm模板。
						</p>
						<p>
						<center><input type="button" size="12" onclick="document.replaceCommentTag.submit();" style="width:50px" value="替换" /></center>
						</p>
					</form>
					<?php else:?>
						<form action="duoshuo.php" name="nextStep" method="post">
						<input name="action" type="hidden" value="manageComments"/>
						检测到自动替换已经生效，如使用静态HTML文档，需先 [<a target="main" href="makehtml_archives.php"><u>更新文档HTML</u></a>] 之后，以前的文章才会显示多说评论框。
						<p>自动替换已经将/templets/default/ajaxfeedback.htm备份为/templets/default/ajaxfeedback.back.htm，并将<b><?php echo Duoshuo_Dedecms::$commentTag;?> </b>写入新的/templets/default/ajaxfeedback.htm模板。</p>
						<center><input type="button" size="12" onclick="document.nextStep.submit();" style="width:70px;height:25px;" value="开始设置" /></center>
						</form>
					<?php endif;?>
				</div>
			</td>
		</tr>
	</table>
</div>

</body>
</html>