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:
// 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:
// 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 - [email protected]
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:
(http://ub3rk1tten.com/site/plogger/images/forum_images/random_stuff/errorminkarma.bmp)
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. ;)
[email protected]
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.
Thats modify, which covers applauding too, this is smite. ;)
This helps so new users can applaud for tutorials/etc. but can't abuse smite.
Ah, interesting idea.
If I get the time, would you mind if I use your code to make a configurable mod for this?
Feel free. :)
Can someone confirm that this works? I want to add it to the tips/tricks board.
Well if my test smf counts, I put it on there: http://ub3rk1tten.com/smftest/
Good enough for me. Now, do you want to package it up? ;)
Quote from: groundup on July 31, 2007, 01:58:37 AM
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!
I don't want to package it, because I've never made a real mod, but anyone else is welcome to. :)
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.
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.
So, has anyone tested this out with 1.1.4?
Did you correct the code ub3r k1tten?
Was anyone able to get this to work for 1.1.4?
Nice mod, thank you.