📄 admin_message.asp
字号:
<td align="center" valign="middle"> <%if cint(xmlchildes(position_).childNodes(0).getattributeNode("type").value)=1 then:response.write("首页公告"):else:response.write("首页消息"):end if%><br> </td>
<td align="left" valign="middle">时 间:<%response.write(xmlchildes(position_).childNodes(2).text)%><br/>发布人:<%=xmlchildes(position_).childNodes(3).text%></td>
<td valign="middle" align="center"><button onClick="editpro(this)">编辑</button> <button onClick="{if(confirm('你是否真的要删除吗?')){window.location.href='admin_message.asp?action=delmsg&id=<%=xmlchildes(position_).childNodes(0).text%>';}return false;}">删除</button></td>
</tr>
<%
position=position+1
line=line+1
loop%>
<tr>
<td height="28" colspan="5" valign="middle" class="td_titleB"> 共有<font color="#ff0000"><%=rscount%></font>条 页次:<font color="#ff0000"><%=currentPage&"</font>/"&pages%>页 每页<font color="#ff0000"><%=pagesizes%></font>条 <%=pagetitle%></td>
</tr>
</table>
<%
End Sub
Sub saveMsg()
if getPopedom("afficheAdmin")=false then
popedomMsg
exit sub
end if
dim xmlpath,id,content,msgType,color,joinTime,joinUser,xmldoc,xmlroot,xmlitem,xmlid,xmlcontent,xmltime,xmluser
content=Request("addcontent")
msgType=Request("msgType")
color=chkColor(Request("color"))
joinTime=Request("joinTime")
joinUser=Request("joinUser")
if isdate(joinTime)=false then
adminShowMsg "出错信息","时间格式出错"
exit sub
end if
xmlpath=server.mappath("../xml/message.maosin")
Set xmldom=Server.CreateObject("Microsoft.XMLDOM")
xmldom.async="false"
xmldom.load(xmlpath)
set xmlroot=xmldom.DocumentElement
if xmlroot.hasChildNodes then
if xmlroot.lastChild.hasChildNodes then
id=cint(xmlroot.lastChild.firstChild.text)+1
else
id=1
end if
else
id=1
end if
set xmlitem=xmldom.createElement("item")
xmlroot.appendChild(xmlitem)
set xmlid=xmldom.createElement("id")
xmlid.text=id
xmlid.setAttribute "type",msgType
xmlitem.appendChild(xmlid)
set xmlcontent=xmldom.createElement("content")
set xmlcdata=xmldom.createCDataSection(content)
xmlcontent.appendChild(xmlcdata)
xmlcontent.setAttribute "color",color
xmlitem.appendChild(xmlcontent)
set xmltime=xmldom.createElement("joinTime")
xmltime.text=joinTime
xmlitem.appendChild(xmltime)
set xmluser=xmldom.createElement("joinUser")
xmluser.text=joinUser
xmlitem.appendChild(xmluser)
xmldom.save(xmlpath)
set xmlpath=nothing
adminShowMsg "系统返回成功信息","<li>已成功添加了一条公告!</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=admin_message.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
'================================
'功 能:删除XML节点公告
'函数名:delmsg()
'================================
Sub delmsg()
if getPopedom("afficheAdmin")=false then
popedomMsg
exit sub
end if
dim id,xmlpath,xmldom,xmlroot
id=Request("id")
xmlpath=server.mappath("../xml/message.maosin")
set xmldom=server.CreateObject("Microsoft.XMLDOM")
xmldom.async="false"
xmldom.load(xmlpath)
set xmlroot=xmldom.documentElement'根节点
for each xmlmsg in xmlroot.childNodes
if CInt(xmlmsg.childNodes(0).text)=CInt(id) then
xmlroot.removeChild(xmlmsg)
exit for
end if
next
xmldom.save(xmlpath)
Set xmldom=Nothing
adminShowMsg "成功信息","恭喜恭喜,已成功删除一条公告信息!<br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=admin_message.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
'===============================
'功 能:保存修改
'函数名:saveUpdate
'==============================
Sub saveUpdate()
if getPopedom("afficheAdmin")=false then
popedomMsg
exit sub
end if
dim id,content,msgType,color,joinTime,joinUser
id=Request("id")
content=Request("content")
msgType=Request("msgType")
color=chkColor(Request("color"))
joinTime=Request("joinTime")
joinUser=Request("joinUser")
if isdate(joinTime)=false then
adminShowMsg "出错信息","时间格式出错"
exit sub
end if
dim xmlpath,xmldom,xmlroot
xmlpath=server.mappath("../xml/message.maosin")
Set xmldom=Server.CreateObject("Microsoft.XMLDOM")
xmldom.async="false"
xmldom.load(xmlpath)
set xmlroot=xmldom.documentElement'根节点
for each msg in xmlroot.childNodes
if CInt(msg.childNodes(0).text)=CInt(id) then'定位节点
msg.childNodes(0).setAttribute "type",msgType
call msg.replaceChild(msg.childNodes(0),msg.childNodes(0))
set newcontent=xmldom.createElement("content")
set xmlCdate=xmldom.createCDATASection(content)
newcontent.setAttribute "color",color
newcontent.appendChild(xmlCdate)
call msg.replaceChild(newcontent,msg.childNodes(1))
set newTime=xmldom.createElement("joinTime")
newTime.text=jointime
call msg.replaceChild(newTime,msg.childNodes(2))
set newUser=xmldom.createElement("joinUser")
newUser.text=joinuser
call msg.replaceChild(newUser,msg.childNodes(3))
xmldom.save(xmlpath)
adminShowMsg "成功信息","恭喜恭喜,成功修改一条公告信息"
exit for
end if
next
End Sub
Sub showSet()
if getPopedom("afficheAdmin")=false then
popedomMsg
exit sub
end if
dim showType,xmlpath,xmldom,xmlroot
showType=trim(Request("showType"))
showNum=trim(Request("showNum"))
if showtype="num" then
if isNumeric(showNum)=false then
showType=1
else
showType=showNum
end if
else
showType=showType
end if
if isNumeric(showType)=false then
adminShowMsg "参数出错","显示类型数目应为一个整形数字"
exit sub
end if
xmlpath=server.mappath("../xml/message.maosin")
Set xmldom=Server.CreateObject("Microsoft.XMLDOM")
xmldom.async="false"
xmldom.load(xmlpath)
set xmlroot=xmldom.documentElement'根节点
xmlroot.getattributeNode("showType").value=showType
xmldom.save(xmlpath)
response.Write("<script>alert('恭喜恭喜,设置成功!');window.history.go(-1);</script>")
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -