2017-05-07 68 views
1

上午使用joomla .., 由runnig joomla它顯示以下錯誤鏈接部分 和主要錯誤是關於該參數期待引用。 如果我改變它,它不會顯示任何鏈接Php代碼顯示網頁中的以下錯誤

警告:參數2 modChrome_artblock()預計將在 d給予 參考,值:\ XAMPP \ htdocs中\網站\模板\ A_2 \ HTML \ modules.php上 線36

警告:參數3至modChrome_artblock()預計將在 d給予 參考,值:\ XAMPP \ htdocs中\站點\模板\ A_2 \ HTML \ modules.php on line 36

並在此錯誤的PHP代碼是

- <?php 
      defined('_JEXEC') or die; 

      if (!defined('_ARTX_FUNCTIONS')) 
      require_once dirname(__FILE__) . str_replace('/', DIRECTORY_SEPARATOR, '/../functions.php'); 

      function modChrome_artstyle($module, &$params, &$attribs) 
      { 
      $style = isset($attribs['artstyle']) ? $attribs['artstyle'] : 'art-nostyle'; 
      $styles = array(
       'art-nostyle' => 'modChrome_artnostyle', 
       'art-block' => 'modChrome_artblock', 
       'art-article' => 'modChrome_artarticle', 
       'art-vmenu' => 'modChrome_artvmenu' 
      ); 
      // moduleclass_sfx support: 
      // '' or 'suffix' - the default module style: custom suffix will not be added to the module tag 
      //      but will be added to the module elements. 
      // ' suffix'  - adds suffix to the module as well as to the module elements. 
      // 'art-...'  - overwrites the default module style. 
      // 'suffix art-...' - overwrites the default style and adds suffix to the module and 
      //      to its elements, does not add art-... to the module elements. 

      $classes = explode(' ', rtrim($params->get('moduleclass_sfx'))); 
      $keys = array_keys($styles); 
      $art = array(); 
      foreach ($classes as $key => $class) { 
       if (in_array($class, $keys)) { 
       $art[] = $class; 
       $classes[$key] = ' '; 
       } 
      } 
      $classes = str_replace(' ', ' ', rtrim(implode(' ', $classes))); 
      $style = count($art) ? array_pop($art) : $style; 
      $params->set('moduleclass_sfx', $classes); 


> call_user_func($styles[$style], $module, $params, $attribs); 

      } 

      function modChrome_artnostyle($module, &$params, &$attribs) 
      { 
      if (!empty ($module->content)) : ?> 
      <!-- begin nostyle --> 
      <div class="art-nostyle<?php echo $params->get('moduleclass_sfx'); ?>"> 
      <?php if ($module->showtitle != 0) : ?> 
      <h3><?php echo $module->title; ?></h3> 
      <?php endif; ?> 
      <!-- begin nostyle content --> 
      <?php echo $module->content; ?> 
      <!-- end nostyle content --> 
      </div> 
      <!-- end nostyle --> 
      <?php endif; 
      } 

      function modChrome_artblock($module, &$params, &$attribs) 
      { 
      if (!empty ($module->content)) 
       echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, 
       $params->get('moduleclass_sfx')); 
      } 

      function modChrome_artvmenu($module, &$params, &$attribs) 
      { 
      if (!empty ($module->content)) { 
       if (function_exists('artxVMenuBlock')) 
       echo artxVMenuBlock(($module->showtitle != 0) ? $module->title : '', $module->content, 
        $params->get('moduleclass_sfx')); 
       else 
       echo artxBlock(($module->showtitle != 0) ? $module->title : '', $module->content, 
        $params->get('moduleclass_sfx')); 
      } 
      } 

      function modChrome_artarticle($module, &$params, &$attribs) 
      { 
      if (!empty ($module->content)) { 
       $data = array('classes' => $params->get('moduleclass_sfx'), 'content' => $module->content); 
       if ($module->showtitle != 0) 
       $data['header-text'] = $module->title; 
       echo artxPost($data); 
      } 
      } 

它示出了錯誤

call_user_func($樣式[$風格],$模塊,$ PARAMS,$ attribs);

+2

可能的重複[爲什麼錯誤「預計是參考,給定的值」出現?](http://stackoverflow.com/questions/3637164/why-does-the-error-expected-to -be-a-reference-value-given-appear) – user4035

+0

不,它不是。我已經通過這個鏈接超過三次 –

+0

你是否嘗試將'call_user_func'改爲'call_user_func_array'? – user4035

回答

2

嘗試以下方法,它會解決你的問題

轉到模塊 - >高級 - >模塊樣式 - >更改 「繼承」 到相應位置的樣式。 (例如:選擇藝術nostyle,藝術塊等),在這種情況下 你不必按比例縮小的PHP版本

*****它應該在的Joomla管理員打開,然後做以上步驟

+0

哇!非常感謝它解決了我的問題:-) –