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

📄 admin_channel.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
  <tr>
    <td height="25" colspan="3" align="center" valign="middle" class="td_titleB">
	<input name="addchannel" type="submit" id="addchannel" value="增加频道">&nbsp;
    <input type="reset" name="Submit" value="重新编辑">
  </td></tr>
	</form>
</table>
<%End Sub
Sub modifychannel()
if getPopedom("channelAdmin")=false then
	popedomMsg
	exit sub
end if
dim rs,sql,isclass,title,content
id=Request("id")
isclass=Request("isclass")
if isInteger(id)=false then
	adminShowMsg "出错信息","ID参数应为数字整型参数"
	exit sub
end if
sql="select * from ms_channel where id="&id
Set rs=conn.Execute(sql)
if rs.eof and rs.bof then
	adminShowMsg "出错信息","没有频道,或此频道已经删除了"
	exit sub
end if
if rs("channel_content")="" or isNull(rs("channel_content")) then
content=""
else
content=rs("channel_content")
end if
dim editpath:editpath="../editor/"
%>
<script language="javascript">
function checksubmit(){
submits();
if(document.form.title.value==""){
alert("频道标题不能为空");
document.form.title.focus();
return false;}
if(!document.form.isclass.checked){
	if(document.form.content.value==""){
	alert("频道内容不能为空");
	IframeID.document.body.focus();
	return false;}
}
return true;}
var editorpath="../editor/";
function IsClass(objValue){
	var Value=objValue.checked;
	if (Value){
		ctitle.innerText="频道分类";
		showcontent.style.display="none";
	}else{
		ctitle.innerText="频道名称";
		showcontent.style.display="block";
	}
}
function isTran(Value){
	if (Value==1){
		showcontent.style.display="none";
	}else{
		showcontent.style.display="block";
	}
}
</Script>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="text table_border mainTable">
  <form name="form" id="modifyform" onsubmit="return checksubmit()" action="?action=maosin_mdfsava" method="post">
  <tr align="left" valign="middle">
    <td height="25" colspan="2"  class="td_titleT">修改频道</td>
  </tr>
  <tr class="td_bgcolor">
    <td width="80" height="25" valign="middle" align="right"><span id="ctitle">频道标题</span>:</td>
    <td valign="middle"><input name="title" value="<%=rs("channel_title")%>" type="text" size="30">
	<input name="chid" type="hidden" size="30" value="<%=rs("id")%>">
	  <select name="titlecolor" onChange="titlecolor.value=this.value;">
	  <option style="background-color:<%=rs("titlecolor")%>" value="<%=rs("titlecolor")%>">选择颜色</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> &nbsp;<input type="checkbox" value="true" name="isclass" id="isclass" onClick="IsClass(this)" <%if isclass="2" then%>checked<%end if%>><label for="isclass">作为分类</label>
	</td>
  </tr>
  <tbody id="showcontent">
  <tr class="td_bgcolor">
    <td height="25" valign="middle" align="right">所属分类:</td>
    <td valign="middle">
	<select name="rootid">
		<option value="0" <%if rs("rootid")=0 then%>selected<%end if%>>[根目录]</option>
	<%dim crs
	set crs=conn.execute("select id,channel_title from ms_channel where rootid=0 and sflag=0")
	do while not crs.eof
		if crs("id")=rs("rootid") then
			response.write("<option value="""&crs("id")&""" selected>"&crs("channel_title")&"</option>")
		else
			response.write("<option value="""&crs("id")&""">"&crs("channel_title")&"</option>")
		end if
		crs.MoveNext
	loop
	crs.close
	set crs=nothing
	%>
	</select>
	</td>
  </tr>
  <tr class="td_bgcolor">
    <td height="25" valign="middle" align="right">上传图片:</td>
    <td valign="middle">
	<iframe src="myup.asp?cat=channel&uptype=pic&content=oblog_Composition" scrolling="no" frameborder="0" height="25" marginheight="0" marginwidth="0" width="100%"></iframe>
	</td>
  </tr>
  <tr class="td_bgcolor">
    <td height="225" valign="top" align="right">频道内容:</td>
    <td valign="middle">
	<input type="hidden" name="content" id="edit" value="<%=server.HTMLENCode(content)%>"><!--#include file="../editor/edit.asp"-->
	</td>
  </tr>
  </tbody>
  <tr class="td_bgcolor">
    <td height="29" colspan="2" align="center" valign="middle" class="td_titleB">
	<input name="modifychannel" type="submit" id="modifychannel" value="保存修改" >
	<input type="reset" name="Submit" value="清空重写">
  	</td>
  </tr>
	</form>
</table>
<script language="javascript"><%if isclass="2" then%> isTran(1) <%end if%></script>
<%rs.close
End Sub
Sub modifysava()
if getPopedom("channelAdmin")=false then
	popedomMsg
	exit sub
end if
dim sql,id,chtitle,titlecolor,isclass,rootid,chcontent
id=trim(Request.form("chid"))
chtitle=trim(Request.form("title"))
titlecolor=trim(Request.form("titlecolor"))
isclass=trim(Request.form("isclass"))
rootid=trim(Request.form("rootid"))
chcontent=trim(Request.form("content"))
if chtitle="" then
	adminShowMsg "出错信息","频道名称不能为空,请输入频道名称"
	exit sub
end if
if isclass<>"true" then
	if chcontent="" then
		adminShowMsg "操作出错信息","频道内容不能为空,请返回填上"
		exit sub
	end if
	if isInteger(rootid)=false then
		adminShowMsg "出错信息","id分类参数不是数字型参数"
		exit sub
	end if
end if
chtitle=chkFormStr(chtitle)
titlecolor=chkColor(titlecolor)
if isclass="true" then
sql="update ms_channel set channel_title='"&chtitle&"',titlecolor='"&titlecolor&"',rootid=0,sflag=0 where id="&id
else
sql="update ms_channel set channel_title='"&chtitle&"',titlecolor='"&titlecolor&"',channel_content='"&chcontent&"',rootid="&rootid&",sflag=1 where id="&id
end if
conn.Execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,频道已修改成功了</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回频道管理页......</b><meta http-equiv=refresh content=3;url=admin_channel.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub addsava()
if getPopedom("channelAdmin")=false then
	popedomMsg
	exit sub
end if
dim sql,chtitle,titlecolor,isclass,rootid,chcontent
chtitle=trim(Request.form("title"))
titlecolor=trim(Request.form("titlecolor"))
isclass=trim(Request.form("isclass"))
rootid=trim(Request.form("rootid"))
chcontent=trim(Request.form("content"))
if chtitle="" then
	adminShowMsg "出错信息","频道名称不能为空,请输入频道名称"
	exit sub
end if
if isclass<>"true" then
	if chcontent="" then
		adminShowMsg "操作出错信息","频道内容不能为空,请返回填上"
		exit sub
	end if
	if isInteger(rootid)=false then
		adminShowMsg "出错信息","id分类参数不是数字型参数"
		exit sub
	end if
end if
chtitle=chkFormStr(chtitle)
titlecolor=chkColor(titlecolor)
if isclass="true" then
sql="insert into ms_channel(channel_title,titlecolor,channel_date,rootid,sflag) values('"&chtitle&"','"&titlecolor&"',#"&now()&"#,0,0)"
else
sql="insert into ms_channel(channel_title,titlecolor,channel_content,channel_date,rootid,sflag) values('"&chtitle&"','"&titlecolor&"','"&chcontent&"',#"&now()&"#,"&rootid&",1)"
end if
conn.execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,频道已添加成功</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回频道管理页......</b><meta http-equiv=refresh content=3;url=admin_channel.asp><SCRIPT>valignbottom()</SCRIPT><script>function showtime(secs){seNum.innerText=secs;if(--secs>0)setTimeout('showtime('+secs+')',1000);}showtime(3);</script>"
End Sub
Sub deletechannel()
if getPopedom("channelAdmin")=false then
	popedomMsg
	exit sub
end if
sql="delete from ms_channel where id="&Request.QueryString("id")
conn.execute(sql)
adminShowMsg "操作成功信息","<li>恭喜您,已成功删除一条频道信息</li><br><span id=seNum>3</span><a href=javascript:showtime></a>秒钟后系统将自动返回频道管理页......</b><meta http-equiv=refresh content=3;url=admin_channel.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
'========================================================
' 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 + -