リビジョン | ab394e91abccc37a96ff76e07eab2cc5a3fed821 (tree) |
---|---|
日時 | 2019-01-24 00:15:20 |
作者 | umorigu <umorigu@gmai...> |
コミッター | umorigu |
BugTrack/2422 popular plugin supports Dababase counter
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // popular.inc.php |
4 | 4 | // Copyright |
5 | -// 2003-2017 PukiWiki Development Team | |
5 | +// 2003-2019 PukiWiki Development Team | |
6 | 6 | // 2002 Kazunori Mizushima <kazunori@uc.netyou.jp> |
7 | 7 | // License: WHERE IS THE RECORD? |
8 | 8 | // |
@@ -27,8 +27,6 @@ | ||
27 | 27 | |
28 | 28 | define('PLUGIN_POPULAR_DEFAULT', 10); |
29 | 29 | |
30 | -require_once(PLUGIN_DIR . 'counter.inc.php'); | |
31 | - | |
32 | 30 | function plugin_popular_convert() |
33 | 31 | { |
34 | 32 | global $vars; |
@@ -45,7 +43,11 @@ function plugin_popular_convert() | ||
45 | 43 | case 2: $except = $array[1]; |
46 | 44 | case 1: $max = (int)$array[0]; |
47 | 45 | } |
48 | - $counters = plugin_counter_get_popular_list($today, $except, $max); | |
46 | + if (exist_plugin('counter')) { | |
47 | + $counters = plugin_counter_get_popular_list($today, $except, $max); | |
48 | + } else { | |
49 | + $counters = array(); | |
50 | + } | |
49 | 51 | |
50 | 52 | $items = ''; |
51 | 53 | if (! empty($counters)) { |