1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Punish System

Discussion in 'Add-on Releases [Archive]' started by Sumo, Jan 20, 2012.

  1. Sumo

    Sumo Active Member

    This mod was designed to let those with permission remove all likes on posts. This is useful for posts undeserving of likes such as flaming, spam, etc.

    Features:
    • Removes likes on posts.
    • Subtracts removed likes from users like count.
    • Likes easily restorable.
    • Stops post from receiving likes.
    Installation:
    1. Upload everything in /upload to Xf's root directory.
    2. Import the XML add-on.
    3. Do Template Edits (See Below)
    4. Assign permissions to groups.
    5. Start punishing.
    Note to big boards with large post counts. This add-on adds a column to the xf_post table. If you have a large amount of posts run this query over ssh or ask your host to before installing.​

    Code:
    ALTER TABLE  `xf_post` ADD  `is_punished` TINYINT( 1 ) NOT NULL DEFAULT  '0'

    Template Edits:

    In the "post" template Find:​
    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>
     
    

    Replace With​
    Code:
     
     
    <xen:if is="{$post.canLike}">
    <xen:if is="!{$post.is_punished}">
    <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:else />
    <span class="item control">{xen:phrase punish_punished}</span>
    </xen:if>
    <xen:if is="{$visitor.permissions.sumo_punish.sumo_punish_can_punish}">
    <a href="{xen:link punish/post, $post}" class="item control" data-container="#punish-post-{$post.post_id}"><span class="PunishLabel"><xen:if is="!{$post.is_punished}">{xen:phrase punish_punish}<xen:else />{xen:phrase punish_unpunish}</xen:if></span></a>
    </xen:if>
    </xen:if>
     
    

    Screenshots:
    Unpunished Post:​
    xf_unpunished.png
    Punished Post:​
    xf_punished.png
    Permissions:​
    punish_permissions .png

    Usage Rights:

    You may:​
    • Modify the add-on to suite your needs as long as you do not distribute it.
    You may NOT:​
    • Redistribute this add-on to anyone or any site including XenForo and fan sites without my permission
    • Sell this add-on.
    • Convert the add-on to any other software without my permission.
    Revision History:
    • Jan 19/2012 - Initial Release
    • Jan 23/2012 - Fixed a bug that would return an error message when trying to punish a post with no likes.
    Donating:
    Any donations are greatly appreciated and help further development of add-ons.​
    [​IMG]
     

    Attached Files:

    PhySICOLL, Ned, alexD and 5 others like this.
  2. Sumo

    Sumo Active Member

    Reserved
     
  3. M@rc

    M@rc Well-Known Member

    Eh, this got bumped straight to the bottom, o_O Thanks for sharing your addon, Sumo.
    +1 like, (y)
     
    Sumo likes this.
  4. Sumo

    Sumo Active Member

    No problem. Hopefully there will be more in the future :)
     
  5. AzzidReign

    AzzidReign Well-Known Member

    Thanks for the bug fix! Was actually coming here to report it then saw you had it fixed ;) Good stuff!
     

Share This Page