brgreen Posted July 10, 2012 Share Posted July 10, 2012 My Joomla website ios getting this message after I installed template: Parse error: syntax error, unexpected T_STRING in /home/randblaw/public_html/modules/mod_djmultitreemenu/mod_djmultitreemenu.php on line 3 I went and located referencing file in error message. I can not see where the error is in the code. Can some one please fix this error for me. I have attached the code below. Thanks You. <?php/*** @version 1.6.2 stable* @package DJ-MultiTree Menu* @copyright Copyright © 2010 Blue Constant Media LTD, All rights reserved.* @license http://www.gnu.org/licenses GNU/GPL* @author url: http://design-joomla.eu* @author email contact@design-joomla.eu* @developer Szymon Woronowski - szymon.woronowski@design-joomla.eu*** DJ-MultiTree Menu is free software: you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation, either version 3 of the License, or* (at your option) any later version.** DJ-MultiTree Menu is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with DJ-MultiTree Menu. If not, see <http://www.gnu.org/licenses/>.**/ // no direct access defined('_JEXEC') or die('Restricted access'); // Include the syndicate functions only oncerequire_once(dirname(__FILE__).DS.'helper.php'); $app = JFactory::getApplication(); $document = JFactory::getDocument();if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu_fx.css')) { $css_fx = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu_fx.css';} else { $css_fx = 'templates/'.$app->getTemplate().'/css/djmultitreemenu_fx.css';}if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu.css')) { $css = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu.css';} else { $css = 'templates/'.$app->getTemplate().'/css/djmultitreemenu.css';}if($params->get('moo',1)) { JHTML::_('behavior.mootools'); $js = 'modules/mod_djmultitreemenu/assets/js/djmultitreemenu.js'; $document->addScript($js); $document->addStyleSheet($css); $document->addStyleSheet($css_fx); $effect = $params->get('effect'); if($effect!='linear') $effect.=':out'; if(!is_numeric($duration = $params->get('duration'))) $duration = 200; if(!is_numeric($delay = $params->get('delay'))) $delay = 1200; $height_fx = ($params->get('height_fx')) ? 'true' : 'false'; $width_fx = ($params->get('width_fx')) ? 'true' : 'false'; $opacity_fx = ($params->get('opacity_fx')) ? 'true' : 'false'; $submenu_tree = $params->get('submenu_tree',2); $options = "{transition: '$effect', duration: $duration, delay: $delay, submenu_tree: $submenu_tree, height_fx: $height_fx, width_fx: $width_fx, opacity_fx: $opacity_fx, mid: $module->id }"; $wrapper_id = $params->get('wrapper'); $js = " (function($){ // Mootools Safe Mode ON window.addEvent('domready',function(){ var DJTreeMenusAll = $('dj-mtmenu$module->id').getChildren('li.dj-up'); var wrapper = $('$wrapper_id'); DJTreeMenusAll.each(function(djmenu){ if(djmenu.getElement('.dj-drop')) { DJTreeMenus.include(new DJTreeMenu(djmenu,0,wrapper,$options)); } else { djmenu.addEvent('mouseenter',function(){ djmenu.addClass('hover'); }); djmenu.addEvent('mouseleave',function(){ djmenu.removeClass('hover'); }); } }); }); })(document.id);"; $document->addScriptDeclaration($js); } else { if(preg_match('/MSIE 6.0/',$_SERVER['HTTP_USER_AGENT'])) { // IE6 JHTML::_('behavior.mootools'); $css = $css_fx; $js = 'modules/mod_djmultitreemenu/assets/js/ie6Hover.js'; $document->addScript($js); } $document->addStyleSheet($css);}$params->def('module_id',$module->id);$djtreemenu = new modDJMultiTreeMenuHelper();require(JModuleHelper::getLayoutPath('mod_djmultitreemenu'));?> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 10, 2012 Share Posted July 10, 2012 When posting code, enclose it within the forum's . . . BBCode tags. Quote Link to comment Share on other sites More sharing options...
brgreen Posted July 10, 2012 Author Share Posted July 10, 2012 Sorry here you go. <?php/*** @version 1.6.2 stable* @package DJ-MultiTree Menu* @copyright Copyright (C) 2010 Blue Constant Media LTD, All rights reserved.* @license http://www.gnu.org/licenses GNU/GPL* @author url: http://design-joomla.eu* @author email contact@design-joomla.eu* @developer Szymon Woronowski - szymon.woronowski@design-joomla.eu*** DJ-MultiTree Menu is free software: you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation, either version 3 of the License, or* (at your option) any later version.** DJ-MultiTree Menu is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with DJ-MultiTree Menu. If not, see <http://www.gnu.org/licenses/>.**/ // no direct access defined('_JEXEC') or die('Restricted access'); // Include the syndicate functions only oncerequire_once(dirname(__FILE__).DS.'helper.php'); $app = JFactory::getApplication(); $document = JFactory::getDocument();if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu_fx.css')) { $css_fx = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu_fx.css';} else { $css_fx = 'templates/'.$app->getTemplate().'/css/djmultitreemenu_fx.css';}if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu.css')) { $css = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu.css';} else { $css = 'templates/'.$app->getTemplate().'/css/djmultitreemenu.css';}if($params->get('moo',1)) { JHTML::_('behavior.mootools'); $js = 'modules/mod_djmultitreemenu/assets/js/djmultitreemenu.js'; $document->addScript($js); $document->addStyleSheet($css); $document->addStyleSheet($css_fx); $effect = $params->get('effect'); if($effect!='linear') $effect.=':out'; if(!is_numeric($duration = $params->get('duration'))) $duration = 200; if(!is_numeric($delay = $params->get('delay'))) $delay = 1200; $height_fx = ($params->get('height_fx')) ? 'true' : 'false'; $width_fx = ($params->get('width_fx')) ? 'true' : 'false'; $opacity_fx = ($params->get('opacity_fx')) ? 'true' : 'false'; $submenu_tree = $params->get('submenu_tree',2); $options = "{transition: '$effect', duration: $duration, delay: $delay, submenu_tree: $submenu_tree, height_fx: $height_fx, width_fx: $width_fx, opacity_fx: $opacity_fx, mid: $module->id }"; $wrapper_id = $params->get('wrapper'); $js = " (function($){ // Mootools Safe Mode ON window.addEvent('domready',function(){ var DJTreeMenusAll = $('dj-mtmenu$module->id').getChildren('li.dj-up'); var wrapper = $('$wrapper_id'); DJTreeMenusAll.each(function(djmenu){ if(djmenu.getElement('.dj-drop')) { DJTreeMenus.include(new DJTreeMenu(djmenu,0,wrapper,$options)); } else { djmenu.addEvent('mouseenter',function(){ djmenu.addClass('hover'); }); djmenu.addEvent('mouseleave',function(){ djmenu.removeClass('hover'); }); } }); }); })(document.id);"; $document->addScriptDeclaration($js); } else { if(preg_match('/MSIE 6.0/',$_SERVER['HTTP_USER_AGENT'])) { // IE6 JHTML::_('behavior.mootools'); $css = $css_fx; $js = 'modules/mod_djmultitreemenu/assets/js/ie6Hover.js'; $document->addScript($js); } $document->addStyleSheet($css);}$params->def('module_id',$module->id);$djtreemenu = new modDJMultiTreeMenuHelper();require(JModuleHelper::getLayoutPath('mod_djmultitreemenu'));?> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 10, 2012 Share Posted July 10, 2012 I was really hoping it wasn't actually formatted that poorly. At least add linefeeds and indent it properly so people that might try to help you are able to read it. Quote Link to comment Share on other sites More sharing options...
brgreen Posted July 10, 2012 Author Share Posted July 10, 2012 This is how it looks in dreamweaver when i open the file. I tried formatting the best i could for you. <?php/*** @version 1.6.2 stable* @package DJ-MultiTree Menu* @copyright Copyright (C) 2010 Blue Constant Media LTD, All rights reserved.* @license http://www.gnu.org/licenses GNU/GPL* @author url: http://design-joomla.eu* @author email contact@design-joomla.eu* @developer Szymon Woronowski - szymon.woronowski@design-joomla.eu*** DJ-MultiTree Menu is free software: you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation, either version 3 of the License, or* (at your option) any later version.** DJ-MultiTree Menu is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with DJ-MultiTree Menu. If not, see <http://www.gnu.org/licenses/>.**/ // no direct access defined('_JEXEC') or die('Restricted access'); // Include the syndicate functions only oncerequire_once(dirname(__FILE__).DS.'helper.php'); $app = JFactory::getApplication(); $document = JFactory::getDocument();if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu_fx.css')) { $css_fx = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu_fx.css';} else { $css_fx = 'templates/'.$app >getTemplate().'/css/djmultitreemenu_fx.css';}if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app >getTemplate().DS.'css'.DS.'djmultitreemenu.css')) { $css = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu.css';} else { $css = 'templates/'.$app >getTemplate().'/css/djmultitreemenu.css';}if($params->get('moo',1)) { JHTML::_('behavior.mootools'); $js = 'modules/mod_djmultitreemenu/assets/js/djmultitreemenu.js'; $document->addScript($js); $document->addStyleSheet($css); $document->addStyleSheet($css_fx); $effect = $params->get('effect'); if($effect!='linear') $effect.=':out'; if(!is_numeric($duration = $params->get('duration'))) $duration = 200; if(!is_numeric($delay = $params->get('delay'))) $delay = 1200; $height_fx = ($params->get('height_fx')) ? 'true' : 'false'; $width_fx = ($params->get('width_fx')) ? 'true' : 'false'; $opacity_fx = ($params->get('opacity_fx')) ? 'true' : 'false'; $submenu_tree = $params->get('submenu_tree',2); $options = "{transition: '$effect', duration: $duration, delay: $delay, submenu_tree: $submenu_tree, height_fx: $height_fx, width_fx: $width_fx, opacity_fx: $opacity_fx, mid: $module->id }"; $wrapper_id = $params->get('wrapper'); $js = " (function($){ // Mootools Safe Mode ON window.addEvent('domready',function(){ var DJTreeMenusAll = $('dj-mtmenu$module->id').getChildren('li.dj-up'); var wrapper = $('$wrapper_id'); DJTreeMenusAll.each(function(djmenu){ if(djmenu.getElement('.dj-drop')) { DJTreeMenus.include(new DJTreeMenu(djmenu,0,wrapper,$options)); } else { djmenu.addEvent('mouseenter',function(){ djmenu.addClass('hover'); }); djmenu.addEvent('mouseleave',function(){ djmenu.removeClass('hover'); }); } }); }); })(document.id);"; $document->addScriptDeclaration($js); } else { if(preg_match('/MSIE 6.0/',$_SERVER['HTTP_USER_AGENT'])) { // IE6 JHTML::_('behavior.mootools'); $css = $css_fx; $js = 'modules/mod_djmultitreemenu/assets/js/ie6Hover.js'; $document->addScript($js); } $document->addStyleSheet($css);}$params->def('module_id',$module->id);$djtreemenu = new modDJMultiTreeMenuHelper();require(JModuleHelper::getLayoutPath('mod_djmultitreemenu'));?> Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted July 10, 2012 Share Posted July 10, 2012 I literally did nothing but properly format the code, and it no longer throws a parse error. <?php /*** @version 1.6.2 stable* @package DJ-MultiTree Menu* @copyright Copyright (C) 2010 Blue Constant Media LTD, All rights reserved.* @license http://www.gnu.org/licenses GNU/GPL* @author url: http://design-joomla.eu* @author email contact@design-joomla.eu* @developer Szymon Woronowski - szymon.woronowski@design-joomla.eu*** DJ-MultiTree Menu is free software: you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation, either version 3 of the License, or* (at your option) any later version.** DJ-MultiTree Menu is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with DJ-MultiTree Menu. If not, see <http://www.gnu.org/licenses/>.**/ // no direct access defined('_JEXEC') or die('Restricted access'); // Include the syndicate functions only oncerequire_once(dirname(__FILE__).DS.'helper.php'); $app = JFactory::getApplication(); $document = JFactory::getDocument(); if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu_fx.css')) { $css_fx = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu_fx.css'; } else { $css_fx = 'templates/'.$app->getTemplate().'/css/djmultitreemenu_fx.css'; } if($params->get('css',1) || !file_exists(JPATH_ROOT.DS.'templates'.DS.$app->getTemplate().DS.'css'.DS.'djmultitreemenu.css')) { $css = 'modules/mod_djmultitreemenu/assets/css/djmultitreemenu.css'; } else { $css = 'templates/'.$app->getTemplate().'/css/djmultitreemenu.css'; } if($params->get('moo',1)) { JHTML::_('behavior.mootools'); $js = 'modules/mod_djmultitreemenu/assets/js/djmultitreemenu.js'; $document->addScript($js); $document->addStyleSheet($css); $document->addStyleSheet($css_fx); $effect = $params->get('effect'); if($effect!='linear') $effect.=':out'; if(!is_numeric($duration = $params->get('duration'))) $duration = 200; if(!is_numeric($delay = $params->get('delay'))) $delay = 1200; $height_fx = ($params->get('height_fx')) ? 'true' : 'false'; $width_fx = ($params->get('width_fx')) ? 'true' : 'false'; $opacity_fx = ($params->get('opacity_fx')) ? 'true' : 'false'; $submenu_tree = $params->get('submenu_tree',2); $options = "{transition: '$effect', duration: $duration, delay: $delay, submenu_tree: $submenu_tree, height_fx: $height_fx, width_fx: $width_fx, opacity_fx: $opacity_fx, mid: $module->id }"; $wrapper_id = $params->get('wrapper'); $js = " (function($){ // Mootools Safe Mode ON window.addEvent('domready',function(){ var DJTreeMenusAll = $('dj-mtmenu$module->id').getChildren('li.dj-up'); var wrapper = $('$wrapper_id'); DJTreeMenusAll.each(function(djmenu){ if(djmenu.getElement('.dj-drop')) { DJTreeMenus.include(new DJTreeMenu(djmenu,0,wrapper,$options)); } else { djmenu.addEvent('mouseenter',function(){ djmenu.addClass('hover'); }); djmenu.addEvent('mouseleave',function(){ djmenu.removeClass('hover'); }); } }); }); })(document.id); "; $document->addScriptDeclaration($js); } else { if(preg_match('/MSIE 6.0/',$_SERVER['HTTP_USER_AGENT'])) { // IE6 JHTML::_('behavior.mootools'); $css = $css_fx; $js = 'modules/mod_djmultitreemenu/assets/js/ie6Hover.js'; $document->addScript($js); } $document->addStyleSheet($css); } $params->def('module_id',$module->id); $djtreemenu = new modDJMultiTreeMenuHelper(); require(JModuleHelper::getLayoutPath('mod_djmultitreemenu')); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.