21 die(
'Restricted access');
24 include_once
$GLOBALS[
'xoops']->path(
'include/comment_constants.php');
27 include_once
$GLOBALS[
'xoops']->path(
'modules/system/constants.php');
37 $com_mode = isset(
$_GET[
'com_mode']) ? htmlspecialchars(trim(
$_GET[
'com_mode']), ENT_QUOTES) :
'';
45 if (!isset(
$_GET[
'com_order'])) {
58 $com_dborder =
'DESC';
77 include_once
$GLOBALS[
'xoops']->path(
'class/commentrenderer.php');
80 $renderer->renderFlatView($admin_view);
84 if (isset($comment_config[
'extraParams']) && is_array($comment_config[
'extraParams'])) {
86 foreach ($comment_config[
'extraParams'] as $extra_param) {
88 if (isset(${$extra_param})) {
89 $extra_params .= $extra_param .
'=' . ${$extra_param} .
'&';
90 }
else if (isset(
$_POST[$extra_param])) {
91 $extra_params .= $extra_param .
'=' .
$_POST[$extra_param] .
'&';
92 }
else if (isset(
$_GET[$extra_param])) {
93 $extra_params .= $extra_param .
'=' .
$_GET[$extra_param] .
'&';
95 $extra_params .= $extra_param .
'=&';
106 include_once
$GLOBALS[
'xoops']->path(
'class/commentrenderer.php');
109 $renderer->renderThreadView(
$com_id, $admin_view);
114 $c_count = count($top_comments);
116 for(
$i = 0;
$i < $c_count;
$i ++) {
119 include_once
$GLOBALS[
'xoops']->path(
'class/commentrenderer.php');
122 $renderer->renderThreadView($top_comments[
$i]->getVar(
'com_id'), $admin_view);
131 $c_count = count($top_comments);
133 for(
$i = 0;
$i < $c_count;
$i ++) {
135 include_once
$GLOBALS[
'xoops']->path(
'class/commentrenderer.php');
138 $renderer->renderNestView($top_comments[
$i]->getVar(
'com_id'), $admin_view);
145 <form method="get" action="' . $comment_config[
'pageName'] .
'">
146 <table width="95%" class="outer" cellspacing="1">
148 <td class="even" align="center"><select name="com_mode"><option value="flat"';
150 $navbar .=
' selected="selected"';
152 $navbar .=
'>' .
_FLAT .
'</option><option value="thread"';
154 $navbar .=
' selected="selected"';
156 $navbar .=
'>' .
_THREADED .
'</option><option value="nest"';
158 $navbar .=
' selected="selected"';
162 $navbar .=
' selected="selected"';
166 $navbar .=
' selected="selected"';
168 unset($postcomment_link);
169 $navbar .=
'>' .
_NEWESTFIRST .
'</option></select><input type="hidden" name="' . $comment_config[
'itemName'] .
'" value="' .
$com_itemid .
'" /> <input type="submit" value="' .
_CM_REFRESH .
'" class="formButton" />';
171 $postcomment_link =
'comment_new.php?com_itemid=' .
$com_itemid .
'&com_order=' . $com_order .
'&com_mode=' .
$com_mode;
176 if (isset($comment_config[
'extraParams']) && is_array($comment_config[
'extraParams'])) {
177 foreach ($comment_config[
'extraParams'] as $extra_param) {
178 if (isset(${$extra_param})) {
179 $link_extra .=
'&' . $extra_param .
'=' . ${$extra_param};
180 $hidden_value = htmlspecialchars(${$extra_param}, ENT_QUOTES);
181 $extra_param_val = ${$extra_param};
182 }
else if (isset(
$_POST[$extra_param])) {
183 $extra_param_val =
$_POST[$extra_param];
184 }
else if (isset(
$_GET[$extra_param])) {
185 $extra_param_val =
$_GET[$extra_param];
187 if (isset($extra_param_val)) {
188 $link_extra .=
'&' . $extra_param .
'=' . $extra_param_val;
189 $hidden_value = htmlspecialchars($extra_param_val, ENT_QUOTES);
190 $navbar .=
'<input type="hidden" name="' . $extra_param .
'" value="' . $hidden_value .
'" />';
194 if (isset($postcomment_link)) {
195 $navbar .=
' <input type="button" onclick="self.location.href=\'' . $postcomment_link .
'' . $link_extra .
'\'" class="formButton
" value="' . _CM_POSTCOMMENT . '" />';
203 // Start add by voltan
204 if (! empty($xoopsModuleConfig['com_anonpost']) || is_object($xoopsUser)) {
206 xoops_load('XoopsLists');
207 xoops_load('XoopsFormLoader');
209 if(file_exists($GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/comment_fast.php'))) {
210 include_once $GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/comment_fast.php');
212 if (isset($com_replytitle)) {
213 $myts =& MyTextSanitizer::getInstance();
214 $com_title = $myts->htmlSpecialChars($com_replytitle);
215 if (!preg_match("/^
" . _RE . "/i
", $com_title)) {
216 $com_title = _RE . " " . xoops_substr($com_title, 0, 56);
223 $cform = new XoopsThemeForm(_CM_POSTCOMMENT, "commentfastform
", 'comment_post.php', 'post', true);
224 $cform->addElement(new XoopsFormElementTray(''));
225 if (isset($xoopsModuleConfig['com_rule'])) {
226 include_once $GLOBALS['xoops']->path('include/comment_constants.php');
227 switch ($xoopsModuleConfig['com_rule']) {
228 case XOOPS_COMMENT_APPROVEALL:
229 $rule_text = _CM_COMAPPROVEALL;
231 case XOOPS_COMMENT_APPROVEUSER:
232 $rule_text = _CM_COMAPPROVEUSER;
234 case XOOPS_COMMENT_APPROVEADMIN:
236 $rule_text = _CM_COMAPPROVEADMIN;
239 $cform->addElement(new XoopsFormLabel(_CM_COMRULES, $rule_text));
241 $cform->addElement(new XoopsFormText(_CM_TITLE, 'com_title', 50, 255, $com_title), true);
243 $cform->addElement(new XoopsFormText(_CM_USER, 'com_user', 50, 60, ''), true);
244 $cform->addElement(new XoopsFormText(_CM_EMAIL, 'com_email', 50, 60, ''), true);
245 $cform->addElement(new XoopsFormText(_CM_URL, 'com_url', 50, 60, ''), false);
247 $cform->addElement(new XoopsFormTextArea(_CM_MESSAGE, 'com_text', '', 10, 65), true);
249 $cform->addElement(new XoopsFormCaptcha());
252 $cform->addElement(new XoopsFormHidden('com_id', 0));
253 $cform->addElement(new XoopsFormHidden('com_pid', 0));
254 $cform->addElement(new XoopsFormHidden('com_rootid', 0));
255 $cform->addElement(new XoopsFormHidden('com_order', 0));
256 $cform->addElement(new XoopsFormHidden('com_itemid', $com_itemid));
257 $cform->addElement(new XoopsFormHidden('com_mode', $com_mode));
258 $cform->addElement(new xoopsFormHidden('dohtml', 0));
259 $cform->addElement(new xoopsFormHidden('dobr', 0));
260 $cform->addElement(new xoopsFormHidden('dosmiley', 0));
261 $cform->addElement(new xoopsFormHidden('doxcode', 0));
263 // add module specific extra params
264 if ('system' != $xoopsModule->getVar('dirname')) {
265 $comment_config = $xoopsModule->getInfo('comments');
266 if (isset($comment_config['extraParams']) && is_array($comment_config['extraParams'])) {
267 $myts =& MyTextSanitizer::getInstance();
268 foreach ($comment_config['extraParams'] as $extra_param) {
269 // This routine is included from forms accessed via both GET and POST
270 if (isset($_POST[$extra_param])) {
271 $hidden_value = $myts->stripSlashesGPC($_POST[$extra_param]);
272 } else if (isset($_GET[$extra_param])) {
273 $hidden_value = $myts->stripSlashesGPC($_GET[$extra_param]);
277 $cform->addElement(new XoopsFormHidden($extra_param, $hidden_value));
282 $button_tray = new XoopsFormElementTray('', ' ');
283 $button_tray->addElement(new XoopsFormButton('', 'com_dopost', _CM_POSTCOMMENT, 'submit'));
284 $cform->addElement($button_tray);
285 $xoopsTpl->assign('commentform', $cform->render());
287 $xoopsTpl->assign('commentform', '');
291 $xoopsTpl->assign(array(
292 'commentsnav' => $navbar ,
293 'editcomment_link' => 'comment_edit.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra ,
294 'deletecomment_link' => 'comment_delete.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra ,
295 'replycomment_link' => 'comment_reply.php?com_itemid=' . $com_itemid . '&com_order=' . $com_order . '&com_mode=' . $com_mode . '' . $link_extra));
297 // assign some lang variables
298 $xoopsTpl->assign(array(
299 'lang_from' => _CM_FROM ,
300 'lang_joined' => _CM_JOINED ,
301 'lang_posts' => _CM_POSTS ,
302 'lang_poster' => _CM_POSTER ,
303 'lang_thread' => _CM_THREAD ,
304 'lang_edit' => _EDIT ,
305 'lang_delete' => _DELETE ,
306 'lang_reply' => _REPLY ,
307 'lang_subject' => _CM_REPLIES ,
308 'lang_posted' => _CM_POSTED ,
309 'lang_updated' => _CM_UPDATED ,
310 'lang_notice' => _CM_NOTICE));