-_- 晕~"其本人在此"...还是不幸给你点到名了~
加评论链接的代码在此:- '*********************************************************
- ' 目的:优化Feed
- '*********************************************************
- Function getRelateList(intID,strTag,strTitle,strURL)
- If (intID=0) Then Exit Function
- If strTag<>"" Then
- Dim strCC_Count,strCC_ID,strCC_Name,strCC_Url,strCC_PostTime,strCC_Title
- Dim strCC
- Dim i
- Dim j
- Dim objRS
- Dim strSQL
- Dim strOutput
- strOutput=""
- Set objRS=Server.CreateObject("ADODB.Recordset")
- strSQL="SELECT top 10 [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Intro],[log_Level],[log_AuthorID],[log_PostTime],[log_Url] FROM [blog_Article] WHERE ([log_Level]>2) AND [log_ID]<>"& intID &" "
- strSQL = strSQL & " AND ("
- Dim aryTAGs
- strTag=Replace(strTag,"}","")
- aryTAGs=Split(strTag,"{")
- For j = LBound(aryTAGs) To UBound(aryTAGs)
- If aryTAGs(j)<>"" Then
- strSQL = strSQL & "([log_Tag] Like '%{"&aryTAGs(j)&"}%')"
- If j=UBound(aryTAGs) Then Exit For
- If aryTAGs(j)<>"" Then strSQL = strSQL & " OR "
- End If
- Next
- strSQL = strSQL & ")"
- strSQL = strSQL + " ORDER BY [log_PostTime] DESC "
- Set objRS=Server.CreateObject("ADODB.Recordset")
- objRS.CursorType = adOpenKeyset
- objRS.LockType = adLockReadOnly
- objRS.ActiveConnection=objConn
- objRS.Source=strSQL
- objRS.Open()
- If (Not objRS.bof) And (Not objRS.eof) Then
-
- For i=1 To 5 '相关文章数目,可自行设定
- Dim objArticle
- Set objArticle=New TArticle
- If objArticle.LoadInfoByArray(Array(objRS("log_ID"),objRS("log_Tag"),objRS("log_CateID"),objRS("log_Title"),"","",objRS("log_Level"),objRS("log_AuthorID"),objRS("log_PostTime"),"","","",objRS("log_Url"),"")) Then
- strCC_Count=strCC_Count+1
- strCC_ID=objArticle.ID
- strCC_Url=objArticle.Url
- strCC_PostTime=objArticle.PostTime
- strCC_Title=objArticle.Title
- Application.Lock
- strCC=Application(ZC_BLOG_CLSID & "TEMPLATE_B_ARTICLE_Mutuality")
- Application.UnLock
- strCC=Replace(strCC,"<#article/mutuality/id#>",strCC_ID)
- strCC=Replace(strCC,"<#article/mutuality/url#>",strCC_Url)
- strCC=Replace(strCC,"<#article/mutuality/posttime#>",strCC_PostTime)
- strCC=Replace(strCC,"<#article/mutuality/name#>",strCC_Title)
- strOutput=strOutput & strCC
-
- end if
- Set objArticle=nothing
- objRS.MoveNext
- If objRS.eof Then Exit For
- Next
- End if
- objRS.Close()
- Set objRS=Nothing
- End If
- strOutput=Replace(strOutput,vbCrlf,"")
- getRelateList= "<br/><br/><br/><a href="""+strURL+"#comment"" target=""_blank"">《"+strTitle+"》这篇文章挺有意思的,我也想来评论两句</a>"
- IF strOutput<>"" then
- getRelateList= getRelateList+"<br/>----<br/>相关文章:<ul>" + strOutput + "</ul> "
- end if
- End Function
复制代码 打开c_system_event.asp文件
找到Function ExportRSS函数
(摘要输出)把原有objArticle.HtmlIntro改为
objArticle.HtmlIntro+getRelateList(objArticle.ID,objArticle.Tag,objArticle.Title,objArticle.URL)
(全文输出)把原有objArticle.HtmlContent改为
objArticle.HtmlContent+getRelateList(objArticle.ID,objArticle.Tag,objArticle.Title,objArticle.URL)
还有哦,我觉得把这种BETTER FEED叫做插件不太好,应该叫做源码修改.~
[ 本帖最后由 Zx.MYS 于 2007-3-10 00:20 编辑 ] |