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

📄 admin_channel.asp

📁 蓝色WAP建站系统,WAP源码,更多请登陆http://xywap.cn
💻 ASP
字号:
<%
'==================================
'=文 件 名:admin_channel.asp
'=适用版本:游戏天府WAP网站管理系统(CMS)V1.1
'=官方版权:http://www.gotf.cn
'=文件功能:自编频道管理
'=文件作者:游戏天府
'=发行时间:2007-02-01
'==================================
%>
<!--#include file="wapls_admin_conn.asp"-->
<!--#include file="wapls_admin_top.asp"-->
<%
if session("wapls_adminlogin")<>wapls_sessionvar then	
	errmsg="您没有登陆或不是管理员。请登陆。"
response.write "<script>window.alert('"&errmsg&"');window.location='admin_login.asp';</script>"
	response.End
elseif cur_adminsuper<>1 then
	errmsg=""&cur_adminname&",您不是超级管理员,没有权限进行此操作!"
response.write "<script>window.alert('"&errmsg&"');window.location='javascript:history.go(-1);';</script>"
	response.End
end if
dim page,title,channelcontent,channel_id,userview
if request.querystring("page")<>"" then
	page=checksql("频道分页",request.querystring("page"),0,8)
end if
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<tr align="center" class="tablebody">
		<td width="50%" class="td_title"><a href="?action=admin"><font color="#ffffff">频道管理</font></a></td>
		<td  width="50%" class="td_title"><a href="?action=add"><font color="#ffffff">新增频道</font></a></td>
	</tr>
</table>
<br>
<%
'==================================
'=功    能:主调代码,相应功能皆有说明
'==================================
Select case request.QueryString("action")
	case "admin"		'频道管理
		call admin()
	case "add"	'添加频道
		call add()
	case "edit"		'编辑频道
		call edit()
	case "del"	'删除频道
		call del()
	case else
		call admin()
End Select
'==================================
'=过 程 名:admin()
'=功    能:频道管理
'==================================
sub admin() 
dim totalchannel,Currentpage,totalpages,k
sql="select * from wapls_channel where isadmin=false order by id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<tr class="tablebody">
		<td colspan="5" class="td_title">频道管理</td>
	</tr>
	<tr class="tablebody">
		<td colspan="5">注:<br>
		1、频道调用:如需要在前台调用,则将链接代码加入到主页管理中就可以排版显示了!<br>
		2、说明:这里的文件编辑仅支持wml的文件标签!</td>
	</tr>
	<tr class="tablebody" align="center">
		<td width="5%">编号</td>
		<td width="24%">频道标题</td>
		<td width="20%">添加时间</td>
		<td width="30%">频道地址</td>
		<td width="20%">操作</td>
	</tr>
	<%
	if not rs.eof then
		rs.movefirst
		perpage=cint(perpage)
		rs.pagesize=perpage
		if trim(request("page"))<>"" then
			currentpage=cint(request.querystring("page"))
			if currentpage>rs.pagecount then
				currentpage=rs.pagecount
			end if
		else
			currentpage=1
		end if
		totalchannel=rs.recordcount
		if currentpage<>1 then
			if (currentpage-1)*perpage<totalchannel then
				rs.move(currentpage-1)*perpage
			end if
		end if
		if (totalchannel mod perpage)=0 then
			totalpages=totalchannel\perpage
		else
			totalpages=totalchannel\perpage+1
		end if
		k=0
		do while not rs.eof and k<perpage
		%>
		<tr class="tablebody">
			<td align="center"><%=rs("id")%></td>
			<td><%=rs("channel_title")%>&nbsp;<%if DateDiff("d",rs("channel_date"),now())<1 then%><img src="images/new.gif" border="0"><%end if %><%if rs("user_view")=1 then%>&nbsp;<img src="images/userview.gif" border="0" alt="会员频道,查看需消费<%=rs("moneypay")%>个金币"><%elseif rs("user_view")=2 then%>&nbsp;<img src="images/vipview.gif" border="0" alt="VIP会员频道,查看需消费<%=rs("moneypay")%>个金币"><%end if%></td>
			<td><span class="disable_font"><%=rs("channel_date")%></span></td>
			<td align="center"><input type="text" value="channel.asp?id=<%=rs("id")%>" onmouseover="this.focus()" onfocus="this.select()"></td>
			<td align="center"><button onClick="window.location
