[Pmwiki-users] finding orphaned pages

Christian Ridderström chr
Fri Jan 16 16:34:24 CST 2004


On Fri, 16 Jan 2004, Patrick R. Michaud wrote:

> Take a look at the refcount.php script; it can be activated via
> 
>     include_once("scripts/refcount.php");
> 
> in local.php.  You can see it in action at
> 
>     http://www.pmichaud.com/wiki?action=refcount
> 
> Do a search for "existing" pages and then scroll to the bottom of the
> list--all of the pages that have a reference count of zero are "orphaned"
> pages.

This reminds me... 'refcount.php' could use an update so that it works 
with the automatic links to groups (can't remember what cookbook this is 
right now, but bascially, if you have a group called PmWiki and you write
	PmWiki
this will automatically be interpreted as PmWiki/PmWiki (very nice btw)).

Now, IIRC, 'refcount.php' incorrectly (well, sort of) reports 'PmWiki' as 
an orphaned link, rather than recognizing that it's the name of a group 
etc.

Oh... wait, maybe this is not even a cookbook thing yet... here's the code 
in my local.php

# Fix so that 'LyX' refers to 'LyX/LyX' if the group exists
# To activate this, uncomment the line below
$MyFmtWikiLink_Old = $FmtWikiLink;
$FmtWikiLink = 'MyFmtWikiLink';
function MyFmtWikiLink($pat,$ref,$btext,$out=NULL,$pname=NULL) {
  global $DefaultTitle, $MyFmtWikiLink_Old;
  $pg = FmtWikiLink($pat,$ref,$btext,'PageName',$pname);
  if (!PageExists($pg))
    {
      $t = preg_replace("/^.*\\./",'',$pg);
      if (PageExists("$t.$t"))
        $ref = "$t/\{\{$t}}";   // in case $t isn't a wikiword
      elseif (PageExists("$t.$DefaultTitle")) // try HomePage
        $ref = "$t.$DefaultTitle";
    }
  return $MyFmtWikiLink_Old($pat,$ref,$btext,$out,$pname);
}
#

Hmm... I'm too tired right now, I'll just send this and reply myself 
tomorrow.

/Christian

> 
> Pm
> 
> 
> On Fri, Jan 16, 2004 at 03:51:43PM -0500, Bob Dively wrote:
> > Does pmwiki have an built-in facility for finding orphaned
> > pages (i.e., pages which are not linked to by any other
> > pages)? I could hack up a script to do this but don't want
> > to duplicate someone else's effort (in other words, I'm
> > lazy).
> > 
> > 
> > --
> > Pmwiki-users mailing list
> > Pmwiki-users at pmichaud.com
> > http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> 
> --
> Pmwiki-users mailing list
> Pmwiki-users at pmichaud.com
> http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
> 

-- 
Dr. Christian Ridderstr?m, +46-8-768 39 44       http://www.md.kth.se/~chr




More information about the pmwiki-users mailing list