NP_StickyItem code

<?php
 
class NP_StickyItem extends NucleusPlugin {
	function getName() { return 'StickyItem'; }
	function getAuthor() { return 'Anand (edited by xiffy)'; }
	function getURL() { return 'http://www.tamizhan.com/'; }
	function getVersion() { return '0.14'; }
 
	function supportsFeature($feature) {
		switch($feature) {
			case 'SqlTablePrefix':
		return 1;
			default:
		return 0;
   		}
 	}
	function install(){
	    $this->createOption('itemid','enter the sticky item\'s id','text','2');
        $this->createOption('template','enter the name of the template','text','default');
    }
 
    function unInstall() {}
 
    function getDescription() {
        return 'This plugin can be used to display one sticky post';
    }
 
    function doSkinVar($data) {
        global $manager, $blog, $CONF;
        if ($blog) $b =& $blog;
        else       $b =& $manager->getBlog($CONF['DefaultBlog']);
 
        $itemid = $this->getOption('itemid');
        $template = $this->getOption('template');
        $extraQuery = ' and inumber=' . intval($itemid);
        $b->readLogAmount($template, 1, $extraQuery, 0, 1, 0);
    }
}
?>
stickyitem_code.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki