Support » Plugins and Hacks » [Plugin: Add Local Avatar] Avatar-Link to user-profile page?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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;
    			}
    		}

    Say I’m using the default (ugly) permalink structure (link should be ‘domain.com/?author=1’), how would I go about doing that ?

    Ian

    (@ianaleksander)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Add Local Avatar] Avatar-Link to user-profile page?’ is closed to new replies.