PHP 代码在网页中显示以下错误

标签 php joomla joomla3.0

我正在使用 joomla .. , 通过运行 joomla 它在链接部分显示以下错误 主要错误是关于参数需要引用。 如果我更改它,它将不会显示任何链接

Warning: Parameter 2 to modChrome_artblock() expected to be a reference, value given in D:\xampp\htdocs\Site\templates\a_2\html\modules.php on line 36

Warning: Parameter 3 to modChrome_artblock() expected to be a reference, value given in D:\xampp\htdocs\site\templates\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($styles[$style], $module, $params, $attribs);

最佳答案

尝试以下操作,它将解决您的问题

Go to Module -> Advance -> Module Style -> Change "inherited" to corresponding position styles. (e.g: select art-nostyle, art-block et) in that case you don't have to scale down Php version

*****它应该在joomla管理员中打开,然后执行上述步骤

关于PHP 代码在网页中显示以下错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43831209/

相关文章:

php - Joomla 所有菜单项都链接到主页

php - 从 silverstripe $many_many 关系返回所有者字段

php - Laravel Form 方法 VS 传统编码

php - 在 Joomla 3.x 的前端文章编辑页面中显示自定义字段选项卡

css - Gantry 5.1.2 - 布局 block 宽度

php - MySQL 逗号分隔值

php - joomla 1.7 : overriding pagination. php 不工作

php - php 重定向不起作用

html - 在页面上居中 div

php - Joomla 3.x Protostar - 如何使自定义位置水平而不是垂直堆叠