Jump to content

Unify Avatars and User Photos


MageLeif

Recommended Posts


If you're that set on changing it, you don't need to go through all references in the code. Just edit admin/sources/base/core.php buildProfilePhoto() to return the avatar instead of the photo.





Based on this suggestion I made the following changes to the core.php file for my 3.1.2 install. The idea being that if the user has an Avatar image set, but not a Photo then it will use the avatar image. If neither is set it should use the default image. I haven't fully tested it yet, but it seems to be working on the profile pages, but not in the 'Member' list.

at line 8053 in /sources/base/core.php. Change:


$member['pp_main_photo']  = ipsRegistry::$settings['img_url'] . '/profile/default_large.png';

to


if($member['avatar']) {

    $dom = new DOMDocument();

    $dom->loadHTML($member['avatar']);

    $avatar_path = $dom->getElementsByTagName('img')->item(0)->getAttribute('src');

    $member['pp_main_photo']  = $avatar_path;

}

else

{

    $member['pp_main_photo']  = ipsRegistry::$settings['img_url'] . '/profile/default_large.png';

}

Link to comment
Share on other sites

  • Replies 68
  • Created
  • Last Reply

I just figured out that my hack above will only effect the main member image and not the thumbnails. So you also need to add the following at line 8070 of the core.php file

Change:


if( $member['_has_photo'] )

{

    $member['pp_thumb_photo']  = $member['pp_main_photo'];

}

else

{

    $member['pp_thumb_photo']  = ipsRegistry::$settings['img_url'] . '/profile/default_thumb.png';

}

to:


if( $member['_has_photo'] )

{

    $member['pp_thumb_photo']  = $member['pp_main_photo'];

}

else if ($member['avatar_type'] == 'upload')

{

    $member['pp_thumb_photo'] = ipsRegistry::$settings['upload_url'] . '/' . $member['avatar_location'];

}

else

{

    $member['pp_thumb_photo']  = ipsRegistry::$settings['img_url'] . '/profile/default_thumb.png';

}



I should have also noted that I haven't fully tested this, so please backup the core.php file before you hack it and if anyone has improvement or alternatives to this hack let me know.

Link to comment
Share on other sites

Please add an option to let the avatar override the photo, or vice versa. It is extremely confusing for everyone to have two identities. Don't add another confusing option for the end user to check; most will never bother to figure it out.

I get PMs all the time (which show both the avatar and the user photo) and it's only then that I realize those two images are of the same person.

The whole purpose of the avatar is so you can glance at it and know who it is, without having to read their name. You associate that photo or image with the person, and when they have multiple representations of themself it is very confusing.

I also want to encourage the use of photos everywhere and discourage stupid little cartoon avatars. It's much more professional.

Link to comment
Share on other sites

First of all: Thanks for phylaxis for bringing this tweak to my attention! I have made the following changes to make all photo thumbs to properly sized avatar thumbs:

Got to /admin/sources/base/core.php!

Finde at around line 8070:


			if ( ! $member['pp_thumb_photo'] OR $member['pp_thumb_photo'] == 'profile/' )

			{

				if( $member['_has_photo'] )

				{

					$member['pp_thumb_photo']  = $member['pp_main_photo'];

				}

				else

				{

					$member['pp_thumb_photo']  = ipsRegistry::$settings['img_url'] . 


'/profile/default_thumb.png';

				}


				$member['pp_thumb_width']  = 50;

				$member['pp_thumb_height'] = 50;

			}

			else

			{

				if( $member['_has_photo'] )

				{

					$member['pp_thumb_photo'] = ipsRegistry::$settings['upload_url'] . '/' . 


$member['pp_thumb_photo'];

				}

				else

				{

					$member['pp_thumb_photo']  = ipsRegistry::$settings['img_url'] . 


'/profile/default_thumb.png';

				}

			}



			//-----------------------------------------

			// Try not to distort the image

			//-----------------------------------------


			if ( !ipsRegistry::member()->getProperty('g_mem_info') )

			{

				$member['pp_thumb_width']  = 50;

				$member['pp_thumb_height'] = 50;

			}

displace with:

			if ( $member['avatar_location'] )

			{

				if ( $member['avatar_type'] == 'upload' )

				{

					$member['pp_thumb_photo'] = ipsRegistry::$settings['upload_url'] . '/' . $member['avatar_location'];

				}

				else

				{

					$member['pp_thumb_photo']  = $member['avatar_location'];

				}

			}

			else

			{

				$member['pp_thumb_photo']  = ipsRegistry::$settings['img_url'] . '/profile/default_thumb.png';

			}


			//-----------------------------------------

			// Try not to distort the image

			//-----------------------------------------


			if ( $member['avatar_size'] )

			{

				$avatar_size_thumb = explode ( 'x', $member['avatar_size'] ); 

				$_data = IPSLib::scaleImage( array( 'max_height' => 50, 'max_width' => 50, 'cur_width' => $avatar_size_thumb[0], 'cur_height' => $avatar_size_thumb[1] ) );

				$member['pp_thumb_width']  = $_data['img_width'];

			  $member['pp_thumb_height'] = $_data['img_height'];

			}			

			else

			{

				$member['pp_thumb_width']  = 50;

				$member['pp_thumb_height'] = 50;

			}



