3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
\r
4 * Copyright (C) 2002-2012 The Nucleus Group
\r
6 * This program is free software; you can redistribute it and/or
\r
7 * modify it under the terms of the GNU General Public License
\r
8 * as published by the Free Software Foundation; either version 2
\r
9 * of the License, or (at your option) any later version.
\r
10 * (see nucleus/documentation/index.html#license for more info)
\r
13 * This class contains the functions that get called by using
\r
14 * the special tags in the skins
\r
16 * The allowed tags for a type of skinpart are defined by the
\r
17 * Skin::getAllowedActionsForType($type) method
\r
19 * @license http://nucleuscms.org/license.txt GNU General Public License
\r
20 * @copyright Copyright (C) 2002-2012 The Nucleus Group
\r
21 * @version $Id: ACTIONS.php 1725 2012-04-07 02:21:32Z sakamocchi $
\r
24 class Actions extends BaseActions
\r
26 // part of the skin currently being parsed ('index', 'item', 'archive',
\r
27 // 'archivelist', 'member', 'search', 'error', 'imagepopup')
\r
30 // contains an assoc array with parameters that need to be included when
\r
31 // generating links to items/archives/... (e.g. catid)
\r
34 // reference to the skin object for which a part is being parsed
\r
37 // used when including templated forms from the include/ dir. The $formdata var
\r
38 // contains the values to fill out in there (assoc array name -> value)
\r
41 // filled out with the number of displayed items after calling one of the
\r
42 // (other)blog/(other)searchresults skinvars.
\r
46 * AdminActions::$page_action_names
\r
47 * list of whole action names with which this class can deal
\r
49 static private $page_action_names = array(
\r
60 'otherarchivedaylist',
\r
61 'otherarchiveyearlist',
\r
84 // deprecated (Nucleus v2.0)
\r
85 /* TODO: remove this */
\r
90 * Actions::$page_type_friendly_names
\r
91 * friendly name for wrapped page types
\r
93 static public $page_type_friendly_names = array(
\r
94 'index' => _SKIN_PART_MAIN,
\r
95 'item' => _SKIN_PART_ITEM,
\r
96 'archivelist' => _SKIN_PART_ALIST,
\r
97 'archive' => _SKIN_PART_ARCHIVE,
\r
98 'search' => _SKIN_PART_SEARCH,
\r
99 'error' => _SKIN_PART_ERROR,
\r
100 'member' => _SKIN_PART_MEMBER,
\r
101 'imagepopup' => _SKIN_PART_POPUP
\r
105 * Actions::get_allowed_actions_for_type()
\r
108 * @param string $type page type
\r
109 * @return array allowed actions for the page type
\r
111 static public function get_allowed_actions_for_type($type)
\r
113 $default_actions = array(
\r
131 'otherarchivedaylist',
\r
132 'otherarchivelist',
\r
133 'otherarchiveyearlist',
\r
148 // deprecated (Nucleus v2.0)
\r
152 // extra actions specific for a certain skin type
\r
153 $extra_actions = array();
\r
158 $extra_actions = array(
\r
172 $extra_actions = array(
\r
189 case 'archivelist':
\r
190 $extra_actions = array(
\r
200 $extra_actions = array(
\r
207 'othersearchresults',
\r
215 $extra_actions = array(
\r
217 // deprecated (Nucleus v2.0)
\r
218 /* TODO: remove this */
\r
223 $extra_actions = array(
\r
231 $extra_actions = array(
\r
254 $extra_actions = array(
\r
260 $extra_actions = array(
\r
277 return array_merge($default_actions, $extra_actions);
\r
281 * AdminActions::get_page_action_names()
\r
285 * @return array list of page action names
\r
287 static public function get_page_action_names()
\r
289 return self::$page_action_names;
\r
293 * Actions::get_page_type_friendly_names()
\r
297 * @return array list of friendly names for page actions
\r
299 static public function get_page_type_friendly_names()
\r
301 return self::$page_type_friendly_names;
\r
305 * Actions::__construct()
\r
306 * Constructor for a new Actions object
\r
308 * @param string $type
\r
311 public function __construct($type)
\r
315 // call constructor of superclass first
\r
316 $this->BaseActions();
\r
317 $this->skintype = $type;
\r
321 $this->linkparams = array('catid' => $catid);
\r
327 * Actions::setSkin()
\r
329 * @param object $skin an instance of Skin class
\r
332 public function setSkin(&$skin)
\r
334 $this->skin =& $skin;
\r
339 * Actions::setParser()
\r
342 * @param object $parser an instance of Parser class
\r
345 public function setParser(&$parser)
\r
347 $this->parser =& $parser;
\r
352 * Actions::doForm()
\r
353 * Forms get parsedincluded now, using an extra <formdata> skinvar
\r
355 * @param string $filename
\r
358 public function doForm($filename)
\r
360 global $DIR_NUCLEUS;
\r
361 array_push($this->parser->actions,'formdata','text','callback','errordiv','ticket');
\r
363 $oldIncludeMode = Parser::getProperty('IncludeMode');
\r
364 $oldIncludePrefix = Parser::getProperty('IncludePrefix');
\r
365 Parser::setProperty('IncludeMode','normal');
\r
366 Parser::setProperty('IncludePrefix','');
\r
368 $this->parse_parsedinclude($DIR_NUCLEUS . 'forms/' . $filename . '.template');
\r
369 Parser::setProperty('IncludeMode',$oldIncludeMode);
\r
370 Parser::setProperty('IncludePrefix',$oldIncludePrefix);
\r
372 array_pop($this->parser->actions); // errordiv
\r
373 array_pop($this->parser->actions); // callback
\r
374 array_pop($this->parser->actions); // text
\r
375 array_pop($this->parser->actions); // formdata
\r
376 array_pop($this->parser->actions); // ticket
\r
381 * Actions::checkCondition()
\r
382 * Checks conditions for if statements
\r
384 * @param string $field type of <%if%>
\r
385 * @param string $name property of field
\r
386 * @param string $value value of property
\r
387 * @return boolean condition
\r
389 public function checkCondition($field, $name='', $value = '')
\r
391 global $catid, $blog, $member, $itemidnext, $itemidprev, $manager, $archiveprevexists, $archivenextexists;
\r
397 $condition = ($blog && $this->ifCategory($name,$value));
\r
399 case 'blogsetting':
\r
400 $condition = ($blog && ($blog->getSetting($name) == $value));
\r
403 $condition = $member->isLoggedIn();
\r
406 $condition = $member->isLoggedIn() && $this->ifOnTeam($name);
\r
409 $condition = $member->isLoggedIn() && $this->ifAdmin($name);
412 $condition = ($itemidnext != '');
\r
415 $condition = ($itemidprev != '');
\r
417 case 'archiveprevexists':
\r
418 $condition = ($archiveprevexists == true);
\r
420 case 'archivenextexists':
\r
421 $condition = ($archivenextexists == true);
\r
424 $condition = (($name == $this->skintype) || ($name == requestVar('action')));
\r
427 $condition = $this->ifHasPlugin($name, $value);
\r
430 $condition = $manager->pluginInstalled("NP_{$field}") && $this->ifPlugin($field, $name, $value);
\r
437 * Actions::_ifHasPlugin()
\r
438 * hasplugin,PlugName
\r
439 * -> checks if plugin exists
\r
440 * hasplugin,PlugName,OptionName
\r
441 * -> checks if the option OptionName from plugin PlugName is not set to 'no'
\r
442 * hasplugin,PlugName,OptionName=value
\r
443 * -> checks if the option OptionName from plugin PlugName is set to value
\r
445 * @param string $name name of plugin
\r
446 * @param string $value
\r
449 private function ifHasPlugin($name, $value)
\r
452 $condition = false;
\r
453 // (pluginInstalled method won't write a message in the actionlog on failure)
\r
454 if ( $manager->pluginInstalled("NP_{$name}") )
\r
456 $plugin =& $manager->getPlugin("NP_{$name}");
\r
457 if ( $plugin != NULL )
\r
459 if ( $value == "" )
\r
465 list($name2, $value2) = preg_split('#=#', $value, 2);
\r
466 if ( $value2 == "" && $plugin->getOption($name2) != 'no' )
\r
470 else if ( $plugin->getOption($name2) == $value2 )
\r
481 * Actions::ifPlugin()
\r
482 * Checks if a plugin exists and call its doIf function
\r
484 * @param string $name name of plugin
\r
485 * @param string $key name of plugin option
\r
486 * @param string $value value of plugin option
\r
489 private function ifPlugin($name, $key = '', $value = '')
\r
493 $plugin =& $manager->getPlugin("NP_{$name}");
\r
499 $params = func_get_args();
\r
500 array_shift($params);
\r
502 return call_user_func_array(array(&$plugin, 'doIf'), $params);
\r
506 * Actions::ifCategory()
\r
507 * Different checks for a category
\r
509 * @param string $name
\r
510 * @param string $value
\r
513 private function ifCategory($name = '', $value='')
\r
515 global $blog, $catid;
\r
517 // when no parameter is defined, just check if a category is selected
\r
518 if ( ($name != 'catname' && $name != 'catid') || ($value == '') )
\r
520 return $blog->isValidCategory($catid);
\r
523 // check category name
\r
524 if ( $name == 'catname' )
\r
526 $value = $blog->getCategoryIdFromName($value);
\r
527 if ( $value == $catid )
\r
529 return $blog->isValidCategory($catid);
\r
533 // check category id
\r
534 if ( ($name == 'catid') && ($value == $catid) )
\r
536 return $blog->isValidCategory($catid);
\r
542 * Actions::ifOnTeam()
\r
543 * Checks if a member is on the team of a blog and return his rights
\r
545 * @param string $blogName name of weblog
\r
548 private function ifOnTeam($blogName = '')
\r
550 global $blog, $member, $manager;
\r
552 // when no blog found
\r
553 if ( ($blogName == '') && !is_object($blog) )
\r
558 // explicit blog selection
\r
559 if ( $blogName != '' )
\r
561 $blogid = getBlogIDFromName($blogName);
\r
564 if ( ($blogName == '') || !$manager->existsBlogID($blogid) )
\r
566 // use current blog
\r
567 $blogid = $blog->getID();
\r
570 return $member->teamRights($blogid);
\r
574 * Actions::ifAdmin()
\r
575 * Checks if a member is admin of a blog
\r
577 * @param string $blogName name of weblog
\r
580 private function ifAdmin($blogName = '')
\r
582 global $blog, $member, $manager;
\r
584 // when no blog found
\r
585 if ( ($blogName == '') && (!is_object($blog)) )
\r
590 // explicit blog selection
\r
591 if ( $blogName != '' )
\r
593 $blogid = getBlogIDFromName($blogName);
\r
596 if ( ($blogName == '') || !$manager->existsBlogID($blogid) )
\r
598 // use current blog
\r
599 $blogid = $blog->getID();
\r
602 return $member->isBlogAdmin($blogid);
\r
608 * - a raw link (html/xml encoded) when no linktext is provided
\r
609 * - a (x)html <a href... link when a text is present (text htmlencoded)
\r
611 * @param string $url URL for href attribute of anchor element
\r
612 * @param string $linktext content of anchor element
\r
615 private function link($url, $linktext = '')
\r
617 $u = Entity::hsc($url);
\r
618 // fix URLs that already had encoded ampersands
\r
619 $u = preg_replace("#&amp;#", '&', $u);
\r
620 if ( $linktext != '' )
\r
622 $l = '<a href="' . $u .'">' . Entity::hsc($linktext) . '</a>';
\r
632 * Actions::searchlink()
\r
633 * Outputs a next/prev link
\r
635 * @param $maxresults
\r
636 * The maximum amount of items shown per page (e.g. 10)
\r
638 * Current start position (requestVar('startpos'))
\r
639 * @param $direction
\r
640 * either 'prev' or 'next'
\r
642 * When present, the output will be a full <a href...> link. When empty,
\r
643 * only a raw link will be outputted
\r
645 private function searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '')
\r
647 global $CONF, $blog, $query, $amount;
\r
648 // TODO: Move request uri to linkparams. this is ugly. sorry for that.
\r
649 $startpos = (integer) $startpos;
\r
650 $parsed = parse_url(serverVar('REQUEST_URI'));
\r
651 $path = $parsed['path'];
\r
652 $parsed = $parsed['query'];
\r
655 if ( $direction == 'prev' )
\r
657 if ( intval($startpos) - intval($maxresults) >= 0 )
\r
659 $startpos = intval($startpos) - intval($maxresults);
\r
661 if ( $this->skintype == 'index' )
\r
665 else if ( $this->skintype == 'search' )
\r
667 $url = $CONF['SearchURL'];
\r
669 $url .= '?' . alterQueryStr($parsed,'startpos',$startpos);
\r
672 else if ( $direction == 'next' )
\r
674 global $navigationItems;
\r
675 if ( !isset($navigationItems) )
\r
677 $navigationItems = 0;
\r
682 $iAmountOnPage = 0;
\r
686 $iAmountOnPage = $this->amountfound;
\r
689 if ( intval($navigationItems) > 0 )
\r
691 $iAmountOnPage = intval($navigationItems) - intval($startpos);
\r
693 elseif ( $iAmountOnPage == 0 )
\r
696 * [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]
\r
697 * try a count query
\r
699 if ( $this->skintype == 'index' )
\r
701 $sqlquery = $blog->getSqlBlog('', 'count');
\r
704 else if ( $this->skintype == 'search' )
\r
706 $unused_highlight = '';
\r
707 $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');
\r
708 $url = $CONF['SearchURL'];
\r
712 $iAmountOnPage = intval(quickQuery($sqlquery)) - intval($startpos);
\r
717 if ( intval($iAmountOnPage) >= intval($maxresults) )
\r
719 $startpos = intval($startpos) + intval($maxresults);
\r
720 $url .= '?' . alterQueryStr($parsed, 'startpos', $startpos);
\r
726 echo $this->link($url, $linktext);
\r
732 * Actions::itemlink()
\r
733 * Creates an item link and if no id is given a todaylink
\r
735 * @param integer $id id for link
\r
736 * @param string $linktext text for link
\r
739 private function itemlink($id, $linktext = '')
\r
744 echo $this->link(Link::create_item_link($id, $this->linkparams), $linktext);
\r
748 $this->parse_todaylink($linktext);
\r
754 * Actions::archivelink)
\r
755 * Creates an archive link and if no id is given a todaylink
\r
757 * @param integer $id id for link
\r
758 * @param string $linktext text for link
\r
761 private function archivelink($id, $linktext = '')
\r
763 global $CONF, $blog;
\r
766 echo $this->link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);
\r
770 $this->parse_todaylink($linktext);
\r
776 * Actions:setBlogCategory()
\r
777 * Helper function that sets the category that a blog will need to use
\r
779 * @param string $blog An object of the blog class, passed by reference (we want to make changes to it)
\r
780 * @param string $catname The name of the category to use
\r
783 private function setBlogCategory(&$blog, $catname)
\r
786 if ( $catname != '' )
\r
788 $blog->setSelectedCategoryByName($catname);
\r
792 $blog->setSelectedCategory($catid);
\r
798 * Actions::preBlogContent()
\r
799 * Notifies the Manager that a PreBlogContent event occurs
\r
801 * @param string $type type of skin
\r
802 * @param object $blog an instance of Blog class
\r
805 private function preBlogContent($type, &$blog)
\r
808 $manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));
\r
813 * Actions::postBlogContent()
\r
814 * Notifies the Manager that a PostBlogContent event occurs
\r
816 * @param string $type type of skin
\r
817 * @param objecct $blog an instance of Blog class
\r
820 private function postBlogContent($type, &$blog)
\r
823 $manager->notify('PostBlogContent', array('blog' => &$blog, 'type' => $type));
\r
828 * Actions::parse_additemform()
\r
829 * Parse skinvar additemform
\r
834 public function parse_additemform()
\r
836 global $blog, $CONF;
\r
837 $this->formdata = array(
\r
838 'adminurl' => Entity::hsc($CONF['AdminURL']),
\r
839 'catid' => $blog->getDefaultCategory()
\r
841 $blog->InsertJavaScriptInfo();
\r
842 $this->doForm('additemform');
\r
847 * Actions::parse_addlink()
\r
848 * Parse skinvar addlink
\r
849 * A Link that allows to open a bookmarklet to add an item
\r
851 public function parse_addlink()
\r
853 global $CONF, $member, $blog;
\r
854 if ( $member->isLoggedIn() && $member->isTeamMember($blog->blogid) )
\r
856 echo $CONF['AdminURL'].'bookmarklet.php?blogid='.$blog->blogid;
\r
862 * Actions::parse_addpopupcode()
\r
863 * Parse skinvar addpopupcode
\r
864 * Code that opens a bookmarklet in an popup window
\r
869 public function parse_addpopupcode()
\r
871 echo "if (event && event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
\r
876 * Parse skinvar adminurl
\r
877 * (shortcut for admin url)
\r
882 public function parse_adminurl()
\r
884 $this->parse_sitevar('adminurl');
\r
889 * Actions::parse_archive()
\r
890 * Parse skinvar archive
\r
892 * @param string $template name of template
\r
893 * @param string $category name of category
\r
896 public function parse_archive($template, $category = '')
\r
898 global $blog, $archive;
\r
899 // can be used with either yyyy-mm or yyyy-mm-dd
\r
900 sscanf($archive,'%d-%d-%d', $y, $m, $d);
\r
901 $this->setBlogCategory($blog, $category);
\r
902 $this->preBlogContent('achive',$blog);
\r
903 $blog->showArchive($template, $y, $m, $d);
\r
904 $this->postBlogContent('achive',$blog);
\r
909 * Actions::parse_archivedate()
\r
910 * %archivedate(locale,date format)%
\r
912 * @param string $locale
\r
915 public function parse_archivedate($locale = '-def-')
\r
920 * TODO: these lines are no meaning because there is no $template.
\r
921 if ( $locale == '-def-' )
\r
923 setlocale(LC_TIME, $template['LOCALE']);
\r
927 setlocale(LC_TIME, $locale);
\r
931 // get archive date
\r
932 sscanf($archive,'%d-%d-%d',$y,$m,$d);
\r
935 $args = func_get_args();
\r
936 // format can be spread over multiple parameters
\r
937 if ( sizeof($args) > 1 )
\r
939 // take away locale
\r
940 array_shift($args);
\r
942 $format=implode(',',$args);
\r
944 elseif ( $d == 0 && $m !=0 )
\r
954 $format = '%d %B %Y';
\r
956 echo i18n::formatted_datetime($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));
\r
961 * Actions::parse_archivedaylist()
\r
962 * Parse skinvar archivedaylist
\r
964 * @param string $template name of template
\r
965 * @param string $category name of category
\r
966 * @param integer $limit the number of items in a display
\r
969 public function parse_archivedaylist($template, $category = 'all', $limit = 0)
\r
972 if ( $category == 'all' )
\r
976 $this->preBlogContent('archivelist',$blog);
\r
977 $this->setBlogCategory($blog, $category);
\r
978 $blog->showArchiveList($template, 'day', $limit);
\r
979 $this->postBlogContent('archivelist',$blog);
\r
984 * Actions::parse_archivelink()
\r
985 * A link to the archives for the current blog (or for default blog)
\r
987 * @param string $linktext text for link
\r
990 public function parse_archivelink($linktext = '')
\r
992 global $blog, $CONF;
\r
995 echo $this->link(Link::create_archivelist_link($blog->getID(), $this->linkparams), $linktext);
\r
999 echo $this->link(Link::create_archivelist_link(), $linktext);
\r
1005 * Actions::parse_archivelist()
\r
1007 * @param string $template name of template
\r
1008 * @param string $category name of category
\r
1009 * @param integer $limit the number of items in a display
\r
1012 public function parse_archivelist($template, $category = 'all', $limit = 0)
\r
1015 if ( $category == 'all' )
\r
1019 $this->preBlogContent('archivelist',$blog);
\r
1020 $this->setBlogCategory($blog, $category);
\r
1021 $blog->showArchiveList($template, 'month', $limit);
\r
1022 $this->postBlogContent('archivelist',$blog);
\r
1027 * Actions::parse_archiveyearlist()
\r
1029 * @param string $template name of template
\r
1030 * @param string $category name of category
\r
1031 * @param integer $limit the number of items in a display
\r
1033 public function parse_archiveyearlist($template, $category = 'all', $limit = 0)
\r
1036 if ( $category == 'all' )
\r
1040 $this->preBlogContent('archivelist',$blog);
\r
1041 $this->setBlogCategory($blog, $category);
\r
1042 $blog->showArchiveList($template, 'year', $limit);
\r
1043 $this->postBlogContent('archivelist',$blog);
\r
1048 * Actions::parse_archivetype()
\r
1049 * Parse skinvar archivetype
\r
1054 public function parse_archivetype()
\r
1056 global $archivetype;
\r
1057 echo $archivetype;
\r
1062 * Actions::parse_blog()
\r
1063 * Parse skinvar blog
\r
1065 * @param string $template name of template
\r
1066 * @param mixed $amount the number of items in a display, in case it includes the beginning
\r
1067 * @param string $category name of category
\r
1070 public function parse_blog($template, $amount = 10, $category = '')
\r
1072 global $blog, $startpos;
\r
1074 list($limit, $offset) = sscanf($amount, '%d(%d)');
\r
1075 $this->setBlogCategory($blog, $category);
\r
1076 $this->preBlogContent('blog',$blog);
\r
1077 $this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);
\r
1078 $this->postBlogContent('blog',$blog);
\r
1083 * Actions::parse_bloglist()
\r
1084 * Parse skinvar bloglist
\r
1085 * Shows a list of all blogs
\r
1087 * @param string $template name of template
\r
1088 * @param string $bnametype whether 'name' or 'shortname' is used for the link text
\r
1089 * @param string $orderby order criteria
\r
1090 * @param string $direction order ascending or descending
\r
1093 public function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc')
\r
1095 Blog::showBlogList($template, $bnametype, $orderby, $direction);
\r
1100 * Actions::parse_blogsetting()
\r
1101 * Parse skinvar blogsetting
\r
1103 * @param string $which key of weblog settings
\r
1106 public function parse_blogsetting($which)
\r
1112 echo Entity::hsc($blog->getID());
\r
1115 echo Entity::hsc($blog->getURL());
\r
1118 echo Entity::hsc($blog->getName());
\r
1121 echo Entity::hsc($blog->getDescription());
\r
1124 echo Entity::hsc($blog->getShortName());
\r
1131 * Actions::parse_callback()
\r
1134 * @param string $eventName name of event
\r
1135 * @param string $type type of skin
\r
1138 public function parse_callback($eventName, $type)
\r
1141 $manager->notify($eventName, array('type' => $type));
\r
1146 * Actions::parse_category()
\r
1147 * Parse skinvar category
\r
1149 * @param string $type key of category settings
\r
1152 public function parse_category($type = 'name')
\r
1154 global $catid, $blog;
\r
1155 if ( !$blog->isValidCategory($catid) )
\r
1163 echo $blog->getCategoryName($catid);
\r
1166 echo $blog->getCategoryDesc($catid);
\r
1176 * Actions::parse_categorylist()
\r
1177 * Parse categorylist
\r
1179 * @param string $template name of template
\r
1180 * @param string $blogname name of weblog
\r
1183 public function parse_categorylist($template, $blogname = '')
\r
1185 global $blog, $manager;
\r
1187 // when no blog found
\r
1188 if ( ($blogname == '') && (!is_object($blog)) )
\r
1193 if ( $blogname == '' )
\r
1195 $this->preBlogContent('categorylist',$blog);
\r
1196 $blog->showCategoryList($template);
\r
1197 $this->postBlogContent('categorylist',$blog);
\r
1201 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1202 $this->preBlogContent('categorylist',$b);
\r
1203 $b->showCategoryList($template);
\r
1204 $this->postBlogContent('categorylist',$b);
\r
1210 * Actions::parse_charset()
\r
1211 * Parse skinvar charset
\r
1216 public function parse_charset()
\r
1218 echo i18n::get_current_charset();
\r
1223 * Actions::parse_commentform()
\r
1224 * Parse skinvar commentform
\r
1226 * @param string $destinationurl URI for redirection
\r
1229 public function parse_commentform($destinationurl = '')
\r
1231 global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage;
\r
1233 // warn when trying to provide a actionurl (used to be a parameter in Nucleus <2.0)
\r
1234 if ( stristr($destinationurl, 'action.php') )
\r
1236 $args = func_get_args();
\r
1237 $destinationurl = $args[1];
\r
1238 ActionLog::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);
\r
1241 $actionurl = $CONF['ActionURL'];
\r
1243 // if item is closed, show message and do nothing
\r
1244 $item =& $manager->getItem($itemid,0,0);
\r
1245 if ( $item['closed'] || !$blog->commentsEnabled() )
\r
1247 $this->doForm('commentform-closed');
\r
1251 if ( !$blog->isPublic() && !$member->isLoggedIn() )
\r
1253 $this->doForm('commentform-closedtopublic');
\r
1257 if ( !$destinationurl )
\r
1259 // note: createLink returns an HTML encoded URL
\r
1260 $destinationurl = Link::create_link(
\r
1263 'itemid' => $itemid,
\r
1264 'title' => $item['title'],
\r
1265 'timestamp' => $item['timestamp'],
\r
1266 'extra' => $this->linkparams
\r
1272 // HTML encode URL
\r
1273 $destinationurl = Entity::hsc($destinationurl);
\r
1276 // values to prefill
\r
1277 $user = cookieVar($CONF['CookiePrefix'] .'comment_user');
\r
1280 $user = postVar('user');
\r
1283 $userid = cookieVar($CONF['CookiePrefix'] .'comment_userid');
\r
1286 $userid = postVar('userid');
\r
1289 $email = cookieVar($CONF['CookiePrefix'] .'comment_email');
\r
1292 $email = postVar('email');
\r
1295 $body = postVar('body');
\r
1297 $this->formdata = array(
\r
1298 'destinationurl' => $destinationurl, // url is already HTML encoded
\r
1299 'actionurl' => Entity::hsc($actionurl),
\r
1300 'itemid' => $itemid,
\r
1301 'user' => Entity::hsc($user),
\r
1302 'userid' => Entity::hsc($userid),
\r
1303 'email' => Entity::hsc($email),
\r
1304 'body' => Entity::hsc($body),
\r
1305 'membername' => $member->getDisplayName(),
\r
1306 'rememberchecked' => cookieVar($CONF['CookiePrefix'] .'comment_user')?'checked="checked"':''
\r
1309 if ( !$member->isLoggedIn() )
\r
1311 $this->doForm('commentform-notloggedin');
\r
1315 $this->doForm('commentform-loggedin');
\r
1321 * Actions::parse_comments()
\r
1322 * Parse skinvar comments
\r
1323 * include comments for one item
\r
1325 * @param string $template name of template
\r
1328 public function parse_comments($template)
\r
1330 global $itemid, $manager, $blog, $highlight;
\r
1331 $template =& $manager->getTemplate($template);
\r
1333 // create parser object & action handler
\r
1334 $actions = new ItemActions($blog);
\r
1335 $parser = new Parser($actions->getDefinedActions(),$actions);
\r
1336 $actions->setTemplate($template);
\r
1337 $actions->setParser($parser);
\r
1338 $item = Item::getitem($itemid, 0, 0);
\r
1339 $actions->setCurrentItem($item);
\r
1341 $comments = new Comments($itemid);
\r
1342 $comments->setItemActions($actions);
\r
1343 // shows ALL comments
\r
1344 $comments->showComments($template, -1, 1, $highlight);
\r
1349 * Actions::parse_errordiv()
\r
1355 public function parse_errordiv()
\r
1357 global $errormessage;
\r
1358 if ( $errormessage )
\r
1360 echo '<div class="error">' . Entity::hsc($errormessage) . "</div>\n";
\r
1366 * Actions::parse_errormessage()
\r
1367 * Parse skinvar errormessage
\r
1372 public function parse_errormessage()
\r
1374 global $errormessage;
\r
1375 echo $errormessage;
\r
1380 * Actions::parse_formdata()
\r
1383 * @param string $what key of format data
\r
1386 public function parse_formdata($what)
\r
1388 echo $this->formdata[$what];
\r
1393 * Actions::parse_ifcat()
\r
1396 * @param string $text
\r
1399 public function parse_ifcat($text = '')
\r
1401 if ( $text == '' )
\r
1404 $this->parse_if('category');
\r
1409 global $catid, $blog;
\r
1410 if ( $blog->isValidCategory($catid) )
\r
1419 * Actions::parse_image()
\r
1420 * Parse skinvar image
\r
1422 * @param string $what name of tag
\r
1425 public function parse_image($what = 'imgtag')
\r
1429 $imagetext = Entity::hsc(requestVar('imagetext'));
\r
1430 $imagepopup = requestVar('imagepopup');
\r
1431 $width = intRequestVar('width');
\r
1432 $height = intRequestVar('height');
\r
1433 $fullurl = Entity::hsc($CONF['MediaURL'] . $imagepopup);
\r
1452 echo "<img src=\"$fullurl\" width=\"$width\" height=\"$height\" alt=\"$imagetext\" title=\"$imagetext\" />";
\r
1459 * Actions::parse_imagetext()
\r
1460 * Parse skinvar imagetext
\r
1465 public function parse_imagetext()
\r
1467 $this->parse_image('imagetext');
\r
1472 * Actions::parse_item()
\r
1473 * Parse skinvar item
\r
1474 * include one item (no comments)
\r
1479 public function parse_item($template)
\r
1481 global $blog, $itemid, $highlight;
\r
1483 // need this to select default category
\r
1484 $this->setBlogCategory($blog, '');
\r
1485 $this->preBlogContent('item',$blog);
\r
1486 $r = $blog->showOneitem($itemid, $template, $highlight);
\r
1489 echo _ERROR_NOSUCHITEM;
\r
1491 $this->postBlogContent('item',$blog);
\r
1496 * Actions::parse_itemid()
\r
1497 * Parse skinvar itemid
\r
1502 public function parse_itemid()
\r
1510 * Actions::parseitemlink()
\r
1511 * Parse skinvar itemlink
\r
1516 public function parse_itemlink($linktext = '')
\r
1519 $this->itemlink($itemid, $linktext);
\r
1524 * Actions::parse_itemtitle()
\r
1530 public function parse_itemtitle($format = '')
\r
1532 global $manager, $itemid;
\r
1533 $item =& $manager->getItem($itemid,0,0);
\r
1535 switch ( $format )
\r
1538 echo Entity::hen($item['title']);
\r
1541 echo $item['title'];
\r
1545 echo Entity::hsc(strip_tags($item['title']));
\r
1552 * Actions::parse_loginform()
\r
1553 * Parse skinvar loginform
\r
1558 public function parse_loginform()
\r
1560 global $member, $CONF;
\r
1561 if ( !$member->isLoggedIn() )
\r
1563 $filename = 'loginform-notloggedin';
\r
1564 $this->formdata = array();
\r
1568 $filename = 'loginform-loggedin';
\r
1569 $this->formdata = array(
\r
1570 'membername' => $member->getDisplayName(),
\r
1573 $this->doForm($filename);
\r
1578 * Actions::parse_member()
\r
1579 * Parse skinvar member
\r
1580 * (includes a member info thingie)
\r
1582 * @param string $what which memberdata is needed
\r
1585 public function parse_member($what)
\r
1587 global $memberinfo, $member, $CONF;
\r
1589 // 1. only allow the member-details-page specific variables on member pages
\r
1590 if ( $this->skintype == 'member' )
\r
1595 echo Entity::hsc($memberinfo->getDisplayName());
\r
1598 echo Entity::hsc($memberinfo->getRealName());
\r
1601 echo Entity::hsc($memberinfo->getNotes());
\r
1604 echo Entity::hsc($memberinfo->getURL());
\r
1607 echo Entity::hsc($memberinfo->getEmail());
\r
1610 echo Entity::hsc($memberinfo->getID());
\r
1615 // 2. the next bunch of options is available everywhere, as long as the user is logged in
\r
1616 if ( $member->isLoggedIn() )
\r
1621 echo $member->getDisplayName();
\r
1623 case 'yourrealname':
\r
1624 echo $member->getRealName();
\r
1627 echo $member->getNotes();
\r
1630 echo $member->getURL();
\r
1633 echo $member->getEmail();
\r
1636 echo $member->getID();
\r
1638 case 'yourprofileurl':
\r
1639 if ($CONF['URLMode'] == 'pathinfo')
\r
1640 echo Link::create_member_link($member->getID());
\r
1642 echo $CONF['IndexURL'] . Link::create_member_link($member->getID());
\r
1650 * Link::parse_membermailform()
\r
1651 * Parse skinvar membermailform
\r
1653 * @param integer $rows the height for textarea
\r
1654 * @param integer $cols the width for textarea
\r
1655 * @param string $desturl URI to redirect
\r
1658 public function parse_membermailform($rows = 10, $cols = 40, $desturl = '')
\r
1660 global $member, $CONF, $memberid;
\r
1662 if ( $desturl == '' )
\r
1664 if ( $CONF['URLMode'] == 'pathinfo' )
\r
1666 $desturl = Link::create_member_link($memberid);
\r
1670 $desturl = $CONF['IndexURL'] . Link::create_member_link($memberid);
\r
1674 $message = postVar('message');
\r
1675 $frommail = postVar('frommail');
\r
1677 $this->formdata = array(
\r
1678 'url' => Entity::hsc($desturl),
\r
1679 'actionurl' => Entity::hsc($CONF['ActionURL']),
\r
1680 'memberid' => $memberid,
\r
1683 'message' => Entity::hsc($message),
\r
1684 'frommail' => Entity::hsc($frommail)
\r
1687 if ( $member->isLoggedIn() )
\r
1689 $this->doForm('membermailform-loggedin');
\r
1691 else if ( $CONF['NonmemberMail'] )
\r
1693 $this->doForm('membermailform-notloggedin');
\r
1697 $this->doForm('membermailform-disallowed');
\r
1703 * Actions::parse_nextarchive()
\r
1704 * Parse skinvar nextarchive
\r
1709 public function parse_nextarchive()
\r
1711 global $archivenext;
\r
1712 echo $archivenext;
\r
1717 * Parse skinvar nextitem
\r
1718 * (include itemid of next item)
\r
1723 public function parse_nextitem()
\r
1725 global $itemidnext;
\r
1726 if ( isset($itemidnext) )
\r
1728 echo (int)$itemidnext;
\r
1734 * Actions::parse_nextitemtitle()
\r
1735 * Parse skinvar nextitemtitle
\r
1736 * (include itemtitle of next item)
\r
1738 * @param string $format format of text
\r
1741 public function parse_nextitemtitle($format = '')
\r
1743 global $itemtitlenext;
\r
1745 switch ( $format )
\r
1748 echo Entity::hen($itemtitlenext);
\r
1751 echo $itemtitlenext;
\r
1755 echo Entity::hsc($itemtitlenext);
\r
1762 * Actions::parse_nextlink()
\r
1763 * Parse skinvar nextlink
\r
1765 * @param string $linktext text for content of anchor element
\r
1766 * @param integer $amount the amount of items in a display
\r
1767 * @param integer $recount increment from this value
\r
1770 public function parse_nextlink($linktext = '', $amount = 10, $recount = '')
\r
1772 global $itemidnext, $archivenext, $startpos;
\r
1773 if ( $this->skintype == 'item' )
\r
1775 $this->itemlink($itemidnext, $linktext);
\r
1777 else if ( $this->skintype == 'search' || $this->skintype == 'index' )
\r
1779 $this->searchlink($amount, $startpos, 'next', $linktext, $recount);
\r
1783 $this->archivelink($archivenext, $linktext);
\r
1789 * Actions::parse_nucleusbutton()
\r
1790 * Parse skinvar nucleusbutton
\r
1792 * @param string $imgurl URL for image
\r
1793 * @param integer $imgwidth width of image
\r
1794 * @param integer $imgheidht height of image
\r
1796 public function parse_nucleusbutton($imgurl = '', $imgwidth = '85', $imgheight = '31')
\r
1799 if ( $imgurl == '' )
\r
1801 $imgurl = $CONF['AdminURL'] . 'nucleus.gif';
\r
1803 else if ( Parser::getProperty('IncludeMode') == 'skindir' )
\r
1805 // when skindit IncludeMode is used: start from skindir
\r
1806 $imgurl = $CONF['SkinsURL'] . Parser::getProperty('IncludePrefix') . $imgurl;
\r
1809 $this->formdata = array(
\r
1810 'imgurl' => $imgurl,
\r
1811 'imgwidth' => $imgwidth,
\r
1812 'imgheight' => $imgheight,
\r
1814 $this->doForm('nucleusbutton');
\r
1819 * Actions::parse_otherarchive()
\r
1820 * Parse skinvar otherarchive
\r
1822 * @param string $blogname name of weblog
\r
1823 * @param string $template name of template
\r
1824 * @param string $category name of category
\r
1827 public function parse_otherarchive($blogname, $template, $category = '')
\r
1829 global $archive, $manager;
\r
1830 sscanf($archive,'%d-%d-%d',$y,$m,$d);
\r
1831 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1832 $this->setBlogCategory($b, $category);
\r
1833 $this->preBlogContent('otherachive',$b);
\r
1834 $b->showArchive($template, $y, $m, $d);
\r
1835 $this->postBlogContent('otherachive',$b);
\r
1840 * Actions::parse_otherarchivedaylist()
\r
1841 * Parse skinvar otherarchivedaylist
\r
1843 * @param string $blogname name of weblog
\r
1844 * @param string $template name of template
\r
1845 * @param string $category name of category
\r
1846 * @param integer $limit the amount of items in a display
\r
1849 public function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0)
\r
1852 if ( $category == 'all')
\r
1856 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1857 $this->setBlogCategory($b, $category);
\r
1858 $this->preBlogContent('otherarchivelist',$b);
\r
1859 $b->showArchiveList($template, 'day', $limit);
\r
1860 $this->postBlogContent('otherarchivelist',$b);
\r
1865 * Actions::parse_otherarchivelist()
\r
1866 * Parse skinvar otherarchivelist
\r
1868 * @param string $blogname name of weblog
\r
1869 * @param string $template name of template
\r
1870 * @param string $category name of category
\r
1871 * @param integer $limit the amount of items in a display
\r
1874 public function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0)
\r
1877 if ( $category == 'all' )
\r
1881 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1882 $this->setBlogCategory($b, $category);
\r
1883 $this->preBlogContent('otherarchivelist',$b);
\r
1884 $b->showArchiveList($template, 'month', $limit);
\r
1885 $this->postBlogContent('otherarchivelist',$b);
\r
1890 * Actions::parse_otherarchiveyearlist()
\r
1891 * Parse skinvar otherarchiveyearlist
\r
1893 * @param string $blogname name of weblog
\r
1894 * @param string $template name of template
\r
1895 * @param string $category name of category
\r
1896 * @limit integer $limit the amount of items in a display
\r
1898 public function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0)
\r
1901 if ( $category == 'all' )
\r
1905 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1906 $this->setBlogCategory($b, $category);
\r
1907 $this->preBlogContent('otherarchivelist',$b);
\r
1908 $b->showArchiveList($template, 'year', $limit);
\r
1909 $this->postBlogContent('otherarchivelist',$b);
\r
1914 * Actions::parse_otherblog()
\r
1915 * Parse skinvar otherblog
\r
1917 * @param string $blogname name of weblog
\r
1918 * @param string $template name of template
\r
1919 * @param mixed $amount the amount of items, in case it includes the beginning
\r
1920 * @param string $category name of category
\r
1923 public function parse_otherblog($blogname, $template, $amount = 10, $category = '')
\r
1927 list($limit, $offset) = sscanf($amount, '%d(%d)');
\r
1929 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1930 $this->setBlogCategory($b, $category);
\r
1931 $this->preBlogContent('otherblog',$b);
\r
1932 $this->amountfound = $b->readLog($template, $limit, $offset);
\r
1933 $this->postBlogContent('otherblog',$b);
\r
1938 * Actions::parse_othersearchresults()
\r
1939 * Parse skinvar othersearchresults
\r
1941 * @param string $blogname name of weblog
\r
1942 * @param string $template name of template
\r
1943 * @param integer $maxresults the amount of results
\r
1946 public function parse_othersearchresults($blogname, $template, $maxresults = 50)
\r
1948 global $query, $amount, $manager, $startpos;
\r
1949 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1950 // need this to select default category
\r
1951 $this->setBlogCategory($b, '');
\r
1952 $this->preBlogContent('othersearchresults',$b);
\r
1953 $b->search($query, $template, $amount, $maxresults, $startpos);
\r
1954 $this->postBlogContent('othersearchresults',$b);
\r
1959 * Actions::parse_plugin()
\r
1960 * Executes a plugin skinvar
\r
1961 * extra parameters can be added
\r
1963 * @param string $pluginName name of plugin (without the NP_)
\r
1966 public function parse_plugin($pluginName)
\r
1970 $plugin =& $manager->getPlugin('NP_' . $pluginName);
\r
1977 $params = func_get_args();
\r
1979 // remove plugin name
\r
1980 array_shift($params);
\r
1982 // add skin type on front
\r
1983 array_unshift($params, $this->skintype);
\r
1985 call_user_func_array(array(&$plugin,'doSkinVar'), $params);
\r
1990 * Actions::parse_prevarchive()
\r
1991 * Parse skinvar prevarchive
\r
1996 public function parse_prevarchive()
\r
1998 global $archiveprev;
\r
1999 echo $archiveprev;
\r
2003 * Actions::parse_preview()
\r
2004 * Parse skinvar preview
\r
2006 * @param string $template name of tempalte
\r
2009 public function parse_preview($template)
\r
2011 global $blog, $CONF, $manager;
\r
2013 $template =& $manager->getTemplate($template);
\r
2015 $row['body'] = '<span id="prevbody"></span>';
\r
2016 $row['title'] = '<span id="prevtitle"></span>';
\r
2017 $row['more'] = '<span id="prevmore"></span>';
\r
2018 $row['itemlink'] = '';
\r
2019 $row['itemid'] = 0; $row['blogid'] = $blog->getID();
\r
2021 echo Template::fill($template['ITEM_HEADER'],$row);
\r
2022 echo Template::fill($template['ITEM'],$row);
\r
2023 echo Template::fill($template['ITEM_FOOTER'],$row);
\r
2028 * Actions::parse_previtem()
\r
2029 * Parse skinvar previtem
\r
2030 * (include itemid of prev item)
\r
2035 public function parse_previtem()
\r
2037 global $itemidprev;
\r
2038 if ( isset($itemidprev) )
\r
2040 echo (integer) $itemidprev;
\r
2046 * Actions::parse_previtemtitle()
\r
2047 * Parse skinvar previtemtitle
\r
2048 * (include itemtitle of prev item)
\r
2050 * @param String $format string format
\r
2051 * @return String formatted string
\r
2053 public function parse_previtemtitle($format = '')
\r
2055 global $itemtitleprev;
\r
2057 switch ( $format )
\r
2060 echo Entity::hen($itemtitleprev);
\r
2063 echo $itemtitleprev;
\r
2067 echo Entity::hsc($itemtitleprev);
\r
2074 * Actions::parse_prevlink()
\r
2075 * Parse skinvar prevlink
\r
2077 * @param string $linktext text as a content of anchor element
\r
2078 * @param integer the amount of links
\r
2081 public function parse_prevlink($linktext = '', $amount = 10)
\r
2083 global $itemidprev, $archiveprev, $startpos;
\r
2085 if ( $this->skintype == 'item' )
\r
2087 $this->itemlink($itemidprev, $linktext);
\r
2089 else if ( $this->skintype == 'search' || $this->skintype == 'index' )
\r
2091 $this->searchlink($amount, $startpos, 'prev', $linktext);
\r
2095 $this->archivelink($archiveprev, $linktext);
\r
2101 * Actions::parse_query()
\r
2102 * Parse skinvar query
\r
2103 * (includes the search query)
\r
2108 public function parse_query()
\r
2111 echo Entity::hsc($query);
\r
2116 * Actions::parse_referer()
\r
2117 * Parse skinvar referer
\r
2122 public function parse_referer()
\r
2124 echo Entity::hsc(serverVar('HTTP_REFERER'));
\r
2129 * Actions::parse_searchform()
\r
2130 * Parse skinvar searchform
\r
2132 * @param string $blogname name of weblog
\r
2135 public function parse_searchform($blogname = '')
\r
2137 global $CONF, $manager, $maxresults;
\r
2140 $blog =& $manager->getBlog(getBlogIDFromName($blogname));
\r
2146 // use default blog when no blog is selected
\r
2147 $this->formdata = array(
\r
2148 'id' => $blog?$blog->getID():$CONF['DefaultBlog'],
\r
2149 'query' => Entity::hsc(getVar('query')),
\r
2151 $this->doForm('searchform');
\r
2156 * Actions::parse_searchresults()
\r
2157 * Parse skinvar searchresults
\r
2159 * @param string $template name of tempalte
\r
2160 * @param integer $maxresults searched items in a display
\r
2163 public function parse_searchresults($template, $maxresults = 50 )
\r
2165 global $blog, $query, $amount, $startpos;
\r
2167 $this->setBlogCategory($blog, ''); // need this to select default category
\r
2168 $this->preBlogContent('searchresults',$blog);
\r
2169 $this->amountfound = $blog->search($query, $template, $amount, $maxresults, $startpos);
\r
2170 $this->postBlogContent('searchresults',$blog);
\r
2175 * Actions::parse_self()
\r
2176 * Parse skinvar self
\r
2181 public function parse_self()
\r
2184 echo $CONF['Self'];
\r
2189 * Actions::parse_sitevar()
\r
2190 * Parse skinvar sitevar
\r
2191 * (include a sitevar)
\r
2193 * @param string $which
\r
2196 public function parse_sitevar($which)
\r
2202 echo $CONF['IndexURL'];
\r
2205 echo $CONF['SiteName'];
\r
2208 echo $CONF['AdminEmail'];
\r
2211 echo $CONF['AdminURL'];
\r
2217 * Actions::parse_skinname()
\r
2223 public function parse_skinname()
\r
2225 echo $this->skin->getName();
\r
2230 * Actions::parse_skintype()
\r
2231 * Parse skintype (experimental)
\r
2236 public function parse_skintype()
\r
2238 echo $this->skintype;
\r
2243 * Actions::parse_text()
\r
2249 public function parse_text($which)
\r
2251 // constant($which) only available from 4.0.4 :(
\r
2252 if ( defined($which) )
\r
2254 eval("echo $which;");
\r
2260 * Actions::parse_ticket()
\r
2266 public function parse_ticket()
\r
2269 $manager->addTicketHidden();
\r
2274 * Actions::parse_todaylink()
\r
2275 * Parse skinvar todaylink
\r
2276 * A link to the today page (depending on selected blog, etc...)
\r
2278 * @param string $linktext text for link
\r
2281 public function parse_todaylink($linktext = '')
\r
2283 global $blog, $CONF;
\r
2286 echo $this->link(Link::create_blogid_link($blog->getID(),$this->linkparams), $linktext);
\r
2290 echo $this->link($CONF['SiteUrl'], $linktext);
\r
2297 * When commentform is not used, to include a hidden field with itemid
\r
2302 public function parse_vars()
\r
2305 echo '<input type="hidden" name="itemid" value="'.$itemid.'" />' . "\n";
\r
2310 * Actions::parse_version()
\r
2311 * Parse skinvar version
\r
2312 * (include nucleus versionnumber)
\r
2317 public function parse_version()
\r
2320 echo 'Nucleus CMS ' . $nucleus['version'];
\r
2325 * Actions::parse_sticky()
\r
2326 * Parse skinvar sticky
\r
2328 * @param integer $itemnumber id of item
\r
2329 * @param string $template name of template
\r
2332 public function parse_sticky($itemnumber = 0, $template = '')
\r
2336 $itemnumber = intval($itemnumber);
\r
2337 $itemarray = array($itemnumber);
\r
2339 $b =& $manager->getBlog(getBlogIDFromItemID($itemnumber));
\r
2340 $this->preBlogContent('sticky',$b);
\r
2341 $this->amountfound = $b->readLogFromList($itemarray, $template);
\r
2342 $this->postBlogContent('sticky',$b);
\r