Not yet exported, as only 4 quite core plugins use it.
return "<a href=\"$bestlink\"@attrs>$linktext</a>";
}
return "<a href=\"$bestlink\"@attrs>$linktext</a>";
}
+sub userpage ($) {
+ my $user=shift;
+ return length $config{userdir} ? "$config{userdir}/$user" : $user;
+}
+
sub openiduser ($) {
my $user=shift;
sub openiduser ($) {
my $user=shift;
else {
$commentauthorurl = IkiWiki::cgiurl(
do => 'goto',
else {
$commentauthorurl = IkiWiki::cgiurl(
do => 'goto',
- page => (length $config{userdir}
- ? "$config{userdir}/$commentuser"
- : "$commentuser"));
+ page => IkiWiki::userpage($commentuser)
+ );
$commentauthor = $commentuser;
}
$commentauthor = $commentuser;
}
push @page_locs, $dir.$page;
}
push @page_locs, $dir.$page;
}
- push @page_locs, "$config{userdir}/$page"
- if length $config{userdir};
+ my $userpage=IkiWiki::userpage($page);
+ push @page_locs, $userpage
+ if ! grep { $_ eq $userpage } @page_locs;
shift eq $form->field("password");
});
shift eq $form->field("password");
});
- my $userpage=$config{userdir} ? $config{userdir}."/".$user : $user;
+ my $userpage=IkiWiki::userpage($user);
if (exists $pagesources{$userpage}) {
$form->text(gettext("Your user page: ").
htmllink("", "", $userpage,
if (exists $pagesources{$userpage}) {
$form->text(gettext("Your user page: ").
htmllink("", "", $userpage,
elsif (length $config{cgiurl}) {
$change->{authorurl} = IkiWiki::cgiurl(
do => "goto",
elsif (length $config{cgiurl}) {
$change->{authorurl} = IkiWiki::cgiurl(
do => "goto",
- page => (length $config{userdir} ? "$config{userdir}/" : "").$change->{author},
+ page => IkiWiki::userpage($change->{author}),