Works like a charm! :)

Link to comment
Share on other sites

I like the way the current layout is for avatar and pictures. But if the community wants it then it will change cause that what IPS does listen and do things to make better products. I just want to say that I hope they keep them both in some way. Cause an avatar is nice to have and all but having a picture still is good as well. ^_^ So my is keep both if your going to change it still. :)

Link to comment
Share on other sites

It could still be worse. At this point, it seems evident there's a huge dev preference toward (imposing) photos.
The mobile skin uses photos everywhere, even for posts (!!?).

With nearly everyone using avatars and not photos, this makes the board looking pretty ugly, with everyone seemingly having no picture differentiating them from the next poster. Worse when you convert a board from another forum system.

Link to comment
Share on other sites

No problem, KittyCanuck!

The only problem with that method is the increased server load, because thumbs of the avatars won't be produced during uploading them. So for all representations the bigger file is used. If somebody could make a mod producing avatar thumbs during uploading them and placing them in a specific folder, that would be great! I don't know, how to do that... :(

Link to comment
Share on other sites


It could still be worse. At this point, it seems evident there's a huge dev preference toward (imposing) photos.


The mobile skin uses photos everywhere, even for posts (!!?).



With nearly everyone using avatars and not photos, this makes the board looking pretty ugly, with everyone seemingly having no picture differentiating them from the next poster. Worse when you convert a board from another forum system.





I totally agree. Many of my users simply don't want to use a photograph, so they either upload their avatar twice, or they leave it blank, which simply looks ugly, empty and deserted :(
Link to comment
Share on other sites


I totally agree. Many of my users simply don't want to use a photograph, so they either upload their avatar twice, or they leave it blank, which simply looks ugly, empty and deserted :(




This! The main reason I want to be able to use Avatars all over my board is because over 90% of my members don't bother with a photo. They upload an avatar, and away they go. The lack of photos makes things like the Members List look empty and neglected because of all the default images.

Avatars are how they recognize one another on the forums, and members got confused by the different (or default) images in places like profile comments.

I have yet to hear a good explanation why IPB wants to replace the forum standard of "Avatar = how you represent yourself". It's all well and good to be innovative and shake things up, but using photos all over the place seems to have no benefit at all, especially since it's not an admin setting.
Link to comment
Share on other sites


This! The main reason I want to be able to use Avatars all over my board is because over 90% of my members don't bother with a photo. They upload an avatar, and away they go. The lack of photos makes things like the Members List look empty and neglected because of all the default images.



Avatars are how they recognize one another on the forums, and members got confused by the different (or default) images in places like profile comments.



I have yet to hear a good explanation why IPB wants to replace the forum standard of "Avatar = how you represent yourself". It's all well and good to be innovative and shake things up, but using photos all over the place seems to have no benefit at all, especially since it's not an admin setting.





The main problem I see here is that IPB is not using either Avatars or photos everywhere, but at some places they use this, while at others they use the opposite without a logic I understand.

If they'd use photos everywhere I'd simply translate "photos" to "avatars" and there we go.

I do agree that IPB should not be identical to other software, but I really do think that vBulletin (3.X) was far superior here. There were avatars that were used EVERYWHERE and optionally members could (if the admin allowed it) upload a photo that was attached to their profile-page and only their profile-page.

Especially on larger forums it seems to be unnecessarily complicated for I often idenitified users by their more or less unique avatar, now there is the avatar and on some other pages there is the photo which I don't see any connection. *sighs*
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

Bringing this back to life, can anyone verify if this is going to happen?

Its extremely annoying, I have articles, downloads and blogs with blank images. I ask my users over and over again to please set your profile photos but of course no one does.

I spent so much time trying to change the default profile photos to use an avatar.

Please change or make it easy to select which picture to use, avatar or profile picture.

Link to comment
Share on other sites

  • 3 weeks later...

From the blog: (Entry: *[url="*)


Yes, we are "merging" avatars and photos in 3.2 and choosing to use the "Photo" labelling as we feel that more users relate tot his over 'avatar' which is starting to become an anachronism.



As for the upgrade process, we haven't fully decided what we're going to do. The current thought is to allow the admin to select which to "keep" during the upgrade process.


Link to comment
Share on other sites

If there was a poll though, the minority would be both avatar + photos.

When people first come to IPB, or a forum for that matter and haven't grown up using IPB. There like wtf is a photo, how come my avatar isn't displaying. Its probably in the best interest to merge them together. However, a mod will probably be made to keep everyone happy.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...