Steve Delve
Member
Posted 2 years ago #
Hey there!
Thanks so much for sharing your plugin! I was just wondering if there is a way to set the avatar-link to a "user-profile" page (in my case generated by the forum-server plugin) and not to the default "user url"?
This way i want to create more interaction between the users on my site, and not send them away onto a different url.
I would really appreciate your help with that. I spend already days to figure out how to do it myself, but unfortunately i'm not very familiar with php.
Regards,
Stefan
example profile: http://www.themichaeljacksonfiles.com/forum/?vasthtmlaction=profile&id=34
http://wordpress.org/extend/plugins/add-local-avatar/
Ding! Same problem. Any solutions?
/add-local-avatar/avatars.php
from line 122 to 140,
if(is_numeric($id_or_email)) { // Numeric - user ID...
$id = (int)$id_or_email;
$user = get_userdata($id);
if($user) {
$email = $user->user_email;
$name = ($avatar_options['name'] == 'on' ? $user->nickname : $user->first_name . ' ' . $user->last_name);
$url = '/author/'.$user->user_nicename;
}
}
elseif(is_object($id_or_email)) { // Comment object...
if(!empty($id_or_email->user_id)) { // Object has a user ID, commenter was registered & logged in...
$id = (int)$id_or_email->user_id;
$user = get_userdata($id);
if($user) {
$email = $user->user_email;
$name = ($avatar_options['name'] == 'on' ? $user->nickname : $user->first_name . ' ' . $user->last_name);
$url = '/author/'.$user->user_nicename;
}
}
lecosmonaute
Member
Posted 1 year ago #
Say I'm using the default (ugly) permalink structure (link should be 'domain.com/?author=1'), how would I go about doing that ?
great thread. Needed this. Thank you!
Say I'm using the default (ugly) permalink structure (link should be 'domain.com/?author=1'), how would I go about doing that ?
Something like this:
change in the code above $url = '/author/'.$user->user_nicename;
to $url = '/?author='.$user->user_id;
Sorry, I'm not real php programmer, so I can't optimize this code to work with two different permalink structure.
I hope, that Peter will fix it up.