Back to top

Autore Topic: [RISOLTO]Strano errore sul menu principale Tasto Home  (Letto 12872 volte)

Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
L altro giorno ho deciso di cambiare TEMPLATE dopo diversi anni.

Nel cambio del TEMPLATE noto un errore sul taso HOME.
Pensando che fosse un errore del TEMPLATE... Provo altri TEMPLATE...
Ma l'errore e' sempre lo stesso anche con diversi TEMPLATE.

Scrive :
Warning: trim() expects parameter 1 to be string, array given in /web/htdocs/www.gentedelsud.it/home/libraries/joomla/html/parameter.php on line 83

Che significa??

[allegato eliminato da un amministratore essendo vecchio pių di un anno]
« Ultima modifica: 14 Mar 2012, 18:52:33 da adottauncane »

adottauncane

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #1 il: 09 Mar 2012, 13:11:32 »
Ciao Sky_80,
prova intanto a rifare la voce di menų home, renderla predefinita e a buttare la vecchia.

mau_develop

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #2 il: 09 Mar 2012, 13:13:08 »
i template sono compatibili con la versione di joomla che usi?

M.

Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #3 il: 09 Mar 2012, 13:13:25 »
Ciao Sky_80,
prova intanto a rifare la voce di menų home, renderla predefinita e a buttare la vecchia.

Si si... ma purtroppo niente da fare.

Citazione
Non č possibile spostare nel cestino la voce di menu predefinita.

Ne disabilitare... Ne cancellare. :(

Offline danteamaral

  • Nuovo arrivato
  • *
  • Post: 33
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #4 il: 09 Mar 2012, 13:16:23 »
Ciao riesci a postare cosa dice l'istruzione alla riga 83 del file libraries/joomla/html/parameter.php?
 ;D

Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #5 il: 09 Mar 2012, 13:16:34 »
i template sono compatibili con la versione di joomla che usi?

M.

Sono dei Template per Joomla 1.5 ???

Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #6 il: 09 Mar 2012, 13:17:08 »
Ciao riesci a postare cosa dice l'istruzione alla riga 83 del file libraries/joomla/html/parameter.php?
 ;D

Volentieri... ma non ho idea di come si fa'  :P

Offline danteamaral

  • Nuovo arrivato
  • *
  • Post: 33
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #7 il: 09 Mar 2012, 13:18:39 »
vai sull'ftp del sito con Filezilla o con un client ftp che hai.... e scarichi il file in questione sul pc...
dopo di che apri il file o con textpad o Dreamveawer e ci leggi il tutto....

Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #8 il: 09 Mar 2012, 13:22:44 »
Ecco qui ...  ;)

Codice: [Seleziona]
<?php
/**
 * @version        $Id: parameter.php 14401 2010-01-26 14:10:00Z louis $
 * @package        Joomla.Framework
 * @subpackage    Parameter
 * @copyright    Copyright (C) 2005 - 2010 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.
 */

// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();

jimport'joomla.registry.registry' );

//Register the element class with the loader
JLoader::register('JElement'dirname(__FILE__).DS.'parameter'.DS.'element.php');

/**
 * Parameter handler
 *
 * @package     Joomla.Framework
 * @subpackage        Parameter
 * @since        1.5
 */
class JParameter extends JRegistry
{
    
/**
     * The raw params string
     *
     * @access    private
     * @var        string
     * @since    1.5
     */
    
var $_raw null;

    
/**
     * The xml params element
     *
     * @access    private
     * @var        object
     * @since    1.5
     */
    
var $_xml null;

    
/**
    * loaded elements
    *
    * @access    private
    * @var        array
    * @since    1.5
    */
    
var $_elements = array();

    
/**
    * directories, where element types can be stored
    *
    * @access    private
    * @var        array
    * @since    1.5
    */
    
var $_elementPath = array();

    
/**
     * Constructor
     *
     * @access    protected
     * @param    string The raw parms text
     * @param    string Path to the xml setup file
     * @since    1.5
     */
    
function __construct($data$path '')
    {
        
parent::__construct('_default');

        
// Set base path
        
$this->_elementPath[] = dirname__FILE__ ).DS.'parameter'.DS.'element';

        if (
trim$data )) {
            
$this->loadINI($data);
        }

        if (
$path) {
            
$this->loadSetupFile($path);
        }

        
$this->_raw $data;
    }

    
/**
     * Set a value
     *
     * @access    public
     * @param    string The name of the param
     * @param    string The value of the parameter
     * @return    string The set value
     * @since    1.5
     */
    
function set($key$value ''$group '_default')
    {
        return 
$this->setValue($group.'.'.$key, (string) $value);
    }

    
/**
     * Get a value
     *
     * @access    public
     * @param    string The name of the param
     * @param    mixed The default value if not found
     * @return    string
     * @since    1.5
     */
    
function get($key$default ''$group '_default')
    {
        
$value $this->getValue($group.'.'.$key);
        
$result = (empty($value) && ($value !== 0) && ($value !== '0')) ? $default $value;
        return 
$result;
    }

    
/**
     * Sets a default value if not alreay assigned
     *
     * @access    public
     * @param    string    The name of the param
     * @param    string    The value of the parameter
     * @param    string    The parameter group to modify
     * @return    string    The set value
     * @since    1.5
     */
    
function def($key$default ''$group '_default') {
        
$value $this->get($key, (string) $default$group);
        return 
$this->set($key$value);
    }

    
/**
     * Sets the XML object from custom xml files
     *
     * @access    public
     * @param    object    An XML object
     * @since    1.5
     */
    
function setXML( &$xml )
    {
        if (
is_object$xml ))
        {
            if (
$group $xml->attributes'group' )) {
                
$this->_xml[$group] = $xml;
            } else {
                
$this->_xml['_default'] = $xml;
            }
            if (
$dir $xml->attributes'addpath' )) {
                
$this->addElementPathJPATH_ROOT str_replace('/'DS$dir) );
            }
        }
    }

    
/**
     * Bind data to the parameter
     *
     * @param    mixed    $data Array or Object
     * @return    boolean    True if the data was successfully bound
     * @access    public
     * @since    1.5
     */
    
function bind($data$group '_default')
    {
        if ( 
is_array($data) ) {
            return 
$this->loadArray($data$group);
        } elseif ( 
is_object($data) ) {
            return 
$this->loadObject($data$group);
        } else {
            return 
$this->loadINI($data$group);
        }
    }

    
/**
     * Render
     *
     * @access    public
     * @param    string    The name of the control, or the default text area if a setup file is not found
     * @return    string    HTML
     * @since    1.5
     */
    
function render($name 'params'$group '_default')
    {
        if (!isset(
$this->_xml[$group])) {
            return 
false;
        }

        
$params $this->getParams($name$group);
        
$html = array ();
        
$html[] = '<table width="100%" class="paramlist admintable" cellspacing="1">';

        if (
$description $this->_xml[$group]->attributes('description')) {
            
// add the params description to the display
            
$desc    JText::_($description);
            
$html[]    = '<tr><td class="paramlist_description" colspan="2">'.$desc.'</td></tr>';
        }

        foreach (
$params as $param)
        {
            
$html[] = '<tr>';

            if (
$param[0]) {
                
$html[] = '<td width="40%" class="paramlist_key"><span class="editlinktip">'.$param[0].'</span></td>';
                
$html[] = '<td class="paramlist_value">'.$param[1].'</td>';
            } else {
                
$html[] = '<td class="paramlist_value" colspan="2">'.$param[1].'</td>';
            }

            
$html[] = '</tr>';
        }

        if (
count($params) < 1) {
            
$html[] = "<tr><td colspan=\"2\">".JText::_('There are no Parameters for this item')."</td></tr>";
        }

        
$html[] = '</table>';

        return 
implode("\n"$html);
    }

    
/**
     * Render all parameters to an array
     *
     * @access    public
     * @param    string    The name of the control, or the default text area if a setup file is not found
     * @return    array    Array of all parameters, each as array Any array of the label, the form element and the tooltip
     * @since    1.5
     */
    
function renderToArray($name 'params'$group '_default')
    {
        if (!isset(
$this->_xml[$group])) {
            return 
false;
        }
        
$results = array();
        foreach (
$this->_xml[$group]->children() as $param)  {
            
$result $this->getParam($param$name);
            
$results[$result[5]] = $result;
        }
        return 
$results;
    }

    
