Re: Tracker item comments
The solution that I found to view the comments maybe can help you. It is based in a smarty function that request the comments for the item and then use the result in a template. Not sure if apply to "Pretty Tracker" but works for me.
Please consider that I am very new on this so there are a lot of chances that this solution breaks the way that things should be done or (worse) things should work in tiki.
By the way I'm using tiki 6.1 in Ubuntu 10.04.
The function to recover the comments (I add it to lib/smarty_tiki/function.getitemcomments.php) was (details excluded):
... function smarty_function_getitemcomments($params, &$smarty) { global $trklib; include_once('lib/trackers/trackerlib.php'); $comments = $trklib->list_item_comments($params["itemId"], 0, -1, 'posted_desc', ''); $smarty->assign_by_ref('comments', $comments["data"]); $smarty->assign_by_ref('commentCount', $comments["cant"]); }
I call and use it from the template with code like the following (details excluded):
--- just sample of use --- ... {* get the comments of the item in $f_itemId *} {getitemcomments itemId=$f_itemId} {* after that in $commentCount we have the number of comments and in $comments the comments itself. *} ... {* comment count can be used as in: *} {if $commentCount gt 0} ... {* comments content can be displayed using: *} {section name=ix loop=$comments} {* ... comment author example *} {if $comments[ix].user}{$comments[ix].user|userlink}{/if} {* ... post date example *} {$comments[ix].posted|tiki_short_datetime} {* ... comment title example *} {$comments[ix].title|escape} {* ... comment text example *} {$comments[ix].parsed} {/section} ...
Hope this can help you.