打开e/class/userfun.php 加入以下代码: PHP: //-------------------------------幻灯新闻调用function egz_pixPicNews($picid,$cont,$showtitle=false,$width,$hight){global $empire,$public_r;if($picid!=0){$sql=$empire->query("select title,pic_url,url,classid from phome_enewspic where classid='$picid' limit $cont");}else{$sql=$empire->query("select title,pic_url,url,classid from phome_enewspic limit $cont");}while($r=$empire->fetch($sql)){$pic_url.=$r[pic_url]."|";$title.=$r[title]."|";$url.=$r[url]."|"; }$pic_url=Substr($pic_url,0,-1);$title=Substr($title,0,-1);$url=Substr($url,0,-1); if($showtitle) {$text_height=20;} else{$text_height=0;}echo "<SCRIPT type=text/javascript>n";echo " <!--n";echo " n";echo " var focus_width=$widthn";echo " var focus_height=$hightn";echo " var text_height=$text_heightn";echo " var swf_height = focus_height+text_heightn";echo " var swfpath = '$public_r[newsurl]/images/pixviewer.swf'n";echo " n";echo " var pics='$pic_url'n";echo " var links='$url'n";echo " var texts='$title'n";echo " n";echo " 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="'+ focus_width +'" height="'+ swf_height +'">');n";echo " document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+swfpath+'"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">');n";echo " document.write('<param name="menu" value="false"><param name=wmode value="opaque">');n";echo " document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');n";echo " document.write('<embed src="'+swfpath+'" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');n";echo " n";echo " //-->n";echo " </SCRIPT>n";}//---------------------------------- 然后添加模板标签 标签符号:egz_pixPicNews 函数名:egz_pixPicNews 标签格式:[egz_pixPicNews]类别ID,显示条数,是否显示标题,宽,高[/egz_pixPicNews] 标签说明:参数 参数说明 类别ID 查看图片新闻ID点这里 显示条数 调用最新几条图片,最好不要超过6条 是否显示标题 是否在图片下显示标题,0为不显示,1为显示 宽 显示幻灯片的宽 高 显示幻灯片的高 注:如果显示标题的话,幻灯片的高会自动加20 然后下载我给的pixviewer.swf放到images目录中 使用说明:函数调用的是"图片新闻"里所添加的图片. 希望大家能互相交流学习,为帝国系统添加更多的功能. 具体演示大家可以看 y.sina.com.cn 里的那个幻灯新闻