source: extensions/Comments_on_Albums/include/coa_admin_intro.php @ 9624

Last change on this file since 9624 was 9624, checked in by mistic100, 13 years ago

[plugins] Comments on Albums

File size: 989 bytes
Line 
1<?php
2/* adds info about comments count on main admin page, uses javascript */
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5// comments count
6$query = '
7SELECT COUNT(*)
8        FROM '.COA_TABLE.'
9;';
10list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
11
12$template->assign('NB_COMMENTS', l10n_dec('%d comment', '%d comments', $nb_comments) .' ('. l10n('Albums') .')');
13
14// unvalidated comments
15$query = '
16SELECT COUNT(*)
17        FROM '.COA_TABLE.'
18        WHERE validated=\'false\'
19;';
20list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
21
22if ($nb_comments > 0) {
23        $template->assign('unvalidated_albums', array(
24                'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments&amp;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_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.