本帖最后由 dinglinbo 于 2010-3-8 20:28 编辑
光有变量没用的,需要写参数,给你发个FLASH幻灯的调用办法
<script language='javascript'>
linkarr = new Array();
picarr = new Array();
textarr = new Array();
var swf_width=300;
var swf_height=225;
var files = "";
var links = "";
var texts = "";
//这里设置调用标记
<!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/1,1/cachetime/900/subjectlen/28/showdetail/1/showcategory/1/cachename/tuwenpingce/tpl/data"}-->
<!--{loop $_SBLOCK['tuwenpingce'] $value}-->
linkarr[1] = "$value[url]";
picarr[1] = "$value[a_thumbpath]";
textarr[1] = "$value[subject]";
<!--{/loop}-->
<!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/2,1/cachetime/900/subjectlen/28/showdetail/1/showcategory/1/cachename/tuwenpingce/tpl/data"}-->
<!--{loop $_SBLOCK['tuwenpingce'] $value}-->
linkarr[2] = "$value[url]";
picarr[2] = "$value[a_thumbpath]";
textarr[2] = "$value[subject]";
<!--{/loop}-->
<!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/3,1/cachetime/900/subjectlen/28/showdetail/1/showcategory/1/cachename/tuwenpingce/tpl/data"}-->
<!--{loop $_SBLOCK['tuwenpingce'] $value}-->
linkarr[3] = "$value[url]";
picarr[3] = "$value[a_thumbpath]";
textarr[3] = "$value[subject]";
<!--{/loop}-->
<!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/4,1/cachetime/900/subjectlen/28/showdetail/1/showcategory/1/cachename/tuwenpingce/tpl/data"}-->
<!--{loop $_SBLOCK['tuwenpingce'] $value}-->
linkarr[4] = "$value[url]";
picarr[4] = "$value[a_thumbpath]";
textarr[4] = "$value[subject]";
<!--{/loop}-->
<!--{block name="spacenews" parameter="haveattach/2/order/i.dateline DESC/limit/5,1/cachetime/900/subjectlen/28/showdetail/1/showcategory/1/cachename/tuwenpingce/tpl/data"}-->
<!--{loop $_SBLOCK['tuwenpingce'] $value}-->
linkarr[5] = "$value[url]";
picarr[5] = "$value[a_thumbpath]";
textarr[5] = "$value[subject]";
<!--{/loop}-->
for(i=1;i<picarr.length;i++){
if(files=="") files = picarr;
else files += "|"+picarr;
}
for(i=1;i<linkarr.length;i++){
if(links=="") links = linkarr;
else links += "|"+linkarr;
}
for(i=1;i<textarr.length;i++){
if(texts=="") texts = textarr;
else texts += "|"+textarr;
}
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="{S_URL}/templates/$_SCONFIG[template]/images/FLASH名称"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'">');
document.write('<embed src="{S_URL}/templates/$_SCONFIG[template]/images/FLASH名称" 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>
根据上面这个分析一下作为参考之用吧。 |