在網站首頁假如想實現單獨某個頻道的統計,可以參照下面代碼對文章頻道進行的統計,不同頻道只要修改查詢的語句里的"ChannelName="值,以及代碼里的相關文字即可
<%@language=vbscript codepage=936 %>
<!--#include file="../conn.asp"-->
<!--#include file="../Inc/function.asp"-->
<%
'=======================
'動易插件之“首頁文章統計調用”
'適用范圍:動易2005/2006各版本
'調用方式:將本文件放到JS根目錄,在模板任何位置加上:<script language="javascript" src="{$InstallDir}JS/ArticalCount.asp"></script>
'=======================
Dim RS,SQL
Set RS=Server.CreateObject("ADODB.RecordSet")
Sql="Select * from PE_Channel where ChannelName='文章'"
rs.open sql,conn
if rs.eof then response.end
rs.movefirst%>
var S;
s='文章總數:<%=RS("ItemCount")%> 篇<br>待審文章:<%=(RS("ItemCount")-RS("ItemChecked"))%>篇<br>評論總數:<%=RS("CommentCount")%>條<br>專題總數:<%=RS("SpecialCount")%>個<br>文章閱讀:<%=RS("HitsCount")%>人次<br>';
document.write(s)
<%
RS.Close
Set RS=Nothing
conn.Close
Set conn=Nothing
%>
-----------------感謝 海浪 提供----------------------
|
新聞熱點
疑難解答
圖片精選