• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Disable unlike

#1
Hi, I need to disable the option to "unlike" posts.
So after a user click in "Like", the user cant click again the button to "Unlike" that post.

I need the Like button enabled, but Unlike disabled.

Is there any way to do this please?

Any help will be appreciated.

Regards!
 

Amaury

Well-known member
#2
Try playing around with the following codes.

Template: post

Code:
                <xen:if is="{$post.canLike}">
                    <a href="{xen:link posts/like, $post}" class="LikeLink item control {xen:if $post.like_date, unlike, like}" data-container="#likes-post-{$post.post_id}"><span></span><span class="LikeLabel">{xen:if $post.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
                </xen:if>
Template: profile_post

Code:
                    <xen:if is="{$profilePost.canLike}">
                        <a href="{xen:link 'profile-posts/like', $profilePost}" class="LikeLink item control {xen:if $profilePost.like_date, unlike, like}" data-container="#likes-wp-{$profilePost.profile_post_id}"><span></span><span class="LikeLabel">{xen:if $profilePost.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
                    </xen:if>
Template: profile_post_comment

Code:
                    <xen:if is="{$comment.canLike}">
                        <a href="{xen:link 'profile-posts/comments/like', $comment}" class="LikeLink item control {xen:if $comment.like_date, unlike, like}" data-container="#likes-pc-{$comment.profile_post_comment_id}"><span></span><span class="LikeLabel">{xen:if $comment.like_date, {xen:phrase unlike}, {xen:phrase like}}</span></a>
                    </xen:if>