The plugin displays the category logo of the item it's belong to.
| General Plugin info | |
|---|---|
| Author: | Qi, Liangpei (qi at jabber.org) |
| Current Version: | 0.3 |
| Download: | - |
| Code: | np_catlogo.php_code |
| Demo: | - |
| Forum Thread: | - |
There also is another way to get the same effect, even more simple and nice, and no plugin needed, see this forum thread.
<div class="logobox"><%CatLogo%></div>
When installed, there will be 4 options in the category config page. Goto the bottom of the blog config page, pick one category to set its logo options:
The pic path and pic name will be combined together to form the whole logo picture source in the <img > tag. Remember to prepare this path and the needed logo pictures by yourself.
Nucleus (by default) relies heavily upon a seperate stylesheet (.css file) that controls the look of your weblog/news page. The look of the category logo can be controlled by adding extra declarations to your css file. For instance:
.logobox { float: right; margin: 2px; padding: 0; }
<?php class NP_CatLogo extends NucleusPlugin { function getName() { return 'Category Logo'; } function getAuthor() { return 'Qi, Liangpei';} function getURL() { return '';} function getVersion() { return '0.3';} function getDescription() { return 'The plugin displays the category logo of the item it\'s belong to.'; } function supportsFeature ($what) { switch ($what) { case 'SqlTablePrefix': return 1; default: return 0; } } function install() { $this->createCategoryOption('pic_width','the width of your logo pic','text','50'); $this->createCategoryOption('pic_height','the height of your logo pic','text','50'); $this->createCategoryOption('pic_path','Logo pics Path. Default is nucleus/plugins/cat_logo/. And it must be ended with a slash.','text','/nucleus/plugins/cat_logo/'); $this->createCategoryOption('pic_name','the full name of your logo pic','text','logo.jpg'); } function doTemplateVar(&$item) { global $manager, $blog; $currentBlogid = $blog->getID(); $catlogo_width = $this->getCategoryOption($item->catid, pic_width); $catlogo_height = $this->getCategoryOption($item->catid, pic_height); $catlogo_path = $this->getCategoryOption($item->catid, pic_path); $catlogo_name = $this->getCategoryOption($item->catid, pic_name); $catlogo = $catlogo_path . $catlogo_name; $params = array('blogid' => $currentBlogid); $catlink = createCategoryLink($item->catid, $params); echo '<a href="' . $catlink . '">' . '<img src="' . $catlogo . '" width="' . $catlogo_width . '" height="' . $catlogo_height . '" alt="' . 'logo" >' . '</a>'; } } ?>
NP_CatLogo version 0.3 works with Nucleus CMS version 3.31 - 2007-10-27 ftruscot
:: Back to Plugins Overview ::