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.

the users shouldnt be able to like their own profile

12 years 4 months ago
  • alfredo's Avatar
    Topic Author
  • alfredo
  • Offline
  • Junior Boarder
  • Posts: 278
  • Thank you received: 4
Licenses:
JomSocial Expired Socialize Expired

hi, there is a way to avoid that?
i dont want the users can click on like button in their own profile.

12 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Alfredo,

Well, that is default behavior you, you cant change it except you hack the core code.

Thank you

12 years 4 months ago
  • alfredo's Avatar
    Topic Author
  • alfredo
  • Offline
  • Junior Boarder
  • Posts: 278
  • Thank you received: 4
Licenses:
JomSocial Expired Socialize Expired

Dimas Tekad Santosa wrote: Hi Alfredo,

Well, that is default behavior you, you cant change it except you hack the core code.

Thank you


can you at least tell me which files should i study for do that?

12 years 4 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

Hi Alfredo,

Ok I give you the solution, I think this is quite simple, but I am not sure will work or not, since this is not tested yet.

1.open this file components/com_community/templates/modules/profile/userinfo.php, find this code :

<?php if($isLikeEnabled){?>
								<li id='like-profile-<?php echo $profile->id; ?>'><a href="javascript:void(0);" onclick="<?php echo ($isUserLiked > 0) ? 'joms.like.newDislike(this)' : 'joms.like.newLike(this)' ?>;" class="<?php if($isUserLiked > 0){ ?> js-focus-like <?php }?>"><i class="joms-icon-thumbs-up"></i><span><?php echo $likes ?></span> <?php echo JText::_('COM_COMMUNITY_LIKE')?></a></li>
							<?php }?>

replace to :
<?php if( !$isMine ){?>
<?php if($isLikeEnabled){?>
								<li id='like-profile-<?php echo $profile->id; ?>'><a href="javascript:void(0);" onclick="<?php echo ($isUserLiked > 0) ? 'joms.like.newDislike(this)' : 'joms.like.newLike(this)' ?>;" class="<?php if($isUserLiked > 0){ ?> js-focus-like <?php }?>"><i class="joms-icon-thumbs-up"></i><span><?php echo $likes ?></span> <?php echo JText::_('COM_COMMUNITY_LIKE')?></a></li>
							<?php } ?>
<?php } ?>

12 years 4 months ago
  • alfredo's Avatar
    Topic Author
  • alfredo
  • Offline
  • Junior Boarder
  • Posts: 278
  • Thank you received: 4
Licenses:
JomSocial Expired Socialize Expired

maybe someone could be find useful this hack:
this is the correct code

<?php if( !$isMine ){?>

							<?php if($isLikeEnabled){?>
								<li id='like-profile-<?php echo $profile->id; ?>'><a href="javascript:void(0);" onclick="<?php echo ($isUserLiked > 0) ? 'joms.like.newDislike(this)' : 'joms.like.newLike(this)' ?>;" class="fanbutton <?php if($isUserLiked > 0){ ?> js-focus-like <?php }?>"><i class="joms-icon-thumbs-up"></i><span><?php echo $likes ?></span> <?php echo JText::_('COM_COMMUNITY_LIKE_PROFILE')?></a></li>
							<?php }?>
                            <?php } else {?>
							<li id='like-profile-<?php echo $profile->id; ?>'>
							<span class="fanbutton <?php if($isUserLiked > 0){ ?> js-focus-like <?php }?>"><i class="joms-icon-thumbs-up"></i><span><?php echo $likes ?></span> <?php echo JText::_('COM_COMMUNITY_LIKE_PROFILE')?></span></li>
							<?php }?>

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