1. 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

Discussion in 'XenForo Questions and Support' started by _NANO_, Sep 1, 2015.

  1. _NANO_

    _NANO_ Member

    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.

  2. Amaury

    Amaury Well-Known Member

    Try playing around with the following codes.

    Template: post

                    <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>
    Template: profile_post

                        <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>
    Template: profile_post_comment

                        <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>

Share This Page