3 * PukiWiki ºÇ¿·¤Î?·ï¤òɽ¼¨¤¹¤ë¥×¥é¥°¥¤¥ó
5 * CopyRight 2002 Y.MASUI GPL2
6 * http://masui.net/pukiwiki/ masui@masui.net
9 * 2002.04.08: pat¤µ¤ó¡¢¤ß¤Î¤ë¤µ¤ó¤Î»ØŦ¤Ë¤è¤ê¡¢¥ê¥ó¥¯À褬ÆüËܸì¤Î¾ì¹ç¤Ë
12 * 2002.06.17: plugin_recent_init()¤òÀßÄê
13 * 2002.07.02: <ul>¤Ë¤è¤ë½ÐÎϤËÊѹ¹¤·¹½Â¤²½
15 * $Id: recent.inc.php,v 1.13 2004/09/04 14:26:52 henoheno Exp $
18 // RecentChanges¤Î¥¥ã¥Ã¥·¥å
19 define('PLUGIN_RECENT_CACHE', CACHE_DIR . 'recent.dat');
21 function plugin_recent_convert()
23 global $script, $vars, $date_format;
24 global $_recent_plugin_frame;
26 if (! file_exists(PLUGIN_RECENT_CACHE)) return '';
29 if (func_num_args()) {
30 $args = func_get_args();
31 if (is_numeric($args[0]))
32 $recent_lines = $args[0];
35 // ÀèƬ¤ÎN·ï(¹Ô)¤ò¼è¤ê½Ð¤¹
36 $lines = array_splice(file(PLUGIN_RECENT_CACHE), 0, $recent_lines);
39 foreach ($lines as $line) {
40 list($time, $page) = explode("\t", rtrim($line));
41 $_date = get_date($date_format, $time);
42 if ($date != $_date) {
43 if ($date != '') $items .= '</ul>';
45 $items .= "<strong>$date</strong>\n" .
46 "<ul class=\"recent_list\">\n";
48 $s_page = htmlspecialchars($page);
49 $r_page = rawurlencode($page);
50 $pg_passage = get_pg_passage($page, FALSE);
51 if($page == $vars['page']) {
52 // No need to link itself, notifies where you just read
53 $items .= " <li><span title=\"$s_page $pg_passage\">$s_page</span></li>\n";
55 $items .= " <li><a href=\"$script?$r_page\" title=\"$s_page $pg_passage\">$s_page</a></li>\n";
58 if (! empty($lines)) $items .= "</ul>\n";
60 return sprintf($_recent_plugin_frame, count($lines), $items);