To get Click counts working for flash banners in Joomla 1.5, you will need to update the code in /modules/mod_banners/helper.php as follows:
replace:
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>";
WITH:
Code:
/* 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)
It works for me.. Milage may vary :-)
Make sure the Destination URL is placed in the ClickURL, otherwise the flash click link will be used. Also make sure the size of the banner is placed in height and width. This will make the overlay gif render over the complete banner.
This fix should probably be added to the default Joomla package!. I modified the code based on changes that were supplied in ArtsBannersXTD for Joomla v1 and don't understand how banners could be left only partially working, when it only took me a couple of hours to figure it all out!
I also added the 'wmode = opaque' to the flash embed/object code so that dropdown menus will actually be shown above the flash code.
Hope that helps y'all!