20function b_legacy_comments_show($options)
23 include_once XOOPS_ROOT_PATH.
'/include/comment_constants.php';
24 $comment_handler =& xoops_gethandler(
'comment');
26 $criteria->setLimit((
int)$options[0]);
27 $criteria->setSort(
'com_created');
28 $criteria->setOrder(
'DESC');
29 $comments =& $comment_handler->getObjects($criteria,
true);
30 $member_handler =& xoops_gethandler(
'member');
31 $module_handler =& xoops_gethandler(
'module');
32 $modules =& $module_handler->getObjects(
new Criteria(
'hascomments', 1),
true);
34 foreach (array_keys($comments) as $i) {
35 $mid = $comments[$i]->getVar(
'com_modid');
36 $com[
'module'] =
'<a href="'.XOOPS_URL.
'/modules/'.$modules[$mid]->getVar(
'dirname').
'/">'.$modules[$mid]->getVar(
'name').
'</a>';
37 if (!isset($comment_config[$mid])) {
38 $comment_config[$mid] = $modules[$mid]->getInfo(
'comments');
41 $com[
'title'] =
'<a href="'.XOOPS_URL.
'/modules/'.$modules[$mid]->getVar(
'dirname').
'/'.$comment_config[$mid][
'pageName'].
'?'.$comment_config[$mid][
'itemName'].
'='.$comments[$i]->getVar(
'com_itemid').
'&com_id='.$i.
'&com_rootid='.$comments[$i]->getVar(
'com_rootid').
'&'.htmlspecialchars($comments[$i]->getVar(
'com_exparams')).
'#comment'.$i.
'">'.$comments[$i]->getVar(
'com_title').
'</a>';
42 $com[
'icon'] = $comments[$i]->getVar(
'com_icon');
43 $com[
'icon'] = (
'' !== $com[
'icon']) ? $com[
'icon'] :
'icon1.gif';
44 $com[
'time'] = $comments[$i]->getVar(
'com_created');
45 if ($comments[$i]->getVar(
'com_uid') > 0) {
46 $poster =& $member_handler->getUser($comments[$i]->getVar(
'com_uid'));
47 if (is_object($poster)) {
48 $com[
'poster'] =
'<a href="'.XOOPS_URL.
'/userinfo.php?uid='.$comments[$i]->getVar(
'com_uid').
'">'.$poster->getVar(
'uname').
'</a>';
50 $com[
'poster'] = $GLOBALS[
'xoopsConfig'][
'anonymous'];
53 $com[
'poster'] = $GLOBALS[
'xoopsConfig'][
'anonymous'];
55 $block[
'comments'][] =& $com;
61function b_legacy_comments_edit($options)
63 $inputtag =
"<input type='text' name='options[]' value='" . (int)$options[0] .
"'>";
64 $form = sprintf(_MB_LEGACY_DISPLAYC, $inputtag);