Vergleich admin/modules/user/users.php - 1.8.10 - 1.8.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 437Zeile 437

if($mybb->request_method == "post")
{


if($mybb->request_method == "post")
{

 
		$plugins->run_hooks("admin_user_users_edit_start");

		if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid']))
{
flash_message($lang->error_no_perms_super_admin, 'error');

		if(is_super_admin($mybb->input['uid']) && $mybb->user['uid'] != $mybb->input['uid'] && !is_super_admin($mybb->user['uid']))
{
flash_message($lang->error_no_perms_super_admin, 'error');

Zeile 848Zeile 849
				flash_message($lang->success_user_updated, 'success');
admin_redirect("index.php?module=user-users");
}

				flash_message($lang->success_user_updated, 'success');
admin_redirect("index.php?module=user-users");
}

 
			$plugins->run_hooks("admin_user_users_edit_end");

		}
}


		}
}


Zeile 1114Zeile 1116

$username = htmlspecialchars_uni($user['username']);
$table->output("{$lang->user_overview}: {$username}");


$username = htmlspecialchars_uni($user['username']);
$table->output("{$lang->user_overview}: {$username}");

 
	$plugins->run_hooks("admin_user_users_edit_overview");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1221Zeile 1224
		$form_container->end();
}


		$form_container->end();
}


 
	$plugins->run_hooks("admin_user_users_edit_profile");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1346Zeile 1350
	$form_container->output_row($lang->other_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $other_options)."</div>");

$form_container->end();

	$form_container->output_row($lang->other_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $other_options)."</div>");

$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_settings");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1480Zeile 1485
	$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));

$form_container->end();

	$form_container->output_row($lang->signature_preferences, "", implode("<br />", $signature_options));

$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_signatur");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1545Zeile 1551
		$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');
}
$form_container->end();

		$form_container->output_row($lang->or_specify_avatar_url, "", $form->generate_text_box('avatar_url', $avatar_url, array('id' => 'avatar_url')), 'avatar_url');
}
$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_avatar");

	echo "</div>\n";

//

	echo "</div>\n";

//

Zeile 1644Zeile 1651


$form_container->end();



$form_container->end();

 
	$plugins->run_hooks("admin_user_users_edit_moderator_options");

	echo "</div>\n";

$plugins->run_hooks("admin_user_users_edit_graph");

	echo "</div>\n";

$plugins->run_hooks("admin_user_users_edit_graph");

Zeile 1962Zeile 1970
			$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("reportedcontent", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("posts", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("privatemessages", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("reportedcontent", $uid_update, "uid='{$source_user['uid']}'");

			$db->update_query("threadratings", $uid_update, "uid='{$source_user['uid']}'");

 
			$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'");
$db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");

			$db->update_query("threads", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", $uid_update, "uid='{$source_user['uid']}'");
$db->update_query("warnings", array("revokedby" => $destination_user['uid']), "revokedby='{$source_user['uid']}'");
$db->update_query("warnings", array("issuedby" => $destination_user['uid']), "issuedby='{$source_user['uid']}'");

 

// Thread ratings
merge_thread_ratings($source_user['uid'], $destination_user['uid']);


// Banning
$db->update_query("banned", array('admin' => $destination_user['uid']), "admin = '{$source_user['uid']}'");


// Banning
$db->update_query("banned", array('admin' => $destination_user['uid']), "admin = '{$source_user['uid']}'");

Zeile 2001Zeile 2011
						continue;
}
}

						continue;
}
}





				$last_result = array(
"rid" => $rep['rid'],
"uid" => $rep['uid']

				$last_result = array(
"rid" => $rep['rid'],
"uid" => $rep['uid']

Zeile 2070Zeile 2080
			$ignored = array_unique(array_merge($source_ignored, $destination_ignored));
// ... and the same for the new ignore list
$ignored_array = array_diff($ignored, array($destination_user['uid'], $source_user['uid']));

			$ignored = array_unique(array_merge($source_ignored, $destination_ignored));
// ... and the same for the new ignore list
$ignored_array = array_diff($ignored, array($destination_user['uid'], $source_user['uid']));





			// Remove any ignored users from the buddy list
$buddies = array_diff($buddies_array, $ignored_array);
// implode the arrays so we get a nice neat list for each

			// Remove any ignored users from the buddy list
$buddies = array_diff($buddies_array, $ignored_array);
// implode the arrays so we get a nice neat list for each

Zeile 2082Zeile 2092
				"ignorelist" => $ignored
);
$db->update_query("users", $lists, "uid='{$destination_user['uid']}'");

				"ignorelist" => $ignored
);
$db->update_query("users", $lists, "uid='{$destination_user['uid']}'");


// Set up user handler.
require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('delete');

// Delete the old user
$userhandler->delete_user($source_user['uid']);

 

// Get a list of forums where post count doesn't apply
$fids = array();
$query = $db->simple_select("forums", "fid", "usepostcounts=0");
while($fid = $db->fetch_field($query, "fid"))


// Get a list of forums where post count doesn't apply
$fids = array();
$query = $db->simple_select("forums", "fid", "usepostcounts=0");
while($fid = $db->fetch_field($query, "fid"))

			{

			{

				$fids[] = $fid;
}


				$fids[] = $fid;
}


Zeile 2109Zeile 2112
			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']

			$num = $db->fetch_array($query);
$updated_count = array(
"postnum" => $num['postnum']

			);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");


			);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");


			// Update user thread count
$query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
$num = $db->fetch_array($query);

			// Update user thread count
$query = $db->simple_select("threads", "COUNT(*) AS threadnum", "uid='".$destination_user['uid']."' {$fids_not_in}");
$num = $db->fetch_array($query);

Zeile 2127Zeile 2130
			}

$plugins->run_hooks("admin_user_users_merge_commit");

			}

$plugins->run_hooks("admin_user_users_merge_commit");

 

// Set up user handler.
require_once MYBB_ROOT.'inc/datahandlers/user.php';
$userhandler = new UserDataHandler('delete');

// Delete the old user
$userhandler->delete_user($source_user['uid']);


$cache->update_awaitingactivation();



$cache->update_awaitingactivation();


Zeile 2167Zeile 2177
	<script type="text/javascript">
<!--
$("#source_username").select2({

	<script type="text/javascript">
<!--
$("#source_username").select2({

		placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 2,
multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",
dataType: \'json\',
data: function (term, page) {

		placeholder: "'.$lang->search_for_a_user.'",
minimumInputLength: 2,
multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2\'s convenient helper
url: "../xmlhttp.php?action=get_users",
dataType: \'json\',
data: function (term, page) {

				return {
query: term // search term
};

				return {
query: term // search term
};

Zeile 2242Zeile 2252
	{
// Build view options from incoming search options
if($mybb->input['vid'])

	{
// Build view options from incoming search options
if($mybb->input['vid'])

		{
$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'");
$admin_view = $db->fetch_array($query);
// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);
}

		{
$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'");
$admin_view = $db->fetch_array($query);
// View does not exist or this view is private and does not belong to the current user
if(!$admin_view['vid'] || ($admin_view['visibility'] == 1 && $admin_view['uid'] != $mybb->user['uid']))
{
unset($admin_view);
}

		}

if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']])

		}

if($mybb->input['search_id'] && $admin_session['data']['user_views'][$mybb->input['search_id']])

Zeile 2390Zeile 2400
		{
// We already have a cookie, so let's use it...
$mybb->input['vid'] = $mybb->cookies['acp_view'];

		{
// We already have a cookie, so let's use it...
$mybb->input['vid'] = $mybb->cookies['acp_view'];

		}

		}


$vid_url = "&amp;vid=".$mybb->input['vid'];
}


$vid_url = "&amp;vid=".$mybb->input['vid'];
}

Zeile 2460Zeile 2470
				$lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));

if($to_update_count != count($selected))

				$lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));

if($to_update_count != count($selected))

				{

				{

					// The update count is different to how many we selected!
$not_updated_count = count($selected) - $to_update_count;
$lang->inline_activated_more = $lang->sprintf($lang->inline_activated_more, my_number_format($not_updated_count));

					// The update count is different to how many we selected!
$not_updated_count = count($selected) - $to_update_count;
$lang->inline_activated_more = $lang->sprintf($lang->inline_activated_more, my_number_format($not_updated_count));

Zeile 2529Zeile 2539
				$sql_array = implode(",", $selected);
// Build a cache array for this users that have been banned already
$query = $db->simple_select("banned", "uid", "uid IN (".$sql_array.")");

				$sql_array = implode(",", $selected);
// Build a cache array for this users that have been banned already
$query = $db->simple_select("banned", "uid", "uid IN (".$sql_array.")");

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

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

					$bannedcache[] = "u_".$user['uid'];
}


					$bannedcache[] = "u_".$user['uid'];
}


Zeile 2566Zeile 2576
							"bantime" => $db->escape_string($mybb->input['bantime']),
"lifted" => $db->escape_string($lifted),
"reason" => $db->escape_string($reason)

							"bantime" => $db->escape_string($mybb->input['bantime']),
"lifted" => $db->escape_string($lifted),
"reason" => $db->escape_string($reason)

						);

						);

						$db->update_query("banned", $update_array, "uid = '".$user['uid']."'");
}
else

						$db->update_query("banned", $update_array, "uid = '".$user['uid']."'");
}
else

