$s = getCredits($article, -1);
}
- wfDebug("Credits: '$s'\n");
-
$wgOut->addHTML( $s );
wfProfileOut( $fname );
if ($last_author == 0) {
$author_credit = wfMsg('anonymous');
} else {
+
$real_name = User::whoIsReal($last_author);
+ $user_name = User::whoIs($last_author);
+
if (!empty($real_name)) {
- $author_credit = $real_name;
+ $author_credit = creditLink($user_name, $real_name);
} else {
- $author_credit = wfMsg('siteuser', User::whoIs($last_author));
+ $author_credit = wfMsg('siteuser', creditLink($user_name));
}
}
-
+
$timestamp = $article->getTimestamp();
if ($timestamp) {
$d = $wgLang->timeanddate($article->getTimestamp(), true);
foreach ($contributors as $user_id => $user_parts) {
if ($user_id != 0) {
if ($wgAllowRealName && !empty($user_parts[1])) {
- $real_names[$user_id] = $user_parts[1];
+ $real_names[$user_id] = creditLink($user_parts[0], $user_parts[1]);
} else {
- $user_names[$user_id] = $user_parts[0];
+ $user_names[$user_id] = creditLink($user_parts[0]);
}
}
}
return wfMsg('othercontribs', $creds);
}
+function creditLink($user_name, $link_text = '') {
+ global $wgUser, $wgLang;
+ $skin = $wgUser->getSkin();
+ return $skin->makeKnownLink($wgLang->getNsText(NS_USER) . ":" . $user_name,
+ (empty($link_text)) ? $user_name : $link_text);
+}
+
?>
# can be imported, these should be 'trusted'.
$wgImportSources = array();
-# Set this to the number of authors that you want to be credited
-# below an article text. Set it to zero to hide the attribution block.
-# Note that this will require checking the table of old revisions,
-# which can have a significant impact on performance for large wikis.
+# Set this to the number of authors that you want to be credited below an
+# article text. Set it to zero to hide the attribution block, and a
+# negative number (like -1) to show all authors. Note that this will
+# require checking the table of old revisions, which can have a significant
+# impact on performance for large wikis.
$wgMaxCredits = 0;
# Text matching this regular expression will be recognised as spam