Joomla.it Forum
Non solo Joomla... => Sezione dedicata ai Server => : ari_gs 21 Nov 2010, 10:47:45
-
Ciao a tutti, ho un problema che sicuramente è dato dal file htaccess su un sito hostato su *ruba, con altro hostimg il template funziona correttamente, in questo caso l'errore che mi da è il seguente
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /web/htdocs/www.abitareinvacanza.it/home/templates/zengridframework/includes/yth.php on line 36
secondo chi realizza la zengridframework potrebbe essere il php non aggiornato, ma la versione è PHP 5.2.14 , l'altra alternativa sta nel modificare il file htacces, ma come??? ;D ;D ;D
Il contenuto del file htaccess è il seguente:
##
# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
# @package Joomla
# @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##
#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
#
# mod_rewrite in use
RewriteEngine On
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)
# RewriteBase /
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
Mentre il file yth.php ha questo contenuto
<?php
/**
* Yireo Template Helper for Joomla! 1.5
*
* @author Yireo (info@yireo.com)
* @package Yth
* @copyright Copyright 2010
* @license GNU Public License
* @link http://www.yireo.com
* @version 0.8
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
/*
* Yireo template class
*
* @static
* @package Yth
*/
class Yth
{
/*
* Method to get the HTML of a splitmenu
*
* @static
* @access public
* @param string $menu
* @param int $startLeve
* @param int $endLevel
* @param bool $show_children
* @return string
*/
public function getSplitMenu( $menu = 'mainmenu', $startLevel = 0, $endLevel = 1, $show_children = false )
{
// Import the module helper
jimport('joomla.application.module.helper');
// Get a new instance of the mod_mainmenu module
$module =& JModuleHelper::getModule( 'mod_mainmenu', 'mainmenu' );
if(!empty($module) && is_object($module)) {
// Construct the module parameters (as a string)
$params = "menutype=".$menu."\n"
. "showAllChildren=".$show_children."\n"
. "startLevel=".$startLevel."\n"
. "endLevel=".$endLevel;
$module->params = $params;
// Construct the module options
$options = array( 'style' => 'raw' );
// Render this module
$document =& JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$output = $renderer->render($module, $options);
return $output;
}
return null;
}
/*
* Method to determine whether a certain module is loaded or not
*
* @static
* @access public
* @param string $name
* @return bool
*/
public function hasModule($name = '')
{
// Import the module helper
jimport('joomla.application.module.helper');
$instance = JModuleHelper::getModule($name);
if(is_object($instance)) {
return true;
}
return false;
}
/*
* Method to get the parent Menu-Item of the current page
*
* @static
* @access public
* @param int $level
* @return string
*/
public function getActiveParent($level = 0)
{
// Fetch the active menu-item
$menu = JSite::getMenu();
$active = $menu->getActive();
// Get the parent (at a certain level)
$parent = $active->tree[$level];
// Return the title of this Menu-Item
return $menu->getItem($parent)->name;
}
/*
* Method to determine whether the current page is the Joomla! homepage
*
* @static
* @access public
* @param null
* @return bool
*/
public function isHome()
{
// Fetch the active menu-item
$menu = JSite::getMenu();
$active = $menu->getActive();
// Return whether this active menu-item is home or not
if (isset($active))
return (boolean)$active->home;
else return false;
}
/*
* Method to add a global title to every page title
*
* @static
* @access public
* @param string $global_title
* @return null
*/
public function addGlobalTitle( $global_title = null )
{
// Get the current title
$document = JFactory::getDocument();
$title = $document->getTitle();
// Add the global title to the current title
$document->setTitle( $title . '' . $global_title );
}
/*
* Method to detect a certain browser type
*
* @static
* @access public
* @param string $shortname
* @return string
*/
public function isBrowser($shortname = 'ie6')
{
jimport('joomla.environment.browser');
$browser = JBrowser::getInstance();
$name = $browser->getBrowser();
$rt = false;
switch($shortname) {
case 'ie6':
$rt = ($browser->getBrowser() == 'msie' && $browser->getVersion() == '6.0') ? true : false;
break;
case 'ie7':
$rt = ($browser->getBrowser() == 'msie' && $browser->getVersion() == '7.0') ? true : false;
break;
case 'ie8':
$rt = ($browser->getBrowser() == 'msie' && $browser->getVersion() == '8.0') ? true : false;
break;
}
return $rt;
}
/*
* Method to construct the URL for the Yireo CSS/PHP-script
*
* @static
* @access public
* @param array $stylesheets
* @param bool $system_css
* @return string
*/
public function addCssPhp($stylesheets, $system_css = false)
{
$template = JFactory::getApplication()->getTemplate();
$path = 'templates/zengridframework/'.Yth::loadCssPhp($stylesheets, $system_css);
echo '<link rel="stylesheet" href="'.$path.'" type="text/css" />';
}
/*
* Method to construct the URL for the Yireo CSS/PHP-script
*
* @static
* @access public
* @param array $extra
* @return string
*/
public function loadCssPhp($sheets = array(), $system_css = false)
{
// The actual file
$css_php = 'css/css.php';
// Detect component CSS automatically
$option = JRequest::getCmd('option');
if(is_file(dirname(__FILE__).'/css/'.$option.'.css')) {
$sheets[] = $option;
}
// Load the sheet options
$options = array();
if(!empty($sheets) && is_array($sheets)) {
$options[] = 's='.implode(',', $sheets);
}
// Add a SSL-flag
if(JURI::getInstance()->isSsl()) {
$options[] = 'ssl=1';
}
// Add the system CSS flag
if($system_css == true) {
$options[] = 'system=1';
}
if(!empty($options)) {
$css_php .= '?'.implode('&', $options);
}
return $css_php;
}
}
Grazie a tutti in anticipo
Gabriele
-
Ciao ari_gs,
prova a seguire questo articolo
http://www.joomla.it/articoli-della-community/903-configurazione-seo-di-joomla-rendere-appetibile-il-sito-ai-motori-di-ricerca.html
e a commentare la riga 23
#Options +FollowSymLinks
-
Ciao Adottauncane,
ti ringrazio per l'aiuto, ma la cosa non ha cambiato, sempre lo stesso errore...... io ho l'impressione che il problema sia proprio nel php, ho aperto un tiket nell hosting, ora vediamo...
-
Secondo il manteiner il problema stà nella configurazione del sito e quindi nel file htaccess....
Avete consigli in merito?
Grazie
-
Problema risolto, dopo mille verifiche sulla versione in uso del php che sembrava essere la 5.2.14, invece c'era la vecchia 4 che è stata aggiornata....