这是我的插件:
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Import library dependencies
jimport('joomla.plugin.plugin');
class plgContentEya extends JPlugin
{
function plgContentEya( &$subject, $config )
{
parent::__construct( $subject, $config );
}
/**
* Plugin method with the same name as the event will be called automatically.
*/
function onAfterDisplayContent( &$article, &$params, $limitstart)
{//Echo script there
echo "script works";
// Plugin code goes here.
// You can access parameters via $this->params.
return "<script src='http://widget.eya.com/sprk.1.0.2.js' type='text/javascript'></script>";
}
}
http://docs.joomla.org/Plugin/Events/Content
根据他们的文件
Return Value
String. Returned value from this event will be displayed in a placeholder. Most templates display this placeholder after the article separator.
当我安装它时,该插件会显示并且不会引发错误。但该事件永远不会被触发。我在文档中没有看到
<install version="2.5" type="plugin" group="content">
<name>plg_content_eya</name>
<author>eya</author>
<creationDate>February 2013</creationDate>
<copyright>(C) 2013 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>anattaligg@graeit.com</authorEmail>
<authorUrl>www.eya.com</authorUrl>
<version>2.5.0</version>
<description>Adds eya plugin ot your site</description>
<files>
<filename plugin="eya">eya.php</filename>
</files>
</install>