Joomla!のプラグインを「書きました」!私は実際に誰かのものなので "書かれた"と言いますが、それはJoomla 1.5用であり、Joomla 1.7で動作するようにアップグレードしようとしています。しかし、それはインストールされており、実行したくありません。私はそれが何のエラーも発生させようとしましたが、それは私に何も与えませんでした。 Joomla 1.7のコードかどうかはわかりませんが、私もあなたもそれを手伝ってくれることを願っています。Joomlaプラグインが実行されていません(インストールされています)
<?php
// no direct access
defined('_VALID_MOS') or die('Restricted access');
jimport('joomla.plugin.plugin');
class plgContentRegisteredTags extends JPlugin
{
function plgContentRegisteredTags (&$subject, $params)
{
parent::__construct($subject,$params);
}
function onPrepareContent ($context, &$article, &$params, $page=0)
{
global $mainframe;
//if (!$published) return true;
// define the regular expression for the bot
$regex1 = "#{reg}(.*?){/reg}#s";
$regex2 = "#{noreg}(.*?){/noreg}#s";
// perform the replacement
$article->text = preg_replace_callback(
$regex1,
create_function(
'$matches',
'global $my;
if($my->id) return $matches[1];
return "";'
),
$article->text
);
$article->text = preg_replace_callback(
$regex2,
create_function(
'$matches',
'global $my;
if(!$my->id) return $matches[1];
return "";'
),
$article->text
);
return true;
}
}
注:それはちょうどそれが有効になっていて、インストールされているにもかかわらず、すべての(エラーなし、ノーコードの実行)で実行する必要はありません。
ご協力いただければ幸いです。
を読むことができますルート) – Nobody
比較的に 'components/com_registeredtags/helloworld.php' –
私はしばらくjoomlaで動作しませんでしたが、コンポーネントファイルの名前に命名規則があることを覚えています。私はそれが 'componentname.php'であるべきだと思います。だから、 'helloworld.php'ではなく' registeredtags.php'になります。 – Nobody