/**
     * Return number of params to render
     *
     * @access    public
     * @return    mixed    Boolean falst if no params exist or integer number of params that exist
     * @since    1.5
     */
    
function getNumParams($group '_default')
    {
        if (!isset(
$this->_xml[$group]) || !count($this->_xml[$group]->children())) {
            return 
false;
        } else {
            return 
count($this->_xml[$group]->children());
        }
    }

    
/**
     * Get the number of params in each group
     *
     * @access    public
     * @return    array    Array of all group names as key and param count as value
     * @since    1.5
     */
    
function getGroups()
    {
        if (!
is_array($this->_xml)) {
            return 
false;
        }
        
$results = array();
        foreach (
$this->_xml as $name => $group)  {
            
$results[$name] = $this->getNumParams($name);
        }
        return 
$results;
    }

    
/**
     * Render all parameters
     *
     * @access    public
     * @param    string    The name of the control, or the default text area if a setup file is not found
     * @return    array    Aarray of all parameters, each as array Any array of the label, the form element and the tooltip
     * @since    1.5
     */
    
function getParams($name 'params'$group '_default')
    {
        if (!isset(
$this->_xml[$group])) {
            return 
false;
        }
        
$results = array();
        foreach (
$this->_xml[$group]->children() as $param)  {
            
$results[] = $this->getParam($param$name);
        }
        return 
$results;
    }

    
/**
     * Render a parameter type
     *
     * @param    object    A param tag node
     * @param    string    The control name
     * @return    array    Any array of the label, the form element and the tooltip
     * @since    1.5
     */
    
function getParam(&$node$control_name 'params'$group '_default')
    {
        
//get the type of the parameter
        
$type $node->attributes('type');

        
//remove any occurance of a mos_ prefix
        
$type str_replace('mos_'''$type);

        
$element =& $this->loadElement($type);

        
// error happened
        
if ($element === false)
        {
            
$result = array();
            
$result[0] = $node->attributes('name');
            
$result[1] = JText::_('Element not defined for type').' = '.$type;
            
$result[5] = $result[0];
            return 
$result;
        }

        
//get value
        
$value $this->get($node->attributes('name'), $node->attributes('default'), $group);

        return 
$element->render($node$value$control_name);
    }

    
/**
     * Loads an xml setup file and parses it
     *
     * @access    public
     * @param    string    path to xml setup file
     * @return    object
     * @since    1.5
     */
    
function loadSetupFile($path)
    {
        
$result false;

        if (
$path)
        {
            
$xml = & JFactory::getXMLParser('Simple');

            if (
$xml->loadFile($path))
            {
                if (
$params = & $xml->document->params) {
                    foreach (
$params as $param)
                    {
                        
$this->setXML$param );
                        
$result true;
                    }
                }
            }
        }
        else
        {
            
$result true;
        }

        return 
$result;
    }

    
/**
     * Loads a element type
     *
     * @access    public
     * @param    string    elementType
     * @return    object
     * @since    1.5
     */
    
function &loadElement$type$new false )
    {
        
$false false;
        
$signature md5$type  );

        if( (isset( 
$this->_elements[$signature] ) && !is_a($this->_elements[$signature], '__PHP_Incomplete_Class'))  && $new === false ) {
            return    
$this->_elements[$signature];
        }

        
$elementClass    =    'JElement'.$type;
        if( !
class_exists$elementClass ) )
        {
            if( isset( 
$this->_elementPath ) ) {
                
$dirs $this->_elementPath;
            } else {
                
$dirs = array();
            }

            
$file JFilterInput::clean(str_replace('_'DS$type).'.php''path');

            
jimport('joomla.filesystem.path');
            if (
$elementFile JPath::find($dirs$file)) {
                include_once 
$elementFile;
            } else {
                return 
$false;
            }
        }

        if( !
class_exists$elementClass ) ) {
            return 
$false;
        }

        
$this->_elements[$signature] = new $elementClass($this);

        return 
$this->_elements[$signature];
    }

    
/**
     * Add a directory where JParameter should search for element types
     *
     * You may either pass a string or an array of directories.
     *
     * JParameter will be searching for a element type in the same
     * order you added them. If the parameter type cannot be found in
     * the custom folders, it will look in
     * JParameter/types.
     *
     * @access    public
     * @param    string|array    directory or directories to search.
     * @since    1.5
     */
    
function addElementPath$path )
    {
        
// just force path to array
        
settype$path'array' );

        
// loop through the path directories
        
foreach ( $path as $dir )
        {
            
// no surrounding spaces allowed!
            
$dir trim$dir );

            
// add trailing separators as needed
            
if ( substr$dir, -) != DIRECTORY_SEPARATOR ) {
                
// directory
                
$dir .= DIRECTORY_SEPARATOR;
            }

            
// add to the top of the search dirs
            
array_unshift$this->_elementPath$dir );
        }


    }
}

Usare tastino #.
« Ultima modifica: 09 Mar 2012, 13:25:56 da adottauncane »

Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #9 il: 09 Mar 2012, 13:24:47 »
Se poi parameter.php on line 83 sta per RIGO 83


Questo e' quello che c'e' scritto al rigo 83
Citazione
if (trim( $data )) {


adottauncane

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #10 il: 09 Mar 2012, 13:26:39 »
Si si... ma purtroppo niente da fare.

Ne disabilitare... Ne cancellare. :(

Be, prima devi rendere predefinita quella nuova. Poi butti la vecchia.

Offline danteamaral

  • Nuovo arrivato
  • *
  • Post: 33
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #11 il: 09 Mar 2012, 13:28:45 »
prendi queste righe

if (trim($data))
{
  $this->loadINI($data);
}         


e le sostituisci con queste

if (gettype($data) == 'array')
{
  foreach ($data as $data_string)
  {
    if (trim($data_string))
   {
     $this->loadINI($data_string);
   }         
  }
}
else
{
  if (trim($data))
  {
    $this->loadINI($data);
   }         
}      

e ricarichi il file.....magari salvati quello vecchio prima che non si sa mai ;D ;D



Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #12 il: 09 Mar 2012, 13:40:11 »
Perfetto abbiamo risolto!!!!!  ;D

Ora esce un sotto menu'...  :o un link al produttore del template.
Si puo' eliminare??

Ps - quel codice che ho messo... cosa ha fatto??  :P


[allegato eliminato da un amministratore essendo vecchio pių di un anno]

mau_develop

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #13 il: 09 Mar 2012, 14:12:49 »
...quindi era sbagliato "Joomla"?

M.

adottauncane

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #14 il: 09 Mar 2012, 14:15:22 »

Ora esce un sotto menu'...  :o un link al produttore del template.
Si puo' eliminare??
Ciao Sky_80,
prova intanto a rifare la voce di menų home, renderla predefinita e a buttare la vecchia.


Offline Sky_80

  • Appassionato
  • ***
  • Post: 525
  • Sesso: Maschio
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #15 il: 09 Mar 2012, 14:25:02 »


Ci ho provato...
Ho creato un nuovo Tasto HOME. tra tutte le voci ho scelto Link ESTERNO...
Era l'unico che mi faceva mettere il link.

Ma mi da il sito inraggiungibile...  :-[

Offline danteamaral

  • Nuovo arrivato
  • *
  • Post: 33
    • Mostra profilo
Re:Strano errore sul menu principale Tasto Home
« Risposta #16 il: 09 Mar 2012, 14:27:07 »
Mha il link al produttore del template non č che percaso č all'interno dei parametri avanzati del menų home ??  ;)

in sostanza hai imposto una condizione in pių rispetto a prima: alcuni menų sono realizzati non come singole variabili ma come array e prima il tuo file diceva: "se č una variabile bene altrimenti dai il warning"...adesso dice:" se č una variablie bene, ltrimenti se č un array prosegui "....
č un piccolo bug di Joomla che ogni tanto salta fuori, dipende dalla versione del core che monti ....

ciao ciao ;D

adottauncane

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #17 il: 09 Mar 2012, 14:32:04 »
Scusa perché link esterno? Fai una home normale, come era quella di default. Articoli ŧ Prima pagina.


adottauncane

  • Visitatore
Re:Strano errore sul menu principale Tasto Home
« Risposta #19 il: 09 Mar 2012, 14:41:12 »
Non riesci a cliccare Aspetto blog prima pagina?

 



Web Design Bolzano Kreatif