⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_wisdom.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
    <td valign="middle"><input type="button" name="Submit" value="编辑" onClick="editpro(this)"/> <button onClick="{if(confirm('你是否真的要删除吗?')){window.location.href='admin_wisdom.asp?action=deletenode&id=<%=xmlchildes(position_).childNodes(0).text%>';}return false;}">删除</button></td>
  </tr>
<%
position=position+1
line=line+1
loop%>
  <tbody id="addpro" style="display:none;">
<form name="addform" action="?action=addwisdom" method="post">
  <tr> 
    <td width="*" height="22" colspan="3" valign="middle" class="title">添加新的小贴 <font face="Wingdings 3">ii</font></td>
  </tr>
  <tr class="td_bgcolor" align="center"> 
    <td height="39" valign="middle">
	<select name="addtype" onChange="chtype(options[selectedIndex].value)">
        <option value="1" selected="selected">每日一贴</option>
        <option value="2">英语贴</option>
		<option value="3">广告贴</option>
      </select></td>
    <td valign="middle">
	<div id="addwisdow1">
	<input name="addtitle1" type="text" value="每日一贴:" size="10"/> 
 	<input type="text" name="addwis1" size="45"/>
	<select name="addcolor1">
	<option value="#000000">字体颜色</option>
	  <%
	  colorStr=split(colorRS,",")
	  for i=0 to ubound(colorStr)
		  Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
	  next
	  %>
	  </select>
	  <select name="addbgcolor1">
	  <option value="#ffffff">背景颜色</option>
	  <%
	  colorStr=split(colorRS,",")
	  for i=0 to ubound(colorStr)
		  Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
	  next
	  %>
	  </select></div>
	  <div id="addwisdom2" style="display:none;">
	<input name="addtitle2" type="text" value="翻译:" size="10"/> 
 	<input type="addtext" name="addwis2" id="addwis2" size="45"/>
	<select name="addcolor2">
	<option value="#000000">字体颜色</option>
	  <%
	  colorStr=split(colorRS,",")
	  for i=0 to ubound(colorStr)
		  Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
	  next
	  %>
	  </select>
	  <select name="addbgcolor2">
	  <option value="#ffffff">背景颜色</option>
	  <%
	  colorStr=split(colorRS,",")
	  for i=0 to ubound(colorStr)
		  Response.Write ("<option style=""background-color:"& colorStr(i) &";color: "& colorStr(i) &""" value="""&colorStr(i)&""">"&colorStr(i)&"</option>")
	  next
	  %>
	  </select></div></td>
    <td valign="middle"><input type="submit" name="Submit" value="增加"/> <input type="button" value="取消" onclick="showadd()"></input></td>
  </tr>
 </form>
 </tbody>
  <tr> 
    <td width="*" height="32" colspan="3" valign="middle" class="td_titleB">&nbsp;<input type="button" value="添加新的记录" onclick="showadd()"></input> &nbsp;&nbsp;共有<font color="#ff0000"><%=rscount%></font>条&nbsp; 页次:<font color="#ff0000"><%=currentPage&"</font>/"&pages%>页&nbsp; 每页<font color="#ff0000"><%=pagesizes%></font>条 <%=pagetitle%>&nbsp;</td>
  </tr>
  <tr> 
    <td width="*" height="40" colspan="3" valign="middle" align="center" class="td_bgcolor">
	说明:插入图标的标标为{img:图标名},如:{img:1},不包含后缀名;请按照下面方式<br>
	<a href="javascript:onclick=put('{img:1}')"><img src="../images/label/1.gif" border="0" align="absmiddle">{img:1}</a>
	<a href="javascript:onclick=put('{img:2}')"><img src="../images/label/2.gif" border="0" align="absmiddle">{img:2}</a>
	<a href="javascript:onclick=put('{img:3}')"><img src="../images/label/3.gif" border="0" align="absmiddle">{img:3}</a>
	<a href="javascript:onclick=put('{img:4}')"><img src="../images/label/4.gif" border="0" align="absmiddle">{img:4}</a>
	<a href="javascript:onclick=put('{img:5}')"><img src="../images/label/5.gif" border="0" align="absmiddle">{img:5}</a>
	<a href="javascript:onclick=put('{img:6}')"><img src="../images/label/6.gif" border="0" align="absmiddle">{img:6}</a>
	<a href="javascript:onclick=put('{img:7}')"><img src="../images/label/7.gif" border="0" align="absmiddle">{img:7}</a>
	<a href="javascript:onclick=put('{img:8}')"><img src="../images/label/8.gif" border="0" align="absmiddle">{img:8}</a>
	<a href="javascript:onclick=put('{img:9}')"><img src="../images/label/9.gif" border="0" align="absmiddle">{img:9}</a>
	<a href="javascript:onclick=put('{img:10}')"><img src="../images/label/10.gif" border="0" align="absmiddle">{img:10}</a>
	<a href="javascript:onclick=put('{img:11}')"><img src="../images/label/11.gif" border="0" align="absmiddle">{img:11}</a>
	</td>
  </tr>
</table>
<%End Sub
Sub addwisdom()
if getPopedom("wisdomAdmin")=false then
	popedomMsg
	exit sub
end if
dim addtype,addtitle1,addwis1,addcolor1,addbgcolor1,id,addtitle2,addwis2,addcolor2,addbgcolor2
addtype=cint(Request("addtype"))
addtitle1=reImg(trim(Request("addtitle1"))):addtitle2=reImg(trim(Request("addtitle2")))
addwis1=reImg(trim(Request("addwis1"))):addwis2=reImg(trim(Request("addwis2")))
addcolor1=Request("addcolor1"):addcolor2=Request("addcolor2")
addbgcolor1=Request("addbgcolor1"):addbgcolor2=Request("addbgcolor2")
if addtype=1 then
	if addwis1="" then
		adminShowMsg "出错信息","<li>请您输入内容</li>"
		exit sub
	end if
elseif addtype=2 then
	if addwis1="" then
		adminShowMsg "出错信息","<li>内容1不能为空</li>"
		exit sub
	end if
	if addwis2="" then
		adminShowMsg "出错信息","<li>内容2不能为空</li>"
		exit sub
	end if
elseif addtype=3 then
	if addwis1="" then
		adminShowMsg "出错信息","<li>请您输入内容</li>"
		exit sub
	end if
else
	adminShowMsg "出错信息","<li>请选择添加类型</li>"
end if
dim xmlpath,xmldom,xmlroot,mychild
xmlpath=server.mappath("../xml/wisdom.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
	set mychild=xmlroot.lastChild.firstChild
	id=cint(mychild.text)+1
else
	id=1
end if
else
id=1
end if
dim xmlmsg,xmlid,xmltitle1,xmlctitle1,xmlwis1,xmlcwis1,xmltitle2,xmlctitle2,xmlwis2,xmlcwis2
set xmlmsg=xmldom.createElement("item")
xmlroot.appendChild(xmlmsg)
set xmlid=xmldom.createElement("id")
xmlid.text=id
xmlid.setAttribute "type",addtype
xmlmsg.appendChild(xmlid)
set xmltitle1=xmldom.createElement("title1")
if addtype=1 or addtype=2 then
	set xmlctitle1=xmldom.CreateCDATASection(addtitle1)
	xmltitle1.appendChild(xmlctitle1)
end if
xmlmsg.appendChild(xmltitle1)
set xmlwis1=xmldom.createElement("wis1")
set xmlcwis1=xmldom.CreateCDATASection(addwis1)
xmlwis1.appendChild(xmlcwis1)
xmlwis1.setAttribute "color",addcolor1
xmlwis1.setAttribute "bgcolor",addbgcolor1
xmlmsg.appendChild(xmlwis1)
set xmltitle2=xmldom.createElement("title2")
if addtype=2 then
set xmlctitle2=xmldom.CreateCDATASection(addtitle2)
xmltitle2.appendChild(xmlctitle2)
end if
xmlmsg.appendChild(xmltitle2)
set xmlwis2=xmldom.createElement("wis2")
if addtype=2 then
set xmlcwis2=xmldom.CreateCDATASection(addwis2)
xmlwis2.appendChild(xmlcwis2)
end if
xmlwis2.setAttribute "color",addcolor2
xmlwis2.setAttribute "bgcolor",addbgcolor2
xmlmsg.appendChild(xmlwis2)
xmldom.save(xmlpath)
set xmldom=Nothing
adminShowMsg "系统返回成功信息","<li>已成功添加了一条记录!</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=admin_wisdom.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
exit sub
End Sub
Sub deletenode()
if getPopedom("wisdomAdmin")=false then
	popedomMsg
	exit sub
end if
dim id,xmlpath,xmldom,xmlroot
id=Request.QueryString("id")
xmlpath=server.mappath("../xml/wisdom.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 "系统返回成功信息","<li>已成功删除一条记录!</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=admin_wisdom.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub editNode()
if getPopedom("wisdomAdmin")=false then
	popedomMsg
	exit sub
end if
dim id,edittype,title1,wis1,color1,bgcolor1
id=Request.form("id")
edittype=cint(Request("type"))
title1=reImg(trim(Request("title1"))):title2=reImg(trim(Request("title2")))
wis1=reImg(trim(Request("wis1"))):wis2=reImg(trim(Request("wis2")))
color1=Request("color1"):color2=Request("color2")
bgcolor1=Request("bgcolor1"):bgcolor2=Request("bgcolor2")
if edittype=1 then
	if wis1="" then
		adminShowMsg "出错信息","<li>请您输入内容</li>"
		exit sub
	end if
elseif edittype=2 then
	if wis1="" then
		adminShowMsg "出错信息","<li>内容1不能为空</li>"
		exit sub
	end if
	if wis2="" then
		adminShowMsg "出错信息","<li>内容2不能为空</li>"
		exit sub
	end if
elseif edittype=3 then
	if wis1="" then
		adminShowMsg "出错信息","<li>内容1不能为空</li>"
		exit sub
	end if
else
	adminShowMsg "出错信息","<li>请选择添加类型</li>"
end if
dim xmlpath,xmldom,xmlroot,xmlmsg
xmlpath=server.mappath("../xml/wisdom.maosin")
Set xmldom=server.CreateObject("Microsoft.XMLDOM")
xmldom.async="false"
xmldom.load(xmlpath)
set xmlroot=xmldom.documentElement
dim newid,newtitle1,xmlctitle1,newwis1,xmlcwis1,newtitle2,xmlctitle2,newwis2,xmlcwis2
for each xmlmsg in xmlroot.childNodes
	if CInt(xmlmsg.childNodes(0).text)=CInt(id) then
		set newid=xmldom.CreateElement("id")
		newid.text=id
		newid.setAttribute "type",edittype
		call xmlmsg.replaceChild(newid,xmlmsg.childNodes(0))
			
		set newtitle1=xmldom.CreateElement("title1")
		if edittype=1 or edittype=2 then
			set xmlctitle1=xmldom.CreateCDATASection(title1)
			newtitle1.appendChild(xmlctitle1)
		end if
		call xmlmsg.replaceChild(newtitle1,xmlmsg.childNodes(1))
		
		set newwis1=xmldom.CreateElement("wis1")
		set xmlcwis1=xmldom.CreateCDATASection(wis1)
		newwis1.appendChild(xmlcwis1)
		call xmlmsg.replaceChild(newwis1,xmlmsg.childNodes(2))
		newwis1.setAttribute "color",color1
		newwis1.setAttribute "bgcolor",bgcolor1
		
		set newtitle2=xmldom.CreateElement("title2")
		if edittype=2 then
		set xmlctitle2=xmldom.CreateCDATASection(title2)
		newtitle2.appendChild(xmlctitle2)
		end if
		call xmlmsg.replaceChild(newtitle2,xmlmsg.childNodes(3))
		
		set newwis2=xmldom.CreateElement("wis2")
		if edittype=2 then
		set xmlcwis2=xmldom.CreateCDATASection(wis2)
		newwis2.appendChild(xmlcwis2)
		end if
		call xmlmsg.replaceChild(newwis2,xmlmsg.childNodes(4))
		newwis2.setAttribute "color",color2
		newwis2.setAttribute "bgcolor",bgcolor2
		xmldom.save(xmlpath)
		exit for
	end if
next
Set xmldom=Nothing
adminShowMsg "系统返回成功信息","<li>恭喜恭喜,记录修改成功!</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回......</b><meta http-equiv=refresh content=3;url=admin_wisdom.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
exit sub
End Sub
function reImg(str)
	if str="" then
		reImg=""
		exit function
	else
		set regEx=new regExp
		regEx.ignoreCase=True
		regEx.global=True
		regEx.pattern="\{img:(\w{0,})\}"
		str=regEx.replace(str,"<img src=""images/label/$1.gif"" border=""0"" align=""absmiddle"">")
		reImg=str
	end if
end function
'========================================================
'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 + -