使用自定义SQL标签,查询语句:
select ID,Tid,Title,Intro,Picurl,Slide from KS_Article where tid in('栏目ID1','栏目ID2') and verific=1 and Slide =1 order by ID desc
循环体:
<script type="text/javascript">
var swf_width={$Param(0)}
var swf_height={$Param(1)}
var swf_Str="/kscms/images/flash.swf"
var text_height={$Param(2)};
var aPic = new Array();
var aLink = new Array();
var aTitle = new Array();
var aText = new Array();
[loop=6]
aPic[aPic.length] = "{$Field(Picurl,Text,0,...,0,)}";
aLink[aLink.length] = "{$Field(ID,GetInfoUrl,1,1)}";
aTitle[aTitle.length] = "{$Field(Title,Text,0,...,0,)}";
aText[aText.length] = "{$Field(Intro,Text,20,...,0,)}";
[/loop]
var files = "",linkS="",textS="",i;
for(i=0;i<aPic.length;i++)
{
if(files=="")
{
files = aPic[i];
linkS = aLink[i];
textS = "<div style=\"margin-top:10px;\" align=\"center\"><a href=\""+aLink[i]+"\" target=\"_blank\" class=\"news_hd\">"+aTitle[i]+"</a></div><div class=\"flashlr\" style=\"padding:2px;\">"+aText[i]+"……[<a href=\""+aLink[i]+"\" target=\"_blank\" class=\"news_hd_qw\">全文</a>]</div>";
}
else
{
files = files+"|"+aPic[i];
linkS = linkS+"|"+aLink[i];
textS = textS+"|<div style=\"margin-top:10px\" align=\"center\" ><a href=\""+aLink[i]+"\" target=\"_blank\" class=\"news_hd\">"+aTitle[i]+"</a></div><div class=\"flashlr\" style=\"padding:2px;\"> "+aText[i]+"……[<a href=\""+aLink[i]+"\" target=\"_blank\" class=\"news_hd_qw\">全文</a>]</div>";
}
}
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="' + swf_Str +'"><param name="quality" value="high">');
document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&TitleBgPosition=1&Tween=1">');
document.write('<embed src="'+ swf_Str +'" wmode="opaque" FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
</SCRIPT>
前提是你的SWF文件调用数据方法一置。或者用你的源码替换循环体的内容,再插入相关的查询值。