Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Show profile picture only to selected friends

11 years 4 weeks ago
  • Didier's Avatar
    Topic Author
  • Didier
  • Offline
  • Fresh Boarder
  • Posts: 22
  • Thank you received: 0
Licenses:
JomSocial Active

Is there a way or a plug-in which allows a member to select the friends he would like to show his profile picture to ?

Or if not, could a member choose to show his profile picture only to his friends ?

thanks,
Didier

11 years 4 weeks ago
Licenses:

Hi, Didier.

That's interesting :) Well, to make avatar visible only for selected user will involve a lot of coding... and you'll need to hire a developer.
But if yous hide avatar and show it to all friends only? It can be done with simple hack :D

Go to this file: ROOT/components/com_community/templates/default/modules/profile/userinfo.php
(WARNING! Core file hacking! Please make a safe copy of that file before any changes. It mean also that this file will be overwritten during next JomSocial upgrade. So please make copy of customized file as well)

Edit file in line 69, change this:

				<div class="thumbnail js-focus-avatar">
					<img src="<?php echo $profile->largeAvatar; ?>" alt="<?php echo $this->escape( $user->getDisplayName() ); ?>" />
					<?php if( $isMine || COwnerHelper::isCommunityAdmin() ): ?>
						<b class="js-focus-avatar-option">
							<a href="javascript:void(0)" onclick="joms.photos.uploadAvatar('profile','<?php echo $profile->id?>')"><?php echo JText::_('COM_COMMUNITY_CHANGE_AVATAR')?></a>
						</b>
					<?php endif; ?>
				</div>

with this:
			<?php if($isFriend OR $isMine) { ?>
				<div class="thumbnail js-focus-avatar">
					<img src="<?php echo $profile->largeAvatar; ?>" alt="<?php echo $this->escape( $user->getDisplayName() ); ?>" />
					<?php if( $isMine || COwnerHelper::isCommunityAdmin() ): ?>
						<b class="js-focus-avatar-option">
							<a href="javascript:void(0)" onclick="joms.photos.uploadAvatar('profile','<?php echo $profile->id?>')"><?php echo JText::_('COM_COMMUNITY_CHANGE_AVATAR')?></a>
						</b>
					<?php endif; ?>
				</div>
				<?php } ?>

Now avatar will be show only to profile owner and his/her friends :D

Even more could be done with this condition e.g for all other users only default avatar could be shown or some information... or anything else :)


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: Didier
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW