diff options
author | mistic100 <mistic@piwigo.org> | 2012-01-14 22:29:10 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2012-01-14 22:29:10 +0000 |
commit | c501688dbc98428635bdf569dc9c136e24fbd9a9 (patch) | |
tree | e60e9507668a8f508ddadf2b5b7fed333598d95d /admin/intro.php | |
parent | a412558492bf24ee9c39502ac37730ff4bc40177 (diff) |
feature:2549 Allow to disable comments for everybody
git-svn-id: http://piwigo.org/svn/trunk@12887 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/intro.php')
-rw-r--r-- | admin/intro.php | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/admin/intro.php b/admin/intro.php index 63d5b9805..72406dee6 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -187,12 +187,6 @@ list($nb_groups) = pwg_db_fetch_row(pwg_query($query)); $query = ' SELECT COUNT(*) - FROM '.COMMENTS_TABLE.' -;'; -list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); - -$query = ' -SELECT COUNT(*) FROM '.RATE_TABLE.' ;'; list($nb_rates) = pwg_db_fetch_row(pwg_query($query)); @@ -218,7 +212,6 @@ $template->assign( 'DB_IMAGE_TAG' => l10n_dec('%d association', '%d associations', $nb_image_tag), 'DB_USERS' => l10n_dec('%d user', '%d users', $nb_users), 'DB_GROUPS' => l10n_dec('%d group', '%d groups', $nb_groups), - 'DB_COMMENTS' => l10n_dec('%d comment', '%d comments', $nb_comments), 'DB_RATES' => sprintf('%d rates', $nb_rates), 'U_CHECK_UPGRADE' => PHPWG_ROOT_PATH.'admin.php?action=check_upgrade', 'U_PHPINFO' => PHPWG_ROOT_PATH.'admin.php?action=phpinfo', @@ -226,6 +219,35 @@ $template->assign( 'DB_DATATIME' => $db_current_date, ) ); + +if ($conf['activate_comments']) +{ + $query = ' +SELECT COUNT(*) + FROM '.COMMENTS_TABLE.' +;'; + list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); + $template->assign('DB_COMMENTS', l10n_dec('%d comment', '%d comments', $nb_comments)); + + // unvalidated comments + $query = ' +SELECT COUNT(*) + FROM '.COMMENTS_TABLE.' + WHERE validated=\'false\' +;'; + list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); + + if ($nb_comments > 0) + { + $template->assign( + 'unvalidated', + array( + 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments', + 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) + ) + ); + } +} if ($nb_elements > 0) { @@ -247,25 +269,6 @@ SELECT MIN(date_available) ); } -// unvalidated comments -$query = ' -SELECT COUNT(*) - FROM '.COMMENTS_TABLE.' - WHERE validated=\'false\' -;'; -list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); - -if ($nb_comments > 0) -{ - $template->assign( - 'unvalidated', - array( - 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments', - 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) - ) - ); -} - // graphics library switch (pwg_image::get_library()) { |