<li class="mutualityurl"><a href="<#article/mutuality/url#>.html"><#article/mutuality/name#></a> (<#article/mutuality/posttime#>)</li>
2.b_article-single.html增加如下内容,具体位置自己选
<ul class="msg trackback">
<li class="tbname">相关文章</li>
<#template:article_mutuality#>
</ul>
3.CSS样式增加一个,具体根据自己喜好修改,内容如下
li.mutualityurl{
text-align:left;
padding:3px 10px 0px 10px;
margin:0;
background:#F6F4EE;
line-height:150%;
}
4.c_system_base.asp的Function LoadGlobeCache()部分,原来的几处27改为28,增加
aryFileName(28)="/TEMPLATE/b_article_mutuality.html"
aryFileName_Variable(28)="TEMPLATE_ARTICLE_mutuality"
5.c_system_lib.asp
Class TArticle增加一行
Public Template_Article_Mutuality
Public Function Export(intType)增加两行,注意Call Export_Mutuality一定要放在Call Export_Tag的前面,否则会出错。
Call Export_Mutuality
Template_Article_Single=Replace(Template_Article_Single,"<#template:article_mutuality#>",Template_Article_Mutuality)
以下部分找个地方放下就可以了
'相关文章的生成
Function Export_Mutuality()
Call CheckParameter(ID,"int",0)
If (ID=0) Then Del=False:Exit Function
If Tag<>"" Then
Dim strCC_Count,strCC_ID,strCC_Name,strCC_Url,strCC_PostTime,strCC_Title
Dim strCC
Dim i
Dim j
Dim objTNode
Dim objCNode
Dim objSingleNode
Dim objNodeText
Dim objMutArticle
Dim objRS
Dim strSQL
Set objRS=Server.CreateObject("ADODB.Recordset")
strSQL="SELECT top 30 [log_ID],[log_Tag],[log_CateID],[log_Title],[log_Level],[log_AuthorID],[log_PostTime],[log_Url] FROM [blog_Article] WHERE ([log_Level]>2) AND [log_ID]<>"& ID &" "
Dim aryTAGs
If InStr(Tag,"}{") > 0 Then
aryTAGs = Split(Tag,"}{")
Else
ReDim aryTAGs(0)
aryTAGs(0) = Tag
End If
strSQL = strSQL & " AND ("
For j = 0 To UBound(aryTAGs)
If Not (IsNull(aryTAGs(j)) Or IsEmpty(aryTAGs(j)) Or aryTAGs(j) = "" Or Len(aryTAGs(j)) < 1) Then
aryTAGs(j) = Replace(Replace(aryTAGs(j),"}",""),"{","")
If IsNumeric(aryTAGs(j)) Then
If j > 0 Then strSQL = strSQL & " OR "
strSQL = strSQL & "([log_Tag] Like '%{"&aryTAGs(j)&"}%')"
End If
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 30 '相关文章数目,可自行设定
strCC_Count=strCC_Count+1
strCC_ID=objRS("log_ID")
strCC_Url=objRS("log_Url")
strCC_PostTime=objRS("log_PostTime")
strCC_Title=objRS("log_Title")
Application.Lock
strCC=Application(ZC_BLOG_CLSID & "TEMPLATE_ARTICLE_Mutuality")
Application.UnLock
If IsNull(strCC_Url) Or IsEmpty(strCC_Url) Or strCC_Url="" Then
strCC_Url=strCC_ID
end if
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)
Template_Article_Mutuality=Template_Article_Mutuality & strCC
objRS.MoveNext
If objRS.eof Then Exit For
Next
End if
objRS.Close()
Set objRS=Nothing
End If
Export_Mutuality=True
End Function