OSDN Git Service

PukiWiki/1.4 first beta release
[pukiwiki/pukiwiki.git] / plugin / versionlist.inc.php
1 <?php
2 /*
3  * PukiWiki versionlist¥×¥é¥°¥¤¥ó
4  *
5  * CopyRight 2002 S.YOSHIMURA GPL2
6  * http://masui.net/pukiwiki/ yosimura@excellence.ac.jp
7  *
8  * $Id: versionlist.inc.php,v 1.3 2003/01/27 05:38:47 panda Exp $
9  */
10
11 function plugin_versionlist_convert()
12 {
13   global $vars, $script;
14   $SCRIPT_DIR = array("./","./plugin/");
15   /* Ãµº÷¥Ç¥£¥ì¥¯¥È¥êÀßÄê¡£ËÜÅö¤Ï¡¢pukiwiki.ini.php ¤«¤Ê */
16
17   if (func_num_args())
18     $aryargs = func_get_args();
19   else
20     $aryargs = array();
21
22   $lst = $comment = '';
23
24   foreach($SCRIPT_DIR as $sdir){
25     if ($dir = @dir($sdir)){
26       while($file = $dir->read()){
27         if ($file == ".." || $file == ".") continue;
28         if (!preg_match('/\.php$/i',$file)) continue;
29         
30         $comment = '';
31         $filenp = $sdir . $file;
32         $fd = fopen($filenp,'r');
33         while(!feof ($fd)){
34           if (preg_match('/Id:(.+),v (\d+\.\d+)/',fgets($fd,1024),$match)){
35             $comment = trim($match[1] . " -&gt; " .  $match[2]) ;
36             break;
37           }else {
38             continue;
39           }
40         }
41         fclose($fd);
42         if ($comment != '')
43           $lst .= "<li>$filenp =&gt; $comment\n";
44       }
45     }
46     $dir->close();
47   }
48   if ($lst=='') {
49     return '';
50   }
51
52   return "<ul>$lst</ul>";
53 }
54 ?>