3 * PukiWiki versionlist¥×¥é¥°¥¤¥ó
5 * CopyRight 2002 S.YOSHIMURA GPL2
6 * http://masui.net/pukiwiki/ yosimura@excellence.ac.jp
8 * $Id: versionlist.inc.php,v 1.13 2004/08/01 01:22:37 henoheno Exp $
11 function plugin_versionlist_action()
13 global $_title_versionlist;
16 'msg' => $_title_versionlist,
17 'body' => plugin_versionlist_convert()
21 function plugin_versionlist_convert()
23 /* õº÷¥Ç¥£¥ì¥¯¥È¥êÀßÄê */
24 $SCRIPT_DIR = array('./');
25 if (LIB_DIR != './') array_push($SCRIPT_DIR, LIB_DIR);
26 if (DATA_HOME != './' && DATA_HOME != LIB_DIR) array_push($SCRIPT_DIR, DATA_HOME);
27 array_push($SCRIPT_DIR, PLUGIN_DIR, SKIN_DIR);
31 foreach ($SCRIPT_DIR as $sdir)
33 if (!$dir = @dir($sdir))
35 // die_message('directory '.$sdir.' is not found or not readable.');
38 while($file = $dir->read())
40 if (!preg_match("/\.(php|lng|css|js)$/i",$file))
44 $data = join('',file($sdir.$file));
45 $comment = array('file'=>htmlspecialchars($sdir.$file),'rev'=>'','date'=>'');
46 if (preg_match('/\$'.'Id: (.+),v (\d+\.\d+) (\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2})/',$data,$matches))
48 // $comment['file'] = htmlspecialchars($sdir.$matches[1]);
49 $comment['rev'] = htmlspecialchars($matches[2]);
50 $comment['date'] = htmlspecialchars($matches[3]);
52 $comments[$sdir.$file] = $comment;
56 if (count($comments) == 0)
62 foreach ($comments as $comment)
67 <td>{$comment['file']}</td>
68 <td align="right">{$comment['rev']}</td>
69 <td>{$comment['date']}</td>