📄 admin_blog.asp
字号:
<%
'==================================
'=文 件 名:admin_blog.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=true 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="3" class="td_title">日志管理</td>
</tr>
<tr class="tablebody">
<td colspan="3" style="font-weight:bold;color:#0000ff">注:网站日志主要供管理员记录一些网站管理方面的内容,功能类似站长日志。</td>
</tr>
<tr class="tablebody" align="center">
<td width="8%">编号</td>
<td width="72%">日志标题</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 id="menutitle<%=k%>" onclick="showsubmenu(<%=k%>)" style="cursor:hand;"><%=rs("channel_title")%> [<%=rs("channel_date")%>]<br>
<table style="display:none" id='submenu<%=k%>' class="tableborder" cellspacing="1" cellpadding="4" align="center">
<tr>
<td bgcolor="#ffffff"><%=replace(ChangeEmot(rs("channel_content")),"<IMG","<IMG onload=""javascript:ContentImage(this);"" onmousewheel=""return cgimg(this);"" ")%>
</td>
</table>
</td>
<td align="center"><button onClick="window.location
='?id=<%=rs("id")%>&action=edit&page=<%=currentpage%>'">编辑</button> <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="3" 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_blog.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,50)
if request.form("titlecolor")<>"" then
titlecolor=checksql("日志标题色彩",request.form("titlecolor"),1,7)
else
titlecolor=""
end if
channelcontent=checksql("日志内容",request.form("content"),1,0)
channelcontent=replace(channelcontent,replaceurl,"")
sql="select * from wapls_channel"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
if titlecolor<>"" then
rs("channel_title")="<font color="""&titlecolor&""">"&title&"</font>"
else
rs("channel_title")=title
end if
rs("user_view")=0
rs("moneypay")=0
rs("channel_content")=channelcontent
rs("isadmin")=true
rs.update
rs.close
set rs=nothing
response.redirect "admin_blog.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 align="center" width="13%">标 题</td>
<td width="87%"><input type="text" name="channel_title" size="30" maxlength="50">
<select name="titlecolor">
<option value="" selected>无色彩</option>
<option style="background-color:#ff0000;color: #ff0000" value="#ff0000">#ff0000</option>
<option style="background-color:#0000ff;color: #0000ff" value="#0000ff">0000ff</option>
<option style="background-color:#228b22;color: #228b22" value="#228b22">#228b22</option>
<option style="background-color:#1e90ff;color: #1e90ff" value="#1e90ff">1e90ff</option>
<option style="background-color:#8b0000;color: #8b0000" value="#8b0000">#8b0000</option>
<option style="background-color:#9932cc;color: #9932cc" value="#9932cc">9932cc</option>
</select></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" valign="top">内 容</td>
<td><!-- #include file = "wapls_edit.asp"--></td>
</tr>
<tr class="tablebody">
<td class="tablebody" height="30" align="center" colspan="2"><input type="submit" name="Submit2" value="确定新增" onClick="if (Dvbbs_bTextMode!=1) {Dvbbs_setMode(1);}"><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
channel_id=checksql("日志ID",request.Form("id"),0,8)
title=checksql("日志标题",request.form("channel_title"),1,50)
if request.form("titlecolor")<>"" then
titlecolor=checksql("日志标题色彩",request.form("titlecolor"),1,7)
else
titlecolor=""
end if
channelcontent=checksql("日志内容",request.form("content"),1,0)
channelcontent=replace(channelcontent,replaceurl,"")
sql="select * from wapls_channel where id="&channel_id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if titlecolor<>"" then
rs("channel_title")="<font color="""&titlecolor&""">"&title&"</font>"
else
rs("channel_title")=title
end if
rs("moneypay")=0
rs("user_view")=0
rs("channel_content")=channelcontent
rs("isadmin")=true
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 align="center" width="13%">标 题</td>
<td width="87%">
<%
if instr(rs("channel_title"),"<font color")<>0 then
channeltitle=split(rs("channel_title"),">")
channel_color=mid(channeltitle(0),14,7)
channel_title=replace(channeltitle(1),"</font","")
else
channel_color=""
channel_title=rs("channel_title")
end if
%>
<input type="text" name="channel_title" size="56" value="<%=channel_title%>" maxlength="100">
<select name="titlecolor">
<option value="" <%if channel_color="" then%>selected<%end if%>>无色彩</option>
<option style="background-color:#ff0000;color: #ff0000" value="#ff0000" <%if channel_color="#ff0000" then%>selected<%end if%>>#ff0000</option>
<option style="background-color:#0000ff;color: #0000ff" value="#0000ff" <%if channel_color="#0000ff" then%>selected<%end if%>>0000ff</option>
<option style="background-color:#228b22;color: #228b22" value="#228b22" <%if channel_color="#228b22" then%>selected<%end if%>>#228b22</option>
<option style="background-color:#1e90ff;color: #1e90ff" value="#1e90ff" <%if channel_color="#1e90ff" then%>selected<%end if%>>1e90ff</option>
<option style="background-color:#8b0000;color: #8b0000" value="#8b0000" <%if channel_color="#8b0000" then%>selected<%end if%>>#8b0000</option>
<option style="background-color:#9932cc;color: #9932cc" value="#9932cc" <%if channel_color="#9932cc" then%>selected<%end if%>>9932cc</option>
</select></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" valign="top">内 容</td>
<td><input name="edit" id="edit" type="hidden" value="<%=Server.HTMLEncode(rs("channel_content"))%>"></input>
<!-- #include file = "wapls_edit.asp"-->
<script>
IframeID.document.body.innerHTML=form1.edit.value;
</script>
</td>
</tr>
<tr class="tablebody">
<td class="tablebody" colspan="2" height="30" align="center">
<input type="submit" name="Submit" value="确定修改" onClick="if (Dvbbs_bTextMode!=1) {Dvbbs_setMode(1);}">
<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" height="100" valign="top">内 容</td>
<td><%=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 + -