Revision 3781:a86e029cb95d,
863 bytes
checked in by franck <carnet.franck.paul@…>, 7 years ago
(diff) |
Animate some counters on dashboard icons (nb of comments, spam comments and posts), just for fun
|
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * @brief antispam, a plugin for Dotclear 2 |
---|
4 | * |
---|
5 | * @package Dotclear |
---|
6 | * @subpackage Plugins |
---|
7 | * |
---|
8 | * @copyright Olivier Meunier & Association Dotclear |
---|
9 | * @copyright GPL-2.0-only |
---|
10 | */ |
---|
11 | |
---|
12 | if (!defined('DC_CONTEXT_ADMIN')) {return;} |
---|
13 | |
---|
14 | class dcAntispamRest |
---|
15 | { |
---|
16 | /** |
---|
17 | * Serve method to get number of spams for current blog. |
---|
18 | * |
---|
19 | * @param core <b>dcCore</b> dcCore instance |
---|
20 | * @param get <b>array</b> cleaned $_GET |
---|
21 | */ |
---|
22 | public static function getSpamsCount($core, $get) |
---|
23 | { |
---|
24 | $count = dcAntispam::countSpam($core); |
---|
25 | if ($count > 0) { |
---|
26 | $str = sprintf(($count > 1) ? __('(including %d spam comments)') : __('(including %d spam comment)'), $count); |
---|
27 | } else { |
---|
28 | $str = ''; |
---|
29 | } |
---|
30 | |
---|
31 | $rsp = new xmlTag('count'); |
---|
32 | $rsp->ret = $str; |
---|
33 | |
---|
34 | return $rsp; |
---|
35 | } |
---|
36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.