织梦(dedecms)仿站课程第二十讲—dede幻灯片制作
织梦(dedecms)仿站教程第二十讲—dede幻灯片制作这一讲说说封面页的右侧,右侧最上面是幻灯片代码,在讲首页
织梦(dedecms)仿站教程第二十讲—dede幻灯片制作
这一讲说说封面页的右侧,右侧最上面是幻灯片代码,在讲首页制作时,讲过幻灯片代码,我们这里简要说说。我们直接将拳击在线封面里的幻灯片代码:
- <SCRIPT type=text/javascript>
- <!--
- var interval_time=3;
- var focus_width=288;
- var focus_height=220;
- var text_height=19;
- var text_align="center";
- var swf_height = focus_height+text_height;
- var swfpath="/e/data/images/pixviewer.swf";
- var swfpatha="/e/data/images/pixviewer.swf";
- var pics="%2Fd%2Ffile%2Fnews%2F1%2F732488265adfe6d9153f489f7550e2dc.jpg%7C%2Fd%2Ffile%2Fnews%2F1%2Fe02812004247d409b9ed1716b8169f5e.jpg%7C%2Fd%2Ffile%2Fnews%2F1%2Fsmall0a72185ad918b79b8177baff67a7d8f51309318211.jpg";
- var links="%2Fnews%2F1%2F6095.html%7C%2Fnews%2F1%2F6093.html%7C%2Fnews%2F1%2F6004.html";
- var texts="可汗5回合KO朱达获得胜利(附视频)|小克里琴科点数战胜海耶 统一四大拳击组织(|梅威瑟VS奥提兹纽约召开新闻发布会";
- document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
- document.write('<param name="movie" value="'+swfpath+'"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');
- document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
- document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&text_align='+text_align+'&interval_time='+interval_time+'">');
- document.write('<embed src="'+swfpath+'" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'&text_align='+text_align+'&interval_time='+interval_time+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
- document.write('</object>');
- //-->
- </SCRIPT>
替换成织梦封面里的幻灯片代码:
- <script language='javascript'>
- linkarr = new Array();
- picarr = new Array();
- textarr = new Array();
- var swf_width=280;
- var swf_height=192;
- var files = "";
- var links = "";
- var texts = "";
- //这里设置调用标记
- {dede:arclistflag='f' row='5'}
- linkarr[[field:global.autoindex/]] = "[field:arcurl/]";
- picarr[[field:global.autoindex/]] = "[field:litpic/]";
- textarr[[field:global.autoindex/]] = "[field:title function='html2text(@me)'/]";
- {/dede:arclist}
- for(i=1;i<picarr.length;i++){
- if(files=="") files = picarr[i];
- else files += "|"+picarr[i];
- }
- for(i=1;i<linkarr.length;i++){
- if(links=="") links = linkarr[i];
- else links += "|"+linkarr[i];
- }
- for(i=1;i<textarr.length;i++){
- if(texts=="") texts = textarr[i];
- else texts += "|"+textarr[i];
- }
- 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="{dede:global.cfg_templets_skin/}/images/bcastr3.swf"><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="{dede:global.cfg_templets_skin/}/images/bcastr3.swf" 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>
将将上面代码里的宽度和高度修改一下,将var swf_width=280; var swf_height=192; 修改为:var swf_width=288; var swf_height=239; 因为织梦幻灯片的文字在幻片上面,所以高度要等于原幻灯高度加文字高度,所以高度为239。本来想将右侧放在一节里面讲完,但下面的最新新闻和热门新闻在列表页和内容页都会用到,所以我们放在一个单独的一节里讲解。看下我们这一讲的成绩吧!