OSDN Git Service

* Enable old design #ref(filename,BrackettedBracketName)
[pukiwiki/pukiwiki.git] / plugin / touchgraph.inc.php
1 <?php
2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
4 //
5 // $Id: touchgraph.inc.php,v 1.4 2004/07/31 03:09:20 henoheno Exp $
6 //
7 // TouchGraph WikiBrowserÍѤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤òºî¤ê¤Þ¤¹¡£
8 //
9 // Usage:
10 //   java -Dfile.encoding=EUC-JP \
11 //    -cp TGWikiBrowser.jar;BrowserLauncher.jar com.touchgraph.wikibrowser.TGWikiBrowser \
12 //    http://<pukiwiki site>/pukiwiki.php?plugin=touchgraph \
13 //    http://<pukiwiki site>/pukiwiki.php? \
14 //    FrontPage 2 true
15 //
16 // TouchGraph http://www.touchgraph.com/index.html
17
18 function plugin_touchgraph_action()
19 {
20         header('Content-type: text/plain');
21         plugin_touchgraph_rel();
22 //      plugin_touchgraph_ref(); // reverse
23
24         die;
25 }
26 function plugin_touchgraph_rel()
27 {
28         foreach (get_existpages() as $page)
29         {
30                 if (file_exists(CACHE_DIR.encode($page).'.rel'))
31                 {
32                         $data = file(CACHE_DIR.encode($page).'.rel');
33                         echo $page.' '.str_replace("\t",' ',trim($data[0]))."\n";
34                 }
35         }
36 }
37 function plugin_touchgraph_ref()
38 {
39         foreach (get_existpages() as $page)
40         {
41                 if (file_exists(CACHE_DIR.encode($page).'.ref'))
42                 {
43                         $data = file(CACHE_DIR.encode($page).'.ref');
44                         $node = $page;
45                         foreach ($data as $line)
46                         {
47                                 list($name) = explode("\t",$line);
48                                 $node .= " $name";
49                         }
50                         echo "$node\n";
51                 }
52         }
53 }
54 ?>