MyBB Community Forums

Full Version: About giving reputation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
I want to do this:

When a user (user1) gives reputation to a user (user2), he/she (user1) can't give reputation again that user (user2) until he/she (user1) give reputation 15 different users.

How can I do that?
in reputation.php

find
// The user we're trying to give a reputation to doesn't have permission to receive reps.
above it add
//Let's check the if there are enough reputation to give permisions
	$query = $db->query("SELECT * FROM ".TABLE_PREFIX."reputation WHERE adduid='".$mybb->user['uid']."' ORDER by dateline DESC");
	$i = 0;
	while($info = $db->fetch_array($query))
	{
		$i++;
		if($info['uid'] == $mybb->input['uid'])
		{
			if($i < 15)
			{
				$message = "You need ".(15-$i)." reputation";
				eval("\$error = \"".$templates->get("reputation_add_error")."\";");
				output_page($error);
				exit;
			}
		}
	}
Great work!
Thank you very much.
will this also work with the "multiple reps" MOD?
I have coded upon default mybb codes. I have ne idea how multiple reputation mod works.