Line | |
---|
1 | <?php |
---|
2 | /* adds info about comments count on main admin page, uses javascript */ |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | // comments count |
---|
6 | $query = ' |
---|
7 | SELECT COUNT(*) |
---|
8 | FROM '.COA_TABLE.' |
---|
9 | ;'; |
---|
10 | list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); |
---|
11 | |
---|
12 | $template->assign('DB_COMMENTS_ALBUMS', l10n_dec('%d comment', '%d comments', $nb_comments)); |
---|
13 | |
---|
14 | // unvalidated comments |
---|
15 | $query = ' |
---|
16 | SELECT COUNT(*) |
---|
17 | FROM '.COA_TABLE.' |
---|
18 | WHERE validated=\'false\' |
---|
19 | ;'; |
---|
20 | list($nb_comments) = pwg_db_fetch_row(pwg_query($query)); |
---|
21 | |
---|
22 | if ($nb_comments > 0) { |
---|
23 | $template->assign('unvalidated_albums', array( |
---|
24 | 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&section=albums', |
---|
25 | 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) |
---|
26 | )); |
---|
27 | } |
---|
28 | |
---|
29 | // template |
---|
30 | $template->set_filename('comments_on_albums', dirname(__FILE__) .'/../template/coa_admin_intro.tpl'); |
---|
31 | $template->concat('ADMIN_CONTENT', $template->parse('comments_on_albums', true)); |
---|
32 | |
---|
33 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.