- Timestamp:
- Mar 12, 2011, 10:56:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Comments_on_Albums/include/functions_comment.inc.php
r9624 r9634 3 3 4 4 //returns string action to perform on a new comment: validate, moderate, reject 5 function user_comment_check($action, $comment) 6 { 7 global $conf,$user; 8 9 if ($action=='reject') 10 return $action; 11 12 $my_action = $conf['comment_spam_reject'] ? 'reject':'moderate'; 13 14 if ($action==$my_action) 15 return $action; 16 17 // we do here only BASIC spam check (plugins can do more) 18 if ( !is_a_guest() ) 19 return $action; 20 21 $link_count = preg_match_all( '/https?:\/\//', 22 $comment['content'], $matches); 23 24 if ( strpos($comment['author'], 'http://')!==false ) 25 { 26 $link_count++; 27 } 28 29 if ( $link_count>$conf['comment_spam_max_links'] ) 30 return $my_action; 31 32 return $action; 5 if (!function_exists('user_comment_check')) { 6 function user_comment_check($action, $comment) 7 { 8 global $conf,$user; 9 10 if ($action=='reject') 11 return $action; 12 13 $my_action = $conf['comment_spam_reject'] ? 'reject':'moderate'; 14 15 if ($action==$my_action) 16 return $action; 17 18 // we do here only BASIC spam check (plugins can do more) 19 if ( !is_a_guest() ) 20 return $action; 21 22 $link_count = preg_match_all( '/https?:\/\//', 23 $comment['content'], $matches); 24 25 if ( strpos($comment['author'], 'http://')!==false ) 26 { 27 $link_count++; 28 } 29 30 if ( $link_count>$conf['comment_spam_max_links'] ) 31 return $my_action; 32 33 return $action; 34 } 33 35 } 34 36 … … 44 46 * @param array infos out array of messages 45 47 */ 46 function insert_user_comment ( &$comm, $key, &$infos )48 function insert_user_comment_albums( &$comm, $key, &$infos ) 47 49 { 48 50 global $conf, $user; … … 185 187 * @param comment_id 186 188 */ 187 function delete_user_comment ($comment_id) {189 function delete_user_comment_albums($comment_id) { 188 190 $user_where_clause = ''; 189 191 if (!is_admin()) … … 216 218 */ 217 219 218 function update_user_comment ($comment, $post_key)220 function update_user_comment_albums($comment, $post_key) 219 221 { 220 222 global $conf; … … 259 261 } 260 262 261 function email_admin($action, $comment) 262 { 263 global $conf; 264 265 if (!in_array($action, array('edit', 'delete')) 266 or (($action=='edit') and !$conf['email_admin_on_comment_edition']) 267 or (($action=='delete') and !$conf['email_admin_on_comment_deletion'])) 268 { 269 return; 270 } 271 272 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 273 274 $keyargs_content = array(); 275 $keyargs_content[] = get_l10n_args('Author: %s', $comment['author']); 276 if ($action=='delete') 277 { 278 $keyargs_content[] = get_l10n_args('This author removed the comment with id %d', 279 $comment['comment_id'] 280 ); 281 } 282 else 283 { 284 $keyargs_content[] = get_l10n_args('This author modified following comment:', ''); 285 $keyargs_content[] = get_l10n_args('Comment: %s', $comment['content']); 286 } 287 288 pwg_mail_notification_admins(get_l10n_args('Comment by %s', 289 $comment['author']), 290 $keyargs_content 291 ); 292 } 293 294 function get_comment_author_id($comment_id, $die_on_error=true) 263 if (!function_exists('email_admin')) { 264 function email_admin($action, $comment) 265 { 266 global $conf; 267 268 if (!in_array($action, array('edit', 'delete')) 269 or (($action=='edit') and !$conf['email_admin_on_comment_edition']) 270 or (($action=='delete') and !$conf['email_admin_on_comment_deletion'])) 271 { 272 return; 273 } 274 275 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 276 277 $keyargs_content = array(); 278 $keyargs_content[] = get_l10n_args('Author: %s', $comment['author']); 279 if ($action=='delete') 280 { 281 $keyargs_content[] = get_l10n_args('This author removed the comment with id %d', 282 $comment['comment_id'] 283 ); 284 } 285 else 286 { 287 $keyargs_content[] = get_l10n_args('This author modified following comment:', ''); 288 $keyargs_content[] = get_l10n_args('Comment: %s', $comment['content']); 289 } 290 291 pwg_mail_notification_admins(get_l10n_args('Comment by %s', 292 $comment['author']), 293 $keyargs_content 294 ); 295 } 296 } 297 298 function get_comment_author_id_albums($comment_id, $die_on_error=true) 295 299 { 296 300 $query = ' … … 318 322 } 319 323 320 function validate_user_comment ($comment_id)324 function validate_user_comment_albums($comment_id) 321 325 { 322 326 $query = '
Note: See TracChangeset
for help on using the changeset viewer.