从SP1开始就存在的问题:子栏目新闻列表,使用导航图片时,只有第一个子栏目正确,其他的都无法显示;研究发现并非仅仅导航图片存在这样的问题,还有新闻分割图片,新闻间距,栏目间距等等都存在类似问题。初步断定为变量定义及赋值的位置不对,使得部分代码在循环内自我复制导致错误。现提供我的修改方法,供大家参考:
文件:Admin/Refresh/Refreshfunction.asp
位置:ChildClassList函数 和 GetOneClassNewsList函数
function ChildClassList(ClassNumberStr,NewsNumberStr,CompatPicStr,NaviPicStr,ClassRowHeightStr,NewsRowHeightStr,ClassRowNumberStr,NewsRowNumberStr,DateRuleStr,DateRightStr,TitleNumberStr,MoreLinkTypeStr,MoreLinkContentStr,ClassBGPicStr,CSSStyleStr,OpenTypeStr,DateCSSStyleStr,TxtNaviStr)
dim TempRowNumberStr ' 新增变量
If TitleNumberStr <> "" then
TitleNumberStr = Cint(TitleNumberStr)
Else
TitleNumberStr = 10
End If
'这个地方昨天晚上忘了标出来了,所以导致导航图片无法显示,不好意思:>
if TxtNaviStr <> "" then
NaviPicStr = TxtNaviStr
else
if NaviPicStr <> "" then NaviPicStr = "<img src=""" & NaviPicStr & """>"
end if
if RefreshType = "Class" then
Dim ClassSql,RsClassObj,AllChildClassID,i
AllChildClassID = ChildClassIDList(RefreshID)
if AllChildClassID <> "" then
if Left(AllChildClassID,1) = "," then
AllChildClassID = Right(AllChildClassID,Len(AllChildClassID)-1)
end if
else
ChildClassList = ""
Exit function
end if
if ClassBGPicStr <> "" then
ClassBGPicStr = "<tr>" & Chr(13) & Chr(10) & "<td Height=1 colspan=""" & ClassRowNumberStr & """>" & Chr(13) & Chr(10) & "<table width=""100%"" cellpadding=""0"" cellspacing=""0"">" & Chr(13) & Chr(10) & "<tr>" & Chr(13) & Chr(10) & "<td Height=1 background=""" & ClassBGPicStr & """>" & Chr(13) & Chr(10) & "</td>" & Chr(13) & Chr(10) & "</tr>" & Chr(13) & Chr(10) & "</table>" & Chr(13) & Chr(10) & "</td>" & Chr(13) & Chr(10) & "</tr>"
end if
ClassSql = "Select Top " & ClassNumberStr & " * from NewsClass where ClassID in (" & AllChildClassID & ") and DelFlag=0 order by ID desc"
Set RsClassObj = Conn.Execute(ClassSql)
if Not RsClassObj.Eof then
'======== 新增代码=======
if DateRuleStr <> "" then
if DateRightStr = "Left" then
新闻热点
疑难解答