OSDN Git Service

ruby.inc.php by reimy.
[pukiwiki/pukiwiki.git] / plugin / touchgraph.inc.php
1 <?php
2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
4 //
5 // $Id: touchgraph.inc.php,v 1.1 2003/04/13 07:48:04 arino Exp $
6 //
7 // TouchGraph http://www.touchgraph.com/index.html
8
9
10 function plugin_touchgraph_action()
11 {
12         header('Content-type: text/plain');
13         plugin_touchgraph_ref();
14 //      plugin_touchgraph_rel();
15         
16         die;    
17 }
18 function plugin_touchgraph_rel()
19 {
20         foreach (get_existpages() as $page)
21         {
22                 if (file_exists(CACHE_DIR.encode($page).'.rel'))
23                 {
24                         $data = file(CACHE_DIR.encode($page).'.rel');
25                         echo mb_convert_encoding($page.' '.str_replace("\t",' ',trim($data[0]))."\n",'Shift_JIS',SOURCE_ENCODING);
26                 }
27         }
28 }
29 function plugin_touchgraph_ref()
30 {
31         foreach (get_existpages() as $page)
32         {
33                 if (file_exists(CACHE_DIR.encode($page).'.ref'))
34                 {
35                         $data = file(CACHE_DIR.encode($page).'.ref');
36                         $node = $page;
37                         foreach ($data as $line)
38                         {
39                                 list($name) = explode("\t",$line);
40                                 $node .= " $name";
41                         }
42                         echo mb_convert_encoding("$node\n",'Shift_JIS',SOURCE_ENCODING);
43                 }
44         }
45 }
46 ?>