Changeset 12596 for trunk/admin


Ignore:
Timestamp:
Nov 11, 2011, 11:19:44 AM (12 years ago)
Author:
mistic100
Message:

feature 2500: make 'validate_user_comment' and 'delete_user_comment' working with array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/comments.php

    r8728 r12596  
    4949  else
    5050  {
     51    include_once( PHPWG_ROOT_PATH .'include/functions_comment.inc.php' );
    5152    check_input_parameter('comments', $_POST, true, PATTERN_ID);
    5253   
    5354    if (isset($_POST['validate']))
    5455    {
    55       $query = '
    56 UPDATE '.COMMENTS_TABLE.'
    57   SET validated = \'true\'
    58     , validation_date = NOW()
    59   WHERE id IN ('.implode(',', $_POST['comments']).')
    60 ;';
    61     pwg_query($query);
     56      validate_user_comment($_POST['comments']);
    6257
    63     array_push(
    64       $page['infos'],
    65       l10n_dec(
    66         '%d user comment validated', '%d user comments validated',
    67         count($_POST['comments'])
    68         )
    69       );
     58      array_push(
     59        $page['infos'],
     60        l10n_dec(
     61          '%d user comment validated', '%d user comments validated',
     62          count($_POST['comments'])
     63          )
     64        );
    7065    }
    7166
    7267    if (isset($_POST['reject']))
    7368    {
    74       $query = '
    75 DELETE
    76   FROM '.COMMENTS_TABLE.'
    77   WHERE id IN ('.implode(',', $_POST['comments']).')
    78 ;';
    79       pwg_query($query);
     69      delete_user_comment($_POST['comments']);
    8070
    8171      array_push(
Note: See TracChangeset for help on using the changeset viewer.