📄 bokeadmin.asp
字号:
End If
DvBoke.Execute("update Dv_Boke_System set S_LastPostTime='"&S_LastPostTime&"',S_TopicNum="&S_TopicNum&",S_PhotoNum="&S_PhotoNum&",S_FavNum="&S_FavNum&",S_TodayNum="&S_TodayNum&",S_PostNum="&S_PostNum)
SucMsg = "<li>博客系统总信息: :文章共"&S_TopicNum&"篇,相册共"&S_PhotoNum&"篇,收藏共"&S_FavNum&"篇,评论共"&S_PostNum&"篇,今日发表共"&S_TodayNum&"篇,最后更新时间:"&S_LastPostTime&"</li>"
DvBoke.LoadSetup(1)
Dv_suc(SucMsg)
End Sub
Sub Boke_Update_UserInfo()
Dim BokeUserCount,Rs,i
BokeUserCount = DvBoke.Execute("Select Count(*) From [Dv_Boke_User]")(0)
If BokeUserCount = "" Or IsNull(BokeUserCount) Then Exit Sub
%>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tableBorder" align=center>
<tr><td colspan=2 class=td1>
下面开始更新论坛用户资料,预计本次共有<%=BokeUserCount%>个用户需要更新
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td bgcolor=000000>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor=ffffff height=9><img src="skins/default/bar/bar3.gif" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>
</td></tr></table> <span id=txt2 name=txt2 style="font-size:9pt">0</span><span style="font-size:9pt">%</span></td></tr>
</table>
<%
Dim uTopicNum,uFavNum,uPostNum,uTodayNum,uPhotoNum,uXmlData,DayStr,SucMsg,iBokeCat
Dim Node,XmlDoc,NodeList,ChildNode,BokeBody
Dim tRs,Sql
Dim DvCode
Set DvCode = New DvBoke_UbbCode
If Dv_Boke_DataBase = 1 Then
DayStr = "d"
Else
DayStr = "'d'"
End If
i = 0
Set Rs = DvBoke.Execute("Select UserID,BokeName,XmlData From [Dv_Boke_User]")
Do While Not Rs.Eof
i = i + 1
uTopicNum = DvBoke.Execute("Select Count(*) From Dv_Boke_Topic Where sType=0 And UserID = " & Rs(0))(0)
uFavNum = DvBoke.Execute("Select Count(*) From Dv_Boke_Topic Where sType=1 And UserID = " & Rs(0))(0)
uPhotoNum = DvBoke.Execute("Select Count(*) From Dv_Boke_Topic Where sType=4 And UserID = " & Rs(0))(0)
uTodayNum = DvBoke.Execute("Select Count(*) From Dv_Boke_Post Where BokeUserID = " & Rs(0) & " And DateDiff("&DayStr&",JoinTime,"&bSqlNowString&") = 0")(0)
uPostNum = DvBoke.Execute("Select Count(*) From Dv_Boke_Post Where ParentID>0 And BokeUserID = " & Rs(0))(0)
'目前仅更新首页主题列表数据
Set iBokeCat = Server.CreateObject("Msxml2.FreeThreadedDOMDocument")
If Rs(2)="" Or IsNull(Rs(2)) Then
iBokeCat.Load(Server.MapPath(DvBoke.Cache_Path &"usercat.config"))
Else
If Not iBokeCat.LoadXml(Rs(2)) Then
iBokeCat.Load(Server.MapPath(DvBoke.Cache_Path &"usercat.config"))
End If
End If
Set Node = iBokeCat.selectNodes("xml/boketopic")
If Not (Node Is Nothing) Then
For Each NodeList in Node
iBokeCat.DocumentElement.RemoveChild(NodeList)
Next
End If
Set Node=iBokeCat.createNode(1,"boketopic","")
Set XmlDoc=Server.CreateObject("Msxml2.FreeThreadedDOMDocument")
If Not IsNumeric(DvBoke.BokeSetting(6)) Then DvBoke.BokeSetting(6) = "10"
Sql = "Select Top "&DvBoke.BokeSetting(6)&" TopicID,CatID,sCatID,UserID,UserName,Title,TitleNote,PostTime,Child,Hits,IsView,IsLock,sType,LastPostTime,IsBest,S_Key,Weather From [Dv_Boke_Topic] Where UserID="&Rs(0)&" and sType <>2 order by PostTime desc"
Set tRs = DvBoke.Execute(LCase(Sql))
If Not tRs.Eof Then
tRs.Save XmlDoc,1
XmlDoc.documentElement.RemoveChild(XmlDoc.documentElement.selectSingleNode("s:Schema"))
Set ChildNode = XmlDoc.documentElement.selectNodes("rs:data/z:row")
For Each NodeList in ChildNode
If tRs("TitleNote")="" Or IsNull(tRs("TitleNote")) Then
BokeBody = DvBoke.Execute("Select Content From Dv_Boke_Post Where ParentID=0 and Rootid="&tRs(0))(0)
If Len(BokeBody) > 250 Then
BokeBody = SplitLines(BokeBody,DvBoke.BokeSetting(2))
End If
Else
BokeBody = tRs("TitleNote")
End If
BokeBody = DvCode.UbbCode(BokeBody) & "...<br/>[<a href=""boke.asp?"&Rs(1)&".showtopic."&tRs("TopicID")&".html"">阅读全文</a>]"
NodeList.attributes.getNamedItem("titlenote").text = BokeBody
NodeList.attributes.getNamedItem("posttime").text = tRs("PostTime")
NodeList.attributes.getNamedItem("lastposttime").text = tRs("LastPostTime")
tRs.MoveNext
Next
Set ChildNode=XmlDoc.documentElement.selectSingleNode("rs:data")
Node.appendChild(ChildNode)
End If
tRs.Close
Set tRs = Nothing
iBokeCat.documentElement.appendChild(Node)
'End
DvBoke.Execute("Update Dv_Boke_User set XmlData = '"&Replace(iBokeCat.documentElement.xml,"'","''")&"',TopicNum="&uTopicNum&",FavNum="&uFavNum&",PhotoNum="&uPhotoNum&",TodayNum="&uTodayNum&",PostNum="&uPostNum&" where UserID="&Rs(0))
Response.Write "<script>img2.width=" & Fix((i/BokeUserCount) * 400) & ";" & VbCrLf
Response.Write "txt2.innerHTML=""更新完"&Rs(1)&"的数据,正在更新下一个用户数据," & FormatNumber(i/BokeUserCount*100,4,-1) & """;" & VbCrLf
Response.Write "img2.title=""" & Rs(1) & "(" & i & ")"";</script>" & VbCrLf
Response.Flush
Rs.MoveNext
Loop
Rs.Close
Set Rs=Nothing
Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"
SucMsg = "<li>更新所有用户数据成功!</li>"
Dv_suc(SucMsg)
End Sub
Sub Boke_SysNews()
Dim Bodystr,Bodystr1,Node,Node1,createCDATASection
Set Node = DvBoke.SystemDoc.documentElement.selectSingleNode("/bokesystem/topnews")
If Node Is Nothing Then
Set Node = DvBoke.SystemDoc.createNode(1,"topnews","")
DvBoke.SystemDoc.documentElement.appendChild(Node)
End If
Bodystr = Node.text
Set Node1 = DvBoke.SystemDoc.documentElement.selectSingleNode("/bokesystem/managenews")
If Node1 Is Nothing Then
Set Node1 = DvBoke.SystemDoc.createNode(1,"managenews","")
DvBoke.SystemDoc.documentElement.appendChild(Node1)
End If
Bodystr1 = Node1.text
'Response.Write Bodystr1
%>
<table width="100%" border="0" cellspacing="1" cellpadding="5" align="center" class="tableBorder">
<tr>
<th width="100%" colspan="2" height="25" align="left" ID="TableTitleLink">
首页公告信息
</th>
</tr>
<%
If Request.Form("act") = "save" Then
Node.text = Request.Form("boketopnews")
DvBoke.SaveSystemCache()
Manage_Suc "您成功编辑了博客首页公告信息","2","?s=4"
ElseIf Request.Form("act") = "save1" Then
Node1.text = Request.Form("bokemanagenews")
DvBoke.SaveSystemCache()
Manage_Suc "您成功编辑了个人博客管理首页系统通知信息","2","?s=4"
Else
%>
<form method="post" action="?s=4">
<tr>
<td class="td2" width="20%">
编辑信息内容:
</td>
<td class="td2"width="80%">
<input type="hidden" name="act" value="save">
<textarea name="boketopnews" rows="0" cols="0" style="display:none;"><%=Server.Htmlencode(Bodystr)%></textarea>
<iframe id="EditFrame" src="boke/edit_plus/FCKeditor/editor/fckeditor.html?InstanceName=boketopnews&Toolbar=Default" width="100%" height="200" frameborder="no" scrolling="no"></iframe>
<input type="submit" value="提交更改" class="button">
</td>
</tr>
</form>
<tr>
<td width="100%" class="td1" colspan="2" height="25" align="left">
</td>
</tr>
<tr>
<th width="100%" colspan="2" height="25" align="left" ID="TableTitleLink">
个人博客管理首页系统通知
</th>
</tr>
<form method="post" action="?s=4">
<tr>
<td class="td2" width="20%">
编辑信息内容:
</td>
<td class="td2"width="80%">
<input type="hidden" name="act" value="save1">
<textarea name="bokemanagenews" rows="0" cols="0" style="display:none;"><%=Server.Htmlencode(Bodystr1)%></textarea>
<iframe id="EditFrame" src="boke/edit_plus/FCKeditor/editor/fckeditor.html?InstanceName=bokemanagenews&Toolbar=Default" width="100%" height="200" frameborder="no" scrolling="no"></iframe>
<input type="submit" value="提交更改" class="button">
</td>
</tr>
</form>
<%
End If
%>
</table>
<%
End Sub
Sub Boke_Skins()
Dim Rs,Sql
Dim S_ID,S_Name,S_Builder,S_Path,S_ViewPic,S_Info
S_ID = 0
If Request("act")="save" Then
S_ID = DvBoke.CheckNumeric(Request.Form("S_ID"))
If Request.Form("S_Name") = "" or Len(Request.Form("S_Name"))>50 Then
ErrMsg = "模板名称不能为空或超出50个字符!"
Dvbbs_error()
Exit Sub
End If
If Request.Form("S_Path")="" or Len(Request.Form("S_Path"))>150 Then
ErrMsg = "模板路径不能为空或超出150个字符!"
Dvbbs_error()
Exit Sub
End If
If Len(Request.Form("S_Info"))>250 Then
ErrMsg = "模板信息及说明不能超出250个字符!"
Dvbbs_error()
Exit Sub
End If
Sql = "Select S_ID,S_SkinName,S_Path,S_ViewPic,S_Info,S_Builder From Dv_Boke_Skins where S_ID="&S_ID
If Not IsObject(Boke_Conn) Then Boke_ConnectionDatabase
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open Sql,Boke_Conn,1,3
If Rs.Eof and Rs.Bof Then
Rs.AddNew
End If
Rs("S_SkinName") = Request.Form("S_Name")
Rs("S_Path") = Request.Form("S_Path")
Rs("S_ViewPic") = Request.Form("S_ViewPic")
Rs("S_Info") = Request.Form("S_Info")
Rs("S_Builder") = Request.Form("S_Builder")
Rs.Update
Rs.Close
Set Rs = Nothing
Dv_suc("模板数据保存成功")
Exit Sub
ElseIf Request("act") = "edit" Then
S_ID = DvBoke.CheckNumeric(Request("S_ID"))
If S_ID>0 Then
Sql = "Select S_ID,S_SkinName,S_Path,S_ViewPic,S_Info,S_Builder From Dv_Boke_Skins where S_ID="&S_ID
Set Rs = DvBoke.Execute(Sql)
If Not Rs.Eof Then
S_ID = Rs(0)
S_Name = Rs(1)
S_Builder = Rs(5)
S_Path = Rs(2)
S_ViewPic = Rs(3)
S_Info = Rs(4)&""
End If
Rs.Close
Set Rs = Nothing
End If
ElseIf Request("act") = "addsys" Then
S_ID = DvBoke.CheckNumeric(Request("S_ID"))
If S_ID>0 Then
Sql = "Select S_ID,S_SkinName From Dv_Boke_Skins where S_ID="&S_ID
Set Rs = DvBoke.Execute(Sql)
If Not Rs.Eof Then
S_Name = Rs(1)
DvBoke.Execute("Update Dv_Boke_System Set SkinID = "&S_ID)
DvBoke.LoadSetup(1)
Dv_suc("已将模板["& S_Name &"]设为系统默认模板!")
End If
Rs.Close
Set Rs = Nothing
Exit Sub
End If
ElseIf Request("act")="del" Then
Dim NewS_ID
S_ID = DvBoke.CheckNumeric(Request("S_ID"))
If S_ID>0 Then
If Clng(DvBoke.System_Node.getAttribute("skinid")) = S_ID Then
ErrMsg = "不能删除系统默认模板,请重新选取!"
Dvbbs_error()
Exit Sub
End If
Sql = "Select S_ID,S_SkinName From Dv_Boke_Skins where S_ID="&S_ID
Set Rs = DvBoke.Execute(Sql)
If Not Rs.Eof Then
S_Name = Rs(1)
NewS_ID = DvBoke.Execute("Select Top 1 S_ID From Dv_Boke_Skins Order by S_ID")(0)
If NewS_ID>0 Then
DvBoke.Execute("Update Dv_Boke_User Set SkinID = "&NewS_ID&" where SkinID="&S_ID)
DvBoke.Execute("Delete from Dv_Boke_Skins where S_ID="&S_ID)
Dv_suc("模板["& S_Name &"]删除成功!")
Else
ErrMsg = "请添加可用模板后再进行删除操作!"
Dvbbs_error()
End If
Else
ErrMsg = "模板的不存在,删除失败!"
Dvbbs_error()
End If
Rs.Close
Set Rs = Nothing
Else
ErrMsg = "模板的参数错误,删除失败!"
Dvbbs_error()
End If
Exit Sub
End If
%>
<table width="100%" border="0" cellspacing="1" cellpadding="5" align="center" class="tableBorder">
<tr>
<th width="100%" colspan="2" height="25" align="left" ID="TableTitleLink">
模板信息管理
</th>
</tr>
<form method="post" action="?s=7&act=save">
<tr>
<td class="td2" width="20%">模板名称</td>
<td class="td2"width="80%">
<input type="text" name="S_Name" value="<%=S_Name%>">
</td>
</tr>
<tr>
<td class="td2">提供者</td>
<td class="td2">
<input type="text" name="S_Builder" value="<%=S_Builder%>">
</td>
</tr>
<tr>
<td class="td2">模板路径</td>
<td class="td2">
<input type="text" name="S_Path" size="50" value="<%=S_Path%>">
</td>
</tr>
<tr>
<td class="td2">演示图片</td>
<td class="td2">
<input type="text" name="S_ViewPic" size="50" value="<%=S_ViewPic%>">
</td>
</tr>
<tr>
<td class="td2">信息及说明</td>
<td class="td2">
<textarea name="S_Info" rows="5" cols="50"><%=Server.Htmlencode(S_Info)%></textarea>
</td>
</tr>
<tr>
<td class="td2" colspan="2" align="center">
<input type="hidden" name="S_ID" value="<%=S_ID%>">
<input type="submit" value="保存" class="button">
</td>
</tr>
</form>
</table>
<br/>
<table width="100%" border="0" cellspacing="1" cellpadding="5" align="center" class="tableBorder">
<tr>
<th width="100%" colspan="5" height="25" align="left" ID="TableTitleLink">
模板信息列表
</th>
</tr>
<tr>
<td class="bodytitle" height="24" width="15%">
演示
</td>
<td class="bodytitle" height="24" width="20%">
名称/ 路径
</td>
<td class="bodytitle" height="24" width="15%">
提供者
</td>
<td class="bodytitle" height="24" width="30%">
信息及说明
</td>
<td class="bodytitle" height="24" width="20%">
操作
</td>
</tr>
<%
Dim CurrentPage,Page_Count,Pcount,i
Dim TotalRec,EndPage
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
Sql = "Select S_ID,S_SkinName,S_Path,S_ViewPic,S_Info,S_Builder From Dv_Boke_Skins order by S_id Desc"
If Not IsObject(Boke_Conn) Then Boke_ConnectionDatabase
Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open Sql,Boke_Conn,1,1
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)
%>
<tr>
<td class="td1">
<%
If Rs(3)<>"" Then
Response.Write "<img src=""../"&Rs(3)&""" border=""1"" width=""80"" height=""60"">"
Else
Response.Write "<img src=""../boke/images/viewskins_bck.png"" border=""1"" width=""80"" height=""60"">"
End If
%>
</td>
<td class="td1">
<b><%=Rs(1)%></b>
<br/><u><%=Rs(2)%></u>
</td>
<td class="td2">
<%=Rs(5)%>
</td>
<td class="td1">
<%=Rs(4)%>
</td>
<td class="td2">
<a href="?s=7&act=edit&s_id=<%=Rs(0)%>">编辑</a> | <a href="?s=7&act=del&s_id=<%=Rs(0)%>">删除</a>
|
<%If Clng(DvBoke.System_Node.getAttribute("skinid")) = Rs(0) Then%>
<font color="red">系统默认</font>
<%Else%>
<a href="?s=7&act=addsys&s_id=<%=Rs(0)%>">设为默认</a>
<%End If%>
</td>
</tr>
<%
Page_Count = Page_Count + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -