Vergleich reputation.php - 1.8.4 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
define('THIS_SCRIPT', 'reputation.php');

$templatelist = "reputation_addlink,reputation_no_votes,reputation,reputation_vote,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,reputation_vote_delete";

define('THIS_SCRIPT', 'reputation.php');

$templatelist = "reputation_addlink,reputation_no_votes,reputation,reputation_vote,multipage,multipage_end,multipage_jump_page,multipage_nextpage,multipage_page,multipage_page_current,multipage_page_link_current,multipage_prevpage,multipage_start,reputation_vote_delete";

$templatelist .= ",reputation_add_delete,reputation_add_neutral,reputation_add_positive,reputation_add_negative,reputation_add_error,reputation_add_error_nomodal,reputation_add,reputation_added,reputation_deleted,reputation_vote_report";

$templatelist .= ",reputation_add_delete,reputation_add_neutral,reputation_add_positive,reputation_add_negative,reputation_add_error,reputation_add_error_nomodal,reputation_add,reputation_added,reputation_deleted,reputation_vote_report,postbit_reputation_formatted_link";


require_once "./global.php";
require_once MYBB_ROOT."inc/class_parser.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/class_parser.php";

Zeile 161Zeile 161
			$forum = get_forum($thread['fid']);
$forumpermissions = forum_permissions($forum['fid']);
// Post doesn't belong to that user or isn't visible

			$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'] == 0 && !is_moderator($fid, "canviewunapprove")) || $post['visible'] < 0)

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

			{
$mybb->input['pid'] = 0;
}
// Thread isn't visible

			{
$mybb->input['pid'] = 0;
}
// Thread isn't visible

			elseif(($thread['visible'] == 0 && !is_moderator($forum['fid'], "canviewunapprove")) || $thread['visible'] < 0)

			elseif($thread['visible'] != 1)

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

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

Zeile 611Zeile 611
			if($title['posts'] <= $user['postnum'])
{
$usertitle = $title['title'];

			if($title['posts'] <= $user['postnum'])
{
$usertitle = $title['title'];

 
				break;

			}
}
unset($usertitles, $title);

			}
}
unset($usertitles, $title);

Zeile 770Zeile 771
			}
}
}

			}
}
}


















	
// Format all reputation numbers
$rep_total = my_number_format($user['reputation']);
$f_positive_count = my_number_format($positive_count);
$f_negative_count = my_number_format($negative_count);
$f_neutral_count = my_number_format($neutral_count);
$f_positive_week = my_number_format($positive_week);
$f_negative_week = my_number_format($negative_week);
$f_neutral_week = my_number_format($neutral_week);
$f_positive_month = my_number_format($positive_month);
$f_negative_month = my_number_format($negative_month);
$f_neutral_month = my_number_format($neutral_month);
$f_positive_6months = my_number_format($positive_6months);
$f_negative_6months = my_number_format($negative_6months);
$f_neutral_6months = my_number_format($neutral_6months);


	// Format the user's 'total' reputation
if($user['reputation'] < 0)
{

	// Format the user's 'total' reputation
if($user['reputation'] < 0)
{

Zeile 793Zeile 809

// General
// We count how many reps in total, then subtract the reps from posts


// General
// We count how many reps in total, then subtract the reps from posts

	$rep_members = my_number_format($total_reputation - $rep_posts);

	$rep_members = my_number_format($total_reputation - $rep_post_count);


// Is negative reputation disabled? If so, tell the user
if($mybb->settings['negrep'] == 0)


// Is negative reputation disabled? If so, tell the user
if($mybb->settings['negrep'] == 0)

Zeile 809Zeile 825
	if($mybb->settings['neurep'] == 0)
{
$neu_rep_info = $lang->neu_rep_disabled;

	if($mybb->settings['neurep'] == 0)
{
$neu_rep_info = $lang->neu_rep_disabled;

 
	}

$perpage = (int)$mybb->settings['repsperpage'];
if($perpage < 1)
{
$perpage = 15;

	}

// Check if we're browsing a specific page of results
if($mybb->get_input('page', MyBB::INPUT_INT) > 0)

	}

// Check if we're browsing a specific page of results
if($mybb->get_input('page', MyBB::INPUT_INT) > 0)

	{

	{

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

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

		$start = ($page-1) * $mybb->settings['repsperpage'];
$pages = $reputation_count / $mybb->settings['repsperpage'];

		$start = ($page-1) * $perpage;
$pages = $reputation_count / $perpage;

		$pages = ceil($pages);
if($page > $pages)
{

		$pages = ceil($pages);
if($page > $pages)
{

Zeile 828Zeile 850
	{
$start = 0;
$page = 1;

	{
$start = 0;
$page = 1;

	}


	}


	$multipage = '';

// Build out multipage navigation
if($reputation_count > 0)

	$multipage = '';

// Build out multipage navigation
if($reputation_count > 0)

	{
$multipage = multipage($reputation_count, $mybb->settings['repsperpage'], $page, "reputation.php?uid={$user['uid']}".$s_url);
}


	{
$multipage = multipage($reputation_count, $perpage, $page, "reputation.php?uid={$user['uid']}".$s_url);
}


	// Fetch the reputations which will be displayed on this page
$query = $db->query("
SELECT r.*, r.uid AS rated_uid, u.uid, u.username, u.reputation AS user_reputation, u.usergroup AS user_usergroup, u.displaygroup AS user_displaygroup

	// Fetch the reputations which will be displayed on this page
$query = $db->query("
SELECT r.*, r.uid AS rated_uid, u.uid, u.username, u.reputation AS user_reputation, u.usergroup AS user_usergroup, u.displaygroup AS user_displaygroup

Zeile 845Zeile 867
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.adduid)
WHERE r.uid='{$user['uid']}' $conditions
ORDER BY $order

		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.adduid)
WHERE r.uid='{$user['uid']}' $conditions
ORDER BY $order

		LIMIT $start, {$mybb->settings['repsperpage']}

		LIMIT $start, {$perpage}

	");

// Gather a list of items that have post reputation

	");

// Gather a list of items that have post reputation

Zeile 859Zeile 881
		if($reputation_vote['pid'] && !isset($post_cache[$reputation_vote['pid']]))
{
$post_cache[$reputation_vote['pid']] = $reputation_vote['pid'];

		if($reputation_vote['pid'] && !isset($post_cache[$reputation_vote['pid']]))
{
$post_cache[$reputation_vote['pid']] = $reputation_vote['pid'];

		}

		}

	}

	}





	if(!empty($post_cache))
{

	if(!empty($post_cache))
{

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


























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

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

// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)
{
$sql[] = "p.fid NOT IN ({$unviewable})";
}

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

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


		$query = $db->query("

		$query = $db->query("

			SELECT p.pid, p.uid, p.message, t.tid, t.subject

			SELECT p.pid, p.uid, p.fid, p.visible, p.message, t.tid, t.subject, t.visible AS thread_visible

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

			WHERE p.pid IN ({$sql})

			WHERE {$sql}

		");

		");

 

$forumpermissions = array();


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


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

 
			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(!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'])
{
continue;
}


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

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

Zeile 902Zeile 971
			$reputation_vote['username'] = format_name($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'] = format_name($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']})";

		}

$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 939Zeile 1008
		$postrep_given = '';
if($reputation_vote['pid'])
{

		$postrep_given = '';
if($reputation_vote['pid'])
{

			$link = get_post_link($reputation_vote['pid'])."#pid{$reputation_vote['pid']}";

$thread_link = '';

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



			if(isset($post_reputation[$reputation_vote['pid']]))
{

			if(isset($post_reputation[$reputation_vote['pid']]))
{

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

$thread_link = get_thread_link($post['tid']);
$subject = htmlspecialchars_uni($post['subject']);


				$thread_link = get_thread_link($post_reputation[$reputation_vote['pid']]['tid']);
$subject = htmlspecialchars_uni($parser->parse_badwords($post_reputation[$reputation_vote['pid']]['subject']));




				$thread_link = $lang->sprintf($lang->postrep_given_thread, $thread_link, $subject);

				$thread_link = $lang->sprintf($lang->postrep_given_thread, $thread_link, $subject);

 
				$link = get_post_link($reputation_vote['pid'])."#pid{$reputation_vote['pid']}";

$postrep_given = $lang->sprintf($lang->postrep_given, $link, $user['username'], $thread_link);

			}

			}


$postrep_given = $lang->sprintf($lang->postrep_given, $link, $user['username'], $thread_link);

 
		}

// Does the current user have permission to delete this reputation? Show delete link

		}

// Does the current user have permission to delete this reputation? Show delete link