Advertisement:

Author Topic: Minimum posts/karma to smite user  (Read 11034 times)

t3h ub3r k1tten

  • Guest
Minimum posts/karma to smite user
« on: July 30, 2007, 02:35:35 AM »
This is a simple check to see if you are below 50 posts or 5 karma to be able to smite someone.
Made this mostly for a friends forum but I also use it on mine.
Reason for it is because noobs kept coming to the forum, asking questions that have been answered in at least 15 tutorials in the tutorials board, (sometimes in the wrong forums or ironically in the tutorial board itself), and then one users come and get mad at them they get mad and smite anyone who doesn't help them.
This caused a lot of trouble with users getting in karma fights and warring by smiting each other. -.- (left some users with -20 karma :P)
So, made this to stop the turmoil because new members can't smite, after my friend neglected to write it himself even though he supported the idea. :P

Enough of my rambling:
Edit file: Source/Karma.php
Find this:   
Code: [Select]
// Delete any older items from the log. (karmaWaitTime is by hour.)
db_query("
DELETE FROM {$db_prefix}log_karma
WHERE " . time() . " - logTime > " . (int) ($modSettings['karmaWaitTime'] * 3600), __FILE__, __LINE__);
And add this after it:
Code: [Select]
// Karma smite block, can't smite if under 50 posts or 5 karma, unless administrator
//  This might have been better to put in Load.php in the context['user']['karma']['allow'], but this is stabler between versions ;)
// By: T3h Ub3r K1tten - superstuntguy@gmail.com
if(!allowedTo('moderate_forum') && // Admin check
($user_info['posts'] < 50 || // Post check, change 50 to minimum posts
($context['user']['karma']['good'] - $context['user']['karma']['bad']) < 5 )) { // Karma check, change 5 to minimum karma
fatal_error('You need a minimum of 50 posts or 5 karma to smite someone.', false); // Change this according to above, and maybe translate for mulitlang forums
}
And when they don't have sufficient posts/karma they'll see this:


So, post if you use, and anyone wanting to make this into a mod is free to do so, as long as you email me first. ;) superstuntguy@gmail.com

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,020
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: Minimum posts/karma to smite user
« Reply #1 on: July 30, 2007, 11:17:15 AM »
Although you can't restrict by how much karma a user has in SMF currently, you can accomplish the 50 post minimum. In the Karma area of Features and Options, there is a "minimum posts needed to modify karma" setting that you can fill in.
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


t3h ub3r k1tten

  • Guest
Re: Minimum posts/karma to smite user
« Reply #2 on: July 30, 2007, 05:12:10 PM »
Thats modify, which covers applauding too, this is smite. ;)
This helps so new users can applaud for tutorials/etc. but can't abuse smite.

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,020
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Re: Minimum posts/karma to smite user
« Reply #3 on: July 30, 2007, 05:51:54 PM »
Ah, interesting idea.

If I get the time, would you mind if I use your code to make a configurable mod for this?
Motoko-chan
Director, Simple Machines

Just because it's pouring down doesn't mean we're gonna drown. There's a time when all you can say is let it rain - Mat Kearney (Let It Rain)

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


t3h ub3r k1tten

  • Guest
Re: Minimum posts/karma to smite user
« Reply #4 on: July 30, 2007, 07:22:46 PM »
Feel free. :)

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,775
  • Gender: Male
    • joshuaadickerson on GitHub
    • joshuaadickerson on LinkedIn
Re: Minimum posts/karma to smite user
« Reply #5 on: July 30, 2007, 11:57:51 PM »
Can someone confirm that this works? I want to add it to the tips/tricks board.
Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

t3h ub3r k1tten

  • Guest
Re: Minimum posts/karma to smite user
« Reply #6 on: July 31, 2007, 01:54:42 AM »
Well if my test smf counts, I put it on there: http://ub3rk1tten.com/smftest/

Offline Joshua Dickerson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,775
  • Gender: Male
    • joshuaadickerson on GitHub
    • joshuaadickerson on LinkedIn
Re: Minimum posts/karma to smite user
« Reply #7 on: July 31, 2007, 01:58:37 AM »
Good enough for me. Now, do you want to package it up? ;)
Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

Offline pirat3

  • Semi-Newbie
  • *
  • Posts: 77
Re: Minimum posts/karma to smite user
« Reply #8 on: July 31, 2007, 04:37:45 PM »
Good enough for me. Now, do you want to package it up? ;)

Can you pm me o rreply back in this thread when you package it up, I am DYING to get this mod!!! +love to you bro!

t3h ub3r k1tten

  • Guest
Re: Minimum posts/karma to smite user
« Reply #9 on: July 31, 2007, 08:55:06 PM »
I don't want to package it, because I've never made a real mod, but anyone else is welcome to. :)

Offline pirat3

  • Semi-Newbie
  • *
  • Posts: 77
Re: Minimum posts/karma to smite user
« Reply #10 on: August 11, 2007, 06:51:21 PM »
This does not work on 1.1.2 (not sure of 113), but MEMBERS cannot smite or applaud, they get the message regardless and regardless of post# and karma ammount.

t3h ub3r k1tten

  • Guest
Re: Minimum posts/karma to smite user
« Reply #11 on: August 14, 2007, 03:46:49 PM »
Oops looks like I forgot to make it smite only, not sure how I missed that :P but you might have put it in the wrong place.

Offline S3NTYN3L

  • Jr. Member
  • **
  • Posts: 192
  • Gender: Male
  • Oderint Dum Metuant
Re: Minimum posts/karma to smite user
« Reply #12 on: December 19, 2007, 06:08:37 AM »
So, has anyone tested this out with 1.1.4?

Did you correct the code ub3r k1tten?

Offline Fiery

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,209
  • Gender: Male
  • Community Builder
Re: Minimum posts/karma to smite user
« Reply #13 on: January 09, 2008, 01:02:14 AM »
Was anyone able to get this to work for 1.1.4?


Offline Jalkson

  • Jr. Member
  • **
  • Posts: 173
  • Gender: Male
Re: Minimum posts/karma to smite user
« Reply #14 on: January 10, 2008, 05:43:21 PM »
Nice mod, thank you.