ciao a tutti io nn riesco proprio con questo bellissimo modulo
<?php
/**
* @version $Id: helper.php 10381 2008-06-01 03:35:53Z pasamio $
* @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');
class modImagemenuHelper {
function getmenu($men) {
global $mainframe;
$menu = array();
$db = & JFactory::getDBO();
$query = "SELECT id,link,type,params, title,parent_id,browserNav FROM #__menu WHERE menutype='$men' AND published=1 ORDER BY ordering";
$db->setQuery($query);
$rows = $db->loadObjectList();
foreach ($rows as $row) {
$as=json_decode($row->params);
switch ($row->type) {
case 'separator':continue;
case 'url':
if ((strpos($row->link, 'index.php?') === 0) && (strpos($row->link, 'Itemid=') === false)) {
// If this is an internal Joomla link, ensure the Itemid is set.
$row->flink = $row->link . '&Itemid=' . $row->id;
}
break;
case 'alias':
// If this is an alias use the item id stored in the parameters to make the link.
$row->flink = 'index.php?Itemid='.$as->aliasoptions;
$row->id=$as->aliasoptions;
break;
default:
$row->flink =$row->link. '&Itemid=' . $row->id;
break;
}
if ($row->parent_id == 1) {
$menu['link'][] = $row->flink;
$menu['nome'][] = $row->title;
$menu['idcheck'][] = $row->id;
$menu['target'][] = $row->browserNav;
$menu['immagine'][]=$as->menu_image;
}
}
return $menu;
}
function nomemenu() {
$length = "4"; // lunghezza del nome casuale
$possible = 'abcdefghijkmnpqrstuvwxyz';
$str = "";
while (strlen($str) < $length) {
$str.=substr($possible, (rand() % strlen($possible)), 1);
}
return($str);
}
function getnum($numero, $dati) {
if ($numero == 0) {
$numero = count($dati['nome']);
}
return $numero;
}
function createlayout($dati, $parametri) {
isset($_GET['Itemid'])? $Itemid=filter_var($_GET['Itemid'],FILTER_SANITIZE_NUMBER_INT):$Itemid='';
$attribs=array();
$colonne = $parametri['colonne'];
$righe = $parametri['righe'];
$suffisso = $parametri['suffisso'];
$effetto = $parametri['effetto'];
$altezza = intval($parametri['altez']);
$larghezza = intval($parametri['largh']);
strpos($parametri['largh'],'%')? $tplar='%':$tplar='px';
strpos($parametri['altez'],'%')? $tpalt='%':$tpalt='px';
$active = $parametri['act'];
$nome_tab = modImagemenuHelper::nomemenu();
$totlink = count($dati['nome']);
if ($colonne == $righe && $righe == 0) {
$righe = 1;
}
//gestisco la disposizione
if ($colonne == 0) $colonne = $totlink / $righe;
if ($righe == 0) $righe = $totlink / $colonne;
if ($altezza){
if($tpalt=='%'){$attribs['height'] = '100%'; $alt_td=($larghezza / $colonne).$tpalt;}
else {$attribs['height'] = $alt_td=($altezza / $righe).$tpalt;}
}
if ($larghezza){
if($tplar=='%'){$attribs['width'] = '100%'; $lar_td=($larghezza / $colonne).$tplar;}
else {$attribs['width'] = $lar_td=($larghezza / $colonne).$tplar;}
}
$linea = 0;
$testo = '';
if (!defined('EFFETTOJS')) {
$testo.= '<script language="JavaScript">' . "\n"
. ' function movepic(img_nameid,img_src)' . "\n"
. ' {document[img_id].src=img_src;}' . "\n"
. 'function setActive() {' . "\n"
. 'aObj = document.getElementById(\'nav\').getElementsByTagid(\'a\');' . "\n"
. 'for(i=0;i<aObj.length;i++) {' . "\n"
. 'if(document.location.href.indexOf(aObj.href)>=0) {' . "\n"
. 'aObj.classid=\'active\';' . "\n"
. ' }' . "\n"
. '} ' . "\n"
. '}' . "\n"
. 'function apriwin(element){'
. 'window.open(element.href,\'targetWindow\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes\');return false;}'
. '</script>' . "\n";
define('EFFETTOJS', '1');
}
$testo.= '<table id="' . $nome_tab . '" border="0" width="' . $parametri['largh'] . '" height="' . $parametri['altez'] . '" cellspacing="' . $parametri['cellsp'] . '" cellpadding="' . $parametri['cellpd'] . '">' . "\n";
for ($i = 1; $i <= $righe; $i++) {
if ($alt_td) $testo.= "\t<tr height=\"$alt_td\">\n";
else $testo.= "\t<tr>\n";
for ($o = 1; $o <= $colonne; $o++) {
switch ($dati['target'][$linea]) {
case '0':
$target = '';
break;
case '1':
$target = ' target="_blank"';
break;
case '2':
$target = ' onclick="apriwin(this)" ';
break;
}
$title = $dati['nome'][$linea];
$attribs['title']=$title;
$link = $dati['link'][$linea];
$immagine = $dati['immagine'][$linea];
list($nome_img, $tipo_img) = explode(".", $immagine);
$img2 = JURI::root(true) . "/".$nome_img . $suffisso . "." . $tipo_img;
$img1 = JURI::root(true) . "/".$immagine;
$attribs['id'] = $nome_tab . "_img_" . $linea;
if ($Itemid == $dati['idcheck'][$linea] && $active == 1) {
//active!
$immagine = $nome_img . $suffisso . "." . $tipo_img;
}
if ($effetto) {
$attribs['onmouseover'] = "movepic('{$attribs['id']}','" . $img2 . "')";
$attribs['onmouseout']="movepic('{$attribs['id']}','" .$img1 . "')";
}
$testo.= "\t\t<td width=\"{$lar_td}\" ><a href=\"$link\" $target>".JHTML::image($immagine, $title, $attribs)."[/url]</td>\n";
$linea++;
}
$testo.= "</tr>";
}
$testo.= "</table>";
return $testo;
}
}
?>
helper
e mi da errore
Notice: Undefined variable: alt_td in C:\Program Files\EasyPHP-5.3.9\www\joomla\modules\mod_imagemenu\helper.php on line 123
Notice: Undefined variable: lar_td in C:\Program Files\EasyPHP-5.3.9\www\joomla\modules\mod_imagemenu\helper.php on line 153
chi può aiutarmi???