• Hello,

    I installed this plugin so that my users can have both an avatar and an official photo of themselves for use on the staff directory page.

    I am using the People List plugin for the staff directory page and it currently pulls the user’s avatar as the thumbnail pic. I want to change that so it is using the User Photo.

    I believe the relevant code is contained in this:

    $input_template[0] = "%nickname%";
    	$input_template[1] = "%email%";
    	$input_template[2] = "%bio%";
    	$input_template[3] = "%firstname%";
    	$input_template[4] = "%lastname%";
    	$input_template[5] = "%username%";
    	$input_template[6] = "%thumbnail%";
    	$input_template[7] = "%website%";
    	$input_template[8] = "%aim%";
    	$input_template[9] = "%yahooim%";
    	$input_template[10] = "%jabbergoogle%";	
    
    	$counter = 11;
    	if( is_array($people_list_option['settings']) ):
    		foreach($people_list_option['settings'] as $index => $field_slug):
    			$input_template[$counter] = "%".$index."%";
    			$counter++;
    		endforeach;
    	endif;
    
    	if( is_array($found_people_list['list']['uid']) ):
    		foreach($found_people_list['list']['uid'] as $id):
    			$replacements = array();
    			$user_data = get_userdata($id);
    
    			$replacements[0] = $user_data->nickname;
    			$replacements[1] = $user_data->user_email;
    			$replacements[2] = $user_data->description;
    			$replacements[3] = $user_data->first_name;
    			$replacements[4] = $user_data->last_name;
    			$replacements[5] = $user_data->user_login;
    			$replacements[6] = get_avatar($id);
    			$replacements[7] = $user_data->user_url;
    			$replacements[8] = $user_data->aim;
    			$replacements[9] = $user_data->yim;
    			$replacements[10] = $user_data->jabber;

    Specifically the line: $replacements[6] = get_avatar($id);

    Any ideas how to change this?

    Thanks!!

    http://wordpress.org/extend/plugins/user-photo/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Did you ever figure this out? Or does anyone have a solution. I’m currently using no shop for my employee lists…pain in the butt manually uploading every pic. I would love to use this with my current user photo plugin.

    Thread Starter rileydog

    (@rileydog)

    No luck so far. I had to remove the User Photo plugin and force all users to only have their one Avatar.

    Which plugin are you using…’no shop’? I haven’t seen that before.

    it is pretty simple but light and stable, just lists items on a page with details and a picture. The store without the checkout… “noshop”. I use it for each employee.

    Had the same problem and did a little hack… I know it’s not a nice one but it does it’s job:

    What to do:

    add the following to your user-photo.php (dont know if necessary but I did it before the userphoto_filter_get_avatar() function:

    /*
     * basically it just gets the sourcepath of a desired photo. So I can reuse as much as possible.
     */        
    
    function userphoto_get_source_path($user_id,$photoSize) {
    	$src = '';
    	if($user_id && ($userdata = get_userdata($user_id))){
    		$image_file = ($photoSize == USERPHOTO_FULL_SIZE ? $userdata->userphoto_image_file : $userdata->userphoto_thumb_file);
    		$upload_dir = wp_upload_dir();
    			if(!empty($upload_dir['error']))
    				return "Error: " . $upload_dir['error'];
    		$src .= trailingslashit($upload_dir['baseurl']) . 'userphoto/' . $image_file;
    	}
    	return $src;
    }

    change in the userphoto_filter_get_avatar() function the following BEFORE: $img = userphoto__get_userphoto($userid,…):

    $before = '<a href="' . userphoto_get_source_path($userid,USERPHOTO_FULL_SIZE ) . '" >';
    	$after  = '</a>';

    So now. that basically is it.. your people list plugin calls the ordinary get_avatr() function and user_photo filter for it.

    ATTENTION: this changes ALL your userphoto thumbs called via get_avatar. For me this wasnt a problem so I didn’t care…

    cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: User Photo] How to use this user photo in People Lists plugin?’ is closed to new replies.