该改进适合天天疲于奔命在各频道间查看是否有待审文章和待审评论的用户。
假如只有几个或10来个频道还问题不大,几十上百个频道的网站估计在频道间走一遍就得烦死!
现提供解决办法:
<%
dim MDB_Article_ADO,MDB_Article_LinkStr,MDB_Channel_ADO,MDB_Channel_LinkStr,MDB_Comment_ADO,MDB_Comment_LinkStr,MDB_User_ADO,MDB_User_LinkStr
dim vChannelID_1,vChannelID_2,a1,a2,vNoApproveUser,vTestUser
dim vArticleID,vChannelID,vChannelIDAry(50),vChannelName(50),vCommentCount(50),x,y
set MDB_Article_ADO = Server.CreateObject("ADODB.Recordset")
MDB_Article_LinkStr = "select * from PE_Article where status=0 order by ChannelID"
MDB_Article_ADO.open MDB_Article_LinkStr,Conn,1,1
a1 = 0
a2 = 0
vChannelID_1 = 0
vChannelID_2 = 0
if MDB_Article_ADO.recordcount > 0 then
%>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td <td class="topbg" align="center"><span class="Glow">各 频 道 未 审 文 章 篇 数</span></td>
<td </tr>
<tr>
<td <td>
<%
do while not MDB_Article_ADO.eof
vChannelID_1 = MDB_Article_ADO("ChannelID")
if vChannelID_1 <> vChannelID_2 then
if vChannelID_2 <> 0 then
response.write "<span style='color:#ff0000'>" & a1 & "</span>] "
end if
set MDB_Channel_ADO = Server.CreateObject("ADODB.Recordset")
MDB_Channel_LinkStr = "select * from PE_Channel where ChannelID=" & vChannelID_1
MDB_Channel_ADO.open MDB_Channel_LinkStr,Conn,1,1
response.write "<a href='Admin_Article.asp?ChannelID=" & vChannelID_1 & "&Action=Manage&ManageType=&ClassID=0&SpecialID=0&Field=&keyword='>" & MDB_Channel_ADO("ChannelName") & "</a>["
MDB_Channel_ADO.close
set MDB_Channel_ADO=nothing
a1 = 1
vChannelID_2 = vChannelID_1
else
a1 = a1 1
end if
MDB_Article_ADO.movenext
loop
if vChannelID_2 <> 0 then
response.write "<span style='color:#ff0000'>" & a1 & "</span>] "
end if
%>
</td>
<td </tr>
</table>
<%
end if
MDB_Article_ADO.close
set MDB_Article_ADO=nothing
%>
<%
Set MDB_Comment_ADO = Server.CreateObject("ADODB.Recordset")
MDB_Comment_LinkStr = "select * from PE_Comment where passed=False order by InfoID"
MDB_Comment_ADO.open MDB_Comment_LinkStr,Conn,1,1
vCommentCount(0) = 0
vChannelIDAry(0) = 0
vChannelName(0) = ""
x = 0
y = 0
do while not MDB_Comment_ADO.eof
vArticleID = MDB_Comment_ADO("InfoID")
Set MDB_Article_ADO=Server.CreateObject("ADODB.Recordset")
MDB_Article_LinkStr="select * from PE_Article where ArticleID="& vArticleID &""
MDB_Article_ADO.open MDB_Article_LinkStr,Conn,1,1
vChannelID=MDB_Article_ADO("ChannelID")
MDB_Article_ADO.close
新闻热点
疑难解答
图片精选