Zeile 2742Zeile 2752
							break;
case '3':
$threshold = $base_time * 183; // 6 months = 365 days / 2

							break;
case '3':
$threshold = $base_time * 183; // 6 months = 365 days / 2

							break;

							break;

						case '4':
$threshold = $base_time * 365; // 1 year = 365 days
break;

						case '4':
$threshold = $base_time * 365; // 1 year = 365 days
break;

Zeile 2811Zeile 2821
							$db->delete_query("polls", "tid='$tid'");
$db->delete_query("threadsread", "tid='$tid'");
$db->delete_query("threadratings", "tid='$tid'");

							$db->delete_query("polls", "tid='$tid'");
$db->delete_query("threadsread", "tid='$tid'");
$db->delete_query("threadratings", "tid='$tid'");

						}
}

						}
}


// After deleting threads, rebuild the thread counters for the affected threads
if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0)


// After deleting threads, rebuild the thread counters for the affected threads
if(is_array($prune_array['thread_update']) && count($prune_array['thread_update']) > 0)

Zeile 2822Zeile 2832
						while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);

						while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);

						}
}

						}
}


// After updating thread counters, update the affected forum counters
if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0)


// After updating thread counters, update the affected forum counters
if(is_array($prune_array['forum_update']) && count($prune_array['forum_update']) > 0)

Zeile 2845Zeile 2855
					//log_admin_action();
my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie
flash_message($lang->prune_complete, 'success');

					//log_admin_action();
my_unsetcookie("inlinemod_useracp"); // We've got our users, remove the cookie
flash_message($lang->prune_complete, 'success');

					admin_redirect("index.php?module=user-users".$vid_url);
}
}


					admin_redirect("index.php?module=user-users".$vid_url);
}
}


			$page->output_header($lang->manage_users);
$page->output_nav_tabs($sub_tabs, 'manage_users');


			$page->output_header($lang->manage_users);
$page->output_nav_tabs($sub_tabs, 'manage_users');


Zeile 2862Zeile 2872
			if($errors)
{
$page->output_inline_error($errors);

			if($errors)
{
$page->output_inline_error($errors);

			}

			}


// Display the prune options
$form = new Form("index.php?module=user-users", "post");


// Display the prune options
$form = new Form("index.php?module=user-users", "post");

Zeile 2883Zeile 2893
			// Generate a list of months (1 - 12)
$month_options = array();
$month_options[] = "&nbsp;";

			// Generate a list of months (1 - 12)
$month_options = array();
$month_options[] = "&nbsp;";

			for($i = 1; $i <= 12; ++$i)

			for($i = 1; $i <= 12; ++$i)

			{
$string = "month_{$i}";
$month_options[] = $lang->$string;

			{
$string = "month_{$i}";
$month_options[] = $lang->$string;

Zeile 3092Zeile 3102
			update_admin_session('from', '');
admin_redirect("index.php");
exit;

			update_admin_session('from', '');
admin_redirect("index.php");
exit;

		}
else

		}
else

		{
$errors[] = $lang->error_no_users_found;
}

		{
$errors[] = $lang->error_no_users_found;
}

Zeile 3604Zeile 3614
				$user['view']['warninglevel'] = get_colored_warning_level($warning_level);
}


				$user['view']['warninglevel'] = get_colored_warning_level($warning_level);
}


			if($user['avatar'] && !my_validate_url($user['avatar']))
{
$user['avatar'] = "../{$user['avatar']}";
}
if($view['view_type'] == "card")
{
$scaled_avatar = fetch_scaled_avatar($user, 80, 80);
}
else
{
$scaled_avatar = fetch_scaled_avatar($user, 34, 34);
}
if(!$user['avatar'] || (my_strpos($user['avatar'], '://') !== false && !$mybb->settings['allowremoteavatars']))
{
if(my_validate_url($mybb->settings['useravatar']))
{
$user['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}
else
{
$user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}
}
$user['view']['avatar'] = "<img src=\"".htmlspecialchars_uni($user['avatar'])."\" alt=\"\" width=\"{$scaled_avatar['width']}\" height=\"{$scaled_avatar['height']}\" />";

			if($view['view_type'] == "card")
{
$max_dimensions = '80x80';
}
else
{
$max_dimensions = '34x34';
}

$avatar = format_avatar($user['avatar'], $user['avatardimensions'], $max_dimensions);

$user['view']['avatar'] = "<img src=\"".$avatar['image']."\" alt=\"\" {$avatar['width_height']} />";














// Convert IP's to readable
$user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));


// Convert IP's to readable
$user['regip'] = my_inet_ntop($db->unescape_binary($user['regip']));

			$user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));

			$user['lastip'] = my_inet_ntop($db->unescape_binary($user['lastip']));


if($view['view_type'] == "card")
{
$users .= build_user_view_card($user, $view, $i);


if($view['view_type'] == "card")
{
$users .= build_user_view_card($user, $view, $i);

			}

			}

			else
{
build_user_view_table($user, $view, $table);
}

			else
{
build_user_view_table($user, $view, $table);
}

		}


		}


		// If card view, we need to output the results
if($view['view_type'] == "card")
{

		// If card view, we need to output the results
if($view['view_type'] == "card")
{

Zeile 3659Zeile 3657
	$switch_view = "<div class=\"float_right\">";
$switch_url = $view['url'];
if($mybb->input['page'] > 0)

	$switch_view = "<div class=\"float_right\">";
$switch_url = $view['url'];
if($mybb->input['page'] > 0)

	{

	{

		$switch_url .= "&amp;page=".$mybb->get_input('page', MyBB::INPUT_INT);

		$switch_url .= "&amp;page=".$mybb->get_input('page', MyBB::INPUT_INT);

	}

	}

	if($view['view_type'] != "card")
{
$switch_view .= "<strong>{$lang->table_view}</strong> | <a href=\"{$switch_url}&amp;type=card\" style=\"font-weight: normal;\">{$lang->card_view}</a>";

	if($view['view_type'] != "card")
{
$switch_view .= "<strong>{$lang->table_view}</strong> | <a href=\"{$switch_url}&amp;type=card\" style=\"font-weight: normal;\">{$lang->card_view}</a>";

	}

	}

	else
{
$switch_view .= "<a href=\"{$switch_url}&amp;type=table\" style=\"font-weight: normal;\">{$lang->table_view}</a> | <strong>{$lang->card_view}</strong>";

	else
{
$switch_view .= "<a href=\"{$switch_url}&amp;type=table\" style=\"font-weight: normal;\">{$lang->table_view}</a> | <strong>{$lang->card_view}</strong>";

	}

	}

	$switch_view .= "</div>";

// Do we need to construct the pagination?

	$switch_view .= "</div>";

// Do we need to construct the pagination?

Zeile 3681Zeile 3679
		$search_style = "";
}
else

		$search_style = "";
}
else

	{

	{

		$search_class = '';
$search_style = "text-align: right;";
}

		$search_class = '';
$search_style = "text-align: right;";
}

Zeile 3689Zeile 3687
	$search_action = $view['url'];
// stop &username= in the query string
if($view_upos = strpos($search_action, '&amp;username='))

	$search_action = $view['url'];
// stop &username= in the query string
if($view_upos = strpos($search_action, '&amp;username='))

	{

	{

		$search_action = substr($search_action, 0, $view_upos);
}
$search_action = str_replace("&amp;", "&", $search_action);

		$search_action = substr($search_action, 0, $view_upos);
}
$search_action = str_replace("&amp;", "&", $search_action);

Zeile 3698Zeile 3696
	$built_view .= "<div class=\"{$search_class}\" style=\"padding-bottom: 3px; margin-top: -9px; {$search_style}\">";
$built_view .= $search->generate_hidden_field('action', 'search')."\n";
if(isset($view['conditions']['username']))

	$built_view .= "<div class=\"{$search_class}\" style=\"padding-bottom: 3px; margin-top: -9px; {$search_style}\">";
$built_view .= $search->generate_hidden_field('action', 'search')."\n";
if(isset($view['conditions']['username']))

	{

	{

		$default_class = '';
$value = $view['conditions']['username'];
}

		$default_class = '';
$value = $view['conditions']['username'];
}

