Vergleich reputation.php - 1.8.20 - 1.8.30

  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 197Zeile 206

// Is the user giving too much reputation to another?
if(!$message && $mybb->usergroup['maxreputationsperuser'] != 0)


// Is the user giving too much reputation to another?
if(!$message && $mybb->usergroup['maxreputationsperuser'] != 0)

		{

		{

			$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "uid='{$uid}' AND adduid='{$mybb->user['uid']}' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);

			$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "uid='{$uid}' AND adduid='{$mybb->user['uid']}' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);

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("
SELECT COUNT(p.pid) AS posts

			$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->query("
SELECT COUNT(p.pid) AS posts

Zeile 218Zeile 227
				LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid = r.pid)
WHERE r.uid = '{$uid}' AND r.adduid = '{$mybb->user['uid']}' AND p.tid = '{$post['tid']}' AND r.dateline > '{$timesearch}'
");

				LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid = r.pid)
WHERE r.uid = '{$uid}' AND r.adduid = '{$mybb->user['uid']}' AND p.tid = '{$post['tid']}' AND r.dateline > '{$timesearch}'
");





			$numtoday = $db->fetch_field($query, 'posts');

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

			$numtoday = $db->fetch_field($query, 'posts');

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

			{

			{

				$message = $lang->add_maxperthread;
}
}

				$message = $lang->add_maxperthread;
}
}

Zeile 270Zeile 279
		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}'");


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

Zeile 286Zeile 295
	if(my_strlen($mybb->input['comments']) < $mybb->settings['minreplength'] && $mybb->get_input('pid', MyBB::INPUT_INT) == 0)
{
$message = $lang->sprintf($lang->add_no_comment, $mybb->settings['minreplength']);

	if(my_strlen($mybb->input['comments']) < $mybb->settings['minreplength'] && $mybb->get_input('pid', MyBB::INPUT_INT) == 0)
{
$message = $lang->sprintf($lang->add_no_comment, $mybb->settings['minreplength']);

		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;

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


		exit;
}


Zeile 302Zeile 311
	if($reputation > $mybb->usergroup['reputationpower'])
{
$message = $lang->add_invalidpower;

	if($reputation > $mybb->usergroup['reputationpower'])
{
$message = $lang->add_invalidpower;

		if($mybb->input['nomodal'])
{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else

		if($mybb->input['nomodal'])
{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 1, 0)."\";");
}
else

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

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

Zeile 318Zeile 327
	if($mybb->get_input('reputation', MyBB::INPUT_INT) < 0 && $mybb->settings['negrep'] != 1)
{
$message = $lang->add_negative_disabled;

	if($mybb->get_input('reputation', MyBB::INPUT_INT) < 0 && $mybb->settings['negrep'] != 1)
{
$message = $lang->add_negative_disabled;

		if($mybb->input['nomodal'])

		if($mybb->input['nomodal'])

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

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

Zeile 334Zeile 343
	if($mybb->get_input('reputation', MyBB::INPUT_INT) == 0 && $mybb->settings['neurep'] != 1)
{
$message = $lang->add_neutral_disabled;

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

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


		exit;
}


Zeile 366Zeile 375
	if(my_strlen($mybb->input['comments']) > $mybb->settings['maxreplength'])
{
$message = $lang->sprintf($lang->add_toolong, $mybb->settings['maxreplength']);

	if(my_strlen($mybb->input['comments']) > $mybb->settings['maxreplength'])
{
$message = $lang->sprintf($lang->add_toolong, $mybb->settings['maxreplength']);

		if($mybb->input['nomodal'])

		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
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
}
echo $error;
exit;

		else
{
eval("\$error = \"".$templates->get("reputation_add_error", 1, 0)."\";");
}
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 412Zeile 421
		// 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}'");
}


		$db->update_query("users", array('reputation' => (int)$reputation_value), "uid='{$uid}'");
}


Zeile 460Zeile 469
	else
{
$post_rep_info = '';

	else
{
$post_rep_info = '';

	}


	}


	// Draw the "power" options
if($mybb->settings['negrep'] || $mybb->settings['neurep'] || $mybb->settings['posrep'])
{

	// Draw the "power" options
if($mybb->settings['negrep'] || $mybb->settings['neurep'] || $mybb->settings['posrep'])
{

Zeile 492Zeile 501
			{
$positive_title = $lang->sprintf($lang->power_positive, "+".$value);
eval("\$positive_power = \"".$templates->get("reputation_add_positive")."\";");

			{
$positive_title = $lang->sprintf($lang->power_positive, "+".$value);
eval("\$positive_power = \"".$templates->get("reputation_add_positive")."\";");

			}


			}


			if($mybb->settings['negrep'])
{
$negative_title = $lang->sprintf($lang->power_negative, "-".$value);
$neg_value = "-{$value}";
eval("\$negative_power .= \"".$templates->get("reputation_add_negative")."\";");
}

			if($mybb->settings['negrep'])
{
$negative_title = $lang->sprintf($lang->power_negative, "-".$value);
$neg_value = "-{$value}";
eval("\$negative_power .= \"".$templates->get("reputation_add_negative")."\";");
}

		}

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


		}

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


		$plugins->run_hooks("reputation_add_end");
eval("\$reputation_add = \"".$templates->get("reputation_add", 1, 0)."\";");
}

		$plugins->run_hooks("reputation_add_end");
eval("\$reputation_add = \"".$templates->get("reputation_add", 1, 0)."\";");
}

Zeile 513Zeile 522

$plugins->run_hooks("reputation_add_end_error");
if($mybb->input['nomodal'])


$plugins->run_hooks("reputation_add_end_error");
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 531Zeile 540
{
// 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 559
	{
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 865Zeile 880
	");

// 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 943Zeile 958
	}

$reputation_votes = '';

	}

$reputation_votes = '';

 
	if(!empty($reputation_cache) && $mybb->user['uid'] != 0)
{
$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'
");
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 1025Zeile 1055
		}

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