Plugin Request - Improved Reputation System
#3
(2020-09-23, 06:45 PM)Omar G. Wrote:
(2020-09-23, 11:56 AM)Myusername69 Wrote: I think that's basically it...

Pretty much, taking a quick look I think you will need to hook to reputation_do_add_start and reputation_add_start to modify the value of $mybb->usergroup['reputationpower'] and probably $mybb->input['reputation'] if I understand correctly your inquiry.


$senderuid = $mybb->user['uid'];

$query1337 = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$senderuid}'");
$sender_repvalue = (int)$db->fetch_field($query1337, "reputation_count");

$sender_reppower = ceil($sender_repvalue / 100);


so i put that into ~line 382 in reputation.php



and right below it modified a part of the reputation object from
//"reputation" => $mybb->get_input('reputation', MyBB::INPUT_INT),
//changed to
"reputation" => $sender_reppower,

so when someone with a reputation of 999 "reps" someone else, the other person receives 10 reputation

(2020-09-23, 06:45 PM)Omar G. Wrote:
(2020-09-23, 11:56 AM)Myusername69 Wrote: I think that's basically it...

Pretty much, taking a quick look I think you will need to hook to reputation_do_add_start and reputation_add_start to modify the value of $mybb->usergroup['reputationpower'] and probably $mybb->input['reputation'] if I understand correctly your inquiry.


so I think reputation_do_add_start and reputation_add_start are for plugins... and I think that's over my head for now, I'm not even sure what hook means (but I understand it a little more after looking at what you said)



$mybb->usergroup['reputationpower'] I think I'm going to ignore cause I don't want to break anything... I saw that as one of the options in myBB... actually I think I should change it to 1,000,000,000,000 or something so it doesn't end up blocking the change I did because the reputations are going to get high quickly, soon people could be giving "rep" for like values of 5,000 (in my system meaning they have a reputation of 500,000 in the database and 1% is 5,000)


Also I'm going to change line 201 in reputation.php and add "* 7" so that people can only rep the same person once a week... I think once a day would make it exploitable


Now I need to make reputation "reps" and "negs" private to only the person that received them...

Okay to make Reputation private I added this part inside the start of the existing if(!$mybb->input['action']) part (around line 573 in reputation.php)

// Otherwise, show a listing of reputations for the given user.
if(!$mybb->input['action'])
{
	if($uid != $mybb->user['uid']) 
	{
		// Not viewing own reputations
		error_no_permission();
	}

Now I need to hide the HTML link on posts

... also now Admins can't access user's rep maybe need to hardcode in the 'uid' of an admin to be allowed
Reply


Messages In This Thread
RE: Plugin Request - Improved Reputation System - by noob1337 - 2020-09-29, 11:36 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)