<?php

/**
  * BLOG:CMS: PHP/MySQL Personal Content Management System (CMS)
  * http://blogcms.com/
  * ----------------------------------------------------------------
  *
  * Copyright (C) 2003-2005 Radek HULÁN
  * http://hulan.cz/contact/
  *
  * ----------------------------------------------------------------
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
**/

class NP_Item extends NucleusPlugin {
	function getName() { return 'Item'; }
	function getAuthor() { return 'Radek Hulán'; }
	function getURL() { return 'http://hulan.cz/'; }
	function getVersion() { return '1.1'; }

	function supportsFeature($feature) {
		switch($feature) {
			case 'SqlTablePrefix':
				return 1;
			default:
				return 0;
		}
	}

  function getDescription() { return 'This plugin can be used to display one item with a given template. Usage: <%Item(itemid,templatename)%>';  }

  function doSkinVar($data,$id=0,$template='default') {
    global $catid;
	$_blogid = getBlogIDFromItemID(intval($id));
	$b = new BLOG($_blogid);
	$_catid = $catid;
	unset($catid);
    $extraQuery = ' and inumber=' . intval($id);
    $b->readLogAmount($template, 1, $extraQuery, 0, 1, 0);
	$catid = $_catid;
  }
}
?>