Changeset 28714 for trunk/include/functions_comment.inc.php
- Timestamp:
- Jun 18, 2014, 9:51:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_comment.inc.php
r28587 r28714 25 25 * @package functions\comment 26 26 */ 27 28 29 add_event_handler('user_comment_check', 'user_comment_check', 30 EVENT_HANDLER_PRIORITY_NEUTRAL, 2); 27 28 29 add_event_handler('user_comment_check', 'user_comment_check'); 31 30 32 31 /** … … 144 143 $_POST['cr'][] = 'key'; // rvelices: I use this outside to see how spam robots work 145 144 } 146 145 147 146 // website 148 147 if (!empty($comm['website_url'])) … … 159 158 } 160 159 } 161 160 162 161 // email 163 162 if (empty($comm['email'])) … … 178 177 $comment_action='reject'; 179 178 } 180 179 181 180 // anonymous id = ip address 182 181 $ip_components = explode('.', $comm['ip']); … … 284 283 $user_where_clause = ' AND author_id = \''.$GLOBALS['user']['id'].'\''; 285 284 } 286 285 287 286 if (is_array($comment_id)) 288 287 $where_clause = 'id IN('.implode(',', $comment_id).')'; 289 288 else 290 289 $where_clause = 'id = '.$comment_id; 291 290 292 291 $query = ' 293 292 DELETE FROM '.COMMENTS_TABLE.' … … 295 294 $user_where_clause.' 296 295 ;'; 297 296 298 297 if ( pwg_db_changes(pwg_query($query)) ) 299 298 { 300 299 invalidate_user_cache_nb_comments(); 301 300 302 email_admin('delete', 301 email_admin('delete', 303 302 array('author' => $GLOBALS['user']['username'], 304 303 'comment_id' => $comment_id … … 384 383 ;'; 385 384 $result = pwg_query($query); 386 385 387 386 // mail admin and ask to validate the comment 388 if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action) 387 if ($result and $conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action) 389 388 { 390 389 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); … … 412 411 } 413 412 } 414 413 415 414 return $comment_action; 416 415 } … … 483 482 } 484 483 } 485 484 486 485 list($author_id) = pwg_db_fetch_row($result); 487 486 … … 500 499 else 501 500 $where_clause = 'id = '.$comment_id; 502 501 503 502 $query = ' 504 503 UPDATE '.COMMENTS_TABLE.' … … 508 507 ;'; 509 508 pwg_query($query); 510 509 511 510 invalidate_user_cache_nb_comments(); 512 511 trigger_notify('user_comment_validation', $comment_id);
Note: See TracChangeset
for help on using the changeset viewer.