Changeset 5195 for trunk/include/functions_comment.inc.php
- Timestamp:
- Mar 19, 2010, 11:25:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_comment.inc.php
r5021 r5195 171 171 $comm['id'] = pwg_db_insert_id(COMMENTS_TABLE); 172 172 173 if ( ($comment_action=='validate' and $conf['email_admin_on_comment']) or174 ($comment_action!='validate' and $conf['email_admin_on_comment_validation']))173 if ($conf['email_admin_on_comment'] 174 or ($conf['email_admin_on_comment_validation'] and 'moderate' == $comment_action)) 175 175 { 176 176 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 177 177 178 $ del_url = get_absolute_root_url().'comments.php?delete='.$comm['id'];178 $comment_url = get_absolute_root_url().'comments.php?comment_id='.$comm['id']; 179 179 180 180 $keyargs_content = array … … 183 183 get_l10n_args('Comment: %s', stripslashes($comm['content']) ), 184 184 get_l10n_args('', ''), 185 get_l10n_args(' Delete: %s', $del_url)185 get_l10n_args('Manage this user comment: %s', $comment_url) 186 186 ); 187 187 188 if ( $comment_action!='validate')188 if ('moderate' == $comment_action) 189 189 { 190 $keyargs_content[] = 191 get_l10n_args('', ''); 192 $keyargs_content[] = 193 get_l10n_args('Validate: %s', 194 get_absolute_root_url().'comments.php?validate='.$comm['id']); 190 $keyargs_content[] = get_l10n_args('', ''); 191 $keyargs_content[] = get_l10n_args('(!) This comment requires validation', ''); 195 192 } 196 193 … … 213 210 * @param comment_id 214 211 */ 215 216 212 function delete_user_comment($comment_id) { 217 213 $user_where_clause = ''; … … 338 334 ); 339 335 } 336 337 function get_comment_author_id($comment_id, $die_on_error=true) 338 { 339 $query = ' 340 SELECT 341 author_id 342 FROM '.COMMENTS_TABLE.' 343 WHERE id = '.$comment_id.' 344 ;'; 345 $result = pwg_query($query); 346 if (pwg_db_num_rows($result) == 0) 347 { 348 if ($die_on_error) 349 { 350 fatal_error('Unknown comment identifier'); 351 } 352 else 353 { 354 return false; 355 } 356 } 357 358 list($author_id) = pwg_db_fetch_row($result); 359 360 return $author_id; 361 } 362 363 function validate_user_comment($comment_id) 364 { 365 $query = ' 366 UPDATE '.COMMENTS_TABLE.' 367 SET validated = "true" 368 , validation_date = NOW() 369 WHERE id = '.$comment_id.' 370 ;'; 371 pwg_query($query); 372 } 340 373 ?>
Note: See TracChangeset
for help on using the changeset viewer.