Changeset 12596 for trunk/include
- Timestamp:
- Nov 11, 2011, 11:19:44 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_comment.inc.php
r12556 r12596 203 203 * so to avoid a new sql request we add author in where clause 204 204 * 205 * @param comment_id205 * @param int or array of int comment_id 206 206 */ 207 function delete_user_comment($comment_id) { 207 function delete_user_comment($comment_id) 208 { 208 209 $user_where_clause = ''; 209 210 if (!is_admin()) … … 211 212 $user_where_clause = ' AND author_id = \''.$GLOBALS['user']['id'].'\''; 212 213 } 214 215 if (is_array($comment_id)) 216 $where_clause = 'id IN('.implode(',', $comment_id).')'; 217 else 218 $where_clause = 'id = '.$comment_id; 219 213 220 $query = ' 214 221 DELETE FROM '.COMMENTS_TABLE.' 215 WHERE id = '.$comment_id.222 WHERE '.$where_clause. 216 223 $user_where_clause.' 217 224 ;'; 218 225 $result = pwg_query($query); 219 if ($result) { 226 227 if ($result) 228 { 220 229 email_admin('delete', 221 230 array('author' => $GLOBALS['user']['username'], … … 378 387 } 379 388 389 /** 390 * Tries to validate a user comment in the database 391 * @param int or array of int comment_id 392 */ 380 393 function validate_user_comment($comment_id) 381 394 { 395 if (is_array($comment_id)) 396 $where_clause = 'id IN('.implode(',', $comment_id).')'; 397 else 398 $where_clause = 'id = '.$comment_id; 399 382 400 $query = ' 383 401 UPDATE '.COMMENTS_TABLE.' 384 402 SET validated = \'true\' 385 403 , validation_date = NOW() 386 WHERE id = '.$comment_id.'404 WHERE '.$where_clause.' 387 405 ;'; 388 406 pwg_query($query);
Note: See TracChangeset
for help on using the changeset viewer.