From: Steve W. <sw...@wc...> - 2001-01-11 15:46:34
|
On Thu, 11 Jan 2001, Malcolm Ryan wrote: > I have just recently started using PhpWiki to run a NomicWiki at > http://ccls1.cse.unsw.edu.au/~malcolmr/nomicwiki/index.php. It is working > quite well. > > Just for kicks, I added a "Site Map" function to the Wiki, which takes a > given starting page and does a breadth-first-search of the entire Wiki > using that page as the root. The result is remarkably readable (for my > Wiki, at least). Have a look at: > > http://ccls1.cse.unsw.edu.au/~malcolmr/nomicwiki/index.php?map=NomicWiki This is really cool. I would like to include it in PhpWiki! > Generating the site map is easy, but there are still a few problems: > > 1) I want to render it more like a standard Wiki page. In particular, I > want to make all the links active. Is there an appropriate function > to output the HTML code for a link? There are functions in stdlib.php for linking words: LinkExistingWikiWord($wikiword) LinkUnknownWikiWord($wikiword) LinkURL($url, $linktext) LinkImage($url, $alt) Will these do? > > 2) I am using ExtractWikiPageLinks to get a list of outgoing links from > a page, but this also returns things I don't want: outside links, > disabled links, and text of the form '[[...]'. What is the best way > to filter these out? Hmm. It would be bad to make you write filtering code, because that creates a dependency... when something about the linking scheme changes, you (or someone) would have to change the site map code as well. But at the moment I don't see an answer other than refactoring the code somehow. Perhaps in C style, we could introduce flags to ExtractWikiPageLinks to return all links, only external, only BumbyText, only brackets, etc. The function is only called once in any given DB library, so the change wouldn't be unmanagable. ~swain ...............................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |