admin_template.asp

来自「多用户管理分权限发布、管理软件信息;  自由选择系统默认为静态HTML或动态A」· ASP 代码 · 共 805 行 · 第 1/3 页

ASP
805
字号
<!--#include file="setup.asp"-->
<!--#include file="temphelp.asp"-->
<%
Dim strcontent,action,Makename
Dim fso,fout,cname1,cname2
Dim strcontent1,fso1,fout1,strbody
Dim srs,TempDir,Style_CSS
Dim id,i,SkinID,StyleID
	NC_Admin.AdminChk = "02"
	NC_Admin.Check
	'*****************************************************************
	'*  NewCloud DownLoad System Version 6.0.1
	'*  File: admin_template.asp
	'*  Date: 2004-5-20
	'*****************************************************************
	'*  Copyright 2002-2004 newasp.net - All Rights Reserved.
	'*  newasp is a trademark of newasp.net
	'*  HomePage: http://www.newasp.net
	'*****************************************************************
	Newasp.admin_header
	action = Trim(Request("action"))
	StyleID = Request("StyleID")
	id = Request("ID")
	'取当前系统默认模板编号
	SkinID = Newasp.Tempid
	If StyleID = "" Then
		StyleID = SkinID
		ElseIf Not IsNumeric(StyleID) Then
		StyleID = SkinID
	End If
	StyleID = CLng(StyleID)
	Set srs = CreateObject("adodb.recordset")
	Response.Write "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write "<tr>"
	Response.Write "<th width=""100%"" class=""tableHeaderText"" colspan=2 height=25>论坛模板管理"
	Response.Write "</th>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<td class=""forumRowHighlight"" colspan=2>"
	Response.Write "<p><B>注意</B>:<BR>①在这里,您可以新建和修改模板,可以编辑CSS样式,可以新建模板页面。<BR>②当前正在使用的默认模板不能删除;<BR>"
	Response.Write "③编样式的同时,系统会按样式目录名自动生成样式文件“style.css”"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<td class=""forumRowHighlight"" width=20% height=25 align=left>"
	Response.Write "<B>模板操作选项</B></td>"
	Response.Write "<td class=""forumRowHighlight"" width=""80%""><a href=""admin_template.asp"">模板管理首页</a>"
	If Request("page") <> "" Then
		Response.Write " | <a href=""?action=edit&stype=1&page=" & Request("page") & "&StyleID=" & StyleID & """>模板基本设置</a>"
		Response.Write " | <a href=""?action=edit&stype=2&page=" & Request("page") & "&StyleID=" & StyleID & """>模板界面风格</a>"
		Response.Write " | <a href=""?action=editcss&StyleID=" & StyleID & """>修改当前模板CSS样式</a>"
	End If
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write "</table>"
	Select Case action
		Case "manage"
			If Request("mostyle") = "编 辑" Then
				TempMain
				ElseIf Request("mostyle") = "删 除" Then
				DelStyle
			End If
		Case "savecss"
			Call SaveCSS
		Case "edit"
			Call Edit
		Case "editcss"
			Call EditCSS
		Case "saveedit"
			Call SaveEdit
		Case "addpage"
			Call addpage
		Case "delpage"
			Call delpage
		Case "pagerename"
			Call temprename
		Case "rename"
			Call rename
		Case "addstyle"
			Call addstyle
		Case Else
			Call TempMain
	End Select
	If FoundErr = True Then
		Response.Redirect ("showmsg.asp?action=error&Message=" & Server.URLEncode(ErrMsg) & "")
		Response.End
	End If
	Newasp.admin_footer

Private Sub TempMain()
	Dim NowOpenTemplate
	Dim Templateslist
	Response.Write "<p></p>"
	Response.Write "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write "<tr>"
	Response.Write "<th width=""100%"" class=""tableHeaderText"" colspan=2 height=25>当前论坛模板管理"
	Response.Write "</th>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<form method=post action=""?action=manage"">"
	Response.Write "<td class=""forumRowHighlight"" height=40 align=left>"
	Response.Write "请选择模板: "
	'利用系统缓存数据取得所有模板名称和ID

	Newasp.Name = "Templateslist"
	If Newasp.ObjIsEmpty Then Newasp.ReloadTemplateslist
	Templateslist = Newasp.Value
	Templateslist = Split(Templateslist, "@@@")
	Response.Write "<select name=""StyleID"" size=1>"
	For i = 0 To UBound(Templateslist)
		Templateslist(i) = Split(Templateslist(i), "|||")
		Response.Write "<option value=""" & Templateslist(i)(0) & """"
		If CLng(Templateslist(i)(0)) = CLng(StyleID) Then
			Response.Write " selected"
			NowOpenTemplate = Templateslist(i)(1)
		End If
		Response.Write ">" & Templateslist(i)(1) & "</option>"
	Next
	Response.Write "</select>"
	Response.Write "&nbsp;"
	Response.Write "<input type=submit value=""编 辑"" name=""mostyle"" class=button>&nbsp;"
	Response.Write "<input type=submit value=""删 除"" name=""mostyle"" class=button>"
	Response.Write "<br><b>说明:</b>删除操作将删除该模板所有数据,慎用。"
	Response.Write "</td>"
	Response.Write "</FORM>"
	Response.Write "<FORM METHOD=POST ACTION=""?action=addpage"">"
	Response.Write "<td class=""forumRowHighlight"" height=25 align=left>"
	Response.Write "新建分模板页面:&nbsp;<BR>"
	Response.Write "<input type=text size=25 name=""StylePageName"">&nbsp;&nbsp;"
	Response.Write "<input type=submit name=submit value=""添 加"" class=button> "
	Response.Write "</td>"
	Response.Write "</FORM>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<td class=""forumRowHighlight"" height=25 align=right colspan=2>"
	Response.Write "↑请输入ASP页面名(不要包含后缀),新建立的页面模板既是该页面的模板资源)↑"
	Response.Write "</td></tr>"
	Response.Write "<tr>"
	Response.Write "<th height=25 colspan=2>"
	Response.Write NowOpenTemplate & "--模板资源管理</th></tr><tr><td height=25 class=""bodytitle"" colspan=2>"
	Response.Write "分页面模板就是每个页面的风格模板,括号中是字段名,字段的命名规则为:temp_页面名(不要后缀)"
	Response.Write "</td>"
	Response.Write "</tr>"
	Set Rs = Newasp.Execute("Select top 1 * From NC_Template ")
	For i = 3 To Rs.Fields.Count - 1
		If i > 12 Then
			Response.Write "<form method=post action=""?action=pagerename"">"
		End If
		Response.Write "<tr onmouseover=""this.style.backgroundColor='#F3F3FA';this.style.color='red'"" onmouseout=""this.style.backgroundColor='';this.style.color=''"">"
		Response.Write "<td height=25 align=left>"
		Response.Write "<li>"
		Select Case i
			Case 3
				Response.Write "当前模板CSS设置<a href=#>"
			Case 4
				Response.Write "当前模板主模块<a href=#>"
			Case 5
				Response.Write "当前首页模板<a href=#>"
			Case 6
				Response.Write "软件列表页模板<a href=#>"
			Case 7
				Response.Write "软件信息页模板<a href=#>"
			Case 8
				Response.Write "当前搜索页模板<a href=#>"
			Case 9
				Response.Write "文章首页模板<a href=#>"
			Case 10
				Response.Write "文章列表页模板<a href=#>"
			Case 11
				Response.Write "文章内容页模板<a href=#>"
			Case 12
				Response.Write "下载帮助信息<a href=#>"
			Case Else
				Response.Write "当前分页模板<a href=#>"
		End Select
		If i > 12 Then
			Response.Write "</a>&nbsp;&nbsp;temp_"
			Response.Write "<input type=text size=15 name=newpagename value=" & Replace(Rs(i).Name, "temp_", "") & ">&nbsp;&nbsp;"
			Response.Write "<input type=hidden size=15 name=oldpagename value=" & Replace(Rs(i).Name, "temp_", "") & ">"
			Response.Write "<input type=submit value=""分模板页面改名"" name=""mo"" title=""修改名称后提交"" class=button>"
		Else
			Response.Write "(" & Rs(i).Name & ")</a>&nbsp;&nbsp;"
		End If
		Response.Write "</td>"
		Response.Write "<td height=""25"" align=""left"">"
		If i > 3 Then
			Response.Write "编辑该模块:"
			Response.Write " <a href=""?action=edit&stype=1&page="
			Response.Write Rs(i).Name
			Response.Write "&StyleID="
			Response.Write StyleID
			Response.Write """>模板基本设置</a> "
			Response.Write " | <a href=""?action=edit&stype=2&page="
			Response.Write Rs(i).Name
			Response.Write "&StyleID="
			Response.Write StyleID
			Response.Write """>模板界面风格</a>"
			ElseIf i = 3 Then
			Response.Write "编辑该模块:"
			Response.Write "<a href=""?action=editcss&StyleID=" & StyleID & """>修改CSS样式</a>"
		End If
		If i > 12 Then
			Response.Write "&nbsp;&nbsp;<a href=""?action=delpage&StylePageName=" & Rs(i).Name & """ title=""注意,删除后不可恢复""> 删除分模板页面 </a>"
		End If
		Response.Write "</td>"
		Response.Write "</tr>"
		If i > 8 Then
			Response.Write "</form>"
		End If
	Next
	Response.Write "</table><p></p>"
	Response.Write "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"" align=center class=""tableBorder"">"
	Response.Write "<tr>"
	Response.Write "<th width=""100%"" class=""tableHeaderText"" colspan=2 height=25>模板管理"
	Response.Write "</th>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<FORM METHOD=POST ACTION=""?action=addstyle"">"
	Response.Write "<td class=""forumRowHighlight"" height=40 align=left width=45% >"
	Response.Write "新建模板:&nbsp;"
	Response.Write "<input type=text size=25 name=""TempName"">&nbsp;&nbsp;"
	Response.Write "<input type=submit value=""添 加"" name=""mostyle"" class=button>&nbsp;&nbsp;填写模板名"
	Response.Write "<br><b>说明:</b>新建模板将把当前默认模版数据复制到新的模板中"
	Response.Write "</td>"
	Response.Write "</FORM>"
	Response.Write "</tr>"
	Response.Write "<tr>"
	Response.Write "<FORM METHOD=POST ACTION=""?action=rename"">"
	Response.Write "<td class=""forumRowHighlight"" height=25 align=left>"
	Response.Write "<select name=""StyleID"" size=1>"
	For i = 0 To UBound(Templateslist)
		Response.Write "<option value=""" & Templateslist(i)(0) & """"
		If CLng(Templateslist(i)(0)) = CLng(StyleID) Then
			Response.Write " selected"
		End If
		Response.Write ">" & Templateslist(i)(1) & "</option>"
	Next
	Response.Write "</select>"
	Response.Write "&nbsp;&nbsp;"
	Response.Write "改名为:<input type=text size=20 name=""TempName"" value="""
	Response.Write """>&nbsp;&nbsp;"
	Response.Write "<input type=submit name=submit value=""修 改"" class=button>"
	Response.Write "</td>"
	Response.Write "</FORM>"
	Response.Write "</tr>"
	Response.Write "</table>"
	Rs.Close
	Set Rs = Nothing
End Sub

Private Sub Edit()
	Dim page
	Dim mystr
	Dim MyRemark
	Dim TempStr
	Dim TemplateStr
	Dim stype
	Dim TempStyleHelp
	Dim StyleHelpValue
	Dim vtitle
	Dim vSorting
	Dim vSoftInfo
	Dim SetHelpStr
	Dim StyleHelpStr
	stype = Newasp.checkStr(Request("stype"))
	page = Newasp.checkStr(Request("page"))
	If Not IsNumeric(stype) Then
		ErrMsg = ErrMsg + "<BR><li>错误的样式参数"
		FoundErr = True

⌨️ 快捷键说明

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