0
"행복한 플러그인입니다"라는 텍스트가 아카이브 된 항목에만 표시되도록 코드를 변경하는 방법은 무엇입니까?PHP 코드 Joomla 플러그인 변경
function onPrepareContent (&$article, &$params, $page=0)
{
if ($article->state==-1) {
print "I am a happy plugin";
}
}
:
<?php
// No direct access allowed to this file
defined('_JEXEC') or die('Restricted access');
// Import Joomla! Plugin library file
jimport('joomla.plugin.plugin');
//The Content plugin MakePlugIn
class plgContentMakePlugIn extends JPlugin
{
function plgContentMakePlugIn (&$subject)
{
parent::__construct ($subject);
}
function onPrepareContent (&$article, &$params, $page=0)
{
print "I am a happy plugin";
}
}
?>