You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
765 B

<?php
function smarty_modifier_forumname($commentid, $retrun_forumid = 'n')
{
global $tikilib;
$cachelib = TikiLib::lib('cache');
require_once 'lib/comments/commentslib.php';
$comments = new Comments();
if ($retrun_forumid == 'y') {
$cacheItem = "retrun_forumid" . $commentid;
} else {
$cacheItem = "retrun_forumname" . $commentid;
}
if ($cached = $cachelib->getCached($cacheItem)) {
return $cached;
}
$forum_id = $comments->get_comment_forum_id($commentid);
$cachelib->cacheItem($cacheItem, $forum_id);
if ($retrun_forumid == 'y') {
return $forum_id;
}
$ret = $comments->get_forum($forum_id);
$cachelib->cacheItem($cacheItem, $ret['name']);
return $ret['name'];
}