复制这部分函数代码出来看看是不是这里有多什么呢??我看不懂,,
以下代码在KS5.0的 KS_Cls\Kesion.Label.FunctionCls.asp里324到412行
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'函数名:KS_Rolls
'作 用: 通用连续图片滚动函数
'参 数: ChannelID模块ID,SqlStr 待查询的SQL语句等
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function KS_Rolls(LabelID,ChannelID,SqlStr,M_Dir, M_Width, M_Height, OpenType, ShowTitle, Width, Height, M_Speed, T_Len, T_Css, BorderType, Border)
Dim ImgStr, TempPicStr, T_CssStr,Title, TempTitleStr, O_T_S,Url
Dim SQL,K,RS:Set RS=Conn.Execute(SqlStr)
If RS.EOF Then KS_Rolls="":RS.Close:Set RS=Nothing:Exit Function
SQL=RS.GetRows(-1):RS.Close:Set RS = Nothing
T_CssStr = KS.GetCss(T_Css):O_T_S = KS.G_O_T_S(OpenType)
If LCase(M_Dir) = "left" Or LCase(M_Dir) = "right" Then
ImgStr = "<table width=""100%"" height=""100%"" border=""0"">" & vbCrLf
ImgStr = ImgStr & "<tr>" & vbCrLf
For K=0 To Ubound(SQL,2)
Title = SQL(1,K)
TempPicStr=GetPicUrl(SQL(7,K))
Url=KS.GetInfoUrl(ChannelID,SQL(2,K),SQL(0,K),SQL(5,K),SQL(3,K),SQL(4,K),SQL(6,K))
'-------------------------给图片加边框开始-------------------------------------------------
Dim TempBorder
If BorderType = 1 And Border <> "" Then
TempBorder = TempPicStr '得到原图片
TempPicStr = Border '将原图片设定为透明边框
Else
TempBorder = Border:TempPicStr = TempPicStr
End If
Dim LinkAndPicStr: LinkAndPicStr = "<a href=""" & Url & """" & O_T_S & " title=""" & Title & """><Img Src=""" & TempPicStr & """ border=""0"" width=""" & Width & """ height=""" & Height & """ align=""absmiddle""/></a>"
TempPicStr = KS.GetPhotoBorder(LinkAndPicStr, BorderType, TempBorder)
'-----------------------给图片加边框结束--------------------------------------------------
TempTitleStr = "<a" & T_CssStr & " href=""" & Url & """" & O_T_S & " title=""" & Title & """>" & KS.GotTopic(Title, T_Len) & "</a>"
ImgStr = ImgStr & "<td>" & vbCrLf
ImgStr = ImgStr & "<table boder=""0"" width=""100%"" height=""100%"">" & vbCrLf
ImgStr = ImgStr & "<tr><td align=""center"">" & TempPicStr & "</td></tr>" & vbCrLf
If Cbool(ShowTitle) = True Then
ImgStr = ImgStr & "<tr><td align=""center"">" & TempTitleStr & " </td></tr>" & vbCrLf
End If
ImgStr = ImgStr & "</table>" & vbCrLf
ImgStr = ImgStr & "</td>" & vbCrLf
Next
ImgStr = ImgStr & "</tr></table>" & vbCrLf
Else
ImgStr = "<table width=""100%"" height=""100%"" border=""0"">" & vbCrLf
For K=0 To Ubound(SQL,2)
Title = SQL(1,K)
TempPicStr=GetPicUrl(SQL(7,K))
Url=KS.GetInfoUrl(ChannelID,SQL(2,K),SQL(0,K),SQL(5,K),SQL(3,K),SQL(4,K),SQL(6,K))
'-------------------------给图片加边框开始-------------------------------------------------
If BorderType = 1 And Border <> "" Then
TempBorder = TempPicStr '得到原图片
TempPicStr = Border '将原图片设定为透明边框
Else
TempBorder = Border
TempPicStr = TempPicStr
End If
LinkAndPicStr = "<a href=""" & URL & """" & O_T_S & " title=""" & Title & """><Img Src=""" & TempPicStr & """ border=""0"" width=""" & Width & """ height=""" & Height & """ align=""absmiddle""/></a>"
TempPicStr = KS.GetPhotoBorder(LinkAndPicStr, BorderType, TempBorder)
'-----------------------给图片加边框结束--------------------------------------------------
TempTitleStr = "<a" & T_CssStr & " href=""" & URL & """" & O_T_S & " title=""" & Title & """>" & KS.GotTopic(Title, T_Len) & "</a>"
ImgStr = ImgStr & "<tr><td>" & vbCrLf
ImgStr = ImgStr & "<table boder=""0"" width=""100%"" height=""100%"">" & vbCrLf
ImgStr = ImgStr & "<tr><td align=""center"">" & TempPicStr & "</td></tr>" & vbCrLf
If Cbool(ShowTitle) = True Then ImgStr = ImgStr & "<tr><td align=""center"">" & TempTitleStr & " </td></tr>" & vbCrLf
ImgStr = ImgStr & "</table>" & vbCrLf
ImgStr = ImgStr & "</td></tr>" & vbCrLf
Next
ImgStr = ImgStr & "</table>" & vbCrLf
End If
KS_Rolls=LFCls.GetConfigFromXML("Label","/labeltemplate/label","roll"&M_Dir)
KS_Rolls=Replace(Replace(Replace(Replace(Replace(KS_Rolls,"{$Width}",M_Width),"{$Height}",M_Height),"{$ImgStr}",ImgStr),"{$Speed}",M_Speed),"{$LabelID}",LabelID)
End Function
'取得连续滚动图片
Function GetRolls(ChannelID,FolderID, I_S_C, M_Dir, SqlSort, M_Width, M_Height, OpenType, ShowTitle, Width, Height, M_Speed, Num, T_Len, T_Css, BorderType, Border,SpecialID,LabelID)
Dim SqlStr,Param
If FolderID = "-1" Then FolderID = FCls.RefreshFolderID
If FolderID = "" Or FolderID = "0" Then Param="" Else If CBool(I_S_C) = True Then Param="Tid In (" & KS.GetFolderTid(FolderID) & ") And" Else Param="Tid='" & FolderID & "' And"
Select Case KS.C_S(ChannelID,6)
Case 1:SqlStr = "SELECT top " & Num & " ID,Title,Tid,ReadPoint,InfoPurview,Fname,Changes,PicUrl FROM " & KS.C_S(ChannelID,2) &" Where " & Param & " Rolls=1 And PicNews=1 AND Verific=1 AND DelTF=0 And " & KS.GetSpecialPara(SpecialID)& " order by IsTop Desc," & SqlSort
Case 2:SqlStr = "SELECT top " & Num & " ID,Title,Tid,ReadPoint,InfoPurview,Fname,0,PhotoUrl FROM " & KS.C_S(ChannelID,2) &" Where " & Param & " Rolls=1 AND Verific=1 AND DelTF=0 And " & KS.GetSpecialPara(SpecialID) & " order by " & SqlSort
Case 3:SqlStr = "SELECT top " & Num & " ID,Title,Tid,ReadPoint,InfoPurview,Fname,0,PhotoUrl FROM " & KS.C_S(ChannelID,2) &" Where " & Param & " Rolls=1 AND Verific=1 AND DelTF=0 And " & KS.GetSpecialPara(SpecialID) & " order by " & SqlSort
Case 4:SqlStr = "SELECT top " & Num & " ID,Title,Tid,ReadPoint,InfoPurview,Fname,0,PhotoUrl FROM KS_Flash Where " & Param & " Rolls=1 AND Verific=1 AND DelTF=0 And " & KS.GetSpecialPara(SpecialID)& " order by " & SqlSort
Case 5:SqlStr = "SELECT top " & Num & " ID,Title,Tid,0,0,Fname,0,PhotoUrl FROM KS_Product Where " & Param & " Rolls=1 AND Verific=1 AND DelTF=0 And " & KS.GetSpecialPara(SpecialID)& " order by " & SqlSort
Case 7:SqlStr = "SELECT top " & Num & " ID,Title,Tid,ReadPoint,InfoPurview,Fname,0,PhotoUrl FROM KS_Movie Where " & Param & " Rolls=1 AND Verific=1 AND DelTF=0 And " & KS.GetSpecialPara(SpecialID)& " order by " & SqlSort
End Select
GetRolls=KS_Rolls(LabelID,ChannelID,SqlStr,M_Dir, M_Width, M_Height, OpenType, ShowTitle, Width, Height, M_Speed, T_Len, T_Css, BorderType, Border)
End Function