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

📄 bokeadmin.asp

📁 公司企业网站管理系统全站源码,用于企业内部对网站的管理
💻 ASP
📖 第 1 页 / 共 5 页
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/Dv_Clsmain.asp"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="boke/config.asp"-->
<!--#include file="boke/checkinput.asp"-->
<%
Dim ErrMsg
If not Dvbbs.master or  Instr(","&session("flag")&",",",38,")=0 Then Response.Redirect "index.asp"
'Set MyBoardOnline=new Cls_UserOnlne 
'Dvbbs.GetForum_Setting
'Dvbbs.CheckUserLogin
'Response.Write "test"
'DvBoke.Execute("update Dv_Boke_user set SysCatID=1 where SysCatID=0")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=keywords content="动网先锋,动网论坛,dvbbs,博客,blog,boke">
<title>动网博客系统管理页面</title>
<link rel="stylesheet" type="text/css" href="<%=Dvbbs.CacheData(33,0)%>skins/css/main.css" />

<SCRIPT LANGUAGE="JavaScript">
<!--
function alertreadme(str,url){
{if(confirm(str)){
location.href=url;
return true;
}return false;}
}
//-->
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0"  align=center class="tableBorder">
<tr> 
<th width="100%" colspan=2 height=25>动网博客系统管理
</th>
</tr>
<tr>
<td class="td1" colspan=2>
<p><B>注意</B>:
<BR>① 删除博客系统栏目或话题前请先将其中文章、评论和用户转移到其他栏目或分栏中,不需要的文章或评论可在信息管理中批量删除
<BR>② 删除用户博客栏目前请先将其中文章和评论转移到该用户的其它栏目后再执行删除操作
</td>
</tr>
<tr>
<td class="td2" height=25>
<B>管理操作选项</B></td>
<td class="td2"><a href="?s=8">设置</a> | 
<a href="?s=1&t=1">栏目</a> | <a href="?s=1&t=2">话题</a> | <a href="?s=2">用户管理</a> | <a href="?s=3">用户栏目</a> | <a href="?s=4">公告管理</a> | <a href="?s=5">上传管理</a> | <a href="?s=6">关键字</a> | <a href="?s=7">模板</a> | <a href="?s=9">数据更新</a>
</td>
</tr>
</table>
<p></p>
<%
Select Case Request("s")
Case "1"
	Boke_SysCat()
Case "2"
	Boke_User()
Case "3"
	Boke_UserCat()
Case "4"
	Boke_SysNews()
Case "5"
	Boke_UploadFile()
Case "6"
	Boke_KeyWord()
Case "7"
	Boke_Skins()
Case "8"
	Boke_Setting()
Case "9"
	Boke_Update()
Case Else
	Boke_Setting()
End Select

Sub Boke_UploadFile()
	Dim FID,Sql,Rs
	If Request.QueryString("act")="del" Then
		Dim FileSize,SpaceSize,objFSO,FilePath,ViewPath
		FID = DvBoke.CheckNumeric(Request("fid"))
		If FID = 0 Then
			ErrMsg = "文件参数错误,请重新选取正确的文件再进行操作!"
			Dvbbs_error()
			Exit Sub
		End If
		Set Rs = DvBoke.Execute("Select ID,BokeUserID,UserID,UserName,CatID,sType,TopicID,PostID,IsTopic,Title,FileName,sFileName,FileType,FileSize,FileNote,DownNum,ViewNum,DateAndTime,PreviewImage,IsLock From Dv_Boke_Upfile where id="&FID)
		If Not Rs.Eof THen
			FileSize = Formatnumber((Rs("FileSize")/1024)/1024,2)
			ViewPath = Rs("PreviewImage")
			FilePath = Rs("FileName")
			If Not FilePath = "" Then
				FilePath = DvBoke.System_UpSetting(19)&FilePath
			End If
			SpaceSize = DvBoke.Execute("Select SpaceSize From Dv_Boke_User where UserID="&Rs("BokeUserID"))(0)
			If SpaceSize>0 Then
				SpaceSize = SpaceSize - FileSize
				If SpaceSize<0 Then SpaceSize = 0
				DvBoke.Execute("Update Dv_Boke_User set SpaceSize = "&SpaceSize&" where UserID="&Rs("BokeUserID"))
			End If
			DvBoke.Execute("delete from Dv_Boke_Upfile where id="&FID)
			Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
			If ViewPath<>"" Then
				If objFSO.FileExists(Server.MapPath(ViewPath)) Then
					objFSO.DeleteFile(Server.MapPath(ViewPath))
				End If
			End If
			If objFSO.FileExists(Server.MapPath(FilePath)) Then
				objFSO.DeleteFile(Server.MapPath(FilePath))
			End If
			Set objFSO = Nothing
		End If
		Dv_suc("文件已成功删除!")
		Exit Sub
	End If
