2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: touchgraph.inc.php,v 1.6 2005/01/03 12:37:45 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)
17 define('PLUGIN_TOUCHGRAPH_REVERSE', 0);
19 function plugin_touchgraph_action()
22 header('Content-type: text/plain');
23 if (PLUGIN_TOUCHGRAPH_REVERSE) {
24 plugin_touchgraph_ref(); // reverse
26 plugin_touchgraph_rel();
31 function plugin_touchgraph_rel()
33 foreach (get_existpages() as $page) {
34 $file = CACHE_DIR . encode($page) . '.rel';
35 if (file_exists($file)) {
39 echo str_replace("\t", ' ', trim($data[0]));
45 function plugin_touchgraph_ref()
47 foreach (get_existpages() as $page) {
48 $file = CACHE_DIR . encode($page) . '.ref';
49 if (file_exists($file)) {
51 foreach (file($file) as $line) {
52 list($name) = explode("\t", $line);