Página 1 de 1

Fatal error: Class 'BannerHelper' not found

Enviado: 26 Dez 2008, 10:09
por mbyte
Olá pessoal,
sou novo nesse site, pois até hoje sempre usei ou o IPB ou PHPBrasil e gostei muito do Joomla!
Vamos lá, venho por meio deste pq me deparei com um problema mei estranho que é logo após a instalação no servidor remoto e de apagar a pasta "installation" ela exibe a seguinte mensagem de erro:
Fatal error: Class 'BannerHelper' not found in /home/firewd/public_html/firewd/modules/mod_banners/helper.php on line 82
Já olhei mas é como se a classe não tivesse sido criada.
Por favor alguém pode me dar uma Luz?
Atenciosamente
Luiz H. Vaisconcelos

Já olhei na linha 82 e nada de errado nela, vou postar como ela está:

<?php
/**
* @version $Id: helper.php 10554 2008-07-15 17:15:19Z ircmaxell $
* @package Joomla
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_banners'.DS.'helpers'.DS.'banner.php');

class modBannersHelper
{
function getList(&$params)
{
$model = modBannersHelper::getModel();

// Model Variables
$vars['cid'] = (int) $params->get( 'cid' );
$vars['catid'] = (int) $params->get( 'catid' );
$vars['limit'] = (int) $params->get( 'count', 1 );
$vars['ordering'] = $params->get( 'ordering' );

if ($params->get( 'tag_search' ))
{
$document =& JFactory::getDocument();
$keywords = $document->getMetaData( 'keywords' );

$vars['tag_search'] = BannerHelper::getKeywords( $keywords );
}

$banners = $model->getList( $vars );
$model->impress( $banners );

return $banners;
}

function getModel()
{
if (!class_exists( 'BannersModelBanner' ))
{
// Build the path to the model based upon a supplied base path
$path = JPATH_SITE.DS.'components'.DS.'com_banners'.DS.'models'.DS.'banner.php';
$false = false;

// If the model file exists include it and try to instantiate the object
if (file_exists( $path )) {
require_once( $path );
if (!class_exists( 'BannersModelBanner' )) {
JError::raiseWarning( 0, 'Model class BannersModelBanner not found in file.' );
return $false;
}
} else {
JError::raiseWarning( 0, 'Model BannersModelBanner not supported. File not found.' );
return $false;
}
}

$model = new BannersModelBanner();
return $model;
}

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/sh ... on=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>";
}

return $html;
}
}

Re: Fatal error: Class 'BannerHelper' not found

Enviado: 26 Dez 2008, 20:48
por bigodines
parece que tá faltando arquivo. Mais especificamente este:
administrator/components/com_banners/helpers/banner.php

ele existe no filesystem?

Re: Fatal error: Class 'BannerHelper' not found

Enviado: 27 Dez 2008, 01:12
por mbyte
bigodines escreveu:parece que tá faltando arquivo. Mais especificamente este:
administrator/components/com_banners/helpers/banner.php

ele existe no filesystem?
Caro amigo, no filesystem o arquivo "banner.php" não existe só na pasta:administrator/components/com_banners/helpers/, o engraçado é que localmente ele funciona perfeitamente fazendo todos os processos normalmente. :(

Oq notei é que o arquivo está em branco.

Re: Fatal error: Class 'BannerHelper' not found

Enviado: 27 Dez 2008, 17:31
por bigodines
se tá em branco, manda ele denovo :D

Re: Fatal error: Class 'BannerHelper' not found

Enviado: 28 Dez 2008, 22:07
por mbyte
Muito Obrigado eu preferi instalar pelo Fantastico mesmo aí ocorreu tu normal.

Atenciosamente
Luiz H. Vaisconcelos