Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [General] reputation.php help
#1
Not Solved
well now i want to add restrictions if user repped any person then he need to add reputation to 5 more members before repping same member again. 
i searched and got this thread reputation restrictions
tried code but i am getting blank reputation.php now plus adding reps also not working.

no replies Sad
Reply
#2
Not Solved
Please post the original code and your edited version so someone can take a look at it!
Reply
#3
Not Solved
(05-03-2011, 03:10 PM)mark-in-dallas Wrote: No plugin, but here's a code modification that will do exactly that:

in reputation.php find this code:
	// This user doesn't have permission to give reputations.
	if($mybb->usergroup['cangivereputations'] != 1)
	{
		$message = $lang->add_no_permission;
		eval("\$error = \"".$templates->get("reputation_add_error")."\";");
		output_page($error);
		exit;
	}

After it add this code:
	//Let's check the if there user has spread 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 < 6)
            {
                $message = "You must spread some love around before repping this member again";
                eval("\$error = \"".$templates->get("reputation_add_error")."\";");
                output_page($error);
                exit;
            }
        }
    } 

The line containing: if($i < 6) indicates that if the user has not repped at least 5 other members since last repping this member, they will get the message saying "YOu must spread some love around before repping this member again"

You can change the message to say anything you want, and you can change the number of reps that must be given to others before repping the same mmember again.

I.E. If you want them be require to rep at least 10 other members before repping the same person again, change the if statement to: if($i <11)

(08-08-2015, 06:53 AM)VAPOR Wrote: Please post the original code and your edited version so someone can take a look at it!
i linked that thread in 1st post. now qouted that post Smile
Reply
#4
Not Solved
no replies Sad
Reply
#5
Not Solved
Before the line with "exit;", there should be a line with "echo $error;",  not "output_page($error);".
This is so for all error checks in reputation.php. The code you showed is for 1.6 not for 1.8.
Regards, Ad Bakker (NL)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)