![]() |
Здравствуйте, Гость ( Вход | Регистрация )
![]() |
![]()
Сообщение
#1
|
|
Member ![]() ![]() Группа: User Сообщений: 22 Регистрация: 5-September 05 Пользователь №: 9 ![]() |
1. Создал файл NP_Sticky.php с кодом
<? class NP_Sticky extends NucleusPlugin { function getName() { return 'Sticky'; } function getAuthor() { return 'Anand'; } function getURL() { return 'http://www.tamizhan.com/'; } function getVersion() { return '0.03'; } function install(){ $this->createOption('itemid','enter the sticky item\'s id','text','263'); $this->createOption('template','enter the name of the template','text','punnagai'); } function unInstall() { } function NP_Sticky(){ $this->skinType = ''; } function event_PreSkinParse($data){ $this->skinType = $data['type']; } function getDescription() { return 'This plugin can be used to display one sticky post'; } function getEventList() { return array('PreBlogContent','PreSkinParse'); } function event_PreBlogContent($data) { if ($this->skinType == 'index'){ $myBlog = new BLOG($data['blog']->blogid); $itemid = $this->getOption('itemid'); $template = $this->getOption('template'); $extraQuery = ' and inumber=' . intval($itemid); $myBlog->readLogAmount($template, 1, $extraQuery, 0, 1, 0); } } } ?> 2. Залил в папку nucleus\plugins 3. В админской зоне установил этот плагин 4. Собственно а дальше что? Есть две поля "enter the sticky item's id" и "enter the name of the template" в которые надо заносить какие-то параметры. Собственно вопрос, какие параметры там надо установить и как сделать чтоб этот прикреплённый пост был виден? |
|
|
![]() ![]() |
Текстовая версия | Сейчас: 25th January 2021 - 09:45 AM |