<?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); } } ?>