Vergleich reputation.php - 1.8.6 - 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)."\";");
}
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 70Zeile 84
	if($user_permissions['usereputationsystem'] != 1)
{
$message = $lang->add_disabled;

	if($user_permissions['usereputationsystem'] != 1)
{
$message = $lang->add_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 84Zeile 98

// Is this user trying to give themself a reputation?
if($uid == $mybb->user['uid'])


// Is this user trying to give themself a reputation?
if($uid == $mybb->user['uid'])

	{

	{

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

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

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

	}


	}


	// If a post has been given but post ratings have been disabled, set the post to 0. This will mean all subsequent code will think no post was given.
if($mybb->settings['postrep'] != 1)

	// If a post has been given but post ratings have been disabled, set the post to 0. This will mean all subsequent code will think no post was given.
if($mybb->settings['postrep'] != 1)

	{

	{

		$mybb->input['pid'] = 0;

		$mybb->input['pid'] = 0;

	}

// Check if this user has reached their "maximum reputations per day" quota
if($mybb->usergroup['maxreputationsday'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "adduid='".$mybb->user['uid']."' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);

// Reached the quota - error.
if($numtoday >= $mybb->usergroup['maxreputationsday'])
{
$message = $lang->add_maxperday;
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;
}
}

// Is the user giving too much reputation to another?
if($mybb->usergroup['maxreputationsperuser'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "uid='".$uid."' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);

if($numtoday >= $mybb->usergroup['maxreputationsperuser'])
{
$message = $lang->add_maxperuser;
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->get_input('pid', MyBB::INPUT_INT))

	}

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

Zeile 160Zeile 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

			// Post doesn't belong to that user or isn't visible

			if($uid != $post['uid'] || ($post['visible'] == 0 && !is_moderator($fid, "canviewunapprove")) || $post['visible'] < 0)
{

			if($uid != $post['uid'] || $post['visible'] != 1)
{

				$mybb->input['pid'] = 0;
}

				$mybb->input['pid'] = 0;
}

 


			// Thread isn't visible

			// Thread isn't visible

			elseif(($thread['visible'] == 0 && !is_moderator($forum['fid'], "canviewunapprove")) || $thread['visible'] < 0)
{
$mybb->input['pid'] = 0;
}


			elseif($thread['visible'] != 1)
{
$mybb->input['pid'] = 0;
}


			// Current user can't see the forum
elseif($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0 || $mybb->user['suspendposting'] == 1)
{
$mybb->input['pid'] = 0;
}

			// Current user can't see the forum
elseif($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0 || $mybb->user['suspendposting'] == 1)
{
$mybb->input['pid'] = 0;
}

 


			// Current user can't see that thread
elseif(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])

			// Current user can't see that thread
elseif(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])

			{

			{

				$mybb->input['pid'] = 0;
}

				$mybb->input['pid'] = 0;
}

			else
// We have the correct post, but has the user given too much reputation to another in the same thread?
if($mybb->usergroup['maxreputationsperthread'] != 0 && ($mybb->input['action'] != "do_add" || ($mybb->input['action'] == "do_add" && empty($mybb->input['delete']))))
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->query("
SELECT COUNT(p.pid) AS posts
FROM ".TABLE_PREFIX."reputation r
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'])
{
$message = $lang->add_maxperthread;
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;
}
}
}

		}






























		else
{
$mybb->input['pid'] = 0;

		else
{
$mybb->input['pid'] = 0;

		}
}


		}
}


	$rid = 0;

// Fetch the existing reputation for this user given by our current user if there is one.

	$rid = 0;

// Fetch the existing reputation for this user given by our current user if there is one.

Zeile 234Zeile 176
		$rid = $existing_reputation['rid'];
$was_post = true;
}

		$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 = '';

// Check if this user has reached their "maximum reputations per day" quota
if($mybb->usergroup['maxreputationsday'] != 0)
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->simple_select("reputation", "*", "adduid='{$mybb->user['uid']}' AND dateline>'$timesearch'");
$numtoday = $db->num_rows($query);

// Reached the quota - error.
if($numtoday >= $mybb->usergroup['maxreputationsday'])
{
$message = $lang->add_maxperday;
}
}

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

if($numtoday >= $mybb->usergroup['maxreputationsperuser'])
{
$message = $lang->add_maxperuser;
}
}

// 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)
{
$timesearch = TIME_NOW - (60 * 60 * 24);
$query = $db->query("
SELECT COUNT(p.pid) AS posts
FROM ".TABLE_PREFIX."reputation r
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'])
{
$message = $lang->add_maxperthread;
}
}

if($message)
{
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;
}
}
}


// Saving the new reputation
if($mybb->input['action'] == "do_add" && $mybb->request_method == "post")


// Saving the new reputation
if($mybb->input['action'] == "do_add" && $mybb->request_method == "post")

Zeile 243Zeile 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));


Zeile 257Zeile 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;

		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)

		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)

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

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

		echo $error;
exit;
}

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

		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 327Zeile 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 343Zeile 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 357Zeile 364

// The length of the comment is too long
if(my_strlen($mybb->input['comments']) > $mybb->settings['maxreplength'])


// The length of the comment is too long
if(my_strlen($mybb->input['comments']) > $mybb->settings['maxreplength'])

	{

	{

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

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

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





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

$lang->vote_added = $lang->vote_updated;

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

$lang->vote_added = $lang->vote_updated;

Zeile 399Zeile 406
	}
// Insert a new reputation
else

	}
// Insert a new reputation
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 422Zeile 429
	$plugins->run_hooks("reputation_add_start");

// If we have an existing reputation for this user, the user can modify or delete it.

	$plugins->run_hooks("reputation_add_start");

// If we have an existing reputation for this user, the user can modify or delete it.

 
	$user['username'] = htmlspecialchars_uni($user['username']);

	if(!empty($existing_reputation['uid']))
{
$vote_title = $lang->sprintf($lang->update_reputation_vote, $user['username']);
$vote_button = $lang->update_vote;
$comments = htmlspecialchars_uni($existing_reputation['comments']);

	if(!empty($existing_reputation['uid']))
{
$vote_title = $lang->sprintf($lang->update_reputation_vote, $user['username']);
$vote_button = $lang->update_vote;
$comments = htmlspecialchars_uni($existing_reputation['comments']);





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

	}

	}

	// Otherwise we're adding an entirely new reputation for this user.
else
{

	// Otherwise we're adding an entirely new reputation for this user.
else
{

Zeile 440Zeile 449
		$vote_button = $lang->add_vote;
$comments = '';
$delete_button = '';

		$vote_button = $lang->add_vote;
$comments = '';
$delete_button = '';

	}

	}

	$lang->user_comments = $lang->sprintf($lang->user_comments, $user['username']);

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

	$lang->user_comments = $lang->sprintf($lang->user_comments, $user['username']);

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

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

	}

	}

	else
{
$message = $lang->add_all_rep_disabled;

	else
{
$message = $lang->add_all_rep_disabled;

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

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

	}

	}


echo $reputation_add;
exit;


echo $reputation_add;
exit;

Zeile 539Zeile 548
	}

// 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='".$mybb->get_input('rid', MyBB::INPUT_INT)."'");


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

// Create moderator log
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->sprintf($lang->delete_reputation_log, $existing_reputation['username'], $existing_reputation['adduid']));

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

// Create moderator log
log_moderator_action(array("uid" => $user['uid'], "username" => $user['username']), $lang->sprintf($lang->delete_reputation_log, $existing_reputation['username'], $existing_reputation['adduid']));





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

redirect("reputation.php?uid={$uid}", $lang->vote_deleted_message);

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

redirect("reputation.php?uid={$uid}", $lang->vote_deleted_message);

