20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
22 include_once
$GLOBALS['xoops']->path('include/comment_constants.php');
37 $redirect_page = XOOPS_URL .
'/modules/system/admin.php?fct=comments&com_modid=' .
$com_modid .
'&com_itemid';
51 $extra_params .= isset(
$_POST[$extra_param]) ? $extra_param .
'=' . htmlspecialchars(
$_POST[$extra_param]) .
'&' : $extra_param .
'=&';
67 if (isset(
$_POST[
'com_dopost'])) {
69 }
else if (isset(
$_POST[
'com_dopreview'])) {
72 if (isset(
$_POST[
'com_dodelete'])) {
75 if (
$op ==
'preview' ||
$op ==
'post') {
76 if (!
$GLOBALS[
'xoopsSecurity']->check()) {
83 if (! $xoopsCaptcha->verify()) {
93 $search_arr = array(
" ",
"\t",
"\r\n",
"\r",
"\n",
",",
".",
"'",
";",
":",
")",
"(",
'"',
'?',
'!',
'{',
'}',
'[',
']',
'<',
'>',
'/',
'+',
'-',
'_',
'\\',
'*',
'=',
'@',
'#',
'$',
'%',
'^',
'&');
94 $replace_arr = array(
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
' ',
'');
104 $com_user = preg_replace(
'`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i',
'\\1',
$com_user);
108 if(!empty(
$_POST[
'com_url'])) {
110 $com_url = filter_var(
$com_url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED);
125 if (!$xoopsUser_isAdmin) {
127 if (!empty($be) && preg_match(
'/' . $be .
'/i',
$com_email)) {
139 $com_mode = isset(
$_POST[
'com_mode']) ? htmlspecialchars(trim(
$_POST[
'com_mode']), ENT_QUOTES) :
'flat';
157 include_once
$GLOBALS[
'xoops']->path(
'include/comment_delete.php');
167 include_once
$GLOBALS[
'xoops']->path(
'modules/system/constants.php');
178 $noname = isset($noname) ? intval($noname) : 0;
181 include_once
$GLOBALS[
'xoops']->path(
'header.php');
185 echo
'<table cellpadding="4" cellspacing="1" width="98%" class="outer">
186 <tr><td class="head">' .
$com_title .
'</td></tr>
187 <tr><td><br />' . $p_comment .
'<br /></td></tr>
189 include_once
$GLOBALS[
'xoops']->path(
'include/comment_form.php');
190 include_once
$GLOBALS[
'xoops']->path(
'footer.php');
193 echo
'<table cellpadding="4" cellspacing="1" width="98%" class="outer">
194 <tr><td class="head">' .
$com_title .
'</td></tr>
195 <tr><td><br />' . $p_comment .
'<br /></td></tr>
197 include_once
$GLOBALS[
'xoops']->path(
'include/comment_form.php');
208 $add_userpost =
false;
209 $call_approvefunc =
false;
210 $call_updatefunc =
false;
212 $notify_event =
false;
218 include_once
$GLOBALS[
'xoops']->path(
'modules/system/constants.php');
222 $old_com_status =
$comment->getVar(
'com_status');
226 $add_userpost =
true;
228 $call_updatefunc =
true;
229 $call_approvefunc =
true;
231 $notify_event =
'comment';
234 $call_updatefunc =
true;
238 $call_updatefunc =
true;
257 $comment->setVar(
'com_created', time());
263 include_once
$GLOBALS[
'xoops']->path(
'modules/system/constants.php');
267 $add_userpost =
true;
268 $call_approvefunc =
true;
269 $call_updatefunc =
true;
271 $notify_event =
'comment';
278 $add_userpost =
true;
279 $call_approvefunc =
true;
280 $call_updatefunc =
true;
282 $notify_event =
'comment';
287 $notify_event =
'comment_submit';
308 $add_userpost =
true;
309 $call_approvefunc =
true;
310 $call_updatefunc =
true;
312 $notify_event =
'comment';
319 $notify_event =
'comment_submit';
335 $comment->setVar(
'com_modified', time());
342 if (isset($extra_params)) {
343 $comment->setVar(
'com_exparams', $extra_params);
346 $newcid =
$comment->getVar(
'com_id');
352 include
$GLOBALS[
'xoops']->path(
'header.php');
354 include
$GLOBALS[
'xoops']->path(
'footer.php');
363 if ($callbackfile !=
'' && file_exists(
$GLOBALS[
'xoops']->path(
'modules/' .
$moddir .
'/' . $callbackfile))) {
364 include_once
$GLOBALS[
'xoops']->path(
'modules/' .
$moddir .
'/' . $callbackfile);
384 if ($callbackfile !=
'' && file_exists(
$GLOBALS[
'xoops']->path(
'modules/' .
$moddir .
'/' . $callbackfile))) {
385 include_once
$GLOBALS[
'xoops']->path(
'modules/' .
$moddir .
'/' . $callbackfile);
400 call_user_func_array($func, array(
409 if (
$uid > 0 &&
false != $add_userpost) {
421 include_once
$GLOBALS[
'xoops']->path(
'include/notification_functions.php');
423 $not_category = $not_catinfo[
'name'];
425 $not_event = $notify_event;
429 $comment_tags = array();
437 $com_config =& $not_module->getInfo(
'comments');
439 if (isset($com_config[
'extraParams']) && is_array($com_config[
'extraParams'])) {
441 foreach($com_config[
'extraParams'] as $extra_param) {
442 $extra_params .= isset(
$_POST[$extra_param]) ? $extra_param .
'=' . htmlspecialchars(
$_POST[$extra_param]) .
'&' : $extra_param .
'=&';
448 $comment_tags[
'X_COMMENT_URL'] = XOOPS_URL .
'/modules/' . $not_module->getVar(
'dirname') .
'/' .
$comment_url .
'=' .
$com_itemid .
'&com_id=' . $newcid .
'&com_rootid=' .
$com_rootid .
'&com_mode=' .
$com_mode .
'&com_order=' .
$com_order .
'#comment' . $newcid;
450 $notification_handler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags,
false, $not_modid);
452 if (!isset($comment_post_results)) {
462 if (!isset($purge_comment_post_results)) {
463 include_once
$GLOBALS[
'xoops']->path(
'header.php');
465 include_once
$GLOBALS[
'xoops']->path(
'footer');
467 $comment_post_results =
$comment->getErrors();