4 This mpi provides a tree of page backlinks from the current or any
5 given page, thus creating a sitemap.
7 <?plugin LocalSiteMap ?>
8 <?plugin LocalSiteMap page=ForThatPage depth=2 ?>
10 You shouldn't use depths greater than 3, else database walking would
11 take a while, and the result would be uglily long.
14 $ewiki_plugins["mpi"]["localsitemap"] = "mpi2_localsitemap";
17 function mpi2_localsitemap($action, $args, &$iii, &$s) {
19 ($depth = $args["depth"]) or ($depth = 2);
23 ($id = $args["page"]) or ($id = $GLOBALS["ewiki_id"]);
25 $src = mpi2_localsitemap_revbl($id, "", $depth);
28 #-- throw output into _format() kernel buffer
39 function mpi2_localsitemap_revbl($id, $li, $depth) {
43 if ($refs = ewiki_get_links($id)) {
44 foreach ($refs as $id) {
45 $src .= "$li [$id]\n";
46 $src .= mpi2_localsitemap_revbl($id, $li, $depth);