Zeile 560Zeile 569
	{
// Reputation page is a part of a profile
error_no_permission();

	{
// Reputation page is a part of a profile
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']);

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

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


// 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 871Zeile 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 889Zeile 883
		$pids = implode(',', $post_cache);

$sql = array("p.pid IN ({$pids})");

		$pids = implode(',', $post_cache);

$sql = array("p.pid IN ({$pids})");





		// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)

		// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)

		{

		{

			$sql[] = "p.fid NOT IN ({$unviewable})";

			$sql[] = "p.fid NOT IN ({$unviewable})";

		}

		}


// get inactive forums
$inactive = get_inactive_forums();
if($inactive)
{
$sql[] = "p.fid NOT IN ({$inactive})";


// get inactive forums
$inactive = get_inactive_forums();
if($inactive)
{
$sql[] = "p.fid NOT IN ({$inactive})";

		}


		}


		if(!$mybb->user['ismoderator'])
{
$sql[] = "p.visible='1'";
$sql[] = "t.visible='1'";
}

		if(!$mybb->user['ismoderator'])
{
$sql[] = "p.visible='1'";
$sql[] = "t.visible='1'";
}





		$sql = implode(' AND ', $sql);

$query = $db->query("

		$sql = implode(' AND ', $sql);

$query = $db->query("

Zeile 917Zeile 911
			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE {$sql}

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE {$sql}

		");


		");


		$forumpermissions = array();

while($post = $db->fetch_array($query))

		$forumpermissions = array();

while($post = $db->fetch_array($query))

Zeile 927Zeile 921
			{
continue;
}

			{
continue;
}


if(($post['visible'] == -1 || $post['thread_visible'] == -1) && !is_moderator($post['fid'], 'canviewdeleted'))
{
continue;
}


if(($post['visible'] == -1 || $post['thread_visible'] == -1) && !is_moderator($post['fid'], 'canviewdeleted'))
{
continue;
}


if(!isset($forumpermissions[$post['fid']]))
{
$forumpermissions[$post['fid']] = forum_permissions($post['fid']);


if(!isset($forumpermissions[$post['fid']]))
{
$forumpermissions[$post['fid']] = forum_permissions($post['fid']);

			}


			}


			// Make sure we can view this post
if(isset($forumpermissions[$post['fid']]['canonlyviewownthreads']) && $forumpermissions[$post['fid']]['canonlyviewownthreads'] == 1 && $post['uid'] != $mybb->user['uid'])
{

			// Make sure we can view this post
if(isset($forumpermissions[$post['fid']]['canonlyviewownthreads']) && $forumpermissions[$post['fid']]['canonlyviewownthreads'] == 1 && $post['uid'] != $mybb->user['uid'])
{

Zeile 945Zeile 939
			}

$post_reputation[$post['pid']] = $post;

			}

$post_reputation[$post['pid']] = $post;

		}


















		}
}

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

	}

	}


$reputation_votes = '';

 

foreach($reputation_cache as $reputation_vote)
{


foreach($reputation_cache as $reputation_vote)
{

Zeile 956Zeile 965
		if($reputation_vote['adduid'] == 0)
{
$reputation_vote['user_reputation'] = 0;

		if($reputation_vote['adduid'] == 0)
{
$reputation_vote['user_reputation'] = 0;

		}

$reputation_vote['user_reputation'] = get_reputation($reputation_vote['user_reputation'], $reputation_vote['adduid']);


		}

$reputation_vote['user_reputation'] = get_reputation($reputation_vote['user_reputation'], $reputation_vote['adduid']);


		// Format the username of this poster
if(!$reputation_vote['username'])
{

		// Format the username of this poster
if(!$reputation_vote['username'])
{

Zeile 968Zeile 977
		}
else
{

		}
else
{

			$reputation_vote['username'] = format_name($reputation_vote['username'], $reputation_vote['user_usergroup'], $reputation_vote['user_displaygroup']);

			$reputation_vote['username'] = format_name(htmlspecialchars_uni($reputation_vote['username']), $reputation_vote['user_usergroup'], $reputation_vote['user_displaygroup']);

			$reputation_vote['username'] = build_profile_link($reputation_vote['username'], $reputation_vote['uid']);
$reputation_vote['user_reputation'] = "({$reputation_vote['user_reputation']})";

			$reputation_vote['username'] = build_profile_link($reputation_vote['username'], $reputation_vote['uid']);
$reputation_vote['user_reputation'] = "({$reputation_vote['user_reputation']})";

		}

$vote_reputation = (int)$reputation_vote['reputation'];


		}

$vote_reputation = (int)$reputation_vote['reputation'];


		// This is a negative reputation
if($vote_reputation < 0)
{

		// This is a negative reputation
if($vote_reputation < 0)
{

Zeile 988Zeile 997
			$status_class = "trow_reputation_neutral";
$vote_type_class = "reputation_neutral";
$vote_type = $lang->neutral;

			$status_class = "trow_reputation_neutral";
$vote_type_class = "reputation_neutral";
$vote_type = $lang->neutral;

		}

		}

		// Otherwise, this is a positive reputation
else
{

		// Otherwise, this is a positive reputation
else
{

Zeile 998Zeile 1007
			$vote_type = $lang->positive;
}


			$vote_type = $lang->positive;
}


		$vote_reputation = "({$vote_reputation})";


		$vote_reputation = "({$vote_reputation})";


		// Format the date this reputation was last modified
$last_updated_date = my_date('relative', $reputation_vote['dateline']);
$last_updated = $lang->sprintf($lang->last_updated, $last_updated_date);

		// Format the date this reputation was last modified
$last_updated_date = my_date('relative', $reputation_vote['dateline']);
$last_updated = $lang->sprintf($lang->last_updated, $last_updated_date);

 

$user['username'] = htmlspecialchars_uni($user['username']);


// Is this rating specific to a post?
$postrep_given = '';


// Is this rating specific to a post?
$postrep_given = '';

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