/** * Parse skinvar comments * include comments for one item */ function parse_comments($template) { global $itemid, $manager, $blog, $highlight; $template =& $manager->getTemplate($template); // create parser object & action handler $actions =& new ITEMACTIONS($blog); $parser =& new PARSER($actions->getDefinedActions(), $actions); $actions->setTemplate($template); $actions->setParser($parser); $item = ITEM::getitem($itemid, 0, 0); $actions->setCurrentItem($item); $comments =& new COMMENTS($itemid); $comments->setItemActions($actions); $comments->showComments($template, -1, 1, $highlight); // shows ALL comments }
/** * Returns the requested item object. If it is not in the cache, it will * first be loaded and then placed in the cache. * Intended use: $item =& $manager->getItem(1234) */ function &getItem($itemid, $allowdraft, $allowfuture) { $item =& $this->items[$itemid]; // check the draft and future rules if the item was already cached if ($item) { if (!$allowdraft && $item['draft']) { return 0; } $blog =& $this->getBlog(getBlogIDFromItemID($itemid)); if (!$allowfuture && $item['timestamp'] > $blog->getCorrectTime()) { return 0; } } if (!$item) { // load class if needed $this->loadClass('ITEM'); // load item object $item = ITEM::getitem($itemid, $allowdraft, $allowfuture); $this->items[$itemid] = $item; } return $item; }