Vergleich reputation.php - 1.8.7 - 1.8.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 102Zeile 102
	if($mybb->settings['postrep'] != 1)
{
$mybb->input['pid'] = 0;

	if($mybb->settings['postrep'] != 1)
{
$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 113
			$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)
{
$mybb->input['pid'] = 0;
}

			// Post doesn't belong to that user or isn't visible
if($uid != $post['uid'] || $post['visible'] != 1)
{
$mybb->input['pid'] = 0;
}

 


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

			// Thread isn't visible
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'])
{
$mybb->input['pid'] = 0;

			// Current user can't see that thread
elseif(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
{
$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

			}
}
else

		{

		{

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

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

Zeile 233Zeile 161
		$existing_reputation = $db->fetch_array($query);
$rid = $existing_reputation['rid'];
$was_post = true;

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

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

	}
}


	}
}


Zeile 359Zeile 352
	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)."\";");
}
else

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

Zeile 387Zeile 380
	if(!empty($existing_reputation['uid']))
{
$db->update_query("reputation", $reputation, "rid='".$existing_reputation['rid']."'");

	if(!empty($existing_reputation['uid']))
{
$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 401Zeile 394
	else
{
$db->insert_query("reputation", $reputation);

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





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

Zeile 422Zeile 415
	$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))
{
eval("\$delete_button = \"".$templates->get("reputation_add_delete")."\";");

		if($mybb->usergroup['issupermod'] == 1 || ($mybb->usergroup['candeletereputations'] == 1 && $existing_reputation['adduid'] == $mybb->user['uid'] && $mybb->user['uid'] != 0))
{
eval("\$delete_button = \"".$templates->get("reputation_add_delete")."\";");

Zeile 467Zeile 461
		}

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

		}

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

		{

		{

			$vote_check[$existing_reputation['reputation']] = " selected=\"selected\"";
}


			$vote_check[$existing_reputation['reputation']] = " selected=\"selected\"";
}


Zeile 578Zeile 572
		error($lang->reputations_disabled_group);
}


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


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


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

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

		}

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


$query = $db->query("
SELECT p.pid, p.uid, p.fid, p.visible, p.message, t.tid, t.subject, t.visible AS thread_visible


$query = $db->query("
SELECT p.pid, p.uid, p.fid, p.visible, p.message, t.tid, t.subject, t.visible AS thread_visible

Zeile 918Zeile 913
			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE {$sql}
");

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

		{

		{

			if(($post['visible'] == 0 || $post['thread_visible'] == 0) && !is_moderator($post['fid'], 'canviewunapprove'))

			if(($post['visible'] == 0 || $post['thread_visible'] == 0) && !is_moderator($post['fid'], 'canviewunapprove'))

			{
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']]))

			{
continue;
}

if(!isset($forumpermissions[$post['fid']]))

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

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

			}

// Make sure we can view this post

			}

// Make sure we can view this post

Zeile 962Zeile 957

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


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

		{

		{

			$reputation_vote['username'] = $lang->na;
$reputation_vote['user_reputation'] = '';
}
else
{

			$reputation_vote['username'] = $lang->na;
$reputation_vote['user_reputation'] = '';
}
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']})";
}

Zeile 1003Zeile 998
		// 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 = '';