Zeile 3763Zeile 3761
		$built_view .= $pagination;
}
if($view['view_type'] != "card")

		$built_view .= $pagination;
}
if($view['view_type'] != "card")

	{
$checkbox = '';
}

	{
$checkbox = '';
}

	else
{
$checkbox = "<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this)\" /> ";

	else
{
$checkbox = "<input type=\"checkbox\" name=\"allbox\" onclick=\"inlineModeration.checkAll(this)\" /> ";

Zeile 3824Zeile 3822
	}

// Loop through fields user wants to show

	}

// Loop through fields user wants to show

	foreach($view['fields'] as $field)
{
if(!$user_view_fields[$field])
{
continue;
}

$view_field = $user_view_fields[$field];


	foreach($view['fields'] as $field)
{
if(!$user_view_fields[$field])
{
continue;
}

$view_field = $user_view_fields[$field];


		// Special conditions for avatar
if($field == "avatar")
{
$avatar = $user['view']['avatar'];

		// Special conditions for avatar
if($field == "avatar")
{
$avatar = $user['view']['avatar'];

		}

		}

		else if($field == "controls")
{
$controls = $user['view']['controls'];

		else if($field == "controls")
{
$controls = $user['view']['controls'];

		}

		}

		// Otherwise, just user data
else if($field != "username")
{

		// Otherwise, just user data
else if($field != "username")
{

Zeile 3852Zeile 3850
			else
{
$value = $user[$field];

			else
{
$value = $user[$field];

			}


			}


			if($field == "postnum")
{
$value = my_number_format($value);

			if($field == "postnum")
{
$value = my_number_format($value);

Zeile 3865Zeile 3863
	}
// Floated to the left or right?
if($i == 1)

	}
// Floated to the left or right?
if($i == 1)

	{

	{

		$float = "left";
}
else

		$float = "left";
}
else

	{

	{

		$float = "right";
}


		$float = "right";
}


Zeile 3877Zeile 3875
	$card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
$card .= "<legend><input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" /> {$user['view']['username']}</legend>\n";
if($avatar)

	$card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";
$card .= "<legend><input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" /> {$user['view']['username']}</legend>\n";
if($avatar)

	{

	{

		$card .= "<div class=\"user_avatar\">{$avatar}</div>\n";
}
if($user_details)

		$card .= "<div class=\"user_avatar\">{$avatar}</div>\n";
}
if($user_details)

	{

	{

		$card .= "<div class=\"user_details\">".implode("<br />", $user_details)."</div>\n";
}
if($controls)

		$card .= "<div class=\"user_details\">".implode("<br />", $user_details)."</div>\n";
}
if($controls)

Zeile 3890Zeile 3888
	}
$card .= "</fieldset>";
return $card;

	}
$card .= "</fieldset>";
return $card;





}

/**

}

/**

Zeile 3899Zeile 3897
 * @param DefaultTable $table
*/
function build_user_view_table($user, $view, &$table)

 * @param DefaultTable $table
*/
function build_user_view_table($user, $view, &$table)

{

{

	global $user_view_fields;

foreach($view['fields'] as $field)

	global $user_view_fields;

foreach($view['fields'] as $field)

Zeile 3924Zeile 3922
		}

if($field == "postnum")

		}

if($field == "postnum")

		{

		{

			$value = my_number_format($user[$field]);
}
$table->construct_cell($value, $field_options);

			$value = my_number_format($user[$field]);
}
$table->construct_cell($value, $field_options);

Zeile 3933Zeile 3931
	$table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" />");

$table->construct_row();

	$table->construct_cell("<input type=\"checkbox\" class=\"checkbox\" name=\"inlinemod_{$user['uid']}\" id=\"inlinemod_{$user['uid']}\" value=\"1\" onclick=\"$('#uid_{$user['uid']}').toggleClass('inline_selected');\" />");

$table->construct_row();

}

/**
* @param array $user
* @param int $max_width
* @param int $max_height
*
* @return array
*/
function fetch_scaled_avatar($user, $max_width=80, $max_height=80)
{
$scaled_dimensions = array(
"width" => $max_width,
"height" => $max_height,
);

global $mybb;

if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))
{
if($user['avatardimensions'])
{
require_once MYBB_ROOT."inc/functions_image.php";
list($width, $height) = explode("|", $user['avatardimensions']);
$scaled_dimensions = scale_image($width, $height, $max_width, $max_height);
}
}

return array("width" => $scaled_dimensions['width'], "height" => $scaled_dimensions['height']);

 
}

