<!--#include file="../include/conn.jsp"-->
<!--#include file="Admin_IsLogin.jsp" -->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<script>
function makecode(){
  var news_location='list.jsp'
  onevalue=document.all.Goods_Type.options[document.all.Goods_Type.selectedIndex].value;
  twovalue=document.all.Goods_SubType.options[document.all.Goods_SubType.selectedIndex].value;
  if (onevalue=="") alert('请选择显示栏目或专题');
  else
    if (twovalue!="") news_location+='?id='+twovalue;
    else
      if (onevalue!="all") news_location+='?id='+onevalue;
  if (document.all.num.value!="" && document.all.num.value!="10") news_location+='&num='+document.all.num.value;
  if (document.all.size.value!="" && document.all.size.value!="10") news_location+='&size='+document.all.size.value;
  if (document.all.height.value!="") news_location+="&height="+document.all.height.value;
  if (document.all.chkShowBigCategory.status==true) news_location+="&ShowBigCategory="+document.all.chkShowBigCategory.value;


  for(var i=1;i<5;i++){
    if (document.all.cont[i].status==true){
      if (document.all.cont[i].value!="") news_location+="&target="+document.all.cont[i].value;
    }
  }
  for(var i=0;i<3;i++){
    if (document.all.order[i].status==true){
      if (document.all.order[i].value!="") news_location+="&order="+document.all.order[i].value;
    }
  }
  if (document.all.date.status==true) news_location+="&date=1";
  if (document.all.time.status==true) news_location+="&time=1";
  if (document.all.hits.status==true) news_location+="&hits=1";
  if (document.all.cate.status==true) news_location+="&cate=1";
  if (document.all.keywords.status==true) news_location+="&keywords=mKeywords";

  list_location=news_location.replace(/list.jsp&/ig,'list.jsp?');
  html_location=news_location.replace(/list.jsp&/ig,'html.jsp?');
//  html_location=news_location.replace(/mKeywords&/ig,'<%=mKeywords%>');

  html_location=html_location.replace(/list.jsp/ig,'html.jsp');
  html_location=html_location.replace(/mKeywords/ig,'[keywords]');
  document.all.code.value='<\script language="javascript" src="'+list_location+'"><\/script>'
  document.all.code1.value='<\script language="javascript" src="'+html_location+'"><\/script>'

}

function copycode() {
  var tempval=eval("document.all.code");
  tempval.focus();
  tempval.select();
  therange=tempval.createTextRange();
  therange.execCommand("Copy");
  alert("\n文章代码已经拷贝到你的剪贴板上了！\n\n请按Ctrl+V将其粘贴到适当的位置。");
}
function copycode1() {
  var tempval=eval("document.all.code1");
  tempval.focus();
  tempval.select();
  therange=tempval.createTextRange();
  therange.execCommand("Copy");
  alert("\n文章代码已经拷贝到你的剪贴板上了！\n\n请按Ctrl+V将其粘贴到适当的位置。");
}
</script>
</head>
<BODY bgcolor="D6DFF7" leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<%
	admin_flag=",1|3|0,"
	if instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true then
	Response.write "<br><br><br><br><b><font color=red>对不起，您没有管理本页面的权限!</font></B>"
	Response.end
	end if
%>
<form name="news" method="POST" action="../Article/NewsDemo.jsp"  target="_blank">
  <br>
  <table class=tableBorder width="95%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
      <tr> 
      <th height=22 colspan="5" align="center" sytle="line-height:150%">文章代码生成器</th>
    </tr>
    <tr  bgcolor="f3f3f3"> 
      <td class=forumRowHighlight  width=6% align="center" ><strong>大类</strong></td>
      <td class=forumRow  width=31%><font color="#FF0000"> 
        <select name="Goods_Type" onChange="TypeChange(this);" style="width:150;border:1 solid #9a9999; font-size:9pt; background-color:#ffffff">
          <% sIDString=""
             mSql="Select F_ID,F_Value From T_BigCategory order by F_Grade"
			 Set rs = conn.Execute(mSql)
			 mBigArray = rs.GetRows()
			 for i=0 to ubound(mBigArray,2)
			   mSql2="Select * From T_SmallCategory Where F_BigCategoryID="&mBigArray(0,i)
			   Set rs = conn.Execute(mSql2)
			   strSmallCategory = ""
			   Do While not rs.Eof 
   			     strSmallCategory= strSmallCategory & rs("F_ID")&"+"&rs("F_Value")+"-"
				 rs.Movenext
			   Loop
			   Response.write "<option value="&strSmallCategory&">"&mBigArray(1,i)&"</option>"
			 next'for
			 rs.Close
          %>
        </select>
		
