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);
\r
412 $condition = $member->isLoggedIn() && $member->isAdmin();
\r
414 case 'allowloginedit':
\r
415 $condition = $member->isLoggedIn() && ($CONF['AllowLoginEdit'] || $member->isAdmin());
\r
418 $condition = ($itemidnext != '');
\r
421 $condition = ($itemidprev != '');
\r
423 case 'archiveprevexists':
\r
424 $condition = ($archiveprevexists == true);
\r
426 case 'archivenextexists':
\r
427 $condition = ($archivenextexists == true);
\r
430 $condition = (($name == $this->skintype) || ($name == requestVar('action')));
\r
433 $condition = $this->ifHasPlugin($name, $value);
\r
435 case 'adminaction':
\r
436 $condition = ($this->objAdmin->action == $name);
\r
438 case 'adminoldaction':
\r
439 $condition = ($this->objAdmin->action == $name);
\r
441 case 'addresschange':
\r
442 $condition = ($this->_ifAddresscange());
\r
444 case 'bechangepass':
\r
445 $condition = ($this->_beChangePassword());
\r
447 case 'skincandidates':
\r
448 $condition = ($this->_ifSkincandidates());
\r
450 case 'nameclashes':
\r
451 $condition = requestVar('nameclashes');
\r
453 case 'existsnewplugin':
\r
454 $condition = ($this->_existsNewPlugin());
\r
457 $condition = $manager->pluginInstalled("NP_{$field}") && $this->ifPlugin($field, $name, $value);
\r
464 * Actions::_ifHasPlugin()
\r
465 * hasplugin,PlugName
\r
466 * -> checks if plugin exists
\r
467 * hasplugin,PlugName,OptionName
\r
468 * -> checks if the option OptionName from plugin PlugName is not set to 'no'
\r
469 * hasplugin,PlugName,OptionName=value
\r
470 * -> checks if the option OptionName from plugin PlugName is set to value
\r
472 * @param string $name name of plugin
\r
473 * @param string $value
\r
476 private function ifHasPlugin($name, $value)
\r
479 $condition = false;
\r
480 // (pluginInstalled method won't write a message in the actionlog on failure)
\r
481 if ( $manager->pluginInstalled("NP_{$name}") )
\r
483 $plugin =& $manager->getPlugin("NP_{$name}");
\r
484 if ( $plugin != NULL )
\r
486 if ( $value == "" )
\r
492 list($name2, $value2) = preg_split('#=#', $value, 2);
\r
493 if ( $value2 == "" && $plugin->getOption($name2) != 'no' )
\r
497 else if ( $plugin->getOption($name2) == $value2 )
\r
508 * Actions::ifPlugin()
\r
509 * Checks if a plugin exists and call its doIf function
\r
511 * @param string $name name of plugin
\r
512 * @param string $key name of plugin option
\r
513 * @param string $value value of plugin option
\r
516 private function ifPlugin($name, $key = '', $value = '')
\r
520 $plugin =& $manager->getPlugin("NP_{$name}");
\r
526 $params = func_get_args();
\r
527 array_shift($params);
\r
529 return call_user_func_array(array(&$plugin, 'doIf'), $params);
\r
533 * Actions::ifCategory()
\r
534 * Different checks for a category
\r
536 * @param string $name
\r
537 * @param string $value
\r
540 private function ifCategory($name = '', $value='')
\r
542 global $blog, $catid;
\r
544 // when no parameter is defined, just check if a category is selected
\r
545 if ( ($name != 'catname' && $name != 'catid') || ($value == '') )
\r
547 return $blog->isValidCategory($catid);
\r
550 // check category name
\r
551 if ( $name == 'catname' )
\r
553 $value = $blog->getCategoryIdFromName($value);
\r
554 if ( $value == $catid )
\r
556 return $blog->isValidCategory($catid);
\r
560 // check category id
\r
561 if ( ($name == 'catid') && ($value == $catid) )
\r
563 return $blog->isValidCategory($catid);
\r
569 * Actions::ifOnTeam()
\r
570 * Checks if a member is on the team of a blog and return his rights
\r
572 * @param string $blogName name of weblog
\r
575 private function ifOnTeam($blogName = '')
\r
577 global $blog, $member, $manager;
\r
579 // when no blog found
\r
580 if ( ($blogName == '') && !is_object($blog) )
\r
585 // explicit blog selection
\r
586 if ( $blogName != '' )
\r
588 $blogid = getBlogIDFromName($blogName);
\r
591 if ( ($blogName == '') || !$manager->existsBlogID($blogid) )
\r
593 // use current blog
\r
594 $blogid = $blog->getID();
\r
597 return $member->teamRights($blogid);
\r
601 * Actions::ifAdmin()
\r
602 * Checks if a member is admin of a blog
\r
604 * @param string $blogName name of weblog
\r
607 private function ifAdmin($blogName = '')
\r
609 global $blog, $member, $manager;
\r
611 // when no blog found
\r
612 if ( ($blogName == '') && (!is_object($blog)) )
\r
617 // explicit blog selection
\r
618 if ( $blogName != '' )
\r
620 $blogid = getBlogIDFromName($blogName);
\r
623 if ( ($blogName == '') || !$manager->existsBlogID($blogid) )
\r
625 // use current blog
\r
626 $blogid = $blog->getID();
\r
629 return $member->isBlogAdmin($blogid);
\r
635 * - a raw link (html/xml encoded) when no linktext is provided
\r
636 * - a (x)html <a href... link when a text is present (text htmlencoded)
\r
638 * @param string $url URL for href attribute of anchor element
\r
639 * @param string $linktext content of anchor element
\r
642 private function link($url, $linktext = '')
\r
644 $u = Entity::hsc($url);
\r
645 // fix URLs that already had encoded ampersands
\r
646 $u = preg_replace("#&amp;#", '&', $u);
\r
647 if ( $linktext != '' )
\r
649 $l = '<a href="' . $u .'">' . Entity::hsc($linktext) . '</a>';
\r
659 * Actions::searchlink()
\r
660 * Outputs a next/prev link
\r
662 * @param $maxresults
\r
663 * The maximum amount of items shown per page (e.g. 10)
\r
665 * Current start position (requestVar('startpos'))
\r
666 * @param $direction
\r
667 * either 'prev' or 'next'
\r
669 * When present, the output will be a full <a href...> link. When empty,
\r
670 * only a raw link will be outputted
\r
672 private function searchlink($maxresults, $startpos, $direction, $linktext = '', $recount = '')
\r
674 global $CONF, $blog, $query, $amount;
\r
675 // TODO: Move request uri to linkparams. this is ugly. sorry for that.
\r
676 $startpos = (integer) $startpos;
\r
677 $parsed = parse_url(serverVar('REQUEST_URI'));
\r
678 $path = $parsed['path'];
\r
679 $parsed = $parsed['query'];
\r
682 if ( $direction == 'prev' )
\r
684 if ( intval($startpos) - intval($maxresults) >= 0 )
\r
686 $startpos = intval($startpos) - intval($maxresults);
\r
688 if ( $this->skintype == 'index' )
\r
692 else if ( $this->skintype == 'search' )
\r
694 $url = $CONF['SearchURL'];
\r
696 $url .= '?' . alterQueryStr($parsed,'startpos',$startpos);
\r
699 else if ( $direction == 'next' )
\r
701 global $navigationItems;
\r
702 if ( !isset($navigationItems) )
\r
704 $navigationItems = 0;
\r
709 $iAmountOnPage = 0;
\r
713 $iAmountOnPage = $this->amountfound;
\r
716 if ( intval($navigationItems) > 0 )
\r
718 $iAmountOnPage = intval($navigationItems) - intval($startpos);
\r
720 elseif ( $iAmountOnPage == 0 )
\r
723 * [%nextlink%] or [%prevlink%] probably called before [%blog%] or [%searchresults%]
\r
724 * try a count query
\r
726 if ( $this->skintype == 'index' )
\r
728 $sqlquery = $blog->getSqlBlog('', 'count');
\r
731 else if ( $this->skintype == 'search' )
\r
733 $unused_highlight = '';
\r
734 $sqlquery = $blog->getSqlSearch($query, $amount, $unused_highlight, 'count');
\r
735 $url = $CONF['SearchURL'];
\r
739 $iAmountOnPage = intval(quickQuery($sqlquery)) - intval($startpos);
\r
744 if ( intval($iAmountOnPage) >= intval($maxresults) )
\r
746 $startpos = intval($startpos) + intval($maxresults);
\r
747 $url .= '?' . alterQueryStr($parsed, 'startpos', $startpos);
\r
753 echo $this->link($url, $linktext);
\r
759 * Actions::itemlink()
\r
760 * Creates an item link and if no id is given a todaylink
\r
762 * @param integer $id id for link
\r
763 * @param string $linktext text for link
\r
766 private function itemlink($id, $linktext = '')
\r
771 echo $this->link(Link::create_item_link($id, $this->linkparams), $linktext);
\r
775 $this->parse_todaylink($linktext);
\r
781 * Actions::archivelink)
\r
782 * Creates an archive link and if no id is given a todaylink
\r
784 * @param integer $id id for link
\r
785 * @param string $linktext text for link
\r
788 private function archivelink($id, $linktext = '')
\r
790 global $CONF, $blog;
\r
793 echo $this->link(Link::create_archive_link($blog->getID(), $id, $this->linkparams), $linktext);
\r
797 $this->parse_todaylink($linktext);
\r
803 * Actions:setBlogCategory()
\r
804 * Helper function that sets the category that a blog will need to use
\r
806 * @param string $blog An object of the blog class, passed by reference (we want to make changes to it)
\r
807 * @param string $catname The name of the category to use
\r
810 private function setBlogCategory(&$blog, $catname)
\r
813 if ( $catname != '' )
\r
815 $blog->setSelectedCategoryByName($catname);
\r
819 $blog->setSelectedCategory($catid);
\r
825 * Actions::preBlogContent()
\r
826 * Notifies the Manager that a PreBlogContent event occurs
\r
828 * @param string $type type of skin
\r
829 * @param object $blog an instance of Blog class
\r
832 private function preBlogContent($type, &$blog)
\r
835 $manager->notify('PreBlogContent',array('blog' => &$blog, 'type' => $type));
\r
840 * Actions::postBlogContent()
\r
841 * Notifies the Manager that a PostBlogContent event occurs
\r
843 * @param string $type type of skin
\r
844 * @param objecct $blog an instance of Blog class
\r
847 private function postBlogContent($type, &$blog)
\r
850 $manager->notify('PostBlogContent', array('blog' => &$blog, 'type' => $type));
\r
855 * Actions::parse_additemform()
\r
856 * Parse skinvar additemform
\r
861 public function parse_additemform()
\r
863 global $blog, $CONF;
\r
864 $this->formdata = array(
\r
865 'adminurl' => Entity::hsc($CONF['AdminURL']),
\r
866 'catid' => $blog->getDefaultCategory()
\r
868 $blog->InsertJavaScriptInfo();
\r
869 $this->doForm('additemform');
\r
874 * Actions::parse_addlink()
\r
875 * Parse skinvar addlink
\r
876 * A Link that allows to open a bookmarklet to add an item
\r
878 public function parse_addlink()
\r
880 global $CONF, $member, $blog;
\r
881 if ( $member->isLoggedIn() && $member->isTeamMember($blog->blogid) )
\r
883 echo $CONF['AdminURL'].'bookmarklet.php?blogid='.$blog->blogid;
\r
889 * Actions::parse_addpopupcode()
\r
890 * Parse skinvar addpopupcode
\r
891 * Code that opens a bookmarklet in an popup window
\r
896 public function parse_addpopupcode()
\r
898 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
903 * Parse skinvar adminurl
\r
904 * (shortcut for admin url)
\r
909 public function parse_adminurl()
\r
911 $this->parse_sitevar('adminurl');
\r
916 * Actions::parse_archive()
\r
917 * Parse skinvar archive
\r
919 * @param string $template name of template
\r
920 * @param string $category name of category
\r
923 public function parse_archive($template, $category = '')
\r
925 global $blog, $archive;
\r
926 // can be used with either yyyy-mm or yyyy-mm-dd
\r
927 sscanf($archive,'%d-%d-%d', $y, $m, $d);
\r
928 $this->setBlogCategory($blog, $category);
\r
929 $this->preBlogContent('achive',$blog);
\r
930 $blog->showArchive($template, $y, $m, $d);
\r
931 $this->postBlogContent('achive',$blog);
\r
936 * Actions::parse_archivedate()
\r
937 * %archivedate(locale,date format)%
\r
939 * @param string $locale
\r
942 public function parse_archivedate($locale = '-def-')
\r
947 * TODO: these lines are no meaning because there is no $template.
\r
948 if ( $locale == '-def-' )
\r
950 setlocale(LC_TIME, $template['LOCALE']);
\r
954 setlocale(LC_TIME, $locale);
\r
958 // get archive date
\r
959 sscanf($archive,'%d-%d-%d',$y,$m,$d);
\r
962 $args = func_get_args();
\r
963 // format can be spread over multiple parameters
\r
964 if ( sizeof($args) > 1 )
\r
966 // take away locale
\r
967 array_shift($args);
\r
969 $format=implode(',',$args);
\r
971 elseif ( $d == 0 && $m !=0 )
\r
981 $format = '%d %B %Y';
\r
983 echo i18n::formatted_datetime($format, mktime(0,0,0,$m?$m:1,$d?$d:1,$y));
\r
988 * Actions::parse_archivedaylist()
\r
989 * Parse skinvar archivedaylist
\r
991 * @param string $template name of template
\r
992 * @param string $category name of category
\r
993 * @param integer $limit the number of items in a display
\r
996 public function parse_archivedaylist($template, $category = 'all', $limit = 0)
\r
999 if ( $category == 'all' )
\r
1003 $this->preBlogContent('archivelist',$blog);
\r
1004 $this->setBlogCategory($blog, $category);
\r
1005 $blog->showArchiveList($template, 'day', $limit);
\r
1006 $this->postBlogContent('archivelist',$blog);
\r
1011 * Actions::parse_archivelink()
\r
1012 * A link to the archives for the current blog (or for default blog)
\r
1014 * @param string $linktext text for link
\r
1017 public function parse_archivelink($linktext = '')
\r
1019 global $blog, $CONF;
\r
1022 echo $this->link(Link::create_archivelist_link($blog->getID(), $this->linkparams), $linktext);
\r
1026 echo $this->link(Link::create_archivelist_link(), $linktext);
\r
1032 * Actions::parse_archivelist()
\r
1034 * @param string $template name of template
\r
1035 * @param string $category name of category
\r
1036 * @param integer $limit the number of items in a display
\r
1039 public function parse_archivelist($template, $category = 'all', $limit = 0)
\r
1042 if ( $category == 'all' )
\r
1046 $this->preBlogContent('archivelist',$blog);
\r
1047 $this->setBlogCategory($blog, $category);
\r
1048 $blog->showArchiveList($template, 'month', $limit);
\r
1049 $this->postBlogContent('archivelist',$blog);
\r
1054 * Actions::parse_archiveyearlist()
\r
1056 * @param string $template name of template
\r
1057 * @param string $category name of category
\r
1058 * @param integer $limit the number of items in a display
\r
1060 public function parse_archiveyearlist($template, $category = 'all', $limit = 0)
\r
1063 if ( $category == 'all' )
\r
1067 $this->preBlogContent('archivelist',$blog);
\r
1068 $this->setBlogCategory($blog, $category);
\r
1069 $blog->showArchiveList($template, 'year', $limit);
\r
1070 $this->postBlogContent('archivelist',$blog);
\r
1075 * Actions::parse_archivetype()
\r
1076 * Parse skinvar archivetype
\r
1081 public function parse_archivetype()
\r
1083 global $archivetype;
\r
1084 echo $archivetype;
\r
1089 * Actions::parse_blog()
\r
1090 * Parse skinvar blog
\r
1092 * @param string $template name of template
\r
1093 * @param mixed $amount the number of items in a display, in case it includes the beginning
\r
1094 * @param string $category name of category
\r
1097 public function parse_blog($template, $amount = 10, $category = '')
\r
1099 global $blog, $startpos;
\r
1101 list($limit, $offset) = sscanf($amount, '%d(%d)');
\r
1102 $this->setBlogCategory($blog, $category);
\r
1103 $this->preBlogContent('blog',$blog);
\r
1104 $this->amountfound = $blog->readLog($template, $limit, $offset, $startpos);
\r
1105 $this->postBlogContent('blog',$blog);
\r
1110 * Actions::parse_bloglist()
\r
1111 * Parse skinvar bloglist
\r
1112 * Shows a list of all blogs
\r
1114 * @param string $template name of template
\r
1115 * @param string $bnametype whether 'name' or 'shortname' is used for the link text
\r
1116 * @param string $orderby order criteria
\r
1117 * @param string $direction order ascending or descending
\r
1120 public function parse_bloglist($template, $bnametype = '', $orderby='number', $direction='asc')
\r
1122 Blog::showBlogList($template, $bnametype, $orderby, $direction);
\r
1127 * Actions::parse_blogsetting()
\r
1128 * Parse skinvar blogsetting
\r
1130 * @param string $which key of weblog settings
\r
1133 public function parse_blogsetting($which)
\r
1139 echo Entity::hsc($blog->getID());
\r
1142 echo Entity::hsc($blog->getURL());
\r
1145 echo Entity::hsc($blog->getName());
\r
1148 echo Entity::hsc($blog->getDescription());
\r
1151 echo Entity::hsc($blog->getShortName());
\r
1158 * Actions::parse_callback()
\r
1161 * @param string $eventName name of event
\r
1162 * @param string $type type of skin
\r
1165 public function parse_callback($eventName, $type)
\r
1168 $manager->notify($eventName, array('type' => $type));
\r
1173 * Actions::parse_category()
\r
1174 * Parse skinvar category
\r
1176 * @param string $type key of category settings
\r
1179 public function parse_category($type = 'name')
\r
1181 global $catid, $blog;
\r
1182 if ( !$blog->isValidCategory($catid) )
\r
1190 echo $blog->getCategoryName($catid);
\r
1193 echo $blog->getCategoryDesc($catid);
\r
1203 * Actions::parse_categorylist()
\r
1204 * Parse categorylist
\r
1206 * @param string $template name of template
\r
1207 * @param string $blogname name of weblog
\r
1210 public function parse_categorylist($template, $blogname = '')
\r
1212 global $blog, $manager;
\r
1214 // when no blog found
\r
1215 if ( ($blogname == '') && (!is_object($blog)) )
\r
1220 if ( $blogname == '' )
\r
1222 $this->preBlogContent('categorylist',$blog);
\r
1223 $blog->showCategoryList($template);
\r
1224 $this->postBlogContent('categorylist',$blog);
\r
1228 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1229 $this->preBlogContent('categorylist',$b);
\r
1230 $b->showCategoryList($template);
\r
1231 $this->postBlogContent('categorylist',$b);
\r
1237 * Actions::parse_charset()
\r
1238 * Parse skinvar charset
\r
1243 public function parse_charset()
\r
1245 echo i18n::get_current_charset();
\r
1250 * Actions::parse_commentform()
\r
1251 * Parse skinvar commentform
\r
1253 * @param string $destinationurl URI for redirection
\r
1256 public function parse_commentform($destinationurl = '')
\r
1258 global $blog, $itemid, $member, $CONF, $manager, $DIR_LIBS, $errormessage;
\r
1260 // warn when trying to provide a actionurl (used to be a parameter in Nucleus <2.0)
\r
1261 if ( stristr($destinationurl, 'action.php') )
\r
1263 $args = func_get_args();
\r
1264 $destinationurl = $args[1];
\r
1265 ActionLog::add(WARNING,_ACTIONURL_NOTLONGER_PARAMATER);
\r
1268 $actionurl = $CONF['ActionURL'];
\r
1270 // if item is closed, show message and do nothing
\r
1271 $item =& $manager->getItem($itemid,0,0);
\r
1272 if ( $item['closed'] || !$blog->commentsEnabled() )
\r
1274 $this->doForm('commentform-closed');
\r
1278 if ( !$blog->isPublic() && !$member->isLoggedIn() )
\r
1280 $this->doForm('commentform-closedtopublic');
\r
1284 if ( !$destinationurl )
\r
1286 // note: createLink returns an HTML encoded URL
\r
1287 $destinationurl = Link::create_link(
\r
1290 'itemid' => $itemid,
\r
1291 'title' => $item['title'],
\r
1292 'timestamp' => $item['timestamp'],
\r
1293 'extra' => $this->linkparams
\r
1299 // HTML encode URL
\r
1300 $destinationurl = Entity::hsc($destinationurl);
\r
1303 // values to prefill
\r
1304 $user = cookieVar($CONF['CookiePrefix'] .'comment_user');
\r
1307 $user = postVar('user');
\r
1310 $userid = cookieVar($CONF['CookiePrefix'] .'comment_userid');
\r
1313 $userid = postVar('userid');
\r
1316 $email = cookieVar($CONF['CookiePrefix'] .'comment_email');
\r
1319 $email = postVar('email');
\r
1322 $body = postVar('body');
\r
1324 $this->formdata = array(
\r
1325 'destinationurl' => $destinationurl, // url is already HTML encoded
\r
1326 'actionurl' => Entity::hsc($actionurl),
\r
1327 'itemid' => $itemid,
\r
1328 'user' => Entity::hsc($user),
\r
1329 'userid' => Entity::hsc($userid),
\r
1330 'email' => Entity::hsc($email),
\r
1331 'body' => Entity::hsc($body),
\r
1332 'membername' => $member->getDisplayName(),
\r
1333 'rememberchecked' => cookieVar($CONF['CookiePrefix'] .'comment_user')?'checked="checked"':''
\r
1336 if ( !$member->isLoggedIn() )
\r
1338 $this->doForm('commentform-notloggedin');
\r
1342 $this->doForm('commentform-loggedin');
\r
1348 * Actions::parse_comments()
\r
1349 * Parse skinvar comments
\r
1350 * include comments for one item
\r
1352 * @param string $template name of template
\r
1355 public function parse_comments($template)
\r
1357 global $itemid, $manager, $blog, $highlight;
\r
1358 $template =& $manager->getTemplate($template);
\r
1360 // create parser object & action handler
\r
1361 $actions = new ItemActions($blog);
\r
1362 $parser = new Parser($actions->getDefinedActions(),$actions);
\r
1363 $actions->setTemplate($template);
\r
1364 $actions->setParser($parser);
\r
1365 $item = Item::getitem($itemid, 0, 0);
\r
1366 $actions->setCurrentItem($item);
\r
1368 $comments = new Comments($itemid);
\r
1369 $comments->setItemActions($actions);
\r
1370 // shows ALL comments
\r
1371 $comments->showComments($template, -1, 1, $highlight);
\r
1376 * Actions::parse_errordiv()
\r
1382 public function parse_errordiv()
\r
1384 global $errormessage;
\r
1385 if ( $errormessage )
\r
1387 echo '<div class="error">' . Entity::hsc($errormessage) . "</div>\n";
\r
1393 * Actions::parse_errormessage()
\r
1394 * Parse skinvar errormessage
\r
1399 public function parse_errormessage()
\r
1401 global $errormessage;
\r
1402 echo $errormessage;
\r
1407 * Actions::parse_formdata()
\r
1410 * @param string $what key of format data
\r
1413 public function parse_formdata($what)
\r
1415 echo $this->formdata[$what];
\r
1420 * Actions::parse_ifcat()
\r
1423 * @param string $text
\r
1426 public function parse_ifcat($text = '')
\r
1428 if ( $text == '' )
\r
1431 $this->parse_if('category');
\r
1436 global $catid, $blog;
\r
1437 if ( $blog->isValidCategory($catid) )
\r
1446 * Actions::parse_image()
\r
1447 * Parse skinvar image
\r
1449 * @param string $what name of tag
\r
1452 public function parse_image($what = 'imgtag')
\r
1456 $imagetext = Entity::hsc(requestVar('imagetext'));
\r
1457 $imagepopup = requestVar('imagepopup');
\r
1458 $width = intRequestVar('width');
\r
1459 $height = intRequestVar('height');
\r
1460 $fullurl = Entity::hsc($CONF['MediaURL'] . $imagepopup);
\r
1479 echo "<img src=\"$fullurl\" width=\"$width\" height=\"$height\" alt=\"$imagetext\" title=\"$imagetext\" />";
\r
1486 * Actions::parse_imagetext()
\r
1487 * Parse skinvar imagetext
\r
1492 public function parse_imagetext()
\r
1494 $this->parse_image('imagetext');
\r
1499 * Actions::parse_item()
\r
1500 * Parse skinvar item
\r
1501 * include one item (no comments)
\r
1506 public function parse_item($template)
\r
1508 global $blog, $itemid, $highlight;
\r
1510 // need this to select default category
\r
1511 $this->setBlogCategory($blog, '');
\r
1512 $this->preBlogContent('item',$blog);
\r
1513 $r = $blog->showOneitem($itemid, $template, $highlight);
\r
1516 echo _ERROR_NOSUCHITEM;
\r
1518 $this->postBlogContent('item',$blog);
\r
1523 * Actions::parse_itemid()
\r
1524 * Parse skinvar itemid
\r
1529 public function parse_itemid()
\r
1537 * Actions::parseitemlink()
\r
1538 * Parse skinvar itemlink
\r
1543 public function parse_itemlink($linktext = '')
\r
1546 $this->itemlink($itemid, $linktext);
\r
1551 * Actions::parse_itemtitle()
\r
1557 public function parse_itemtitle($format = '')
\r
1559 global $manager, $itemid;
\r
1560 $item =& $manager->getItem($itemid,0,0);
\r
1562 switch ( $format )
\r
1565 echo Entity::hen($item['title']);
\r
1568 echo $item['title'];
\r
1572 echo Entity::hsc(strip_tags($item['title']));
\r
1579 * Actions::parse_loginform()
\r
1580 * Parse skinvar loginform
\r
1585 public function parse_loginform()
\r
1587 global $member, $CONF;
\r
1588 if ( !$member->isLoggedIn() )
\r
1590 $filename = 'loginform-notloggedin';
\r
1591 $this->formdata = array();
\r
1595 $filename = 'loginform-loggedin';
\r
1596 $this->formdata = array(
\r
1597 'membername' => $member->getDisplayName(),
\r
1600 $this->doForm($filename);
\r
1605 * Actions::parse_member()
\r
1606 * Parse skinvar member
\r
1607 * (includes a member info thingie)
\r
1609 * @param string $what which memberdata is needed
\r
1612 public function parse_member($what)
\r
1614 global $memberinfo, $member, $CONF;
\r
1616 // 1. only allow the member-details-page specific variables on member pages
\r
1617 if ( $this->skintype == 'member' )
\r
1622 echo Entity::hsc($memberinfo->getDisplayName());
\r
1625 echo Entity::hsc($memberinfo->getRealName());
\r
1628 echo Entity::hsc($memberinfo->getNotes());
\r
1631 echo Entity::hsc($memberinfo->getURL());
\r
1634 echo Entity::hsc($memberinfo->getEmail());
\r
1637 echo Entity::hsc($memberinfo->getID());
\r
1642 // 2. the next bunch of options is available everywhere, as long as the user is logged in
\r
1643 if ( $member->isLoggedIn() )
\r
1648 echo $member->getDisplayName();
\r
1650 case 'yourrealname':
\r
1651 echo $member->getRealName();
\r
1654 echo $member->getNotes();
\r
1657 echo $member->getURL();
\r
1660 echo $member->getEmail();
\r
1663 echo $member->getID();
\r
1665 case 'yourprofileurl':
\r
1666 if ($CONF['URLMode'] == 'pathinfo')
\r
1667 echo Link::create_member_link($member->getID());
\r
1669 echo $CONF['IndexURL'] . Link::create_member_link($member->getID());
\r
1677 * Link::parse_membermailform()
\r
1678 * Parse skinvar membermailform
\r
1680 * @param integer $rows the height for textarea
\r
1681 * @param integer $cols the width for textarea
\r
1682 * @param string $desturl URI to redirect
\r
1685 public function parse_membermailform($rows = 10, $cols = 40, $desturl = '')
\r
1687 global $member, $CONF, $memberid;
\r
1689 if ( $desturl == '' )
\r
1691 if ( $CONF['URLMode'] == 'pathinfo' )
\r
1693 $desturl = Link::create_member_link($memberid);
\r
1697 $desturl = $CONF['IndexURL'] . Link::create_member_link($memberid);
\r
1701 $message = postVar('message');
\r
1702 $frommail = postVar('frommail');
\r
1704 $this->formdata = array(
\r
1705 'url' => Entity::hsc($desturl),
\r
1706 'actionurl' => Entity::hsc($CONF['ActionURL']),
\r
1707 'memberid' => $memberid,
\r
1710 'message' => Entity::hsc($message),
\r
1711 'frommail' => Entity::hsc($frommail)
\r
1714 if ( $member->isLoggedIn() )
\r
1716 $this->doForm('membermailform-loggedin');
\r
1718 else if ( $CONF['NonmemberMail'] )
\r
1720 $this->doForm('membermailform-notloggedin');
\r
1724 $this->doForm('membermailform-disallowed');
\r
1730 * Actions::parse_nextarchive()
\r
1731 * Parse skinvar nextarchive
\r
1736 public function parse_nextarchive()
\r
1738 global $archivenext;
\r
1739 echo $archivenext;
\r
1744 * Parse skinvar nextitem
\r
1745 * (include itemid of next item)
\r
1750 public function parse_nextitem()
\r
1752 global $itemidnext;
\r
1753 if ( isset($itemidnext) )
\r
1755 echo (int)$itemidnext;
\r
1761 * Actions::parse_nextitemtitle()
\r
1762 * Parse skinvar nextitemtitle
\r
1763 * (include itemtitle of next item)
\r
1765 * @param string $format format of text
\r
1768 public function parse_nextitemtitle($format = '')
\r
1770 global $itemtitlenext;
\r
1772 switch ( $format )
\r
1775 echo Entity::hen($itemtitlenext);
\r
1778 echo $itemtitlenext;
\r
1782 echo Entity::hsc($itemtitlenext);
\r
1789 * Actions::parse_nextlink()
\r
1790 * Parse skinvar nextlink
\r
1792 * @param string $linktext text for content of anchor element
\r
1793 * @param integer $amount the amount of items in a display
\r
1794 * @param integer $recount increment from this value
\r
1797 public function parse_nextlink($linktext = '', $amount = 10, $recount = '')
\r
1799 global $itemidnext, $archivenext, $startpos;
\r
1800 if ( $this->skintype == 'item' )
\r
1802 $this->itemlink($itemidnext, $linktext);
\r
1804 else if ( $this->skintype == 'search' || $this->skintype == 'index' )
\r
1806 $this->searchlink($amount, $startpos, 'next', $linktext, $recount);
\r
1810 $this->archivelink($archivenext, $linktext);
\r
1816 * Actions::parse_nucleusbutton()
\r
1817 * Parse skinvar nucleusbutton
\r
1819 * @param string $imgurl URL for image
\r
1820 * @param integer $imgwidth width of image
\r
1821 * @param integer $imgheidht height of image
\r
1823 public function parse_nucleusbutton($imgurl = '', $imgwidth = '85', $imgheight = '31')
\r
1826 if ( $imgurl == '' )
\r
1828 $imgurl = $CONF['AdminURL'] . 'nucleus.gif';
\r
1830 else if ( Parser::getProperty('IncludeMode') == 'skindir' )
\r
1832 // when skindit IncludeMode is used: start from skindir
\r
1833 $imgurl = $CONF['SkinsURL'] . Parser::getProperty('IncludePrefix') . $imgurl;
\r
1836 $this->formdata = array(
\r
1837 'imgurl' => $imgurl,
\r
1838 'imgwidth' => $imgwidth,
\r
1839 'imgheight' => $imgheight,
\r
1841 $this->doForm('nucleusbutton');
\r
1846 * Actions::parse_otherarchive()
\r
1847 * Parse skinvar otherarchive
\r
1849 * @param string $blogname name of weblog
\r
1850 * @param string $template name of template
\r
1851 * @param string $category name of category
\r
1854 public function parse_otherarchive($blogname, $template, $category = '')
\r
1856 global $archive, $manager;
\r
1857 sscanf($archive,'%d-%d-%d',$y,$m,$d);
\r
1858 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1859 $this->setBlogCategory($b, $category);
\r
1860 $this->preBlogContent('otherachive',$b);
\r
1861 $b->showArchive($template, $y, $m, $d);
\r
1862 $this->postBlogContent('otherachive',$b);
\r
1867 * Actions::parse_otherarchivedaylist()
\r
1868 * Parse skinvar otherarchivedaylist
\r
1870 * @param string $blogname name of weblog
\r
1871 * @param string $template name of template
\r
1872 * @param string $category name of category
\r
1873 * @param integer $limit the amount of items in a display
\r
1876 public function parse_otherarchivedaylist($blogname, $template, $category = 'all', $limit = 0)
\r
1879 if ( $category == 'all')
\r
1883 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1884 $this->setBlogCategory($b, $category);
\r
1885 $this->preBlogContent('otherarchivelist',$b);
\r
1886 $b->showArchiveList($template, 'day', $limit);
\r
1887 $this->postBlogContent('otherarchivelist',$b);
\r
1892 * Actions::parse_otherarchivelist()
\r
1893 * Parse skinvar otherarchivelist
\r
1895 * @param string $blogname name of weblog
\r
1896 * @param string $template name of template
\r
1897 * @param string $category name of category
\r
1898 * @param integer $limit the amount of items in a display
\r
1901 public function parse_otherarchivelist($blogname, $template, $category = 'all', $limit = 0)
\r
1904 if ( $category == 'all' )
\r
1908 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1909 $this->setBlogCategory($b, $category);
\r
1910 $this->preBlogContent('otherarchivelist',$b);
\r
1911 $b->showArchiveList($template, 'month', $limit);
\r
1912 $this->postBlogContent('otherarchivelist',$b);
\r
1917 * Actions::parse_otherarchiveyearlist()
\r
1918 * Parse skinvar otherarchiveyearlist
\r
1920 * @param string $blogname name of weblog
\r
1921 * @param string $template name of template
\r
1922 * @param string $category name of category
\r
1923 * @limit integer $limit the amount of items in a display
\r
1925 public function parse_otherarchiveyearlist($blogname, $template, $category = 'all', $limit = 0)
\r
1928 if ( $category == 'all' )
\r
1932 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1933 $this->setBlogCategory($b, $category);
\r
1934 $this->preBlogContent('otherarchivelist',$b);
\r
1935 $b->showArchiveList($template, 'year', $limit);
\r
1936 $this->postBlogContent('otherarchivelist',$b);
\r
1941 * Actions::parse_otherblog()
\r
1942 * Parse skinvar otherblog
\r
1944 * @param string $blogname name of weblog
\r
1945 * @param string $template name of template
\r
1946 * @param mixed $amount the amount of items, in case it includes the beginning
\r
1947 * @param string $category name of category
\r
1950 public function parse_otherblog($blogname, $template, $amount = 10, $category = '')
\r
1954 list($limit, $offset) = sscanf($amount, '%d(%d)');
\r
1956 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1957 $this->setBlogCategory($b, $category);
\r
1958 $this->preBlogContent('otherblog',$b);
\r
1959 $this->amountfound = $b->readLog($template, $limit, $offset);
\r
1960 $this->postBlogContent('otherblog',$b);
\r
1965 * Actions::parse_othersearchresults()
\r
1966 * Parse skinvar othersearchresults
\r
1968 * @param string $blogname name of weblog
\r
1969 * @param string $template name of template
\r
1970 * @param integer $maxresults the amount of results
\r
1973 public function parse_othersearchresults($blogname, $template, $maxresults = 50)
\r
1975 global $query, $amount, $manager, $startpos;
\r
1976 $b =& $manager->getBlog(getBlogIDFromName($blogname));
\r
1977 // need this to select default category
\r
1978 $this->setBlogCategory($b, '');
\r
1979 $this->preBlogContent('othersearchresults',$b);
\r
1980 $b->search($query, $template, $amount, $maxresults, $startpos);
\r
1981 $this->postBlogContent('othersearchresults',$b);
\r
1986 * Actions::parse_plugin()
\r
1987 * Executes a plugin skinvar
\r
1988 * extra parameters can be added
\r
1990 * @param string $pluginName name of plugin (without the NP_)
\r
1993 public function parse_plugin($pluginName)
\r
1997 $plugin =& $manager->getPlugin('NP_' . $pluginName);
\r
2004 $params = func_get_args();
\r
2006 // remove plugin name
\r
2007 array_shift($params);
\r
2009 // add skin type on front
\r
2010 array_unshift($params, $this->skintype);
\r
2012 call_user_func_array(array(&$plugin,'doSkinVar'), $params);
\r
2017 * Actions::parse_prevarchive()
\r
2018 * Parse skinvar prevarchive
\r
2023 public function parse_prevarchive()
\r
2025 global $archiveprev;
\r
2026 echo $archiveprev;
\r
2030 * Actions::parse_preview()
\r
2031 * Parse skinvar preview
\r
2033 * @param string $template name of tempalte
\r
2036 public function parse_preview($template)
\r
2038 global $blog, $CONF, $manager;
\r
2040 $template =& $manager->getTemplate($template);
\r
2042 $row['body'] = '<span id="prevbody"></span>';
\r
2043 $row['title'] = '<span id="prevtitle"></span>';
\r
2044 $row['more'] = '<span id="prevmore"></span>';
\r
2045 $row['itemlink'] = '';
\r
2046 $row['itemid'] = 0; $row['blogid'] = $blog->getID();
\r
2048 echo Template::fill($template['ITEM_HEADER'],$row);
\r
2049 echo Template::fill($template['ITEM'],$row);
\r
2050 echo Template::fill($template['ITEM_FOOTER'],$row);
\r
2055 * Actions::parse_previtem()
\r
2056 * Parse skinvar previtem
\r
2057 * (include itemid of prev item)
\r
2062 public function parse_previtem()
\r
2064 global $itemidprev;
\r
2065 if ( isset($itemidprev) )
\r
2067 echo (integer) $itemidprev;
\r
2073 * Actions::parse_previtemtitle()
\r
2074 * Parse skinvar previtemtitle
\r
2075 * (include itemtitle of prev item)
\r
2077 * @param String $format string format
\r
2078 * @return String formatted string
\r
2080 public function parse_previtemtitle($format = '')
\r
2082 global $itemtitleprev;
\r
2084 switch ( $format )
\r
2087 echo Entity::hen($itemtitleprev);
\r
2090 echo $itemtitleprev;
\r
2094 echo Entity::hsc($itemtitleprev);
\r
2101 * Actions::parse_prevlink()
\r
2102 * Parse skinvar prevlink
\r
2104 * @param string $linktext text as a content of anchor element
\r
2105 * @param integer the amount of links
\r
2108 public function parse_prevlink($linktext = '', $amount = 10)
\r
2110 global $itemidprev, $archiveprev, $startpos;
\r
2112 if ( $this->skintype == 'item' )
\r
2114 $this->itemlink($itemidprev, $linktext);
\r
2116 else if ( $this->skintype == 'search' || $this->skintype == 'index' )
\r
2118 $this->searchlink($amount, $startpos, 'prev', $linktext);
\r
2122 $this->archivelink($archiveprev, $linktext);
\r
2128 * Actions::parse_query()
\r
2129 * Parse skinvar query
\r
2130 * (includes the search query)
\r
2135 public function parse_query()
\r
2138 echo Entity::hsc($query);
\r
2143 * Actions::parse_referer()
\r
2144 * Parse skinvar referer
\r
2149 public function parse_referer()
\r
2151 echo Entity::hsc(serverVar('HTTP_REFERER'));
\r
2156 * Actions::parse_searchform()
\r
2157 * Parse skinvar searchform
\r
2159 * @param string $blogname name of weblog
\r
2162 public function parse_searchform($blogname = '')
\r
2164 global $CONF, $manager, $maxresults;
\r
2167 $blog =& $manager->getBlog(getBlogIDFromName($blogname));
\r
2173 // use default blog when no blog is selected
\r
2174 $this->formdata = array(
\r
2175 'id' => $blog?$blog->getID():$CONF['DefaultBlog'],
\r
2176 'query' => Entity::hsc(getVar('query')),
\r
2178 $this->doForm('searchform');
\r
2183 * Actions::parse_searchresults()
\r
2184 * Parse skinvar searchresults
\r
2186 * @param string $template name of tempalte
\r
2187 * @param integer $maxresults searched items in a display
\r
2190 public function parse_searchresults($template, $maxresults = 50 )
\r
2192 global $blog, $query, $amount, $startpos;
\r
2194 $this->setBlogCategory($blog, ''); // need this to select default category
\r
2195 $this->preBlogContent('searchresults',$blog);
\r
2196 $this->amountfound = $blog->search($query, $template, $amount, $maxresults, $startpos);
\r
2197 $this->postBlogContent('searchresults',$blog);
\r
2202 * Actions::parse_self()
\r
2203 * Parse skinvar self
\r
2208 public function parse_self()
\r
2211 echo $CONF['Self'];
\r
2216 * Actions::parse_sitevar()
\r
2217 * Parse skinvar sitevar
\r
2218 * (include a sitevar)
\r
2220 * @param string $which
\r
2223 public function parse_sitevar($which)
\r
2229 echo $CONF['IndexURL'];
\r
2232 echo $CONF['SiteName'];
\r
2235 echo $CONF['AdminEmail'];
\r
2238 echo $CONF['AdminURL'];
\r
2244 * Actions::parse_skinname()
\r
2250 public function parse_skinname()
\r
2252 echo $this->skin->getName();
\r
2257 * Actions::parse_skintype()
\r
2258 * Parse skintype (experimental)
\r
2263 public function parse_skintype()
\r
2265 echo $this->skintype;
\r
2270 * Actions::parse_text()
\r
2276 public function parse_text($which)
\r
2278 // constant($which) only available from 4.0.4 :(
\r
2279 if ( defined($which) )
\r
2281 eval("echo $which;");
\r
2287 * Actions::parse_ticket()
\r
2293 public function parse_ticket()
\r
2296 $manager->addTicketHidden();
\r
2301 * Actions::parse_todaylink()
\r
2302 * Parse skinvar todaylink
\r
2303 * A link to the today page (depending on selected blog, etc...)
\r
2305 * @param string $linktext text for link
\r
2308 public function parse_todaylink($linktext = '')
\r
2310 global $blog, $CONF;
\r
2313 echo $this->link(Link::create_blogid_link($blog->getID(),$this->linkparams), $linktext);
\r
2317 echo $this->link($CONF['SiteUrl'], $linktext);
\r
2324 * When commentform is not used, to include a hidden field with itemid
\r
2329 public function parse_vars()
\r
2332 echo '<input type="hidden" name="itemid" value="'.$itemid.'" />' . "\n";
\r
2337 * Actions::parse_version()
\r
2338 * Parse skinvar version
\r
2339 * (include nucleus versionnumber)
\r
2344 public function parse_version()
\r
2347 echo 'Nucleus CMS ' . $nucleus['version'];
\r
2352 * Actions::parse_sticky()
\r
2353 * Parse skinvar sticky
\r
2355 * @param integer $itemnumber id of item
\r
2356 * @param string $template name of template
\r
2359 public function parse_sticky($itemnumber = 0, $template = '')
\r
2363 $itemnumber = intval($itemnumber);
\r
2364 $itemarray = array($itemnumber);
\r
2366 $b =& $manager->getBlog(getBlogIDFromItemID($itemnumber));
\r
2367 $this->preBlogContent('sticky',$b);
\r
2368 $this->amountfound = $b->readLogFromList($itemarray, $template);
\r
2369 $this->postBlogContent('sticky',$b);
\r