登录 注册

登录

问题 Ja social模板安装出现问题

更多
2011年03月16日 06:28 - 2011年03月16日 06:55 #1 作者: 万远征
使用Ja Social模板快速安装后,预览主页提示如下信息:

Warning: Parameter 1 to plgContentPlg_JAThumbnail::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Disqus_debate_echo::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Jafacebookshare::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentEmailCloak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentLoadModule() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPagebreak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPlg_JAThumbnail::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Disqus_debate_echo::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Jafacebookshare::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentEmailCloak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentLoadModule() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPagebreak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPlg_JAThumbnail::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Disqus_debate_echo::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Jafacebookshare::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentEmailCloak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentLoadModule() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPagebreak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPlg_JAThumbnail::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Disqus_debate_echo::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Jafacebookshare::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentEmailCloak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentLoadModule() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPagebreak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPlg_JAThumbnail::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Disqus_debate_echo::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentPlg_Jafacebookshare::onPrepareContent() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\event.php on line 67

Warning: Parameter 1 to plgContentEmailCloak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentLoadModule() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136

Warning: Parameter 1 to plgContentPagebreak() expected to be a reference, value given in D:\wamp\www\joomla\libraries\joomla\event\dispatcher.php on line 136


按照提示打开event.php文件,内容如下:
<?php
/**
* @version		$Id: event.php 14401 2010-01-26 14:10:00Z louis $
* @package		Joomla.Framework
* @subpackage	Event
* @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
 
// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();
 
jimport( 'joomla.base.observer' );
 
/**
 * JEvent Class
 *
 * @abstract
 * @package		Joomla.Framework
 * @subpackage	Event
 * @since		1.5
 */
class JEvent extends JObserver
{
 
	/**
	 * Constructor
	 *
	 * For php4 compatability we must not use the __constructor as a constructor for plugins
	 * because func_get_args ( void ) returns a copy of all passed arguments NOT references.
	 * This causes problems with cross-referencing necessary for the observer design pattern.
	 *
	 * @param object $subject The object to observe
	 * @since 1.5
	 */
	function JEvent(& $subject) {
		parent::__construct($subject);
	}
 
	/**
	 * Method to trigger events
	 *
	 * @access public
	 * @param array Arguments
	 * @return mixed Routine return value
	 * @since 1.5
	 */
	function update(& $args)
	{
		/*
		 * First lets get the event from the argument array.  Next we will unset the
		 * event argument as it has no bearing on the method to handle the event.
		 */
		$event = $args['event'];
		unset($args['event']);
 
		/*
		 * If the method to handle an event exists, call it and return its return
		 * value.  If it does not exist, return null.
		 */
		if (method_exists($this, $event)) {
			return call_user_func_array ( array($this, $event), $args );
		} else {
			return null;
		}
	}
}

第67行应该是
return call_user_func_array ( array($this, $event), $args );

dispatcher.ini内容如下
<?php
/**
* @version		$Id: dispatcher.php 14401 2010-01-26 14:10:00Z louis $
* @package		Joomla.Framework
* @subpackage	Event
* @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
 
// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();
 
jimport('joomla.base.observable');
 
/**
 * Class to handle dispatching of events.
 *
 * This is the Observable part of the Observer design pattern
 * for the event architecture.
 *
 * @package 	Joomla.Framework
 * @subpackage	Event
 * @since	1.5
 * @see		JPlugin
 * @link http://docs.joomla.org/Tutorial:Plugins Plugin tutorials
 */
class JDispatcher extends JObservable
{
	/**
	 * Constructor
	 *
	 * @access	protected
	 */
	function __construct()
	{
		parent::__construct();
	}
 
	/**
	 * Returns a reference to the global Event Dispatcher object, only creating it
	 * if it doesn't already exist.
	 *
	 * This method must be invoked as:
	 * 		<pre>  $dispatcher = &JDispatcher::getInstance();</pre>
	 *
	 * @access	public
	 * @return	JDispatcher	The EventDispatcher object.
	 * @since	1.5
	 */
	function & getInstance()
	{
		static $instance;
 
		if (!is_object($instance)) {
			$instance = new JDispatcher();
		}
 
		return $instance;
	}
 
