[Pmwiki-users] Feature request?
John Rankin
john.rankin
Sun Nov 2 13:04:59 CST 2003
Try something like the following in your local.php
$FmtWikiLink = 'MyFmtWikiLink';
function MyFmtWikiLink($pat,$ref,$btext,$out=NULL,$pname=NULL) {
$pg = FmtWikiLink($pat,$ref,$btext,'PageName',$pname);
if (PageExists($pg)) {
return FmtWikiLink($pat,$ref,$btext,$out,$pname);
} else {
$t = preg_replace("/^.*\\./",'',$pg);
if (PageExists("$t.$t")) {
return FmtWikiLink($pat,"$t.$t",$btext,'PageName',$pname);
}
}
return FmtWikiLink($pat,$ref,$btext,$out,$pname);
}
Hope this helps
JR
--
John Rankin
On Saturday, 1 November 2003 5:53 AM, J. Perkins <jason at 379.com> wrote:
In addition to all of my public sites, I am using a private installation
of PmWiki as a "mind map" where I keep track of...well, just about
everything. In order to keep things organized, I started to split it up
into different groups for each topic. Each group has a main page with
the same name as the group, so it looks like "PmWiki.PmWiki". The with
this approach is that every time I mention the topic in a different
group, I have to give the fully qualified "PmWiki/PmWiki" to make the
link. I did this for a while and then got annoyed and modified
pmwiki.php to automatically look for $title.$title if plain old $title
didn't work. In the function "FmtWikiLink", I changed the last few lines to:
if (PageExists("$group.$title")) $fmt=$WikiPageExistsFmt;
elseif (PageExists("$title.$title")) { $group=$title;
$fmt=$WikiPageExistsFmt; }
elseif (preg_match('/\\s/',$txt)) $fmt=$WikiPageCreateSpaceFmt;
else $fmt=$WikiPageCreateFmt;
I added the first "elseif" clause there. Now this works great, but it
requires me to edit pmwiki.php every release to make it work. Is there
any way to achieve this same result via an addon?
Thanks!
Jason
_______________________________________________
Pmwiki-users mailing list
Pmwiki-users at pmichaud.com
http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com
More information about the pmwiki-users
mailing list