/**

}

/**

Zeile 3990Zeile 3959
		switch($type)
{
case "multiselect":

		switch($type)
{
case "multiselect":

				if(!is_array($values[$field_name]))
{
$user_options = explode("\n", $values[$field_name]);
}


				$selected_options = array();
if(!is_array($values[$field_name]))
{
$user_options = explode("\n", $values[$field_name]);
}

				else
{
$user_options = $values[$field_name];

				else
{
$user_options = $values[$field_name];

				}

$selected_options = array();

				}



				foreach($user_options as $val)
{
$selected_options[$val] = htmlspecialchars_uni($val);

				foreach($user_options as $val)
{
$selected_options[$val] = htmlspecialchars_uni($val);

Zeile 4007Zeile 3977

$select_options = explode("\n", $options);
$options = array();


$select_options = explode("\n", $options);
$options = array();

				if($search == true)

				if($search == true)

				{
$select_options[''] = $lang->na;
}

				{
$select_options[''] = $lang->na;
}

Zeile 4028Zeile 3998
				if($search == true)
{
$select_options[''] = $lang->na;

				if($search == true)
{
$select_options[''] = $lang->na;

				}

				}

				$select_options += explode("\n", $options);
$options = array();
foreach($select_options as $val)

				$select_options += explode("\n", $options);
$options = array();
foreach($select_options as $val)

Zeile 4064Zeile 4034
				}
break;
case "checkbox":

				}
break;
case "checkbox":

 
				$select_options = array();

				if(!is_array($values[$field_name]))

				if(!is_array($values[$field_name]))

				{

				{

					$user_options = explode("\n", $values[$field_name]);

					$user_options = explode("\n", $values[$field_name]);

				}

				}

				else
{
$user_options = $values[$field_name];
}

				else
{
$user_options = $values[$field_name];
}

 
				
$selected_options = array();

				foreach($user_options as $val)
{
$selected_options[$val] = $val;
}

				foreach($user_options as $val)
{
$selected_options[$val] = $val;
}

				$select_options = array();

				

				if($search == true)
{
$select_options[''] = $lang->na;

				if($search == true)
{
$select_options[''] = $lang->na;

Zeile 4133Zeile 4106
	}

if(!is_array($input['profile_fields']))

	}

if(!is_array($input['profile_fields']))

	{

	{

		$input['profile_fields'] = my_unserialize($input['profile_fields']);
}


		$input['profile_fields'] = my_unserialize($input['profile_fields']);
}


Zeile 4239Zeile 4212
});
// -->
</script>';

});
// -->
</script>';

 
}

/**
* @param int $source_uid
* @param int $destination_uid
*/
function merge_thread_ratings($source_uid, $destination_uid)
{
global $db;

$source_ratings = $dest_threads = $delete_list = $decrement_list = array();

// Get all thread ratings from both accounts
$query = $db->simple_select('threadratings', 'tid, uid, rid, rating', "uid IN ({$destination_uid}, {$source_uid})");
while($rating = $db->fetch_array($query))
{
if($rating['uid'] == $destination_uid)
{
$dest_threads[] = $rating['tid'];
}
else
{
$source_ratings[] = $rating;
}
}

// If there are duplicates, mark them for deletion
foreach($source_ratings as $rating)
{
if(in_array($rating['tid'], $dest_threads))
{
$delete_list[] = $rating['rid'];
$decrement_list[$rating['tid']][] = (int) $rating['rating'];
}
}

// Attribute all of the source user's ratings to the destination user
$db->update_query("threadratings", array("uid" => $destination_uid), "uid='{$source_uid}'");

// Remove ratings previously given to recently acquired threads
$query = $db->query("
SELECT tr.rid, tr.rating, t.tid
FROM {$db->table_prefix}threadratings tr
LEFT JOIN {$db->table_prefix}threads t ON (t.tid=tr.tid)
WHERE tr.uid='{$destination_uid}' AND tr.uid=t.uid
");
while($rating = $db->fetch_array($query))
{
$delete_list[] = $rating['rid'];
$decrement_list[$rating['tid']][] = (int) $rating['rating'];
}

// Delete the duplicate/disallowed ratings
if(!empty($delete_list))
{
$imp = implode(',', $delete_list);
$db->delete_query('threadratings', "rid IN ({$imp})");
}

// Correct the thread rating counters
if(!empty($decrement_list))
{
foreach($decrement_list as $tid => $ratings)
{
$db->update_query('threads', array('numratings' => 'numratings-'.count($ratings), 'totalratings' => 'totalratings-'.array_sum($ratings)), "tid='{$tid}'", 1, true);
}
}

}

}