OSDN Git Service

BugTrack2/57: Added PLUGIN_CALENDAR_VIEWER_SHOW_DATE_ONLY, to shorten 'pagename/2004...
authorhenoheno <henoheno>
Sat, 4 Jun 2005 04:08:57 +0000 (13:08 +0900)
committerhenoheno <henoheno>
Sat, 4 Jun 2005 04:08:57 +0000 (13:08 +0900)
plugin/calendar_viewer.inc.php

index 54e8888..4311d54 100644 (file)
@@ -1,10 +1,15 @@
 <?php
 // PukiWiki - Yet another WikiWikiWeb clone
-// $Id: calendar_viewer.inc.php,v 1.31 2005/01/26 13:09:58 henoheno Exp $
+// $Id: calendar_viewer.inc.php,v 1.32 2005/06/04 04:08:57 henoheno Exp $
 //
 // Calendar viewer plugin - List pages that calendar/calnedar2 plugin created
 // (Based on calendar and recent plugin)
 
+// Use 'pagename/2004-12-30' => '2004/12/30' for page title
+define('PLUGIN_CALENDAR_VIEWER_SHOW_DATE_ONLY', 1); // 1 = Shorten
+
+// ----
+
 define('PLUGIN_CALENDAR_VIEWER_USAGE',
        '#calendar_viewer(pagename,this|yyyy-mm|n|x*y[,mode[,separater]])');
 /*
@@ -159,7 +164,12 @@ function plugin_calendar_viewer_convert()
                }
 
                $r_page = rawurlencode($page);
-               $s_page = htmlspecialchars($page);
+
+               if (PLUGIN_CALENDAR_VIEWER_SHOW_DATE_ONLY) {
+                       $s_page = htmlspecialchars(strtr(basename($page), $date_sep, '/'));
+               } else {
+                       $s_page = htmlspecialchars($page);
+               }
 
                if (PKWK_READONLY) {
                        $link   = $script . '?' . $r_page;