='?id=<%=rs("id")%>&action=edit&page=<%=currentpage%>'">编辑</button>&nbsp;<button onClick="window.location
='?id=<%=rs("id")%>&action=del&page=<%=currentpage%>'">删除</button></td>
		</tr>
		<%
		k=k+1
		rs.movenext
		loop
	else
		if rs.eof and rs.bof then
		%>
	<tr align="center" class="tablebody">
		<td colspan="5" height="70" class="disable_font">当前没有频道!</td>
	</tr>
		<%
		end if
	end if
	%>
</table>
<%if totalchannel>perpage then%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
		<form name="form" method="post" action="">
		<tr class="tablebody">
		<td align="center">
		<%showpage totalchannel,perpage,"admin_channel.asp?action=admin&"%>
		</td>
		</tr>
		</form>
	</table>
<%
end if
rs.close
set rs=nothing
end sub
'==================================
'=过 程 名:add()
'=功    能:新增频道
'==================================
sub add()
if request.form("addchannel")="true" then
	title=checksql("频道标题",request.form("channel_title"),1,100)
	userview=checksql("会员频道",request.form("userview"),0,1)
	moneypay=checksql("会员消费金币数",request.form("moneypay"),0,10)
	channelcontent=checksql("频道内容",request.form("content"),1,0)
	sql="select * from wapls_channel"
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.addnew
	rs("channel_title")=title
	rs("user_view")=userview
	if userview=0 then
		rs("moneypay")=0
	else
		rs("moneypay")=moneypay
	end if
	rs("channel_content")=channelcontent
	rs.update
	rs.close
	set rs=nothing
	response.redirect "admin_channel.asp"
end if
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action=""  onsubmit="javascript:submits();">
	<tr class="tablebody">
		<td class="td_title" colspan="2">新的频道</td>
	</tr>
	<tr class="tablebody">
		<td colspan="2">注:<br>

		1、频道调用:如需要在前台调用,则将链接代码加入到主页管理中就可以排版显示了!<br>
		2、说明:这里的文件编辑仅支持wml的文件标签!</td>
	</tr>
	<tr class="tablebody">
		<td align="center" width="13%">标 题</td>
		<td width="87%"><input type="text" name="channel_title" size="30"  maxlength="50">
		</tr>
	<tr class="tablebody">
		<td align="center">附 件</td>
		<td>
		<iframe src="wapls_upload.asp" scrolling="no" frameborder="0" height="25" width="100%"></iframe></td>
	</tr>
	<tr class="tablebody">
		<td align="center">查看权限</td>
		<td>
		<input type="radio" name="userview" value="0" checked> 游客查看
		<input type="radio" name="userview" value="1"> 普通会员
		<input type="radio" name="userview" value="2"> VIP会员
		| 消费金币:<input type="text" name="moneypay" value="1" size="6" maxlength="10" title="阅读此会员频道所需金币量"></td>
	</tr>
<tr class="tablebody">
<td align="center" valign="top">内 容</td><td><textarea name="content" rows="20" cols="100"></textarea></td>
</tr>
	
	<tr class="tablebody">
		<td class="tablebody" height="30" align="center" colspan="2"><input type="submit" name="Submit2" value="确定新增"><input type="hidden" name="addchannel" value="true"></td>
	</tr>
	</form>
</table>
<%
end sub
'==================================
'=过 程 名:edit()
'=功    能:编辑频道
'==================================
sub edit()
if request.form("editchannel")="true" then
	dim curpage
	if request.querystring("page")<>"" then
		curpage=cint(request.querystring("page"))
	else
		curpage=1
	end if
	id=checksql("频道ID",request.Form("id"),0,8)
	channel_title=checksql("频道标题",request.form("channel_title"),1,100)
	channel_content=checksql("频道内容",request.form("channel_content"),1,0)
	user_view=checksql("会员频道",request.form("user_view"),0,1)
	moneypay=checksql("会员消费金币数",request.form("moneypay"),0,10)

	set rs=server.createobject("adodb.recordset")
	sql="select * from wapls_channel where id="&id
	rs.open sql,conn,1,3

	rs("channel_title")=channel_title
	rs("channel_content")=channel_content
	rs("user_view")=user_view
	if user_view=0 then
		rs("moneypay")=0
	else
		rs("moneypay")=moneypay
	end if
	rs.update
	rs.close
	set rs=nothing
	response.redirect "?action=admin&page="&curpage&""
