Ignore:
Timestamp:
Nov 11, 2011, 2:57:12 PM (12 years ago)
Author:
mistic100
Message:

some more modifications for Subscribe_to_comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Comments_on_Albums/include/functions_comment.inc.php

    r12562 r12601  
    195195    $user_where_clause = '   AND author_id = \''.$GLOBALS['user']['id'].'\'';
    196196  }
     197 
     198  if (is_array($comment_id))
     199    $where_clause = 'id IN('.implode(',', $comment_id).')';
     200  else
     201    $where_clause = 'id = '.$comment_id;
     202 
    197203  $query = '
    198204DELETE FROM '.COA_TABLE.'
    199   WHERE id = '.$comment_id.
     205  WHERE '.$where_clause.
    200206$user_where_clause.'
    201207;';
    202208  $result = pwg_query($query);
    203   if ($result) {
     209 
     210  if ($result)
     211  {
    204212    email_admin('delete',
    205213                array('author' => $GLOBALS['user']['username'],
     
    366374}
    367375
     376/**
     377 * Tries to validate a user comment in the database
     378 * @param int or array of int comment_id
     379 */
    368380function validate_user_comment_albums($comment_id)
    369381{
     382  if (is_array($comment_id))
     383    $where_clause = 'id IN('.implode(',', $comment_id).')';
     384  else
     385    $where_clause = 'id = '.$comment_id;
     386   
    370387  $query = '
    371388UPDATE '.COA_TABLE.'
    372389  SET validated = \'true\'
    373390    , validation_date = NOW()
    374   WHERE id = '.$comment_id.'
     391  WHERE '.$where_clause.'
    375392;';
    376393  pwg_query($query);
Note: See TracChangeset for help on using the changeset viewer.