%>
	<table width="100%" border="0" cellspacing="1" cellpadding="5"  align="center" class="tableBorder">
	<tr> 
	<th width="100%" height="25" align="left" ID="TableTitleLink">
	博客上传文件管理
	</th>
	</tr>
	<tr><td class="td1">说明:
	<ul>
	<li><font color="red">未知</font>文件:是指作者上传后未发表或未使用的文件。</li>
	</ul></td></tr>
	</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="35%">
	名称/ 路径
	</td>
	<td class="bodytitle" height="24" width="15%">
	作者
	</td>
	<td class="bodytitle" height="24" width="15%">
	上传时间
	</td>
	<td class="bodytitle" height="24" width="20%">
	操作
	</td>
	</tr>
<%
	
	Dim CurrentPage,Page_Count,Pcount,i
	Dim TotalRec,EndPage
	Dim ViewFile
	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
	'ID=0 ,BokeUserID=1 ,UserID=2 ,UserName=3 ,CatID=4 ,sType=5 ,TopicID=6 ,PostID=7 ,IsTopic=8 ,Title=9 ,FileName=10 ,sFileName=11 ,FileType=12 ,FileSize=13 ,FileNote=14 ,DownNum=15 ,ViewNum=16 ,DateAndTime=17 ,PreviewImage=18 ,IsLock=19
	Sql = "Select ID,BokeUserID,UserID,UserName,CatID,sType,TopicID,PostID,IsTopic,Title,FileName,sFileName,FileType,FileSize,FileNote,DownNum,ViewNum,DateAndTime,PreviewImage,IsLock From Dv_Boke_Upfile order by 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)
		ViewFile = Rs(18)
		If ViewFile = "" Then
			ViewFile = DvBoke.System_UpSetting(19) & Rs(10)
		End If
