Vergleich reputation.php - 1.8.24 - 1.8.36

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 173Zeile 173
	{
$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);

	{
$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'];











if($existing_reputation)
{
$rid = $existing_reputation['rid'];
}
else
{
$rid = 0;
}


		$was_post = true;
}


		$was_post = true;
}


Zeile 209Zeile 218
		}

// We have the correct post, but has the user given too much reputation to another in the same thread?

		}

// We have the correct post, but has the user given too much reputation to another in the same thread?

		if(!$message && $was_post && $mybb->usergroup['maxreputationsperthread'] != 0)

		if(!$message && !empty($was_post) && $mybb->usergroup['maxreputationsperthread'] != 0)

		{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->query("

		{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->query("

Zeile 266Zeile 275
		if($mybb->get_input('pid', MyBB::INPUT_INT) != 0)
{
$db->delete_query("reputation", "uid='{$uid}' AND adduid='".$mybb->user['uid']."' AND pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

		if($mybb->get_input('pid', MyBB::INPUT_INT) != 0)
{
$db->delete_query("reputation", "uid='{$uid}' AND adduid='".$mybb->user['uid']."' AND pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

		}
else

		}
else

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

		{
$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}'");


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

Zeile 278Zeile 287

$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)."\";");

		echo $error;
exit;

		echo $error;
exit;

	}

$mybb->input['comments'] = trim($mybb->get_input('comments')); // Trim whitespace to check for length

	}

$mybb->input['comments'] = trim($mybb->get_input('comments')); // Trim whitespace to check for length

Zeile 298Zeile 307
		exit;
}


		exit;
}


	// The power for the reputation they specified was invalid.
if($reputation > $mybb->usergroup['reputationpower'])
{
$message = $lang->add_invalidpower;
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 power for the reputation they specified was invalid.
if($reputation > $mybb->usergroup['reputationpower'])
{
$message = $lang->add_invalidpower;
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 is trying to give a negative reputation, but negative reps have been disabled.
if($mybb->get_input('reputation', MyBB::INPUT_INT) < 0 && $mybb->settings['negrep'] != 1)
{
$message = $lang->add_negative_disabled;

	// The user is trying to give a negative reputation, but negative reps have been disabled.
if($mybb->get_input('reputation', MyBB::INPUT_INT) < 0 && $mybb->settings['negrep'] != 1)
{
$message = $lang->add_negative_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)."\";");
}

		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;
}

		echo $error;
exit;
}

Zeile 335Zeile 344
	{
$message = $lang->add_neutral_disabled;
if($mybb->input['nomodal'])

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

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

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

		}
else
{

		}
else
{

Zeile 350Zeile 359
	if($mybb->get_input('reputation', MyBB::INPUT_INT) > 0 && $mybb->settings['posrep'] != 1)
{
$message = $lang->add_positive_disabled;

	if($mybb->get_input('reputation', MyBB::INPUT_INT) > 0 && $mybb->settings['posrep'] != 1)
{
$message = $lang->add_positive_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;

		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 length of the comment is too long

	}

// The length of the comment is too long

Zeile 376Zeile 385
		}
echo $error;
exit;

		}
echo $error;
exit;

	}


	}


	// Build array of reputation data.
$reputation = array(
"uid" => $uid,

	// Build array of reputation data.
$reputation = array(
"uid" => $uid,

Zeile 389Zeile 398
	);

$plugins->run_hooks("reputation_do_add_process");

	);

$plugins->run_hooks("reputation_do_add_process");





	// Updating an existing reputation
if(!empty($existing_reputation['uid']))
{

	// Updating an existing reputation
if(!empty($existing_reputation['uid']))
{

Zeile 405Zeile 414
		$lang->vote_added_message = $lang->vote_updated_message;
}
// Insert a new reputation

		$lang->vote_added_message = $lang->vote_updated_message;
}
// Insert a new reputation

	else
{

	else
{

		$db->insert_query("reputation", $reputation);

// Recount the reputation of this user - keep it in sync.

		$db->insert_query("reputation", $reputation);

// Recount the reputation of this user - keep it in sync.

Zeile 427Zeile 436
if($mybb->input['action'] == "add")
{
$plugins->run_hooks("reputation_add_start");

if($mybb->input['action'] == "add")
{
$plugins->run_hooks("reputation_add_start");

 
	$delete_button = '';


// If we have an existing reputation for this user, the user can modify or delete it.
$user['username'] = htmlspecialchars_uni($user['username']);


// If we have an existing reputation for this user, the user can modify or delete it.
$user['username'] = htmlspecialchars_uni($user['username']);

Zeile 531Zeile 541
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

 

$rid = $mybb->get_input('rid', MyBB::INPUT_INT);

$plugins->run_hooks("reputation_delete_start");


// Fetch the existing reputation for this user given by our current user if there is one.
$query = $db->query("
SELECT r.*, u.username
FROM ".TABLE_PREFIX."reputation r
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.adduid)


// Fetch the existing reputation for this user given by our current user if there is one.
$query = $db->query("
SELECT r.*, u.username
FROM ".TABLE_PREFIX."reputation r
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.adduid)

		WHERE rid = '".$mybb->get_input('rid', MyBB::INPUT_INT)."'

		WHERE r.rid = '{$rid}' AND r.uid = '{$uid}'

	");
$existing_reputation = $db->fetch_array($query);


	");
$existing_reputation = $db->fetch_array($query);


Zeile 546Zeile 560
	{
error_no_permission();
}

	{
error_no_permission();
}

 
	
$plugins->run_hooks("reputation_delete_end");


// Delete the specified reputation


// Delete the specified reputation

	$db->delete_query("reputation", "uid='{$uid}' AND rid='".$mybb->get_input('rid', MyBB::INPUT_INT)."'");

	$db->delete_query("reputation", "uid='{$uid}' AND rid='{$rid}'");


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


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

Zeile 654Zeile 670
	}

// Check the sorting options for the reputation list

	}

// Check the sorting options for the reputation list

	$sort_selected = array('username' => '', 'last_ipdated' => '');

	$sort_selected = array('username' => '', 'last_updated' => '');

	switch($mybb->get_input('sort'))
{
case "username":

	switch($mybb->get_input('sort'))
{
case "username":

Zeile 945Zeile 961
	$reputation_votes = '';
if(!empty($reputation_cache) && $mybb->user['uid'] != 0)
{

	$reputation_votes = '';
if(!empty($reputation_cache) && $mybb->user['uid'] != 0)
{

		$reputation_ids = implode(',', array_map('array_shift', $reputation_cache));

		$reputation_ids = implode(',', array_column($reputation_cache, 'rid'));

		$query = $db->query("
SELECT id, reporters FROM ".TABLE_PREFIX."reportedcontent WHERE reportstatus != '1' AND id IN (".$reputation_ids.") AND type = 'reputation'
");

		$query = $db->query("
SELECT id, reporters FROM ".TABLE_PREFIX."reportedcontent WHERE reportstatus != '1' AND id IN (".$reputation_ids.") AND type = 'reputation'
");