Flash Ad Banners Using Joomla! Banner Component
This post in the Joomla! Forum is a lifesaver. Not only does it allow you to track clicks on flash ad banners using the built in Joomla! banner component, it also solves problems with dropdown menus appearing under those same banners.
Some note are here for fear of that post disappearing someday:
Goto /modules/mod_banners/helper.php and search for the old flash code. Select all of it and paste the following:
/* Old Flash Code
$html = "<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=\"0\" width=\"$width\" height=\"$height\">
<param name=\"movie\" value=\"$imageurl\"><embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\" width=\"$width\" height=\"$height\"></embed>
</object>";
*/
//HW: BOF New Flash Code that works with Clickthroughs, AND does not hide menus etc (WMODE)
$clickurl = $item->clickurl;
$html_flash = "<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=\"0\" width=\"$width\" height=\"$height\">
<param name=\"movie\" value=\"$imageurl\">
<param name=\"wmode\" value=\"opaque\">
<embed src=\"$imageurl\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\" width=\"$width\" height=\"$height\" wmode=\"opaque\"></embed>
</object>";
if ($clickurl != '') { //Add a GIF based clickthrough IF there is a link supplied in teh 'Click url' for this banner in the banner manager.
$html = '<div style="position:relative;z-index:1;" style="background:#fff;">'; //Add the banner clickthrough
$html .= $html_flash;
$html .= '<a href="'.$link.'" target="_blank" style="display:block;position:absolute;width:'.$width.'px;height:'.$height.'px;z-index:9999;top:0px;left:0px;border:none;background:none;"><img src="components/com_banners/x.gif" style="width:'.$width.'px;height:'.$height.'px;" alt="Banner Campaign" /></a> ';
$html .= '</div>';
} else { //Otherwise use the orignal code, so that the flash banner still goes to the right place... (instead of a blank page!)
$html .= $html_flash;
}
//HW: EOF New Flash Code that works with Clickthroughs, AND does not hide menus etc (WMODE)

0 comments:
Post a Comment