📄 bokeadmin.asp
字号:
Rs.MoveNext
Wend
Pcount=Rs.PageCount
%>
<tr><td colspan=5 class=td1>共有<%=TotalRec%>条记录,分页:
<%
Dim Searchstr
Searchstr = "?s=7"
if currentpage > 4 then
response.write "<a href="""&Searchstr&"&page=1"">[1]</a> ..."
end if
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then
response.write " <font color=""red"">["&i&"]</font>"
else
response.write " <a href="""&Searchstr&"&page="&i&""">["&i&"]</a>"
end if
end if
next
if currentpage+3 < Pcount then
response.write "... <a href="""&Searchstr&"&page="&Pcount&""">["&Pcount&"]</a>"
end if
%>
</td>
</tr>
<%
End If
Rs.Close
Set Rs = Nothing
%>
</table>
<%
End Sub
'博客系统栏目管理
Sub Boke_SysCat()
Dim Rs,i,TableClass,t,tStr
t = Request("t")
If t = "" Or Not IsNumeric(t) Then t = 1
t = Cint(t)
If t = 1 Then
tStr = "栏目"
Else
tStr = "话题"
End If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr>
<th width="100%" colspan=6 height=25 align=left ID="TableTitleLink"> 博客系统<%=tStr%>管理 | <a href="?s=1&t=<%=t%>&Action=Add">添加<%=tStr%></a>
</th>
</tr>
<%
If Request("Action")="Add" Then
%>
<FORM METHOD=POST ACTION="?s=1&t=<%=t%>&Action=Save">
<tr align=center>
<td class="td2" height=24 colspan=6>
<B>添加博客系统<%=tStr%></B>
</td>
</tr>
<tr>
<td class="td1" height=24 width="35%" align=right>
<B><%=tStr%>名称</B>:
</td>
<td class="td1" width="65%">
<input type="text" name="Title" size="50">
</td>
</tr>
<tr>
<td class="td2" height=24 width="35%" align=right>
<B><%=tStr%>说明</B>:
</td>
<td class="td2" width="65%">
<textarea name="Note" cols="50" rows="5"></textarea>
</td>
</tr>
<tr align=center>
<td class="td1" height=24 colspan=6>
<input type=submit name=submit value="添加博客<%=tStr%>" class="button">
</td>
</tr>
</FORM>
<%
ElseIf Request("Action")="Save" Then
If Request("Title")="" Then
Manage_Err "请填写"&tStr&"的名称","6","?s=1&t="&t&""
Exit Sub
End If
If t=1 Then
DvBoke.Execute("Insert Into Dv_Boke_SysCat (sCatTitle,sCatNote) Values ('"&Replace(Request("Title"),"'","''")&"','"&Replace(Request("Note"),"'","''")&"')")
Else
DvBoke.Execute("Insert Into Dv_Boke_SysCat (sCatTitle,sCatNote,stype) Values ('"&Replace(Request("Title"),"'","''")&"','"&Replace(Request("Note"),"'","''")&"',1)")
End If
Manage_Suc "您成功添加了博客"&tStr&"","6","?s=1&t="&t&""
DvBoke.LoadSetup(1)
ElseIf Request("Action")="Edit" Then
If Request("ID") = "" Or Not IsNumeric(Request("ID")) Then
Manage_Err "非法的"&tStr&"参数","6","?s=1&t="&t&""
Exit Sub
End If
Set Rs = DvBoke.Execute("Select * From Dv_Boke_SysCat Where sCatID = " & Request("ID"))
If Rs.Eof And Rs.Bof Then
Manage_Err "非法的"&tStr&"参数","6","?s=1&t="&t&""
Rs.Close
Set Rs=Nothing
Exit Sub
End If
%>
<FORM METHOD=POST ACTION="?s=1&t=<%=t%>&Action=SaveEdit">
<input type=hidden value="<%=Request("ID")%>" name="ID">
<tr align=center>
<td class="td2" height=24 colspan=6>
<B>编辑博客系统<%=tStr%></B>
</td>
</tr>
<tr>
<td class="td1" height=24 width="35%" align=right>
<B><%=tStr%>名称</B>:
</td>
<td class="td1" width="65%">
<input type="text" name="Title" size="50" value="<%=Server.HtmlEncode(Rs("sCatTitle"))%>">
</td>
</tr>
<tr>
<td class="td2" height=24 width="35%" align=right>
<B><%=tStr%>说明</B>:
</td>
<td class="td2" width="65%">
<textarea name="Note" cols="50" rows="5"><%=Server.HtmlEncode(Rs("sCatNote")&"")%></textarea>
</td>
</tr>
<tr align=center>
<td class="td1" height=24 colspan=6>
<input type=submit name=submit value="编辑博客<%=tStr%>" class="button">
</td>
</tr>
</FORM>
<%
ElseIf Request("Action")="SaveEdit" Then
If Request("Title")="" Then
Manage_Err "请填写"&tStr&"的名称","6","?s=1&t="&t&""
Exit Sub
End If
If Request("ID") = "" Or Not IsNumeric(Request("ID")) Then
Manage_Err "非法的"&tStr&"参数","6","?s=1&t="&t&""
Exit Sub
End If
DvBoke.Execute("Update Dv_Boke_SysCat Set sCatTitle='"&Replace(Request("Title"),"'","''")&"',sCatNote='"&Replace(Request("Note"),"'","''")&"' Where sCatID = " & Request("ID"))
Manage_Suc "您成功编辑了博客"&tStr&"","6","?s=1&t="&t&""
DvBoke.LoadSetup(1)
ElseIf Request("Action")="Del" Then
If Request("ID") = "" Or Not IsNumeric(Request("ID")) Then
Manage_Err "非法的"&tStr&"参数","6","?s=1&t="&t&""
Exit Sub
End If
DvBoke.Execute("Delete From Dv_Boke_SysCat Where sCatID = " & Request("ID"))
Manage_Suc "您成功删除了博客"&tStr&"","6","?s=1&t="&t&""
DvBoke.LoadSetup(1)
Else
%>
<tr>
<td class="td1" colspan=6 height=25>
<B>说明</B>:点击用户数可查看此分栏的用户博客列表
</td>
</tr>
<tr align=center>
<td class="bodytitle" height=24>
<B><%=tStr%></B>
</td>
<td class="bodytitle">
<B>今日</B>
</td>
<td class="bodytitle">
<B>文章</B>
</td>
<td class="bodytitle">
<B>回复</B>
</td>
<td class="bodytitle">
<B>用户数</B>
</td>
<td class="bodytitle" align=left>
<B>操作</B>
</td>
</tr>
<%
i = 0
'TableClass = "td1"
Set Rs=DvBoke.Execute("Select * From Dv_Boke_SysCat Where sType = "&t&"-1 Order By sCatID")
Do While Not Rs.Eof
If TableClass = "td2" Then
TableClass="td1"
Else
TableClass="td2"
End If
%>
<tr align=center>
<td class="<%=TableClass%>" height=24>
<%=Rs("sCatTitle")%>
</td>
<td class="<%=TableClass%>">
<%=Rs("TodayNum")%>
</td>
<td class="<%=TableClass%>">
<%=Rs("TopicNum")%>
</td>
<td class="<%=TableClass%>">
<%=Rs("PostNum")%>
</td>
<td class="<%=TableClass%>">
<%=Rs("uCatNum")%> 个
</td>
<td class="<%=TableClass%>" align=left>
<a href="?s=1&t=<%=t%>&Action=Edit&ID=<%=Rs("sCatID")%>">编辑</a> | 设置 |
<%
If Rs("uCatNum") = 0 And Rs("TopicNum") = 0 Then
%>
<a href=# onclick="alertreadme('删除将包括该<%=tStr%>的所有信息,确定删除吗?','?s=1&t=<%=t%>&Action=Del&ID=<%=Rs("sCatID")%>')">删除</a>
<%
Else
%>
<a href=# onclick="alertreadme('该分栏含有用户博客,必须先删除其下属分栏方能删除本分栏!','#')">删除</a>
<%
End If
%>
</td>
</tr>
<%
Rs.MoveNext
Loop
Rs.Close
Set Rs=Nothing
End If
%>
</table>
<%
End Sub
Sub Boke_KeyWord()
Dim Rs,Sql,i,TableClass,KeyWord
Dim CurrentPage,Page_Count,Pcount
Dim TotalRec,EndPage
Dim KeyID
CurrentPage=Request("page")
If CurrentPage="" Or Not IsNumeric(CurrentPage) Then
CurrentPage=1
Else
CurrentPage=Clng(CurrentPage)
If Err Then
CurrentPage=1
Err.Clear
End If
End If
KeyWord = Dvbbs.CheckStr(Request("KeyWord"))
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder">
<tr>
<th width="100%" colspan=4 height=25 align=left ID="TableTitleLink"> 博客系统关键字管理
</th>
</tr>
<FORM METHOD=POST ACTION="?s=6">
<tr>
<td class="td1" colspan=4 height=25>
<B>搜索</B>:<input type="text" value="<%=KeyWord%>" name="KeyWord">
<input type=submit name=submit value="查询" class="button">
可根据用户名、博客名、关键字、链接等模糊查询
</td>
</tr>
</FORM>
<%
If Request("Action")="Edit" Then
If Request("KeyID") = "" Or Not IsNumeric(Request("KeyID")) Then
Manage_Err "非法的关键字参数","4","?s=6"
Exit Sub
End If
Set Rs = DvBoke.Execute("Select * From Dv_Boke_KeyWord Where KeyID = " & Request("KeyID"))
If Rs.Eof And Rs.Bof Then
Manage_Err "非法的关键字参数","4","?s=6"
Rs.Close
Set Rs=Nothing
Exit Sub
End If
%>
<FORM METHOD=POST ACTION="?s=6&Action=SaveEdit">
<input type=hidden value="<%=Request("KeyID")%>" name="KeyID">
<tr align=center>
<td class="td2" height=24 colspan=6>
<B>编辑博客系统用户关键字</B>
</td>
</tr>
<tr>
<td class="td1" height=24 width="35%" align=right>
<B>关 键 字</B>:
</td>
<td class="td1" width="65%">
<input type="text" name="KeyWord" size="50" value="<%=Server.HtmlEncode(Rs("KeyWord"))%>">
</td>
</tr>
<tr>
<td class="td1" height=24 width="35%" align=right>
<B>替换文本</B>:
</td>
<td class="td1" width="65%">
<input type="text" name="nKeyWord" size="50" value="<%=Server.HtmlEncode(Rs("nKeyWord"))%>">
</td>
</tr>
<tr>
<td class="td1" height=24 width="35%" align=right>
<B>链接地址</B>:
</td>
<td class="td1" width="65%">
<input type="text" name="LinkUrl" size="50" value="<%=Server.HtmlEncode(Rs("LinkUrl")&"")%>">
</td>
</tr>
<tr>
<td class="td1" height=24 width="35%" align=right>
<B>链接标题</B>:
</td>
<td class="td1" width="65%">
<input type="text" name="LinkTitle" size="50" value="<%=Server.HtmlEncode(Rs("LinkTitle")&"")%>">
<input type=checkbox name="NewWindows" value="<%=Rs("NewWindows")%>" <%If Rs("NewWindows")=1 Then Response.Write "checked"%>>
新窗口打开
</td>
</tr>
<tr align=center>
<td class="td1" height=24 colspan=6>
<input type=submit name=submit value="编辑博客关键字" class="button">
</td>
</tr>
</FORM>
<%
ElseIf Request("Action")="SaveEdit" Then
Dim nKeyWord,LinkUrl,LinkTitle,NewWindows
KeyID = Request.Form("KeyID")
KeyWord = DvBoke.CheckStr(Request.Form("KeyWord"))
nKeyWord = DvBoke.CheckStr(Request.Form("nKeyWord"))
LinkUrl = DvBoke.CheckStr(Request.Form("LinkUrl"))
LinkTitle = DvBoke.CheckStr(Request.Form("LinkTitle"))
NewWindows = Request.Form("NewWindows")
If KeyID = "" Or Not IsNumeric(KeyID) Then KeyID = 0
KeyID = cCur(KeyID)
If NewWindows = "" Or Not IsNumeric(NewWindows) Then NewWindows = 0
NewWindows = Cint(NewWindows)
If KeyWord = "" Or nKeyWord = "" Then
Manage_Err "非法的关键字参数","4","?s=6"
Exit Sub
Else
KeyWord = Server.HtmlEncode(KeyWord)
nKeyWord = Server.HtmlEncode(nKeyWord)
End If
If LinkUrl <> "" Then LinkUrl = Server.HtmlEncode(Dv_FilterJS(LinkUrl))
If LinkTitle <> "" Then LinkTitle = Server.HtmlEncode(Dv_FilterJS(LinkTitle))
DvBoke.Execute("Update Dv_Boke_KeyWord Set KeyWord = '"&KeyWord&"',nKeyWord = '"&nKeyWord&"',LinkUrl = '"&LinkUrl&"',LinkTitle = '"&LinkTitle&"',NewWindows = "&NewWindows&" Where KeyID = " & KeyID)
Manage_Suc "您成功编辑了博客关键字","4","?s=6"
ElseIf Request("Action")="Del" Then
Dim iKeyID
KeyID = Request.Form("KeyID")
If KeyID = "" Then
Manage_Err "非法的关键字ID","4","?s=6"
Exit Sub
End If
iKeyID = Replace(Replace(KeyID,",","")," ","")
If Not IsNumeric(iKeyID) Then
Manage_Err "非法的关键字ID","4","?s=6"
Exit Sub
End If
DvBoke.Execute("Delete From Dv_Boke_KeyWord Where KeyID In ("&KeyID&")")
Manage_Suc "您成功删除了博客关键字","4","?s=6"
Else
%>
<tr align=center>
<td class="bodytitle" width="20%" height=24 align=left>
<B>用户</B>
</td>
<td class="bodytitle" width="40%" align=left>
<B>关键字</B>
</td>
<td class="bodytitle" width="30%" align=left>
<B>链接</B>
</td>
<td class="bodytitle" width="10%" align=left>
<B>操作</B>
</td>
</tr>
<FORM METHOD=POST ACTION="?s=6&Action=Del">
<%
If KeyWord <> "" Then
Sql = "Select k.*,u.UserName,u.BokeName From Dv_Boke_KeyWord k Inner Join Dv_Boke_User u On k.UserID=u.UserID Where u.UserName Like '%"&KeyWord&"%' Or u.BokeName Like '%"&KeyWord&"%' Or k.KeyWord Like '%"&KeyWord&"%' Or k.nKeyWord Like '%"&KeyWord&"%' Or k.LinkUrl Like '%"&KeyWord&"%' Or k.LinkTitle Like '%"&KeyWord&"%' Order By KeyID Desc"
Else
Sql = "Select k.*,u.UserName,u.BokeName From Dv_Boke_KeyWord k Inner Join Dv_Boke_User u On k.UserID=u.UserID Order By KeyID Desc"
End If
If Not IsObject(Boke_Conn) Then Boke_ConnectionDatabase
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open Sql,Boke_Conn,1,3
If Not (Rs.Eof And Rs.Bof) Then
Rs.PageSize = 30
Rs.AbsolutePage=CurrentPage
Page_Count=0
TotalRec=Rs.RecordCount
While (Not Rs.Eof) And (Not Page_Count = 30)
If TableClass = "td2" Then
TableClass="td1"
Else
TableClass="td2"
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -