aboutsummaryrefslogtreecommitdiffstats
path: root/admin/comments.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-11-11 10:21:58 +0000
committermistic100 <mistic@piwigo.org>2011-11-11 10:21:58 +0000
commitebd35f045a173fe830a418257322a962c68997d6 (patch)
tree98952cde255d388243295ef92cc73571d9abe8c7 /admin/comments.php
parentf8a63307a71ea8b86b783e1374501738c4867a74 (diff)
merge r12596 from trunk: feature 2500: make 'validate_user_comment' and 'delete_user_comment' working with array
git-svn-id: http://piwigo.org/svn/branches/2.3@12597 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/comments.php30
1 files changed, 10 insertions, 20 deletions
diff --git a/admin/comments.php b/admin/comments.php
index f95d0b91c..a8f593705 100644
--- a/admin/comments.php
+++ b/admin/comments.php
@@ -48,35 +48,25 @@ if (!empty($_POST))
}
else
{
+ include_once( PHPWG_ROOT_PATH .'include/functions_comment.inc.php' );
check_input_parameter('comments', $_POST, true, PATTERN_ID);
if (isset($_POST['validate']))
{
- $query = '
-UPDATE '.COMMENTS_TABLE.'
- SET validated = \'true\'
- , validation_date = NOW()
- WHERE id IN ('.implode(',', $_POST['comments']).')
-;';
- pwg_query($query);
+ validate_user_comment($_POST['comments']);
- array_push(
- $page['infos'],
- l10n_dec(
- '%d user comment validated', '%d user comments validated',
- count($_POST['comments'])
- )
- );
+ array_push(
+ $page['infos'],
+ l10n_dec(
+ '%d user comment validated', '%d user comments validated',
+ count($_POST['comments'])
+ )
+ );
}
if (isset($_POST['reject']))
{
- $query = '
-DELETE
- FROM '.COMMENTS_TABLE.'
- WHERE id IN ('.implode(',', $_POST['comments']).')
-;';
- pwg_query($query);
+ delete_user_comment($_POST['comments']);
array_push(
$page['infos'],