Ejemplo n.º 1
0
 function renderBanner($params, &$item)
 {
     $link = JRoute::_('index.php?option=com_banners&task=click&bid=' . $item->bid);
     $baseurl = JURI::base();
     $html = '';
     if (trim($item->custombannercode)) {
         // template replacements
         $html = str_replace('{CLICKURL}', $link, $item->custombannercode);
         $html = str_replace('{NAME}', $item->name, $html);
     } else {
         if (BannerHelper::isImage($item->imageurl)) {
             $image = '<img src="' . $baseurl . 'images/banners/' . $item->imageurl . '" alt="' . JText::_('Banner') . '" />';
             if ($item->clickurl) {
                 switch ($params->get('target', 1)) {
                     // cases are slightly different
                     case 1:
                         // open in a new window
                         $a = '<a href="' . $link . '" target="_blank">';
                         break;
                     case 2:
                         // open in a popup window
                         $a = "<a href=\"javascript:void window.open('" . $link . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\">";
                         break;
                     default:
                         // formerly case 2
                         // open in parent window
                         $a = '<a href="' . $link . '">';
                         break;
                 }
                 $html = $a . $image . '</a>';
             } else {
                 $html = $image;
             }
         } else {
             if (BannerHelper::isFlash($item->imageurl)) {
                 //echo $item->params;
                 $banner_params = new JParameter($item->params);
                 $width = $banner_params->get('width');
                 $height = $banner_params->get('height');
                 $imageurl = $baseurl . "images/banners/" . $item->imageurl;
                 $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}\">\n\t\t\t\t\t\t<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>\n\t\t\t\t\t</object>";
             }
         }
     }
     return $html;
 }
Ejemplo n.º 2
0
                }
                ?>

						<?php 
                if (!empty($height)) {
                    echo 'height ="' . $height . '"';
                }
                ?>

					/>
				<?php 
            }
            ?>

			<?php 
        } elseif (BannerHelper::isFlash($imageurl)) {
            ?>

				<object
					classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
					<?php 
            if (!empty($width)) {
                echo 'width ="' . $width . '"';
            }
            ?>

					<?php 
            if (!empty($height)) {
                echo 'height ="' . $height . '"';
            }
<?php

/**
 * @package     Alligo.Modules
 * @subpackage  mod_banners4varnish
 *
 * @copyright   Copyright (C) 2005 - 2015 Alligo Ltda. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
// Include the syndicate functions only once
require_once __DIR__ . '/helper.php';
$headerText = trim($params->get('header_text'));
$footerText = trim($params->get('footer_text'));
$gaetclick = trim($params->get('gaetclick'));
$gaetviews = trim($params->get('gaetviews'));
if (!class_exists('BannerHelper')) {
    require_once JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php';
    if (class_exists('BannerHelper')) {
        // Only execute if already not loaded by native mod_banners
        BannerHelper::updateReset();
    }
}
$list =& ModBanners4varnishHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
require JModuleHelper::getLayoutPath('mod_banners4varnish', $params->get('layout', 'default'));