PHPCMS V9二次开发实现首页flash版幻灯片

发布时间:2020-02-12编辑:脚本学堂
PHPCMS V9二次开发实现首页flash版幻灯片

首先,来看下flash版幻灯片的效果图,如下所示:
img1

实现以上功能的代码:

复制代码 代码如下:

<script type="text/javascript">
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="6"}
var swf_width=300;
var swf_height=200;
var config='3|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000';
//-- config 参数设置 -- 自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字颜色|当前按键颜色|普通按键色彩 --
var files='{php $num = 1}
{loop $data $n $r}
{$r[thumb]}
{if $num%6!=0}|{/if}
{php $num++}
{/loop}';
var links='{php $num2 = 1}
{loop $data $n $v}
{urlencode($v[url])}
{if $num2%6!=0}|{/if}
{php $num2++}
{/loop}';
var texts='{php $num3 = 1}
{loop $data $n $k}
{$k[title]}
{if $num3%6!=0}|{/if}
{php $num3++}
{/loop}';
{/pc}
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="{IMG_PATH}focus.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="menu" value="false" />');
document.write('<param name=wmode value="opaque" />');
document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
document.write('<embed src="{IMG_PATH}focus.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+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>

注意:调用时只需修改flash的文件路径(两处),还有图片的大小、调用数量即可。