siteweaver 6.8 相关文章增加图片显示的解决办法:
打开siteweaver6.8根目录下的Inclube/PowerEasy.Article.asp,将相关文章的代码替换成下面的
'=================================================
'函数名:GetCorrelative
'作 用:显示相关文章
'参 数:ArticleNum ----最多显示多少篇文章
' TitleLen ----标题最多字符数,一个汉字=两个英文字符
' OrderType ---- 排序方式,1--按文章ID降序,2--按文章ID升序,3--按更新时间降序,4--按更新时间升序,5--按点击数降序,6--按点击数升序,7--按评论数降序,8--按评论数升序
' OpenType ---- 文章打开方式,0为在原窗口打开,1为在新窗口打开
' Cols ---- 每行的列数。超过此列数就换行。
'=================================================
Private Function GetCorrelative(iChannelID, arrClassID, MaxNum, ArticleNum, TitleLen, OrderType, OpenType, Cols, ShowClassName)
Dim rsCorrelative, sqlCorrelative, strCorrelative, iCols, iTemp, DefaultPicUrl
Dim rsCorrelatives, sqlCorrelatives, strCorrelatives,ChannelUrls,UploadDirs,GetArticleUrls
Dim strKey, arrKey, i
iChannelID = Replace(iChannelID,"|",",")
Select Case iChannelID
Case "ChannelID"
iChannelID = ChannelID
Case else
If IsValidID(iChannelID) = False Then
iChannelID = 0
End If
End Select
arrClassID = Replace(arrClassID,"|",",")
If IsValidID(arrClassID) = False Then
arrClassID = 0
End If
MaxNum = PE_Clng(MaxNum)
iTemp = 1
If PE_CLng(Cols) <> 0 Then
iCols = PE_CLng(Cols)
Else
iCols = 1
End If
If ArticleNum > 0 And ArticleNum <= 100 Then
sqlCorrelative = "select top " & ArticleNum
Else
sqlCorrelative = "Select Top 5 "
End If
strKey = Mid(rsArticle("Keyword"), 2, Len(rsArticle("Keyword")) - 2)
If InStr(strKey, "|") > 1 Then
arrKey = Split(strKey, "|")
If MaxNum > UBound(arrKey) Then
MaxNum = UBound(arrKey)
End IF
If MaxNum > 4 Then MaxNum = 4
strKey = "((A.Keyword like '%|" & Replace(Replace(arrKey(0), "[", ""), "]", "") & "|%')"
For i = 1 To MaxNum
strKey = strKey & " or (A.Keyword like '%|" & Replace(Replace(arrKey(i), "[", ""), "]", "") & "|%')"
Next
strKey = strKey & ")"
Else
strKey = "(A.Keyword like '%|" & strKey & "|%')"
End If
sqlCorrelative = sqlCorrelative & " A.ArticleID,A.Title,A.Author,A.UpdateTime,A.Hits,A.InfoPurview,A.InfoPoint,A.DefaultPicUrl,C.ClassID,C.ClassName,C.ParentDir,C.ClassDir,C.ClassPurview from PE_Article A left join PE_Class C on A.ClassID=C.ClassID where 1=1"
If InStr(iChannelID, ",") > 0 Then
sqlCorrelative = sqlCorrelative & " and A.ChannelID in (" & FilterArrNull(iChannelID, ",") & ")"
Else
If PE_CLng(iChannelID) > 0 Then sqlCorrelative = sqlCorrelative & " and A.ChannelID=" & PE_CLng(iChannelID)
End If
If arrClassID <> "0" Then
If InStr(arrClassID, ",") > 0 Then
sqlCorrelative = sqlCorrelative & " and A.ClassID in (" & FilterArrNull(arrClassID, ",") & ")"
Else
If PE_CLng(arrClassID) > 0 Then sqlCorrelative = sqlCorrelative & " and A.ClassID=" & PE_CLng(arrClassID)
End If
End If
sqlCorrelative = sqlCorrelative & " and A.Deleted=" & PE_False & " and A.Status=3 and A.ReceiveType=0"
sqlCorrelative = sqlCorrelative & " and " & strKey & " and A.ArticleID<>" & ArticleID & " Order by "
Select Case PE_CLng(OrderType)
Case 1
sqlCorrelative = sqlCorrelative & "A.ArticleID desc"
Case 2
sqlCorrelative = sqlCorrelative & "A.ArticleID asc"
Case 3
sqlCorrelative = sqlCorrelative & "A.UpdateTime desc"
Case 4
sqlCorrelative = sqlCorrelative & "A.UpdateTime asc"
Case 5
sqlCorrelative = sqlCorrelative & "A.Hits desc"
Case 6
sqlCorrelative = sqlCorrelative & "A.Hits asc"
Case 7
sqlCorrelative = sqlCorrelative & "A.CommentCount desc"
Case 8
sqlCorrelative = sqlCorrelative & "A.CommentCount asc"
Case Else
sqlCorrelative = sqlCorrelative & "A.ArticleID desc"
End Select
sqlCorrelatives = "select * from PE_Channel where ChannelID="& iChannelID
Set rsCorrelatives = Conn.Execute(sqlCorrelatives)
ChannelUrls=rsCorrelatives("ChannelDir")
UploadDirs=rsCorrelatives("UploadDir")
Set rsCorrelative = Conn.Execute(sqlCorrelative)
If TitleLen < 0 Or TitleLen > 255 Then TitleLen = 50
If rsCorrelative.BOF And rsCorrelative.EOF Then
strCorrelative = R_XmlText_Class("ShowArticle/NoCorrelative", "没有相关{$ChannelShortName}")
Else
Do While Not rsCorrelative.EOF
strCorrelative =strCorrelative&"<li>"'商智网络去掉br使用li样式
If PE_CBool(ShowClassName) = True Then
strCorrelative = strCorrelative & GetInfoList_GetStrClassLink(Character_Class,"", rsCorrelative("ClassID"), rsCorrelative("ClassName"), GetClassUrl(rsCorrelative("ParentDir"), rsCorrelative("ClassDir"), rsCorrelative("ClassID"), rsCorrelative("ClassPurview")))
End If
DefaultPicUrl = ChannelUrl & "/" & UploadDir & "/" & rsCorrelative("DefaultPicUrl")
strCorrelative = strCorrelative & "<a href='" & GetArticleUrl(rsCorrelative("ParentDir"), rsCorrelative("ClassDir"), rsCorrelative("UpdateTime"), rsCorrelative("ArticleID"), rsCorrelative("ClassPurview"), rsCorrelative("InfoPurview"), rsCorrelative("InfoPoint")) & "'>"
strCorrelative = strCorrelative & "<img src="& DefaultPicUrl &" border='0' />"
strCorrelative = strCorrelative & "</a>"
strCorrelative = strCorrelative & "<a href='" & GetArticleUrl(rsCorrelative("ParentDir"), rsCorrelative("ClassDir"), rsCorrelative("UpdateTime"), rsCorrelative("ArticleID"), rsCorrelative("ClassPurview"), rsCorrelative("InfoPurview"), rsCorrelative("InfoPoint")) & "'"
strCorrelative = strCorrelative & " title='" & Replace(Replace(Replace(Replace(strList_Title, "{$Title}", rsCorrelative("Title")), "{$Author}", rsCorrelative("Author")), "{$UpdateTime}", rsCorrelative("UpdateTime")), "{$br}", vbCrLf)
If OpenType = 0 Then
strCorrelative = strCorrelative & "' target=""_self"">"
Else
strCorrelative = strCorrelative & "' target=""_blank"">"
End If
strCorrelative = strCorrelative & GetSubStr(rsCorrelative("Title"), TitleLen, ShowSuspensionPoints) & "</a>"
If (iTemp Mod iCols) = 0 Then
'strCorrelative = strCorrelative & "<br>" '商智网络去掉br使用li样式
Else
'strCorrelative = strCorrelative & " " '商智网络去掉br使用li样式
End If
strCorrelative =strCorrelative&"</li>" '商智网络去掉br使用li样式
rsCorrelative.MoveNext
iTemp = iTemp + 1
Loop
End If
rsCorrelative.Close
Set rsCorrelative = Nothing
GetCorrelative = strCorrelative
End Function
相关文章
GODADDY空间动易6.8生成静态页百度收录乱码的解决方法2012-10-08
godaddy安装动易 SiteWeaver CMS6.8教程2012-10-08
siteweaver 自定义文章列表字体颜色的设置方法2012-02-24
动易siteweaver验证码修改为4位的方法2012-02-16
siteweaver 栏目地址不显示扩展名2012-02-01
频道一级栏目导航的函数标签-动易siteweaver2010-11-07
SiteWeaver 6.8 UTF-8版2010-08-03
动易SiteWeaver去除首页和频道扩展名的方法2010-06-07
动易sitewear频道自定义字段首页不能调用的解决方法2010-01-30
动易单页栏目插件、栏目导航标签,可识别内外部连接和单页栏目2009-07-15