开发者

Change PHP code Joomla plugin

How to change the code so that text "I am a happy plugin" appears only in the archived items?.

This is the PHP code:

<?php
// No direct access allowed to this file
defined( '_JEXEC' ) or die( 'Restricted access' );

// Import Joomla! Plugin library file
jimport('joomla.plugin.plugin开发者_StackOverflow');

//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";
    }
}
?>


Looks like this is what you are looking for:

function onPrepareContent (&$article, &$params, $page=0)
{
    if ($article->state==-1) {
        print "I am a happy plugin";
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