Vergleich reputation.php - 1.8.9 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 43Zeile 43
	error($lang->add_no_uid);
}
$user_permissions = user_permissions($uid);

	error($lang->add_no_uid);
}
$user_permissions = user_permissions($uid);

 

// 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))
{
$user_permissions = array_merge($user_permissions, $display_group);
}


$mybb->input['action'] = $mybb->get_input('action');



$mybb->input['action'] = $mybb->get_input('action');


Zeile 54Zeile 68
	if($mybb->usergroup['cangivereputations'] != 1)
{
$message = $lang->add_no_permission;

	if($mybb->usergroup['cangivereputations'] != 1)
{
$message = $lang->add_no_permission;

		if($mybb->input['nomodal'])
{
eval("\$error = \"".$templates->get("reputation_add_error_nomodal", 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)."\";");

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

Zeile 70Zeile 84
	if($user_permissions['usereputationsystem'] != 1)
{
$message = $lang->add_disabled;

	if($user_permissions['usereputationsystem'] != 1)
{
$message = $lang->add_disabled;

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

		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 113Zeile 127
			$thread = get_thread($post['tid']);
$forum = get_forum($thread['fid']);
$forumpermissions = forum_permissions($forum['fid']);

			$thread = get_thread($post['tid']);
$forum = get_forum($thread['fid']);
$forumpermissions = forum_permissions($forum['fid']);





			// Post doesn't belong to that user or isn't visible
if($uid != $post['uid'] || $post['visible'] != 1)
{

			// Post doesn't belong to that user or isn't visible
if($uid != $post['uid'] || $post['visible'] != 1)
{

Zeile 154Zeile 168
		$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];
$was_post = false;

		$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];
$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)."'");

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

Zeile 208Zeile 222
			$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 236Zeile 250
	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("reputation_do_add_start");

	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("reputation_do_add_start");





	// Check if the reputation power they're trying to give is within their "power limit"
$reputation = abs($mybb->get_input('reputation', MyBB::INPUT_INT));

	// Check if the reputation power they're trying to give is within their "power limit"
$reputation = abs($mybb->get_input('reputation', MyBB::INPUT_INT));





	// Deleting our current reputation of this user.
if(!empty($mybb->input['delete']))
{

	// Deleting our current reputation of this user.
if(!empty($mybb->input['delete']))
{

Zeile 250Zeile 264
		}

if($mybb->get_input('pid', MyBB::INPUT_INT) != 0)

		}

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

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

		}

		}

		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");

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

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

		echo $error;
exit;

		echo $error;
exit;

	}

$mybb->input['comments'] = trim($mybb->get_input('comments')); // Trim whitespace to check for length
if(my_strlen($mybb->input['comments']) < $mybb->settings['minreplength'] && $mybb->get_input('pid', MyBB::INPUT_INT) == 0)

	}

$mybb->input['comments'] = trim($mybb->get_input('comments')); // Trim whitespace to check for length
if(my_strlen($mybb->input['comments']) < $mybb->settings['minreplength'] && $mybb->get_input('pid', MyBB::INPUT_INT) == 0)

	{
$message = $lang->add_no_comment;
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;

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

		exit;
}


		exit;
}


Zeile 288Zeile 302
	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
{
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 304Zeile 318
	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'])
{
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 320Zeile 334
	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)."\";");

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

		}
else
{

		}
else
{

Zeile 336Zeile 350
	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'])

		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 377Zeile 391
	$plugins->run_hooks("reputation_do_add_process");

// Updating an existing reputation

	$plugins->run_hooks("reputation_do_add_process");

// Updating an existing reputation

	if(!empty($existing_reputation['uid']))

	if(!empty($existing_reputation['uid']))

	{
$db->update_query("reputation", $reputation, "rid='".$existing_reputation['rid']."'");


	{
$db->update_query("reputation", $reputation, "rid='".$existing_reputation['rid']."'");


Zeile 424Zeile 438

if($mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['candeletereputations'] == 1 && $existing_reputation['adduid'] == $mybb->user['uid'] && $mybb->user['uid'] != 0))
{


if($mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['candeletereputations'] == 1 && $existing_reputation['adduid'] == $mybb->user['uid'] && $mybb->user['uid'] != 0))
{

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

			eval("\$delete_button = \"".$templates->get("reputation_add_delete")."\";");
}
}

			eval("\$delete_button = \"".$templates->get("reputation_add_delete")."\";");
}
}

Zeile 487Zeile 502
			}
}


			}
}


		$mybb->input['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 556Zeile 571
		error_no_permission();
}


		error_no_permission();
}


	// Set display group to their user group if they don't have a display group.
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

// Fetch display group properties.
$displaygroupfields = array('title', 'description', 'namestyle', 'usertitle', 'stars', 'starimage', 'image', 'usereputationsystem');
$display_group = usergroup_displaygroup($user['displaygroup']);

if($user_permissions['usereputationsystem'] != 1 || $display_group['title'] && $display_group['usereputationsystem'] == 0)

	if($user_permissions['usereputationsystem'] != 1)











	{
// Group has reputation disabled or user has a display group that has reputation disabled
error($lang->reputations_disabled_group);

	{
// Group has reputation disabled or user has a display group that has reputation disabled
error($lang->reputations_disabled_group);

	}


	}


	$user['username'] = htmlspecialchars_uni($user['username']);
$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);
$lang->reputation_report = $lang->sprintf($lang->reputation_report, $user['username']);

	$user['username'] = htmlspecialchars_uni($user['username']);
$lang->nav_profile = $lang->sprintf($lang->nav_profile, $user['username']);
$lang->reputation_report = $lang->sprintf($lang->reputation_report, $user['username']);





	// Format the user name using the group username style
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

	// Format the user name using the group username style
$username = format_name($user['username'], $user['usergroup'], $user['displaygroup']);


// Set display group to their user group if they don't have a display group.
if(!$user['displaygroup'])
{
$user['displaygroup'] = $user['usergroup'];
}

 

$usertitle = '';



$usertitle = '';


Zeile 610Zeile 609
			}
}
unset($usertitles, $title);

			}
}
unset($usertitles, $title);

	}

	}

	
$usertitle = htmlspecialchars_uni($usertitle);


	
$usertitle = htmlspecialchars_uni($usertitle);


Zeile 651Zeile 650
			$s_url = '&show=all';
$conditions = '';
$show_select['all'] = 'selected="selected"';

			$s_url = '&show=all';
$conditions = '';
$show_select['all'] = 'selected="selected"';

			break;
}

			break;
}


// Check the sorting options for the reputation list
$sort_selected = array('username' => '', 'last_ipdated' => '');


// Check the sorting options for the reputation list
$sort_selected = array('username' => '', 'last_ipdated' => '');

Zeile 721Zeile 720
			if($reputation_vote['dateline'] >= $last_week)
{
$positive_week++;

			if($reputation_vote['dateline'] >= $last_week)
{
$positive_week++;

			}

			}

			if($reputation_vote['dateline'] >= $last_month)
{
$positive_month++;

			if($reputation_vote['dateline'] >= $last_month)
{
$positive_month++;

Zeile 866Zeile 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 944Zeile 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 1026Zeile 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")."\";");
}