Commit MetaInfo

修订版3099d80b8542bbb8e45ee5014b3d08d8f7f9fd62 (tree)
时间2017-10-23 00:06:41
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/693 calendar_viewer plugin: Extend the show limit (1 to 4)

更改概述

差异

--- a/plugin/calendar_viewer.inc.php
+++ b/plugin/calendar_viewer.inc.php
@@ -55,7 +55,7 @@ function plugin_calendar_viewer_convert()
5555 global $_msg_calendar_viewer_right, $_msg_calendar_viewer_left;
5656 global $_msg_calendar_viewer_restrict, $_err_calendar_viewer_param2;
5757
58- static $viewed = array();
58+ static $show_count = array();
5959
6060 if (func_num_args() < 2)
6161 return PLUGIN_CALENDAR_VIEWER_USAGE . '<br />' . "\n";
@@ -102,11 +102,14 @@ function plugin_calendar_viewer_convert()
102102 if (isset($func_args[3])) $date_sep = $func_args[3];
103103
104104 // Avoid Loop etc.
105- if (isset($viewed[$pagename])) {
105+ if (!isset($show_count[$pagename])) {
106+ $show_count[$pagename] = 0;
107+ }
108+ $show_count[$pagename] += 1;
109+ pkwk_log('show_count: ' . $show_count[$pagename]);
110+ if ($show_count[$pagename] > 4) {
106111 $s_page = htmlsc($pagename);
107- return "#calendar_viewer(): You already view: $s_page<br />";
108- } else {
109- $viewed[$pagename] = TRUE; // Valid
112+ return "#calendar_viewer(): Exceeded the limit of show count: $s_page<br />";
110113 }
111114
112115 // 一覧表示するページ名とファイル名のパターン ファイル名には年月を含む
Show on old repository browser