othersedit.asp
来自「生成html的ASP企业站点,可以进行二次开发的」· ASP 代码 · 共 269 行
ASP
269 行
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="ContentCH-Type" ContentCH="text/html; charset=gb2312" />
<TITLE>其他信息编辑</TITLE>
<link rel="stylesheet" href="Images/Admin.css">
<script language="javascript" src="../Script/Admin.js"></script>
</HEAD>
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<!--#include file="Admin_htmlconfig.asp"-->
<BODY>
<%
Dim quanxian
quanxian=trim(Request.ServerVariables(name))
if Instr(session("AdminPurview"),"|21,")=0 then
response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限!</font></div>")
response.end
end if
dim Result
Result=request.QueryString("Result")
dim ID,OthersNameCh,OthersNameEn,ViewFlagCh,ViewFlagEn,SortNameCH,SortID,SortPath
dim GroupID,GroupIdName,Exclusive,ContentCh,ContentEn,SeoKeywordsCH,SeoKeywordsEN,SeoDescriptionCH,SeoDescriptionEN
ID=request.QueryString("ID")
call OthersEdit()
%>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<th>信息检索及分类查看:添加,修改,删除信息信息</th>
</tr>
<tr>
<td height="24" align="center" nowrap="nowrap" class="forumrow"><a href="OthersEdit.asp?Result=Add" onclick='changeAdminFlag("添加产品信息")'>添加信息信息</a><font color="#0000FF"> | </font><a href="OthersList.asp" onclick='changeAdminFlag("产品列表")'>查看所有信息信息</a><font color="#0000FF"> | </font><a href="OthersList.asp" onclick='changeAdminFlag("产品列表")'>添加信息类别</a><font color="#0000FF"> | </font><a href="Admin_htmlothersort.asp" onclick='changeAdminFlag("生成其他信息分类页面")'>生成其他信息分类页面</a><font color="#0000FF"> | </font><a href="Admin_htmlother.asp" onclick='changeAdminFlag("生成其他信息详细页面")'>生成其他信息详细页面</a></td>
</tr>
</table>
<br>
<table class="tableborder" width="95%" border="0" align="center" cellpadding="3" cellspacing="1">
<form name="editForm" method="post" action="OthersEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
<tr>
<th height="22" colspan="2">【<%If Result = "Add" then%>添加<%ElseIf Result = "Modify" then%>修改<%End If%>信息】</th>
</tr>
<tr>
<td width="20%" align="right" class="forumRow">中文标题:</td>
<td width="80%" class="forumRowHighlight"><input name="OthersNameCH" type="text" id="OthersNameCH" style="width: 280" value="<%=OthersNameCH%>" maxlength="250">
是否显示:<input name="ViewFlagCH" type="checkbox" value="1" checked <%if ViewFlagCH then response.write ("checked")%>>
<font color="red">*</font> <input type="button" name="btn" value="复制标题" title="复制标题到中文:MetaDescription、MetaKeywords" onClick="CopyWebTitleCH(document.editForm.OthersNameCH.value);"></td>
</tr>
<tr>
<td width="20%" align="right" class="forumRow">英文标题:</td>
<td width="80%" class="forumRowHighlight"><input name="OthersNameEN" type="text" id="OthersNameEN" style="width: 280" value="<%=OthersNameEN%>" maxlength="250">
是否显示:<input name="ViewFlagEN" type="checkbox" id="ViewFlagEN" value="1" <%if ViewFlagEN then response.write ("checked")%>> <font color="red">*
<input type="button" name="btn2" value="复制标题" title="复制标题到英文:MetaDescription、MetaKeywords" onClick="CopyWebTitleEN(document.editForm.OthersNameEN.value);">
</font></td>
</tr>
<tr>
<td align="right" class="forumRow">中文MetaKeywords:</td>
<td class="forumRowHighlight"><input name="SeoKeywordsCH" type="text" id="SeoKeywordsCH" style="width: 500" value="<%=SeoKeywordsCH%>" maxlength="250"></td>
</tr>
<tr>
<td align="right" class="forumRow">中文MetaDescription:</td>
<td class="forumRowHighlight"><input name="SeoDescriptionCH" type="text" id="SeoDescriptionCH" style="width: 500" value="<%=SeoDescriptionCH%>" maxlength="250"></td>
</tr>
<tr>
<td align="right" class="forumRow">英文MetaKeywords:</td>
<td class="forumRowHighlight"><input name="SeoKeywordsEN" type="text" id="SeoKeywordsEN" style="width: 500" value="<%=SeoKeywordsEN%>" maxlength="250"></td>
</tr>
<tr>
<td align="right" class="forumRow">英文MetaDescription:</td>
<td class="forumRowHighlight"><input name="SeoDescriptionEN" type="text" id="SeoDescriptionEN" style="width: 500" value="<%=SeoDescriptionEN%>" maxlength="250"></td>
</tr>
<tr>
<td align="right" class="forumRow">信息类别:</td>
<td class="forumRowHighlight"><input name="SortID" type="text" id="SortID" style="width: 18; background-color:#fffff0" value="<%=SortID%>" readonly> <input name="SortPath" type="text" id="SortPath" style="width: 70; background-color:#fffff0" value="<%=SortPath%>" readonly> <input name="SortNameCH" type="text" id="SortNameCH" value="<%=SortNameCH%>" style="width: 180; background-color:#fffff0" readonly> <a href="javaScript:OpenScript('SelectSort.asp?Result=Others',500,500,'')">选择类别</a> <font color="red">*</font></td>
</tr>
<tr>
<td align="right" class="forumRow">阅读权限:</td>
<td class="forumRowHighlight"><select name="GroupID">
<% call SelectGroup() %>
</select>
<input name="Exclusive" type="radio" value=">=" <%if Exclusive="" or Exclusive=">=" then response.write ("checked")%>>
隶属
<input type="radio" <%if Exclusive="=" then response.write ("checked")%> name="Exclusive" value="=">
专属(隶属:权限值≥可查看,专属:权限值=可查看)</td>
</tr>
<tr>
<td align="right" class="forumRow">中文内容:</td>
<td class="forumRowHighlight"><textarea name="ContentCH" id="ContentCH" style="display:none"><%=Server.HTMLEncode((ContentCH))%></textarea>
<iframe ID="eWebEditor1" src="../Editor/ewebeditor.htm?id=ContentCH&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe></td>
</tr>
<tr>
<td align="right" class="forumRow">英文内容:</td>
<td class="forumRowHighlight"><textarea name="ContentEN" id="ContentEN" style="display:none"><%=Server.HTMLEncode((ContentEN))%></textarea>
<iframe ID="eWebEditor1" src="../Editor/ewebeditor.htm?id=ContentEN&style=coolblue" frameborder="0" scrolling="no" width="550" height="350"></iframe></td>
</tr>
<tr>
<td align="right" class="forumRow"></td>
<td class="forumRowHighlight"><input name="submitSaveEdit" type="submit" id="submitSaveEdit" value="保存"> <input type="button" value="返回上一页" onClick="history.back(-1)"></td>
</tr>
</form>
</table>
</BODY>
</HTML>
<%
sub OthersEdit()
dim Action,rsRepeat,rs,sql
Action=request.QueryString("Action")
if Action="SaveEdit" then
set rs = server.createobject("adodb.recordset")
if len(trim(request.Form("OthersNameCH")))<1 then
response.write ("<script language='javascript'>alert('请填写中文标题!');history.back(-1);</script>")
response.end
end if
if request.Form("ViewFlagEn")=1 then
if len(trim(request.Form("OthersNameEn")))<1 then
response.write ("<script language=javascript> alert('您已经选择了""英文""显示,因此英文标题必填!');history.back(-1);</script>")
response.end
end if
end if
if Result="Add" then
sql="select * from LiangJingCMS_Others"
rs.open sql,conn,1,3
rs.addnew
rs("OthersNameCh")=trim(Request.Form("OthersNameCh"))
rs("OthersNameEn")=trim(Request.Form("OthersNameEn"))
if Request.Form("ViewFlagCh")=1 then
rs("ViewFlagCh")=Request.Form("ViewFlagCh")
else
rs("ViewFlagCh")=0
end if
if Request.Form("ViewFlagEn")=1 then
rs("ViewFlagEn")=Request.Form("ViewFlagEn")
else
rs("ViewFlagEn")=0
end if
if Request.Form("SortID")="" and Request.Form("SortPath")="" then
response.write ("<script language='javascript'>alert('请选择所属分类!');history.back(-1);</script>")
response.end
else
rs("SortID")=Request.Form("SortID")
rs("SortPath")=Request.Form("SortPath")
end if
GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
rs("GroupID")=GroupIdName(0)
rs("Exclusive")=trim(Request.Form("Exclusive"))
rs("ContentCh")=trim(Request.Form("ContentCh"))
rs("ContentEn")=trim(Request.Form("ContentEn"))
rs("SeoKeywordsCH")=trim(Request.Form("SeoKeywordsCH"))
rs("SeoDescriptionCH")=trim(Request.Form("SeoDescriptionCH"))
rs("SeoKeywordsEN")=trim(Request.Form("SeoKeywordsEN"))
rs("SeoDescriptionEN")=trim(Request.Form("SeoDescriptionEN"))
rs("AddTime")=now()
rs("UpdateTime")=now()
rs.update
rs.close
set rs=Nothing
set rs=server.createobject("adodb.recordset")
sql="select top 1 ID from LiangJingCMS_Others order by ID desc"
rs.open sql,conn,1,1
ID=rs("ID")
rs.close
set rs=Nothing
if ISHTML = 1 then
call htmll("/CH/","/CH/",""&OtherName&""&Separated&""&ID&"."&HTMLName&"","OtherView.asp","ID=",ID,"","")
call htmll("/EN/","/EN/",""&OtherName&""&Separated&""&ID&"."&HTMLName&"","OtherView.asp","ID=",ID,"","")
End If
end if
if Result="Modify" then
sql="select * from LiangJingCMS_Others where ID="&ID
rs.open sql,conn,1,3
rs("OthersNameCh")=trim(Request.Form("OthersNameCh"))
rs("OthersNameEn")=trim(Request.Form("OthersNameEn"))
if Request.Form("ViewFlagCh")=1 then
rs("ViewFlagCh")=Request.Form("ViewFlagCh")
else
rs("ViewFlagCh")=0
end if
if Request.Form("ViewFlagEn")=1 then
rs("ViewFlagEn")=Request.Form("ViewFlagEn")
else
rs("ViewFlagEn")=0
end if
if Request.Form("SortID")<>"" and Request.Form("SortPath")<>"" then
rs("SortID")=Request.Form("SortID")
rs("SortPath")=Request.Form("SortPath")
else
response.write ("<script language='javascript'>alert('请选择所属分类!');history.back(-1);</script>")
response.end
end if
GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
rs("GroupID")=GroupIdName(0)
rs("Exclusive")=trim(Request.Form("Exclusive"))
rs("ContentCh")=trim(Request.Form("ContentCh"))
rs("ContentEn")=trim(Request.Form("ContentEn"))
rs("SeoKeywordsCH")=trim(Request.Form("SeoKeywordsCH"))
rs("SeoDescriptionCH")=trim(Request.Form("SeoDescriptionCH"))
rs("SeoKeywordsEN")=trim(Request.Form("SeoKeywordsEN"))
rs("SeoDescriptionEN")=trim(Request.Form("SeoDescriptionEN"))
rs("UpdateTime")=now()
rs.update
rs.close
set rs=Nothing
if ISHTML = 1 then
call htmll("/CH/","/CH/",""&OtherName&""&Separated&""&ID&"."&HTMLName&"","OtherView.asp","ID=",ID,"","")
call htmll("/EN/","/EN/",""&OtherName&""&Separated&""&ID&"."&HTMLName&"","OtherView.asp","ID=",ID,"","")
End If
end if
if ISHTML = 1 then
response.write "<script language='javascript'>alert('设置成功,相关静态页面已更新!');location.replace('OthersList.asp');</script>"
Else
response.write "<script language='javascript'>alert('设置成功!');location.replace('OthersList.asp');</script>"
End If
else
if Result="Modify" then
set rs = server.createobject("adodb.recordset")
sql="select * from LiangJingCMS_Others where ID="& ID
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write ("数据库读取记录出错!")
response.end
end if
OthersNameCh=rs("OthersNameCh")
OthersNameEn=rs("OthersNameEn")
ViewFlagCh=rs("ViewFlagCh")
ViewFlagEn=rs("ViewFlagEn")
SortNameCh=SortText(rs("SortID"))
SortID=rs("SortID")
SortPath=rs("SortPath")
GroupID=rs("GroupID")
Exclusive=rs("Exclusive")
ContentCh=rs("ContentCh")
ContentEn=rs("ContentEn")
SeoKeywordsCH=rs("SeoKeywordsCH")
SeoDescriptionCH=rs("SeoDescriptionCH")
SeoKeywordsEN=rs("SeoKeywordsEN")
SeoDescriptionEN=rs("SeoDescriptionEN")
rs.close
set rs=nothing
end if
end if
end sub
sub SelectGroup()
dim rs,sql
set rs = server.createobject("adodb.recordset")
sql="select GroupID,GroupNameCH from LiangJingCMS_MemGroup"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.write("未设组别")
end if
while not rs.eof
response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupNameCH")&"'")
if GroupID=rs("GroupID") then response.write ("selected")
response.write(">"&rs("GroupNameCH")&"</option>")
rs.movenext
wend
rs.close
set rs=nothing
end sub
Function SortText(ID)
Dim rs,sql
Set rs=server.CreateObject("adodb.recordset")
sql="Select * From LiangJingCMS_OthersSort where ID="&ID
rs.open sql,conn,1,1
SortText=rs("SortNameCH")
rs.close
set rs=nothing
End Function
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?