I came up with a simple modification that I thought was worth sharing.
On a site I was making for Christian home-schoolers (at
http://chs.ixo.ca/ if anyone is interested) I wanted to show the author's full name at the bottom of each page but only show a link to e-mail them if the person was logged-in.
I modified the editorinfo() function in inc/common.php just slightly, to be as follows:
function editorinfo($username){
global $conf;
global $auth;
switch($conf['showuseras']){
case 'username':
case 'email':
case 'email_link':
if($auth) $info = $auth->getUserData($username);
break;
default:
return hsc($username);
}
if(isset($info) && $info) {
switch($conf['showuseras']){
case 'username':
$user_mail = obfuscate($info['mail']);
$user_name = hsc($info['name']);
$ret_val = (empty($_SERVER['REMOTE_USER'])) ? $user_name : "<A href=\"mailto:{$user_mail}\">{$user_name}</a>";
return $ret_val;
case 'email':
return obfuscate($info['mail']);
case 'email_link':
$mail=obfuscate($info['mail']);
return '<a href="mailto:'.$mail.'">'.$mail.'</a>';
default:
$user_mail = obfuscate($info['mail']);
$user_name = hsc($username);
$ret_val = (empty($_SERVER['REMOTE_USER'])) ? $user_name : "<A href=\"mailto:{$user_mail}\">{$user_name}</a>";
return $ret_val;
}
} else {
return hsc($username);
}
}
So when I log-out I only see the author name at the bottom of a page, but when I log-in the name becomes a "mailto:" link.