+ my @attrs;
+ if (defined $opts{rel}) {
+ push @attrs, ' rel="'.$opts{rel}.'"';
+ }
+ if (defined $opts{class}) {
+ push @attrs, ' class="'.$opts{class}.'"';
+ }
+
+ return "<a href=\"$bestlink\"@attrs>$linktext</a>";
+} #}}}
+
+sub userlink ($) { #{{{
+ my $user=shift;
+
+ my $oiduser=eval { openiduser($user) };
+ if (defined $oiduser) {
+ return "<a href=\"$user\">$oiduser</a>";
+ }
+ else {
+ eval q{use CGI 'escapeHTML'};
+ error($@) if $@;
+
+ return htmllink("", "", escapeHTML(
+ length $config{userdir} ? $config{userdir}."/".$user : $user
+ ), noimageinline => 1);
+ }