subcategory.asp

来自「top-cms内容管理系统」· ASP 代码 · 共 391 行

ASP
391
字号
<%
'###########################################################################################
'*  程序名称: Top-CMS
'*---------------------------------------------------------------------------------------
'*  系统版本: 1.0 0215
'*  版权所有: www.Net-Develop.com
'*  程序设计: 江南行客
'*  联系方式:
'*            OICQ:2503086
'*            EMAIL:net-oa@sohu.com
'*  网站地址: 
'*            http://www.net-develop.com  
'*            http://www.top-cms.com   
'*---------------------------------------------------------------------------------------
'*  Copyright 2004 www.net-develop.com - All Rights Reserved.
'###########################################################################################
%>
<!--#include file="../common/common.asp" -->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/style.css">
<style type="text/css">
<!--
.active {  font-weight: bold;cursor:default;color:#F5F5F5;}
.unactive {  color: #dddddd; text-decoration: underline;cursor:hand;}
.uuu{position:relative; width:100%; height:expression(body.offsetHeight-t1.offsetHeight-2); z-index:1; left: 0px; top: 0px; overflow-x:hidden;overflow-y:scroll;}
.uuuu{position:relative; width:100%; height:expression(body.offsetHeight-t1.offsetHeight-2); z-index:1; left: 0px; top: 0px; scroll:no}
.o {
	border: 1px solid #999999;
}
-->
</style>
<script language="JavaScript">
		function ChangeDisplay(V,H){
		  	var aChildren = eval(H);
		  	for(i=0; i < aChildren.length; i++) {
				aChildren[i].className = "hidden"
		   	}
		  	var aChildren1 = eval(V);
		   	for(i=0; i < aChildren1.length; i++) {
				aChildren1[i].className = "";
		 	}
		}
	function MM_Change(selObj){
		if (selObj==1){
			ChangeDisplay(sub,s2);
			a1.className="active";
			b1.className="unactive";
		}else{
			ChangeDisplay(s2,sub);
			a1.className="unactive";
			b1.className="active";
		}
	}
function MM_TempValue(from,to) {
 	var tempValue;
	tempValue="";
	for (var i=0; i<from.options.length; i++) {
		var o = from.options[i];
		if (o.selected) {
			tempValue=tempValue + o.value + ",";
		}
	}
	to.value=tempValue;
}
function MM_goToURL(ActionUrl) { 
		myform.action=ActionUrl;
		myform.submit();
}
function vSet(v){
	var vv;
	var vvv;
	vv="";
	vvv=parseInt(form1.vNum.value);
	vvv=vvv+parseInt(v);
	if (vvv<0){vvv=0;}
	form1.vNum.value=vvv;
	for (var i=1; i<=vvv; i++) {
	vv+='变量名称:<input type="text" name="v' + i + '" size="15" maxlength="50" class="o"> ';
	vv+='输入形式:<select name="in'+i+'" ><option value="0">单行文本框<option value="1">多行文本框</option></select><br>';
	}
	if (vv!=""){vv+='<font color="#666666">(注:变量名与模板配合使用,否则无效,建议使用中文,不能为空)</font>';}
	vName.innerHTML=vv;
}
function chkv(o){
var v;
var vv;
var vvv;
v=eval("form1.vv"+o);
vv=eval("form1.d"+o);
vvv=eval("form1.inn"+o);
if (vv.checked==true){
v.disabled=true;
vvv.disabled=true;
}else{
v.disabled=false;
vvv.disabled=false;
}
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<%

Set objCMS = Server.CreateObject("TopCMS.SubCategory")
X=objCMS.ChkString(Request("X"),"U")
if objCMS.ChkAdminPower then
	SystemI_Init
	objCMS.OpenDB()
	
	If Request.ServerVariables("REQUEST_METHOD")="POST" and X<>"T" Then
		objCMS.SaveSubCategory()
	else
	
		sID=objCMS.ChkString(Request("sID"),"U")
		t=objCMS.ChkString(Request("t"),"U")
		iID=objCMS.ChkString(replace(Request("iID")," ",""),"U")
		nT=objCMS.ChkString(Request("nT"),"U")
		if UCase(nT)="PASS" and iID<>"" then
			objCMS.PassInfo sID,iID
		elseif UCase(nT)="DEL" and iID<>"" and X="T" then
			objCMS.DelInfo sID,iID
		elseif UCase(nT)="CRE" and iID<>"" and X="T" then
			objCMS.CreateShtml sID,iID
		end if

	if t<>"edit" then
		objCMS.ListInfo(sID)
		%>
		
  		
<table width="100%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#999999">
  <form name="myform" method="post">
    <tr> 
      <td colspan="4" background="../Images/default_nav.gif"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="86%"><font color="#FFFFFF">信息管理 [所属类别:<%= objCMS.sName %>] </font></td>
            <td width="14%" align="center"> <%
	  objCms.ListPower(sID)
	  If objCMS.ListStatus Then
	  	Response.Write "<img src=""../images/create.gif"" hspace=2 border=0 align=""absmiddle"" alt=""生成所选信息"" onclick=""if (confirm('你确定要生成所选的信息页面吗?')){MM_goToURL('subcategory.asp?sID=" & sID & "&nT=cre&P=" & P & "&X=T');}"" style=""cursor:hand;"">"
      end if
	  %> </td>
          </tr>
        </table></td>
    </tr>
    <tr bgcolor="#EEEEEE"> 
      <td height="24">标题</td>
      <td align="center">发表日期</td>
      <td align="center">是否已审核</td>
      <td align="center">是否已生成</td>
    </tr>
    <%

	dbSql = "SELECT iID,sID,iSetup,iLink,iTitle,iPage,iTop,iDate,iCreate FROM db_Information where sID=" & CInt(sID) & " ORDER BY iID desc"
		set dbRs=objCMS.MyRs(dbSql,1,1,0)
		If dbRs.EOF Then
			Response.Write "<tr bgcolor=""#EEEEEE""><td align=""center"" colspan=""4"">[此类别暂无信息]</td></tr>"
		else
			objCMS.PagingMain dbRs,16
			nPage=objCMS.PNum
			Do While not dbRs.eof and nPage>0
				if nPage mod 2 =0 then nBGcolor="#EEEEEE" else nBGcolor="#FFFFFF"
				iID=Trim(dbRs("iID"))
				iLink=Trim(dbRs("iLink"))
				iTitle=Trim(dbRs("iTitle"))
				iSetup=Trim(dbRs("iSetup"))
				iPage=Trim(dbRs("iPage"))
				iTop=Trim(dbRs("iTop"))
				iDate=dbRs("iDate")
				Create=dbRs("iCreate")
				%>
    <tr bgcolor="<%= nBGcolor %>"> 
      <td width="51%"><input type="checkbox" name="iID" value="<%=iID%>"> 
        <%
				if instr(1,iSetup,"5",1)>0 then response.write Info_TW
				%> <a href="<%response.write AbsWebPath & iLink %>" target="_blank"> 
        <%
				if CBool(iTop) then Response.Write Info_ZDs
				response.write iTitle 
				if CBool(iTop) then Response.Write Info_ZDe
				%>
        </a>&nbsp; <%
				if aPage>1 then response.write "[页数:" & iPage & "]&nbsp;"
				
				if instr(1,iSetup,"0",1)>0 then response.write Info_TJ
				%> </td>
      <td width="20%" align="center"><font color="#999999">
        <%response.write year(iDate) & "-" & month(iDate) & "-" & day(iDate) %>
        </font></td>
      <td width="14%" align="center">
        <%
	If objCMS.ListStatus Then
        If InStr(1, iSetup, "1", 1) > 0 Then
            Response.Write "<a href=""?sID=" & sID & "&iID=" & iID & "&nT=pass&P=" & P & """ ><img src=""../IMAGES/utick.gif"" align=""absmiddle"" alt=""待审核"" border=0></a> "
        Else
            Response.Write "<a href=""?sID=" & sID & "&iID=" & iID & "&nT=pass&P=" & P & """ ><img src=""../IMAGES/tick.gif"" align=""absmiddle"" alt=""已发表"" border=0></a> "
        End If
    Else
        If InStr(1, iSetup, "1", 1) > 0 Then
            Response.Write "<img src=""../IMAGES/utick.gif"" align=""absmiddle"" alt=""待审核"">"
        Else
            Response.Write "<img src=""../IMAGES/tick.gif"" align=""absmiddle"" alt=""已发表"">"
        End If
    End If
	  %>
      </td>
      <td align="center" width="15%">
	  <%
	  if CBool(Create) then response.write "<img src=""../IMAGES/tick.gif"" align=""absmiddle"" alt=""已生成""> " else Response.Write "<img src=""../IMAGES/utick.gif"" align=""absmiddle"" alt=""未生成""> "
	  %>
	   </td>
    </tr>
    <%
				
				dbRs.MoveNext
				nPage=nPage-1
			Loop
			
		end if
		dbRs.close
		set dbRs=nothing
		%>
    <tr> 
      <td colspan="4" height="1" bgcolor="#CCCCCC"></td>
    </tr>
  </form>
</table>
		
		<div align="right">
		<%
		objCMS.DisplayNavigation("sID=" & sID & "&")
		%>
		</div>
	<%
	else
		objCMS.EditSubCategory(sID) 
		
		%>
		<form name="form1" method="post" action="" enctype="multipart/form-data">
  		
  <table width="100%" border="1" bordercolor="#999999" cellspacing="0" cellpadding="2" align="center">
    <tr> 
      <td colspan="2" background="../Images/default_nav.gif"><span onClick="MM_Change(1);" id="a1" class="active">栏目属性</span> 
        | <span onClick="MM_Change(2);" id="b1" class="unactive">生成参数</span></td>
    </tr>
    <tr> 
      <td width="200" align="right" bgcolor="#EEEEEE">类别名称:</td>
      <td bgcolor="#EEEEEE"><%= objCMS.sName %></td>
    </tr>
    <tr id="sub"> 
      <td width="200" align="right">所属栏目:</td>
      <td> <%
		'获取栏目信息 
		objCMS.PreCat()
		%> </td>
    </tr>
    <tr id="sub"> 
      <td width="200" align="right" bgcolor="#EEEEEE">类别套用模板:</td>
      <td bgcolor="#EEEEEE"> <%
		
		objCMS.SubTemplate()
		%> </td>
    </tr>
    <tr id="sub"> 
      <td width="200" align="right">信息套用模板:</td>
      <td> <%
		objCMS.ShtmlTemplate()
		%> </td>
    </tr>
    <tr id="sub"> 
      <td width="200" align="right" bgcolor="#EEEEEE">类别名称:</td>
      <td bgcolor="#EEEEEE"> <input type="text" name="sName" size="15" maxlength="100" value="<%= objCMS.sName %>"> 
      </td>
    </tr>
    <tr id="sub"> 
      <td align="right">类别图:</td>
      <td> <%if objCMS.sImg<>"" then
		text="重新"
		%> <img src="<%response.write AbsWebPath & objCMS.sImg%>"> <br> 
        <%end if%> <input type="checkbox" name="ReUP" value="1" onclick="if (this.checked==true){sImg.className='';}else{sImg.className='hidden';}"> 
        <%=text%>上传 
        <input type="file" name="sImg" id="sImg" class="hidden"> </td>
    </tr>
    <tr id="sub"> 
      <td width="200" align="right" bgcolor="#EEEEEE">放置文件夹:</td>
      <td bgcolor="#EEEEEE"> <input type="text" size="15" maxlength="100" value="<%= objCMS.sFolder %>" disabled> 
      </td>
    </tr>
    <tr id="sub" bgcolor="#FFFFFF"> 
      <td align="right">栏目建立者:</td>
      <td><%=objCMS.sCreater%></td>
    </tr>
    <tr bgcolor="#EEEEEE" id="sub"> 
      <td align="right">栏目最后修改:</td>
      <td><%=objCMS.sEditer%></td>
    </tr>
	<tr id="sub" bgcolor="#FFFFFF"> 
            <td width="200" align="right"><strong><em>自定义变量</em></strong>:</td>
            <td>
               
			  <%=objCMS.ExpandField%> <strong>新增变量总数:</strong> <a href="javascript:vSet(-1);"><img src="../IMAGES/leftArrow.gif" alt="减少变量数" width="7" height="12" border="0" align="absmiddle"></a> 
        <input name="vNum" type="text" class="o" value="0" size="2" maxlength="2" readonly>
              <a href="javascript:vSet(1);"><img src="../IMAGES/rightArrow.gif" alt="增加变量数" width="8" height="12" border="0" align="absmiddle"></a><br>

			  <span id="vName"></span>
            </td>
          </tr>
    <tr bgcolor="#FFFFFF" class="hidden" id="s2"> 
      <td align="right"><font color="#0000FF">该类页面信息生成</font></td>
      <td><font color="#666666">生成页数 
        <input type="text" name="sOption0" size="2" maxlength="2" value="<%=objCMS.sOption0%>">
        (填数字)</font> <font color="#666666"><br>
        每页显示 
        <input type="text" name="sOption1" size="2" maxlength="2" value="<%=objCMS.sOption1%>">
        (填数字)</font> <font color="#666666"><br>
        标题长度 
        <input type="text" name="sOption2" size="2" maxlength="2" value="<%=objCMS.sOption2%>">
        (填数字)</font> <font color="#666666">&nbsp;</font> <font color="#666666">&nbsp;</font></td>
    </tr>
    <tr bgcolor="#EEEEEE" class="hidden" id="s2"> 
      <td width="200" align="right"><font color="#0000FF">最新更新</font></td>
      <td><font color="#666666">显示条数 
        <input type="text" name="sOption3" size="2" maxlength="2" value="<%=objCMS.sOption3%>">
        (填数字)</font> <font color="#666666"><br>
        标题长度 
        <input type="text" name="sOption4" size="2" maxlength="2" value="<%=objCMS.sOption4%>">
        (填数字)</font> <font color="#666666">&nbsp;</font></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="hidden" id="s2"> 
      <td width="200" align="right"><font color="#0000FF">图片信息总条数</font></td>
      <td> <font color="#666666">显示条数 
        <input type="text" name="sOption5" size="2" maxlength="2" value="<%=objCMS.sOption5%>">
        (填数字)</font> <font color="#666666"><br>
        每行显示 
        <input type="text" name="sOption6" size="2" maxlength="2" value="<%=objCMS.sOption6%>">
        (填数字)</font> <font color="#666666"><br>
        标题长度 
        <input type="text" name="sOption7" size="2" maxlength="2" value="<%=objCMS.sOption7%>">
        (填数字)</font> <font color="#666666">&nbsp;</font></td>
    </tr>
    <tr bgcolor="#EEEEEE" class="hidden" id="s2"> 
      <td width="200" align="right"><font color="#0000FF">推荐信息条数</font></td>
      <td><font color="#666666">显示条数 
        <input type="text" name="sOption8" size="2" maxlength="2" value="<%=objCMS.sOption8%>">
        (填数字)</font> <font color="#666666"><br>
        标题长度 
        <input type="text" name="sOption9" size="2" maxlength="2" value="<%=objCMS.sOption9%>">
        (填数字)</font> <font color="#666666">&nbsp;</font></td>
    </tr>
    <tr> 
      <td align="right">当前操作:</td>
      <td> <%
		 if objCMS.ListEdit then
			response.write "<input type=""radio"" name=""cType"" value=""EDIT"" checked>编辑"
			if objCMS.ListDel then
        		response.write "<input type=""radio"" name=""cType"" value=""DEL"">删除 "
			end if
		else
			if objCMS.ListDel then
				response.write "<input type=""radio"" name=""cType"" value=""DEL"" checked>删除 "
			end if
		end if
		
		
		%> </td>
    </tr>
    <tr> 
      <td align="center" colspan="2" bgcolor="#EEEEEE"> <input type="hidden" name="sID" value="<%= sID %>"> 
        <input type="hidden" name="t" value="<%= t %>"> 
        <input type="hidden" name="sTemplate"> <input type="submit" name="S1" value=" 提交 " onclick="MM_TempValue (document.form1.sTempTemplate,document.form1.sTemplate);"> 
        <input type="button" name="S2" value=" 取消 " onclick="history.back();"> 
      </td>
    </tr>
  </table>
</form>
	<%
		end if
	end if
	objCMS.CloseDB	
else
	objCMS.OutInfo "对不起,您还没有登录,请先登录","Login"
end if
set objCMS=nothing

%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?