我正在开发一个插件(对于2.5的开发仍然是一个新发现),但不知何故,我甚至不会让野兽去做最基本的事情 - 它似乎根本没有启动。但是,PHP的解析器错误显示在前端,但是当此代码被触发时什么也没有发生 - 诊断消息没有显示在屏幕上或我的日志文件中...为什么我的Joomla 2.5插件没有执行?
问题在哪里?
<?php
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');
class plgContentSIMPLE_Plugin extends JPlugin
{
function plgContentSIMPLE_Plugin(&$subject , $config) {
echo "constructor!";
parent::__construct($subject , $config);
}
function onPrepareContent ($article , $params, $limitstart)
{
oBDC ("oPC",$article , $params, $limitstart);
}
function onBeforeDisplayContent ($article , $params, $limitstart)
{
oBDC ("oBDC",$article , $params, $limitstart);
}
function onAfterDisplayContent ($article , $params, $limitstart)
{
oBDC ("oADC",$article , $params, $limitstart);
}
function oBDC($whoscalling,$article , $params, $limitstart)
{
echo "whoscalling = " . $whoscalling;
$myFile = "./obdc.log";
$fh = fopen($myFile, 'a'); // or die("can't open file");
$stringData = "\n whoscalling = " . $whoscalling;
fwrite($fh, $stringData);
fclose($fh);
}
}
谢谢布伦特 - 我终于发现我没有命名的权利:((inmotion链接是有用的,谢谢:) – MBaas