による出力に変更し構造化 * * $Id: recent.inc.php,v 1.11 2004/07/31 03:09:20 henoheno Exp $ */ function plugin_recent_convert() { global $script,$BracketName,$date_format; global $_recent_plugin_frame; $recent_lines = 10; if (func_num_args()) { $args = func_get_args(); if (is_numeric($args[0])) { $recent_lines = $args[0]; } } $date = $items = ''; if (!file_exists(CACHE_DIR.'recent.dat')) { return ''; } $recent = file(CACHE_DIR.'recent.dat'); $lines = array_splice($recent,0,$recent_lines); foreach ($lines as $line) { list($time,$page) = explode("\t",rtrim($line)); $_date = get_date($date_format,$time); if ($date != $_date) { if ($date != '') { $items .= ''; } $date = $_date; $items .= "$date\n'; } return sprintf($_recent_plugin_frame,count($lines),$items); } ?>