开发者

Change PHP code Joomla plugin

开发者 https://www.devze.com 2023-03-22 23:56 出处:网络
How to change the code so that text \"I am a happy plugin\" appears only in the archived items?. This is the PHP code:

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

精彩评论

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