13 $db = XoopsDatabaseFactory::getDatabaseConnection();
15 $sql =
"SELECT * FROM ".$db->prefix(
"rmc_comments").
" ORDER BY id_com DESC";
17 $sql .=
" LIMIT 0,$limit";
27 $com->assignVars($row);
31 if(!isset($ecache[$com->getVar(
'user')])){
32 $ecache[$com->getVar(
'user')] =
new RMCommentUser($com->getVar(
'user'));
35 $editor = $ecache[$com->getVar(
'user')];
37 if($editor->getVar(
'xuid')>0){
39 if(!isset($ucache[$editor->getVar(
'xuid')])){
40 $ucache[$editor->getVar(
'xuid')] =
new XoopsUser($editor->getVar(
'xuid'));
43 $user = $ucache[$editor->getVar(
'xuid')];
46 'id' => $user->getVar(
'uid'),
47 'name' => $user->getVar(
'uname'),
48 'email' => $user->getVar(
'email'),
49 'posts' => $user->getVar(
'posts'),
50 'avatar'=> $user->getVar(
'user_avatar')!=
'' && $user->getVar(
'user_avatar')!=
'blank.gif' ? XOOPS_UPLOAD_URL.
'/'.$user->getVar(
'user_avatar') :
RMCURL.
'/images/avatar.gif',
51 'rank' => $user->rank(),
58 'name' => $editor->getVar(
'name'),
59 'email' => $editor->getVar(
'email'),
61 'avatar'=>
RMCURL.
'/images/avatar.gif',
69 $cpath = XOOPS_ROOT_PATH.
'/modules/'.$row[
'id_obj'].
'/class/'.$row[
'id_obj'].
'controller.php';
72 if(!class_exists(ucfirst($row[
'id_obj']).
'Controller'))
75 $class = ucfirst($row[
'id_obj']).
'Controller';
76 $controller =
new $class();
77 $item = $controller->get_item($row[
'params'], $com);
78 $item_url = $controller->get_item_url($row[
'params'], $com);
81 $item =
__(
'Unknow',
'rmcommon');
86 if(isset($mods[$row[
'id_obj']])){
87 $mod = $mods[$row[
'id_obj']];
90 $mod = $m->getVar(
'name');
91 $mods[$row[
'id_obj']] =
$mod;
95 'id' => $row[
'id_com'],
97 'poster' => isset($poster) ? $poster : null,
98 'posted' => formatTimestamp($com->getVar(
'posted'),
'l'),
100 'item_url' => $item_url,
101 'module' => $row[
'id_obj'],
102 'status' => $com->getVar(
'status'),
107 $comments =
RMEvents::get()->run_event(
'rmcommon.loading.block.comments', $comments);
108 $block[
'comments'] = $comments;
109 $block[
'show_module'] =
$options[1];
115 $block[
'data_width'] = floor(100/$num);
127 if(defined(
'RMCLOCATION')){
128 $form .=
'<table><tr><td></td><td>';
131 $form .=
'</td></tr>';
132 $form .=
'<tr><td class="head">'.__(
'Number of Comments:',
'rmcommon').
'</td><td class="odd">';
133 $form .=
'<input type="text" size="5" name="options[0]" value="'.$options[0].
'" />';
134 $form .=
'<tr><td class="head">'.__(
'Show module name:',
'rmcommon').
'</td><td class="odd">';
135 $form .=
'<label><input type="radio" name="options[1]" value="1"'.($options[1]==1?
' checked="checked"':
'').
' />'.
__(
'Yes',
'rmcommon').
'</label>';
136 $form .=
'<label><input type="radio" name="options[1]" value="0"'.($options[1]==0?
' checked="checked"':
'').
' />'.
__(
'No',
'rmcommon').
'</label></td></tr>';
137 $form .=
'<tr><td class="head">'.__(
'Show item name:',
'rmcommon').
'</td><td class="odd">';
138 $form .=
'<label><input type="radio" name="options[2]" value="1"'.($options[2]==1?
' checked="checked"':
'').
' />'.
__(
'Yes',
'rmcommon').
'</label>';
139 $form .=
'<label><input type="radio" name="options[2]" value="0"'.($options[2]==0?
' checked="checked"':
'').
' />'.
__(
'No',
'rmcommon').
'</label></td></tr>';
140 $form .=
'<tr><td class="head">'.__(
'Show user name:',
'rmcommon').
'</td><td class="odd">';
141 $form .=
'<label><input type="radio" name="options[3]" value="1"'.($options[3]==1?
' checked="checked"':
'').
' />'.
__(
'Yes',
'rmcommon').
'</label>';
142 $form .=
'<label><input type="radio" name="options[3]" value="0"'.($options[3]==0?
' checked="checked"':
'').
' />'.
__(
'No',
'rmcommon').
'</label></td></tr>';
143 $form .=
'<tr><td class="head">'.__(
'Show date:',
'rmcommon').
'</td><td class="odd">';
144 $form .=
'<label><input type="radio" name="options[4]" value="1"'.($options[4]==1?
' checked="checked"':
'').
' />'.
__(
'Yes',
'rmcommon').
'</label>';
145 $form .=
'<label><input type="radio" name="options[4]" value="0"'.($options[4]==0?
' checked="checked"':
'').
' />'.
__(
'No',
'rmcommon').
'</label>';
147 if(defined(
'RMCLOCATION')){
148 $form .=
'</td></tr></table>';