	/**
	 * Registers an event handler to the event dispatcher
	 *
	 * @access	public
	 * @param	string	$event		Name of the event to register handler for
	 * @param	string	$handler	Name of the event handler
	 * @return	void
	 * @since	1.5
	 */
	function register($event, $handler)
	{
		// Are we dealing with a class or function type handler?
		if (function_exists($handler))
		{
			// Ok, function type event handler... lets attach it.
			$method = array ('event' => $event, 'handler' => $handler);
			$this->attach($method);
		}
		elseif (class_exists($handler))
		{
			 //Ok, class type event handler... lets instantiate and attach it.
			$this->attach(new $handler($this));
		}
		else
		{
			JError::raiseWarning('SOME_ERROR_CODE', 'JDispatcher::register: Event handler not recognized.', 'Handler: '.$handler );
		}
	}
 
	/**
	 * Triggers an event by dispatching arguments to all observers that handle
	 * the event and returning their return values.
	 *
	 * @access	public
	 * @param	string	$event			The event name
	 * @param	array	$args			An array of arguments
	 * @param	boolean	$doUnpublished	[DEPRECATED]
	 * @return	array	An array of results from each function call
	 * @since	1.5
	 */
	function trigger($event, $args = null, $doUnpublished = false)
	{
		// Initialize variables
		$result = array ();
 
		/*
		 * If no arguments were passed, we still need to pass an empty array to
		 * the call_user_func_array function.
		 */
		if ($args === null) {
			$args = array ();
		}
 
		/*
		 * We need to iterate through all of the registered observers and
		 * trigger the event for each observer that handles the event.
		 */
		foreach ($this->_observers as $observer)
		{
			if (is_array($observer))
			{
				/*
				 * Since we have gotten here, we know a little something about
				 * the observer.  It is a function type observer... lets see if
				 * it handles our event.
				 */
				if ($observer['event'] == $event)
				{
					if (function_exists($observer['handler']))
					{
						$result[] = call_user_func_array($observer['handler'], $args);
					}
					else
					{
						/*
						 * Couldn't find the function that the observer specified..
						 * wierd, lets throw an error.
						 */
						JError::raiseWarning('SOME_ERROR_CODE', 'JDispatcher::trigger: Event Handler Method does not exist.', 'Method called: '.$observer['handler']);
					}
				}
				else
				{
					 // Handler doesn't handle this event, move on to next observer.
					continue;
				}
			}
			elseif (is_object($observer))
			{
				/*
				 * Since we have gotten here, we know a little something about
				 * the observer.  It is a class type observer... lets see if it
				 * is an object which has an update method.
				 */
				if (method_exists($observer, 'update'))
				{
					/*
					 * Ok, now we know that the observer is both not an array
					 * and IS an object.  Lets trigger its update method if it
					 * handles the event and return any results.
					 */
					if (method_exists($observer, $event))
					{
						$args['event'] = $event;
						$result[] = $observer->update($args);
					}
					else
					{
						/*
						 * Handler doesn't handle this event, move on to next
						 * observer.
						 */
						continue;
					}
				}
				else
				{
					/*
					 * At this point, we know that the registered observer is
					 * neither a function type observer nor an object type
					 * observer.  PROBLEM, lets throw an error.
					 */
					JError::raiseWarning('SOME_ERROR_CODE', 'JDispatcher::trigger: Unknown Event Handler.', $observer );
				}
			}
		}
		return $result;
	}
}

第136行应该是:
$result[] = call_user_func_array($observer['handler'], $args);

水平有限,烦请指点,应该怎么修改?
最后修改: 2011年03月16日 06:55 由 Joomla之门.

登录 或者   注册一个会员帐号 来参与讨论

更多
2011年03月16日 11:17 #2 作者: mymyhope
如果你下载的模板没有问题的话,那么很可能是你的运行环境的PHP版本的问题。
检查下你的php版本。

www.cn21cn.com
Magento中文网站
www.magentochina.org
QQ:703640

登录 或者   注册一个会员帐号 来参与讨论

更多
2011年03月21日 08:52 #3 作者: 万远征
回二楼:多谢,多谢。PHP由5.3.0降到5.2.11,问题解决。希望能给其他人做个范例。

回三楼:请去http://hotping.com/查找,刚才试验了一下,好像打不开,可能被和谐了。如果不行,请回本帖,我发你的邮箱去。

登录 或者   注册一个会员帐号 来参与讨论

更多
2011年04月18日 02:57 #4 作者: lyh
必须更换PHP版本才可以解决这个问题吗?

登录 或者   注册一个会员帐号 来参与讨论

更多
2011年04月18日 07:49 #5 作者: 万远征
是,ja social不支持PHP 5.3及以上版本。或者什么时候Joomlart更新了也未可知,GK已经把所有的jomsocial相关模板升级了。

登录 或者   注册一个会员帐号 来参与讨论