从6.0到sp2一直有一个bug,就是发布的文章在没有审核的情况下在某些标签的文章列表中也会显示出来,看了一下源文件,一般显示出未审核文章的标签都是那些没有设定模型的标签,此时他调用文章是在Item_Info表中调用的,而相关的sql语句中没有添加,已审核和未放入回收站的条件。
代码如下:
Sub LoadSQLParam()
Dim DocProperty
If ClassID = "-1" Then ClassID = FCls.RefreshFolderID
If LabelFunName="GetRelativeList" Then
If ModelID<>"0" Then
Param = " Inner Join KS_ItemInfoR R On I.ID=R.RelativeID Where I.Verific=1 And I.DelTF=0 And R.InfoID=" & FCls.RefreshInfoID & " And R.RelativeChannelID=" & ModelID
Else
Param = " Inner Join KS_ItemInfoR R On I.InfoID=R.RelativeID Where I.Verific=1 And I.DelTF=0 And R.InfoID=" & FCls.RefreshInfoID
End If
Else
If ModelID<>"0" Then
Param = " Where I.Verific=1 And I.DelTF=0"
Else
'Param = " Inner Join KS_Channel C On I.ChannelID=C.ChannelID Where C.ChannelStatus=1" 这是官方的代码
Param = " Inner Join KS_Channel C On I.ChannelID=C.ChannelID Where C.ChannelStatus=1 And I.Verific=1 And I.DelTF=0" '这是修改后的代码
End If
End If
If ClassID = "" Then ClassID = "0"
If ClassID <> "0" Then
If Instr(ClassID,",")<>0 Then
Param= Param & " And I.Tid in('" & Replace(ClassID,",","','")& "')"
ElseIf CBool(IncludeSubClass) = True Then
Param= Param & " And I.Tid In (" & KS.GetFolderTid(ClassID) & ")"
Else
Param= Param & " And I.Tid='" & ClassID & "'"
End If
End If
DocProperty = ParamNode.getAttribute("docproperty") : If KS.IsNul(DocProperty) Then DocProperty="00000"
If Mid(DocProperty,1,1)=1 Then Param = Param & " And I.Recommend=1"
If Mid(DocProperty,2,1)=1 Then Param = Param & " And I.Rolls=1"
If Mid(DocProperty,3,1)=1 Then Param = Param & " And I.Strip=1"
If Mid(DocProperty,4,1)=1 Then Param = Param & " And I.Popular=1"
If Mid(DocProperty,5,1)=1 Then Param = Param & " And I.Slide=1"
Param = Param & KS.GetSpecialPara(ModelID,SpecialID)
End Sub
另外检查了一下数据的Item_Info表发现有些彻底删除文章在Item_Info中还有记录,看来6.0以来添加了Item_Info表在调用文章时除去了模型的限制,但是一些相关细节还没有处理好,希望在下个补丁中能改进。