2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: touchgraph.inc.php,v 1.7 2005/01/03 12:59:01 henoheno Exp $
5 // Output an index for 'TouchGraph WikiBrowser'
6 // http://www.touchgraph.com/
8 // Usage: (Check also TGWikiBrowser's sample)
9 // java -Dfile.encoding=EUC-JP \
10 // -cp TGWikiBrowser.jar;BrowserLauncher.jar com.touchgraph.wikibrowser.TGWikiBrowser \
11 // http://<pukiwiki site>/index.php?plugin=touchgraph \
12 // http://<pukiwiki site>/index.php? FrontPage 2 true
14 // Note: -Dfile.encoding=EUC-JP (or UTF-8) may not work with Windows OS
15 // http://www.simeji.com/wiki/pukiwiki.php?Java%A4%CE%CD%AB%DD%B5 (in Japanese)
18 function plugin_touchgraph_action()
23 header('Content-type: text/plain');
24 if (isset($vars['reverse'])) {
25 plugin_touchgraph_ref();
27 plugin_touchgraph_rel();
33 function plugin_touchgraph_rel()
37 $non_list_pattern = '#' . $non_list . '#';
38 foreach (get_existpages() as $page) {
39 if (preg_match($non_list_pattern, $page)) continue;
41 $file = CACHE_DIR . encode($page) . '.rel';
42 if (file_exists($file)) {
45 foreach(explode("\t", trim($data[0])) as $name) {
46 if (preg_match($non_list_pattern, $name)) continue;
55 function plugin_touchgraph_ref()
59 $non_list_pattern = '#' . $non_list . '#';
60 foreach (get_existpages() as $page) {
61 if (preg_match($non_list_pattern, $page)) continue;
63 $file = CACHE_DIR . encode($page) . '.ref';
64 if (file_exists($file)) {
66 foreach (file($file) as $line) {
67 list($name) = explode("\t", $line);
68 if (preg_match($non_list_pattern, $name)) continue;