%>
<tr>
<td class="td1">
<%
If Rs(12)=1 Then
	'修改图片路径为非父路径 2005-10-6 Dv.Yz
	Response.Write "<a href="""&DvBoke.System_UpSetting(19)&Rs(10)&""" target=""_blank""><img src="""&ViewFile&""" border=""1"" width=""80"" height=""60""></a>"
Else
	Response.Write "其它"
End If
%>
</td>
<td class="td1">
《<b><%=Rs(9)%></b>》
<br/><u><%=Rs(10)%></u>
</td>
<td class="td2">
<%=Rs(3)%>
</td>
<td class="td1">
<%=Rs(17)%>
</td>
<td class="td2">
<%If Rs(19)=4 Then%>
<font color="red">未知</font>
<%Else%>
<a href="Userid_<%=Rs(1)%>.showtopic.<%=Rs(6)%>.html" target="_blank">查看</a>
<%End If%>
| <a href="?s=5&act=del&fid=<%=Rs(0)%>">删除</a>
</td>
</tr>
<%
			Page_Count = Page_Count + 1
		Rs.MoveNext
		Wend
		Pcount=Rs.PageCount
%>
<tr><td colspan=5 class=td1>共有<%=TotalRec%>条记录,分页:
<%
	Dim Searchstr
	Searchstr = "?s=5"
	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_Update()
	If Request.QueryString("t")<>"" Then
		Select Case Request.QueryString("t")
			Case "1"
				Boke_Update_Users()
			Case "2"
				Boke_Update_SysCats()
			Case "3"
				Boke_Update_ChatCats()
			Case "4"
				Boke_Update_System()
			Case "5"
				Boke_Update_UserInfo()
		End Select
		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>
	<tr>
	<td class="td2" colspan="2">
	说明:
	</td>
	</tr>
	<tr>
	<td width="10%" class="td2">
	<input type="button" name="act" value="博客用户统计" class="button" onclick="location.href='?s=9&t=1'"/>
	</td>
	<td align="left" width="90%" class="td1">重新统计当前博客用户总数</td>
	</tr>
	<tr>
	<td width="10%" class="td2">
	<input type="button" name="act" value="博客索引数据统计" class="button" onclick="location.href='?s=9&t=2'"/>
	</td>
	<td align="left" width="90%" class="td1">重新统计当前博客索引用户数,帖子数信息</td>
	</tr>
	<tr>
	<td width="10%" class="td2">
	<input type="button" name="act" value="博客话题数据统计" class="button" onclick="location.href='?s=9&t=3'"/>
	</td>
	<td align="left" width="90%" class="td1">重新统计当前博客话题帖子数信息</td>
	</tr>
	<tr>
	<td width="10%" class="td2">
	<input type="button" name="act" value="博客总数据统计" class="button" onclick="location.href='?s=9&t=4'"/>
	</td>
	<td align="left" width="90%" class="td1">重新统计当前博客帖子数信息</td>
	</tr>
	<tr>
	<td width="10%" class="td2">
	<input type="button" name="act" value="博客用户数据总更新" class="button" onclick="location.href='?s=9&t=5'"/>
	</td>
	<td align="left" width="90%" class="td1">更新所有博客用户的相关数据,包括文章数、评论数以及博客用户首页缓存数据等</td>
	</tr>
	</table>
<%

End Sub

Sub Boke_Update_Users()
	Dim AllUsers
	AllUsers = DvBoke.Execute("Select Count(*) From Dv_Boke_User")(0)
	DvBoke.Execute("update Dv_Boke_System set S_UserNum = "&AllUsers)
	DvBoke.LoadSetup(1)
	Dv_suc("博客用户统计完成,当前共有"&AllUsers&"位博客用户!")
End Sub

Sub Boke_Update_SysCats()
	Dim SucMsg,Rs
	Dim uCatNum,TopicNum,PostNum,TodayNum,LastUpTime
	Dim Nodes,ChildNode
	Set Nodes = DvBoke.SysCat.selectNodes("rs:data/z:row")
	If Nodes.Length>0 Then
		For Each ChildNode in Nodes
			uCatNum = DvBoke.Execute("Select Count(*) From Dv_Boke_User where SysCatID="&ChildNode.getAttribute("scatid"))(0)
			TopicNum= DvBoke.Execute("Select Sum(TopicNum) From Dv_Boke_User where SysCatID="&ChildNode.getAttribute("scatid"))(0)
			PostNum= DvBoke.Execute("Select Sum(PostNum) From Dv_Boke_User where SysCatID="&ChildNode.getAttribute("scatid"))(0)
			TodayNum= DvBoke.Execute("Select Sum(TodayNum) From Dv_Boke_User where SysCatID="&ChildNode.getAttribute("scatid"))(0)
			Set Rs = DvBoke.Execute("Select top 1 LastUpTime From Dv_Boke_User where SysCatID="&ChildNode.getAttribute("scatid")&" order by LastUpTime desc")
			If Rs.Eof Then
				LastUpTime = Now()
			Else
				LastUpTime = Rs(0)
			End If
			Rs.Close
			If IsNull(TopicNum) Then
				TopicNum = 0
			End If
			If IsNull(PostNum) Then
				PostNum = 0
			End If
			If IsNull(TodayNum) Then
				TodayNum = 0
			End If
			DvBoke.Execute("update Dv_Boke_SysCat set uCatNum="&uCatNum&",TopicNum="&TopicNum&",PostNum="&PostNum&",TodayNum="&TodayNum&",LastUpTime='"&LastUpTime&"' where sCatID="&ChildNode.getAttribute("scatid"))
			SucMsg = SucMsg &"<li>"&ChildNode.getAttribute("scattitle")&" :共有"&uCatNum&"用户,"&TopicNum&"篇文章,"&PostNum&"篇评论,今日发表共"&TodayNum&"篇,最后更新时间:"&LastUpTime&"</li>"
		Next
	End If
	DvBoke.LoadSetup(1)
	Dv_suc(SucMsg)
End Sub

Sub Boke_Update_ChatCats()
	Dim SucMsg,Rs,DayStr
	Dim TopicNum,PostNum,TodayNum,LastUpTime
	Dim Nodes,ChildNode
	If Dv_Boke_DataBase = 1 Then
		DayStr = "d"
	Else
		DayStr = "'d'"
	End If
	Set Nodes = DvBoke.SysChatCat.selectNodes("rs:data/z:row")
	If Nodes.Length>0 Then
		For Each ChildNode in Nodes
			TopicNum= DvBoke.Execute("Select Count(TopicID) From Dv_Boke_Topic where sCatID="&ChildNode.getAttribute("scatid"))(0)
			PostNum= DvBoke.Execute("Select Count(PostID) From Dv_Boke_Post where ParentID>0 and  sCatID="&ChildNode.getAttribute("scatid"))(0)
			TodayNum= DvBoke.Execute("Select Count(PostID) From Dv_Boke_Post where sCatID="&ChildNode.getAttribute("scatid")&" and DateDiff("&DayStr&",JoinTime,"&bSqlNowString&") = 0")(0)

			Set Rs = DvBoke.Execute("Select top 1 JoinTime From Dv_Boke_Post where sCatID="&ChildNode.getAttribute("scatid")&" order by JoinTime desc")
			If Rs.Eof Then
				LastUpTime = Now()
			Else
				LastUpTime = Rs(0)
			End If
			Rs.Close

			DvBoke.Execute("update Dv_Boke_SysCat set  TopicNum="&TopicNum&",PostNum="&PostNum&",TodayNum="&TodayNum&",LastUpTime='"&LastUpTime&"' where sCatID="&ChildNode.getAttribute("scatid"))
			SucMsg = SucMsg &"<li>"&ChildNode.getAttribute("scattitle")&" :"&TopicNum&"篇文章,"&PostNum&"篇评论,今日发表共"&TodayNum&"篇,最后更新时间:"&LastUpTime&"</li>"
		Next
	End If
	DvBoke.LoadSetup(1)
	Dv_suc(SucMsg)
End Sub

Sub Boke_Update_System()
	Dim SucMsg,Rs,DayStr
	Dim S_LastPostTime,S_TopicNum,S_PhotoNum,S_FavNum,S_TodayNum,S_PostNum
	If Dv_Boke_DataBase = 1 Then
		DayStr = "d"
	Else
		DayStr = "'d'"
	End If
	S_TopicNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Topic] Where sType=0")(0)
	S_PhotoNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Topic] Where sType=4")(0)
	S_FavNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Topic] Where sType=1")(0)
	S_PostNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Post] Where ParentID>0")(0)
	S_TodayNum = DvBoke.Execute("Select Count(*) From [Dv_Boke_Post] Where DateDiff("&DayStr&",JoinTime,"&bSqlNowString&") = 0")(0)
	Set Rs = DvBoke.Execute("Select Top 1 JoinTime From [Dv_Boke_Post] order by JoinTime desc")
	If Rs.Eof Then
		S_LastPostTime = Now()
	Else
		S_LastPostTime = Rs(0)

⌨️ 快捷键说明

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