end if
channel_id=checksql("频道ID",request.querystring("id"),0,8)
sql="select * from wapls_channel where id="&channel_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action="" onsubmit="javascript:submits();">
	<tr class="tablebody">
		<td class="td_title" colspan="2">编辑频道</td>
	</tr>
	<tr class="tablebody">
		<td colspan="2">注:<br>		
		1、频道调用:如需要在前台调用,则将链接代码加入到主页管理中就可以排版显示了!<br>
		2、说明:这里的文件编辑仅支持wml的文件标签!</td></td>
	</tr>
	<tr class="tablebody">
		<td align="center" width="13%">标 题</td>
		<td width="87%">
		<input type="text" name="channel_title"  size="56" value="<%=rs("channel_title")%>" maxlength="100">
		</td>
	</tr>
	<tr class="tablebody">
		<td align="center">附 件</td>
		<td>
		<iframe src="wapls_upload.asp" scrolling="no" frameborder="0" height="25" width="100%"></iframe></td>
	</tr>
	<tr class="tablebody">
		<td align="center">查看权限</td>
		<td>
		<input type="radio" name="user_view" value="0" <%if rs("user_view")=0 then%>checked<%end if%>> 游客查看
		<input type="radio" name="user_view" value="1" <%if rs("user_view")=1 then%>checked<%end if%>> 普通会员
		<input type="radio" name="user_view" value="2"  <%if rs("user_view")=2 then%>checked<%end if%>> VIP会员
		| 消费金币:<input type="text" name="moneypay" <%if rs("user_view")=0 then%> value="1" <%else%> value="<%=rs("moneypay")%>" <%end if%> size="6" maxlength="10" title="阅读此会员频道所需金币量"></td>
	</tr>
	<tr class="tablebody">
<td align="center" valign="top">内 容</td>
<td><textarea name="channel_content" rows="20" cols="100"><%=rs("channel_content")%></textarea></td>
	</tr>
	<tr class="tablebody">
		<td class="tablebody" colspan="2" height="30" align="center">
		<input type="submit" name="Submit" value="确定修改">
		<input type="hidden" name="id" value="<%=rs("id")%>">
		<input type="hidden" name="editchannel" value="true">
		</td>
	</tr>
	</form>
</table>
<%
rs.close
set rs=nothing
end sub
'==================================
'=过 程 名:del()
'=功    能:删除频道
'==================================
sub del()
if request.form("delchannel")="true" then
	dim curpage
	if request.querystring("page")<>"" then
		curpage=cint(request.querystring("page"))
	else
		curpage=1
	end if
	channel_id=checksql("频道ID",request.Form("id"),0,8)
	sql="select * from wapls_channel where id="&channel_id
	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,3
	rs.delete
	rs.update
	rs.close
	set rs=nothing
	response.redirect "?action=admin&page="&curpage&""
end if
channel_id=checksql("频道ID",request.querystring("id"),0,8)
sql="select * from wapls_channel where id="&channel_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table cellspacing="1" cellpadding="4" class="tableborder" align="center">
	<form name="form1" method="post" action="">
	<tr class="tablebody">
		<td class="td_title" colspan="2">删除频道</td>
	</tr>
	<tr class="tablebody">
		<td align="center" width="13%">标 题</td>
		<td width="87%"><%=rs("channel_title")%></td>
	</tr>
	<tr class="tablebody">
		<td align="center">查看权限</td>
		<td><%if rs("user_view")=0 then%>游客方式查看<%elseif rs("user_view")=1 then%>普通会员方式查看&nbsp;<span class="disable_font">[消费<%=rs("moneypay")%>个金币]</span><%elseif rs("user_view")=2 then%>VIP会员方式查看&nbsp;<span class="disable_font">[消费<%=rs("moneypay")%>个金币]</span><%end if%>
		</td>
	</tr>
	<tr class="tablebody">
		<td align="center" height="100" valign="top">内 容</td>
		<td><%=utf8(rs("channel_content"))%></td>
	</tr>
	<tr class="tablebody">
		<td class="tablebody" height="30" align="center" colspan="2">
		<input name="Submit" type="submit" id="Submit" value="确定删除" onclick="{if(confirm('您确定要删除『<%=(rs("channel_title"))%>』这个频道吗?\n\n注意:删除后不可恢复!')){return true;}return false;}">
		<input type="hidden" name="id" value="<%=rs("id")%>">
		<input type="hidden" name="delchannel" value="true"></td>
		<input type="hidden" name="cur_page" value="<%=request.querystring("page")%>">
	</tr>
	</form>
</table>
<%
rs.close
set rs=nothing
end sub
%>
<!--#include file="wapls_admin_bottom.asp"-->

⌨️ 快捷键说明

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