Support jOOmla! Autoit!
 
让com_banner支持flash输出的hack 输出PDF 打印 E-mail
Author Author: Autoit | Date Date:2007-01-05 | View Count View: 18855 | Digg Count Digg: 2708 | section & Category Category: fixed & hacked - 使用手记

其实com_banner本身支持flash的banner输出.只是在joomla本身上未定义 swf 格式而已.

在joomla.php 里

搜索:

bmp|gif|jpg|png

替换为:

bmp|gif|jpg|png|swf

 然后将 里的:

                } else if (eregi("\.swf$", $banner->imageurl)) {
                        $imageurl         = "$mosConfig_live_site/images/banners/".$banner->imageurl;
                        echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" border=\"5\">
                                        <param name=\"movie\" value=\"$imageurl\"><embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"></embed></object>";
                }
        }

替换为:

} else if (eregi("\.swf$", $banner->imageurl)) {
                        $imageurl         = "$mosConfig_live_site/images/banners/".$banner->imageurl;
            $getflashinfo = @getimagesize( $imageurl );
 
                       echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\#version=6,0,0,0\" border=\"5\" width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                        <param name=\"movie\" value=\"$imageurl\">
                        <embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"  width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                        </embed></object>";
                }
                                }

[这个替换是增加flash的高与宽]就可以了,如果你需要定义 flash 上输出后台里写的 url 的话, 就把上面段直接替换为:

} else if (eregi("\.swf$", $banner->imageurl)) {
                        $imageurl         = "$mosConfig_live_site/images/banners/".$banner->imageurl;
            $link = sefRelToAbs( 'index.php?option=com_banners&task=click&bid='. $banner->bid );
            $getflashinfo = @getimagesize( $imageurl );
 
                        echo "<button  title=\"Advertisement\"  style=\"border: 0; padding:0; background: none transparent scroll repeat 0 0; width:".$getflashinfo[0]."; height:".$getflashinfo[1]."; cursor: hand; \" onclick=\"window.location.href='".$link."'\">
                        <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\#version=6,0,0,0\" border=\"5\" width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                       \ <param name=\"movie\" value=\"$imageurl\">  <param name=\"wmode" value="transparent\">
 
                        <embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\"  width=\"".$getflashinfo[0]."\"  height=\"".$getflashinfo[1]."\">
                        </embed></object></button>";
                }
                                }

在论坛里答网友并测试后整理过来的. End. by Autoit.

 


Permanent URL: http://www.autoit.cn/index.php/content/view/97/25.html

Shares: Google书签 Yahoo书签 雅虎收藏夹 365Key网摘 新浪ViVi 百度收藏 天极网摘 diglog 和讯网摘 POCO网摘 YouNote网摘 博拉网 天下图摘 spurl blogmarks BlinkList reddit digg Del.icio.us   |  Tags: banner  flash  

« First « 1 2 » Last »
 
关注 Joomla 的页面 meta 标签   在最新文章模块标题右侧加 more 的推荐方法!