Vergleich reputation.php - 1.8.16 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 46Zeile 46

// Fetch display group properties.
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");


// Fetch display group properties.
$displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image");

 

if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}


$display_group = usergroup_displaygroup($user['displaygroup']);
if(is_array($display_group))
{

$display_group = usergroup_displaygroup($user['displaygroup']);
if(is_array($display_group))
{

Zeile 63Zeile 69
	{
$message = $lang->add_no_permission;
if($mybb->input['nomodal'])

	{
$message = $lang->add_no_permission;
if($mybb->input['nomodal'])

		{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
}
echo $error;
exit;
}

// The user we're trying to give a reputation to doesn't have permission to receive reps.
if($user_permissions['usereputationsystem'] != 1)
{
$message = $lang->add_disabled;
if($mybb->input['nomodal'])
{

		{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
}
echo $error;
exit;
}

// The user we're trying to give a reputation to doesn't have permission to receive reps.
if($user_permissions['usereputationsystem'] != 1)
{
$message = $lang->add_disabled;
if($mybb->input['nomodal'])
{

			eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else

			eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else

Zeile 101Zeile 107
		else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");

		else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");

		}

		}

		echo $error;
exit;
}

		echo $error;
exit;
}

Zeile 157Zeile 163
	// Fetch the existing reputation for this user given by our current user if there is one.
// If multiple reputations is allowed, then this isn't needed
if($mybb->settings['multirep'] != 1 && $mybb->get_input('pid', MyBB::INPUT_INT) == 0)

	// Fetch the existing reputation for this user given by our current user if there is one.
// If multiple reputations is allowed, then this isn't needed
if($mybb->settings['multirep'] != 1 && $mybb->get_input('pid', MyBB::INPUT_INT) == 0)

	{

	{

		$query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND uid='{$uid}' AND pid='0'");

		$query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND uid='{$uid}' AND pid='0'");

		$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];

		$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];

		$was_post = false;

		$was_post = false;

	}

	}

	if($mybb->get_input('pid', MyBB::INPUT_INT) != 0)
{
$query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND uid='{$uid}' AND pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");
$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];
$was_post = true;

	if($mybb->get_input('pid', MyBB::INPUT_INT) != 0)
{
$query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND uid='{$uid}' AND pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");
$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];
$was_post = true;

	}


	}


	if($rid == 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$message = '';

	if($rid == 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$message = '';

Zeile 197Zeile 203
			$numtoday = $db->num_rows($query);

if($numtoday >= $mybb->usergroup['maxreputationsperuser'])

			$numtoday = $db->num_rows($query);

if($numtoday >= $mybb->usergroup['maxreputationsperuser'])

			{

			{

				$message = $lang->add_maxperuser;
}
}

				$message = $lang->add_maxperuser;
}
}

Zeile 264Zeile 270
		else
{
$db->delete_query("reputation", "rid='{$rid}' AND uid='{$uid}' AND adduid='".$mybb->user['uid']."'");

		else
{
$db->delete_query("reputation", "rid='{$rid}' AND uid='{$uid}' AND adduid='".$mybb->user['uid']."'");

		}

// Recount the reputation of this user - keep it in sync.
$query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
$reputation_value = $db->fetch_field($query, "reputation_count");

		}

// Recount the reputation of this user - keep it in sync.
$query = $db->simple_select("reputation", "SUM(reputation) AS reputation_count", "uid='{$uid}'");
$reputation_value = $db->fetch_field($query, "reputation_count");


$db->update_query("users", array('reputation' => (int)$reputation_value), "uid='{$uid}'");
eval("\$error = \"".$templates->get("reputation_deleted", 1, 0)."\";");


$db->update_query("users", array('reputation' => (int)$reputation_value), "uid='{$uid}'");
eval("\$error = \"".$templates->get("reputation_deleted", 1, 0)."\";");

Zeile 859Zeile 865
	");

// Gather a list of items that have post reputation

	");

// Gather a list of items that have post reputation

	$reputation_cache = $post_cache = $post_reputation = array();

	$reputation_cache = $post_cache = $post_reputation = $not_reportable = array();


while($reputation_vote = $db->fetch_array($query))
{


while($reputation_vote = $db->fetch_array($query))
{

Zeile 937Zeile 943
	}

$reputation_votes = '';

	}

$reputation_votes = '';

 
	if(!empty($reputation_cache) && $mybb->user['uid'] != 0)
{
$reputation_ids = implode(',', array_map('array_shift', $reputation_cache));
$query = $db->query("
SELECT id, reporters FROM ".TABLE_PREFIX."reportedcontent WHERE reportstatus != '1' AND id IN (".$reputation_ids.") AND type = 'reputation'
");
while($report = $db->fetch_array($query))
{
$reporters = my_unserialize($report['reporters']);
if(is_array($reporters) && in_array($mybb->user['uid'], $reporters))
{
$not_reportable[] = $report['id'];
}
}
}


foreach($reputation_cache as $reputation_vote)
{


foreach($reputation_cache as $reputation_vote)
{

Zeile 1019Zeile 1040
		}

$report_link = '';

		}

$report_link = '';

		if($mybb->user['uid'] != 0)

		if($mybb->user['uid'] != 0 && !in_array($reputation_vote['rid'], $not_reportable))

		{
eval("\$report_link = \"".$templates->get("reputation_vote_report")."\";");
}

		{
eval("\$report_link = \"".$templates->get("reputation_vote_report")."\";");
}