OSDN Git Service

Newly added lastmod plugin: Originally written by Reimy
authorhenoheno <henoheno>
Sun, 23 Jan 2005 13:02:08 +0000 (22:02 +0900)
committerhenoheno <henoheno>
Sun, 23 Jan 2005 13:02:08 +0000 (22:02 +0900)
plugin/lastmod.inc.php [new file with mode: 0644]

diff --git a/plugin/lastmod.inc.php b/plugin/lastmod.inc.php
new file mode 100644 (file)
index 0000000..7a5da81
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+// PukiWiki - Yet another WikiWikiWeb clone
+// $Id: lastmod.inc.php,v 1.1 2005/01/23 13:02:08 henoheno Exp $
+//
+// Lastmod plugin - Show lastmodifled date of the page
+// Originally written by Reimy
+
+function plugin_lastmod_inline()
+{
+       global $vars, $WikiName, $BracketName;
+
+       $args = func_get_args();
+       $page = $args[0];
+
+       if ($page == ''){
+               $page = $vars['page']; // Default: page itself
+       } else {
+               if (preg_match("/^($WikiName|\[\[$BracketName\]\])$/", $page)) {
+                       $page = get_fullname(strip_bracket($page), $vars['page']);
+               } else {
+                       return FALSE;
+               }
+       }
+       if (! is_page($page)) return FALSE;
+
+       return format_date(get_filetime($page));
+}
+?>