<script language="javascript">                               
function TypeChange(theSelect)
{
var sTemp,sString,i;
sValue=theSelect.value;
sSubTypeArray=sValue.split("-");
sString="<select name='Goods_SubType'>";
for(i=0;i<sSubTypeArray.length-1;i++)
{
 sTemp=sSubTypeArray[i].split("+");
 sString+="<option value='"+sTemp[0]+"'>"+sTemp[1]+"</option>";
}
sString+="</Select>"
news.Goods_SubType.outerHTML=sString;
}
</script>
        <font color="#FF0000"> <font color="#000000"> <span class=unnamed1></span></font></font></font></td>
      <td width=6% align="center" class=forumRowHighlight><strong>小类</strong></td>
      <td class=forumRow width=57%><font color="#FF0000"><font color="#FF0000"><font color="#000000"> 
        <select name="Goods_SubType" style="width:150;border:1 solid #9a9999; font-size:9pt; background-color:#ffffff">
        </select>
        <script language="javascript">TypeChange(news.Goods_Type);</script>
        <input type="checkbox" name="chkShowBigCategory" value="1">
        显示大类</font></font></font></td>
    </tr>
    <tr bgcolor="fcfcfc"> 
      <td class=forumRowHighlight  align="center"><strong>条数</strong></td>
      <td class=forumRow ><input class="text" type="text" name="num" size="2" onBlur="if (isNaN(document.news.num.value)){document.news.num.value='';  alert('对不起，请输入数值！');document.news.num.focus(); }" value="10">
        字符 
        <input class="text" type="text" name="size" size="2" onBlur="if (isNaN(document.news.size.value)){document.news.size.value='';  alert('对不起，请输入数值！');document.news.size.focus(); }">
        行距 
        <input class="text" type="text" name="height" size="2" onBlur="if (isNaN(document.news.height.value)){document.news.height.value='';  alert('对不起，请输入数值！');document.news.height.focus(); }"></td>
      <td class=forumRowHighlight align="center"><strong>目标</strong></td>
      <td class=forumRow> <input name="cont" type="radio" checked>
        无
<input type="radio" name="cont" value="_blank">
        _blank
<input type="radio" name="cont" value="_parent">
        _parent
<input type="radio" name="cont" value="_self">
        _self
<input type="radio" name="cont" value="_top">
        _top</td>
    </tr>
    <tr bgcolor="f3f3f3"> 
      <td class=forumRowHighlight  align="center"><strong>排列</strong></td>
      <td class=forumRow ><input type="radio" name="order" value="" checked>
        ID
<input type="radio" name="order" value="hits">
        点击
<input type="radio" name="order" value="time">
        时间</td>
      <td align="center" class=forumRowHighlight><strong>显示</strong></td>
      <td class=forumRow><input type="checkbox" name="date" value="1">
        日期 
        <input type="checkbox" name="time" value="1">
        时间 
        <input type="checkbox" name="hits" value="1">
        点击 
        <input name="cate" type="checkbox" id="cate4" value="1">
        分类 
        <input name="keywords" type="checkbox" id="keywords2" value="1">
        相关新闻 </td>
    </tr>
    <tr align="center" bgcolor="fcfcfc"> 
      <td height="30" colspan="4" class=forumRowHighlight > <input name="button3" type="button" class="button" onClick="makecode()" value="生成代码">
        　 
        <input class="button" type="reset" value="显示默认">
        　 
        <input class="button" type="submit" value="演示" >
        　      </td>
    </tr>
    <tr valign="top" bgcolor="FFFFFF"> 
      <td class=forumRow  colspan="4"> 显示文章来源于HTML文件:<br>
        <textarea class="text" name="code1" cols="70" rows="4"><script language="javascript" src="html.jsp"></script></textarea>
        <br>
        <input name="button2" type="button" class="button" onClick="copycode1()" value="复制到剪贴板">
        <br> <strong><br>
        </strong>显示文章来源于数据库:<br>
        <textarea class="text" name="code" cols="70" rows="4"><script language="javascript" src="list.jsp"></script>
</textarea>
        <br>
        <input name="button" type="button" class="button" onClick="copycode()" value="复制到剪贴板">
        <br> </td>
    </tr>
    <tr valign="top" bgcolor="FFFFFF"> 
      <td class=forumRowHighlight colspan="4"><span class="p1"><strong><br>
        ※注释：</strong></span><span class="p1">对于显示文章来源于数据库,参数中的mKeywords为服务器端的变量,您可以这样使用，例如：&lt;script 
        language=&quot;javascript&quot; src=&quot;list.jsp?keywords=&lt;%=mKeywords%&gt;&quot;&gt;&lt;/script&gt;<br>
        <font color="#CCCCCC">//之前你可以通过mKeywords = rs(&quot;F_Keywords&quot;&quot;)将数据库里的关键字暂存到mKeywords变量中。</font></span></td>
    </tr>
  </table>
  <br>
</form>
</body>
</html>
<%CloseDatabase%>
