News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Minimum posts/karma to smite user

Started by t3h ub3r k1tten, July 30, 2007, 02:35:35 AM

Previous topic - Next topic

t3h ub3r k1tten

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:


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.
Motoko-chan
Director, Simple Machines

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


t3h ub3r k1tten

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?
Motoko-chan
Director, Simple Machines

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


t3h ub3r k1tten


Joshua Dickerson

Can someone confirm that this works? I want to add it to the tips/tricks board.
Come work with me at Promenade Group



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


Joshua Dickerson

Good enough for me. Now, do you want to package it up? ;)
Come work with me at Promenade Group



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?

pirat3

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!

t3h ub3r k1tten

I don't want to package it, because I've never made a real mod, but anyone else is welcome to. :)

pirat3

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

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.

S3NTYN3L

So, has anyone tested this out with 1.1.4?

Did you correct the code ub3r k1tten?

Fiery

Was anyone able to get this to work for 1.1.4?



Advertisement: