Vergleich admin/modules/user/users.php - 1.8.16 - 1.8.24

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 512Zeile 512
			"profile_fields_editable" => true,
"website" => $mybb->input['website'],
"icq" => $mybb->input['icq'],

			"profile_fields_editable" => true,
"website" => $mybb->input['website'],
"icq" => $mybb->input['icq'],

			"yahoo" => $mybb->input['yahoo'],

 
			"skype" => $mybb->input['skype'],
"google" => $mybb->input['google'],
"birthday" => array(

			"skype" => $mybb->input['skype'],
"google" => $mybb->input['google'],
"birthday" => array(

Zeile 645Zeile 644
						}

// Because Gravatars are square, hijack the width

						}

// Because Gravatars are square, hijack the width

						list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

						list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));


$s = "?s={$maxwidth}";
$maxheight = (int)$maxwidth;


$s = "?s={$maxwidth}";
$maxheight = (int)$maxwidth;

Zeile 693Zeile 692
						{
if($width && $height && $mybb->settings['maxavatardims'] != "")
{

						{
if($width && $height && $mybb->settings['maxavatardims'] != "")
{

								list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

								list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

								if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);

								if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);

Zeile 929Zeile 928

$page->extra_header .= <<<EOF



$page->extra_header .= <<<EOF


	<link rel="stylesheet" href="../jscripts/sceditor/editor_themes/mybb.css" type="text/css" media="all" />
<script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1805"></script>
<script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1808"></script>
<script type="text/javascript" src="../jscripts/sceditor/editor_plugins/undo.js?ver=1805"></script>

	<link rel="stylesheet" href="../jscripts/sceditor/themes/mybb.css" type="text/css" media="all" />
<script type="text/javascript" src="../jscripts/sceditor/jquery.sceditor.bbcode.min.js?ver=1822"></script>
<script type="text/javascript" src="../jscripts/bbcodes_sceditor.js?ver=1824"></script>
<script type="text/javascript" src="../jscripts/sceditor/plugins/undo.js?ver=1805"></script>

EOF;
$page->output_header($lang->edit_user);


EOF;
$page->output_header($lang->edit_user);


Zeile 977Zeile 976
	$table->construct_header($lang->general_account_stats, array('colspan' => '2', 'class' => 'align_center'));

// Avatar

	$table->construct_header($lang->general_account_stats, array('colspan' => '2', 'class' => 'align_center'));

// Avatar

	$avatar_dimensions = explode("|", $user['avatardimensions']);
if($user['avatar'] && (my_strpos($user['avatar'], '://') === false || $mybb->settings['allowremoteavatars']))














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

	{

	{

		if($user['avatardimensions'])

		if(!my_validate_url($user['avatar']))

		{

		{

			require_once MYBB_ROOT."inc/functions_image.php";
list($width, $height) = explode("|", $user['avatardimensions']);
$scaled_dimensions = scale_image($width, $height, 120, 120);
}
else
{
$scaled_dimensions = array(
"width" => 120,
"height" => 120
);
}
if(!my_validate_url($user['avatar']))
{
$user['avatar'] = "../{$user['avatar']}\n";

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













		}
}
else
{
if(my_validate_url($mybb->settings['useravatar']))

		}
}
else
{
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['avatar'] = str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}
else
{
$user['avatar'] = "../".str_replace('{theme}', 'images', $mybb->settings['useravatar']);
}

		$scaled_dimensions = array(
"width" => 120,
"height" => 120
);

 
	}
$avatar_top = ceil((126-$scaled_dimensions['height'])/2);

	}
$avatar_top = ceil((126-$scaled_dimensions['height'])/2);

	if($user['lastactive'])


	$last_seen = max(array($user['lastactive'], $user['lastvisit']));
if(!empty($last_seen))

	{

	{

		$last_active = my_date('relative', $user['lastactive']);

		$last_active = my_date('relative', $last_seen);

	}
else
{

	}
else
{

Zeile 1075Zeile 1072
		if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

		if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;

		}


		}


		$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)
{

		$warning_level = round($user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
if($warning_level > 100)
{

Zeile 1162Zeile 1159
	$form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');
$form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->input['website'], array('id' => 'website')), 'website');
$form_container->output_row($lang->icq_number, "", $form->generate_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');

	$form_container->output_row($lang->custom_user_title, $lang->custom_user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');
$form_container->output_row($lang->website, "", $form->generate_text_box('website', $mybb->input['website'], array('id' => 'website')), 'website');
$form_container->output_row($lang->icq_number, "", $form->generate_numeric_field('icq', $mybb->input['icq'], array('id' => 'icq', 'min' => 0)), 'icq');

	$form_container->output_row($lang->yahoo_messanger_handle, "", $form->generate_text_box('yahoo', $mybb->input['yahoo'], array('id' => 'yahoo')), 'yahoo');

 
	$form_container->output_row($lang->skype_handle, "", $form->generate_text_box('skype', $mybb->input['skype'], array('id' => 'skype')), 'skype');
$form_container->output_row($lang->google_handle, "", $form->generate_text_box('google', $mybb->input['google'], array('id' => 'google')), 'google');


	$form_container->output_row($lang->skype_handle, "", $form->generate_text_box('skype', $mybb->input['skype'], array('id' => 'skype')), 'skype');
$form_container->output_row($lang->google_handle, "", $form->generate_text_box('google', $mybb->input['google'], array('id' => 'google')), 'google');


Zeile 1228Zeile 1224
	//
// ACCOUNT SETTINGS
//

	//
// ACCOUNT SETTINGS
//


// Plugin hook note - we should add hooks in above each output_row for the below so users can add their own options to each group :>

 

echo "<div id=\"tab_settings\">\n";
$form_container = new FormContainer($lang->account_settings.': '.htmlspecialchars_uni($user['username']));
$login_options = array(
$form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->input['invisible'])),


echo "<div id=\"tab_settings\">\n";
$form_container = new FormContainer($lang->account_settings.': '.htmlspecialchars_uni($user['username']));
$login_options = array(
$form->generate_check_box("invisible", 1, $lang->hide_from_whos_online, array("checked" => $mybb->input['invisible'])),

	);

	);

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

if($mybb->input['pmnotice'] > 1)

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

if($mybb->input['pmnotice'] > 1)

Zeile 1254Zeile 1248
		$form->generate_check_box("buddyrequestsauto", 1, $lang->buddy_requests_auto, array("checked" => $mybb->input['buddyrequestsauto'])),
"<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_notification, $lang->instant_email_notification, $lang->instant_pm_notification), $mybb->input['subscriptionmethod'], array('id' => 'subscriptionmethod'))
);

		$form->generate_check_box("buddyrequestsauto", 1, $lang->buddy_requests_auto, array("checked" => $mybb->input['buddyrequestsauto'])),
"<label for=\"subscriptionmethod\">{$lang->default_thread_subscription_mode}:</label><br />".$form->generate_select_box("subscriptionmethod", array($lang->do_not_subscribe, $lang->no_notification, $lang->instant_email_notification, $lang->instant_pm_notification), $mybb->input['subscriptionmethod'], array('id' => 'subscriptionmethod'))
);

 

// Allow plugins to add messaging options
$messaging_options = $plugins->run_hooks('admin_user_users_edit_messaging_options', $messaging_options);

// Output messaging options

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

$date_format_options = array($lang->use_default);

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

$date_format_options = array($lang->use_default);

Zeile 1274Zeile 1273
		"<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->input['timezone']),
"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection'))
);

		"<label for=\"timezone\">{$lang->time_zone}:</label><br />".build_timezone_select("timezone", $mybb->input['timezone']),
"<label for=\"dstcorrection\">{$lang->daylight_savings_time_correction}:</label><br />".$form->generate_select_box("dstcorrection", array(2 => $lang->automatically_detect, 1 => $lang->always_use_dst_correction, 0 => $lang->never_use_dst_correction), $mybb->input['dstcorrection'], array('id' => 'dstcorrection'))
);

 

// Allow plugins to add date options
$date_options = $plugins->run_hooks('admin_user_users_edit_date_options', $date_options);

// Output date options

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



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



Zeile 1308Zeile 1312
		"<label for=\"tpp\">{$lang->threads_per_page}:</label><br />".$form->generate_select_box("tpp", $tpp_options, $mybb->input['tpp'], array('id' => 'tpp')),
"<label for=\"daysprune\">{$lang->default_thread_age_view}:</label><br />".$form->generate_select_box("daysprune", $thread_age_options, $mybb->input['daysprune'], array('id' => 'daysprune'))
);

		"<label for=\"tpp\">{$lang->threads_per_page}:</label><br />".$form->generate_select_box("tpp", $tpp_options, $mybb->input['tpp'], array('id' => 'tpp')),
"<label for=\"daysprune\">{$lang->default_thread_age_view}:</label><br />".$form->generate_select_box("daysprune", $thread_age_options, $mybb->input['daysprune'], array('id' => 'daysprune'))
);

 

// Allow plugins to add forum options
$forum_options = $plugins->run_hooks('admin_user_users_edit_forum_options', $forum_options);

// Output forum options

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

$ppp_options = array($lang->use_default);

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

$ppp_options = array($lang->use_default);

Zeile 1334Zeile 1343
		"<label for=\"ppp\">{$lang->posts_per_page}:</label><br />".$form->generate_select_box("ppp", $ppp_options, $mybb->input['ppp'], array('id' => 'ppp')),
"<label for=\"threadmode\">{$lang->default_thread_view_mode}:</label><br />".$form->generate_select_box("threadmode", array("" => $lang->use_default, "linear" => $lang->linear_mode, "threaded" => $lang->threaded_mode), $mybb->input['threadmode'], array('id' => 'threadmode'))
);

		"<label for=\"ppp\">{$lang->posts_per_page}:</label><br />".$form->generate_select_box("ppp", $ppp_options, $mybb->input['ppp'], array('id' => 'ppp')),
"<label for=\"threadmode\">{$lang->default_thread_view_mode}:</label><br />".$form->generate_select_box("threadmode", array("" => $lang->use_default, "linear" => $lang->linear_mode, "threaded" => $lang->threaded_mode), $mybb->input['threadmode'], array('id' => 'threadmode'))
);

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







// Allow plugins to add thread options
$thread_options = $plugins->run_hooks('admin_user_users_edit_thread_options', $thread_options);

// Output thread options
$form_container->output_row($lang->thread_view_options, "", "<div class=\"user_settings_bit\">".implode("</div><div class=\"user_settings_bit\">", $thread_options)."</div>");


$languages = array_merge(array('' => $lang->use_default), $lang->get_languages());



$languages = array_merge(array('' => $lang->use_default), $lang->get_languages());


Zeile 1345Zeile 1359
		"<label for=\"style\">{$lang->theme}:</label><br />".build_theme_select("style", $mybb->input['style'], 0, "", true, false, true),
"<label for=\"language\">{$lang->board_language}:</label><br />".$form->generate_select_box("language", $languages, $mybb->input['language'], array('id' => 'language'))
);

		"<label for=\"style\">{$lang->theme}:</label><br />".build_theme_select("style", $mybb->input['style'], 0, "", true, false, true),
"<label for=\"language\">{$lang->board_language}:</label><br />".$form->generate_select_box("language", $languages, $mybb->input['language'], array('id' => 'language'))
);

 

// Allow plugins to add other options
$other_options = $plugins->run_hooks('admin_user_users_edit_other_options', $other_options);

// Output other options

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

Zeile 1513Zeile 1532

if($mybb->settings['maxavatardims'] != "")
{


if($mybb->settings['maxavatardims'] != "")
{

		list($max_width, $max_height) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

		list($max_width, $max_height) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

		$max_size = "<br />{$lang->max_dimensions_are} {$max_width}x{$max_height}";
}


		$max_size = "<br />{$lang->max_dimensions_are} {$max_width}x{$max_height}";
}


Zeile 1918Zeile 1937

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


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

		$source_user = get_user_by_username($mybb->input['source_username'], array('fields' => '*'));
if(!$source_user['uid'])

		foreach(array('source', 'destination') as $target)


		{

		{

			$errors[] = $lang->error_invalid_user_source;
}

$destination_user = get_user_by_username($mybb->input['destination_username'], array('fields' => '*'));
if(!$destination_user['uid'])
{
$errors[] = $lang->error_invalid_user_destination;

			${$target.'_user'} = get_user_by_username($mybb->input[$target.'_username'], array('fields' => '*'));
if(!${$target.'_user'}['uid'])
{
$errors[] = $lang->{'error_invalid_user_'.$target};
}



		}

// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action

		}

// If we're not a super admin and we're merging a source super admin or a destination super admin then dissallow this action

Zeile 1937Zeile 1953
			admin_redirect("index.php?module=user-users");
}


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


		if($source_user['uid'] == $destination_user['uid'])

		if($source_user['uid'] == $destination_user['uid'] && !empty($source_user['uid']))

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

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

Zeile 1978Zeile 1994

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

 

// Carry over referrals
$db->update_query("users", array("referrer" => $destination_user['uid']), "referrer='{$source_user['uid']}' AND uid!='{$destination_user['uid']}'");
// If destination user has no referrer but source does and source user was not referred by destination user
// or destination user was referred by the source user
if(($destination_user['referrer'] == 0 && $source_user['referrer'] > 0 && $source_user['referrer'] != $destination_user['uid']) || $destination_user['referrer'] == $source_user['uid'])
{
$db->update_query("users", array("referrer" => $source_user['referrer']), "uid='{$destination_user['uid']}'");
}
$query = $db->simple_select("users", "COUNT(uid) as total_referrals", "referrer='{$destination_user['uid']}' AND uid!='{$source_user['uid']}'");
$new_referrals = $db->fetch_field($query, "total_referrals");
$db->update_query("users", array("referrals" => (int)$new_referrals), "uid='{$destination_user['uid']}'");


// Merging Reputation
// First, let's change all the details over to our new user...


// Merging Reputation
// First, let's change all the details over to our new user...

Zeile 1998Zeile 2026
				{
// Multiple reputation is disallowed, and this isn't a post, so let's remove this comment
$to_remove[] = $rep['rid'];

				{
// Multiple reputation is disallowed, and this isn't a post, so let's remove this comment
$to_remove[] = $rep['rid'];

				}


				}


				// Remove comments or posts liked by "me"
if($last_result['uid'] == $destination_user['uid'] || $rep['uid'] == $destination_user['uid'])
{

				// Remove comments or posts liked by "me"
if($last_result['uid'] == $destination_user['uid'] || $rep['uid'] == $destination_user['uid'])
{

Zeile 2009Zeile 2037
						continue;
}
}

						continue;
}
}





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

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

Zeile 2036Zeile 2064
				WHERE uid='{$source_user['uid']}' AND expired='0'
");
$original_warn_level = $db->fetch_field($query, "warn_lev");

				WHERE uid='{$source_user['uid']}' AND expired='0'
");
$original_warn_level = $db->fetch_field($query, "warn_lev");





			$query = $db->query("
SELECT SUM(points) as warn_lev
FROM ".TABLE_PREFIX."warnings

			$query = $db->query("
SELECT SUM(points) as warn_lev
FROM ".TABLE_PREFIX."warnings

Zeile 2054Zeile 2082
			$db->update_query("threads", $last_poster, "lastposteruid='{$source_user['uid']}'");
$edit_uid = array(
"edituid" => $destination_user['uid']

			$db->update_query("threads", $last_poster, "lastposteruid='{$source_user['uid']}'");
$edit_uid = array(
"edituid" => $destination_user['uid']

			);

			);

			$db->update_query("posts", $edit_uid, "edituid='{$source_user['uid']}'");

$from_uid = array(
"fromid" => $destination_user['uid']

			$db->update_query("posts", $edit_uid, "edituid='{$source_user['uid']}'");

$from_uid = array(
"fromid" => $destination_user['uid']

			);

			);

			$db->update_query("privatemessages", $from_uid, "fromid='{$source_user['uid']}'");
$to_uid = array(
"toid" => $destination_user['uid']

			$db->update_query("privatemessages", $from_uid, "fromid='{$source_user['uid']}'");
$to_uid = array(
"toid" => $destination_user['uid']

Zeile 2072Zeile 2100
			$buddies = array_unique(array_merge($source_buddies, $destination_buddies));
// Make sure the new buddy list doesn't contain either users
$buddies_array = array_diff($buddies, array($destination_user['uid'], $source_user['uid']));

			$buddies = array_unique(array_merge($source_buddies, $destination_buddies));
// Make sure the new buddy list doesn't contain either users
$buddies_array = array_diff($buddies, array($destination_user['uid'], $source_user['uid']));





			$destination_ignored = explode(',', $destination_user['ignorelist']);
$source_ignored = explode(',', $destination_user['ignorelist']);
$ignored = array_unique(array_merge($source_ignored, $destination_ignored));

			$destination_ignored = explode(',', $destination_user['ignorelist']);
$source_ignored = explode(',', $destination_user['ignorelist']);
$ignored = array_unique(array_merge($source_ignored, $destination_ignored));

Zeile 2175Zeile 2203
	<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) {
return {
query: term // search term
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};

		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
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};

			}
},
initSelection: function(element, callback) {

			}
},
initSelection: function(element, callback) {

Zeile 2218Zeile 2246
			results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};

			results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};

			}
},

			}
},

		initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {

		initSelection: function(element, callback) {
var query = $(element).val();
if (query !== "") {

Zeile 2321Zeile 2349
		$plugins->run_hooks("admin_user_users_search_commit");

$results = build_users_view($admin_view);

		$plugins->run_hooks("admin_user_users_search_commit");

$results = build_users_view($admin_view);





		if($results)
{
$page->output_header($lang->find_users);

		if($results)
{
$page->output_header($lang->find_users);

Zeile 2467Zeile 2495
				$to_update_count = count($to_update);
$lang->inline_activated = $lang->sprintf($lang->inline_activated, my_number_format($to_update_count));


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


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

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

				{
// The update count is different to how many we selected!
$not_updated_count = count($selected) - $to_update_count;

				{
// The update count is different to how many we selected!
$not_updated_count = count($selected) - $to_update_count;

Zeile 2512Zeile 2540
					$db->delete_query("banned", "uid = '".$ban['uid']."'");
}


					$db->delete_query("banned", "uid = '".$ban['uid']."'");
}


				$cache->update_banned();

 
				$cache->update_moderators();

$mybb->input['action'] = "inline_lift";

				$cache->update_moderators();

$mybb->input['action'] = "inline_lift";

Zeile 2526Zeile 2553
			else
{
$page->output_confirm_action("index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multilift", $lang->confirm_multilift);

			else
{
$page->output_confirm_action("index.php?module=user-users&amp;action=inline_edit&amp;inline_action=multilift", $lang->confirm_multilift);

			}


			}


			break;
case 'multiban':
if($mybb->input['processed'] == 1)

			break;
case 'multiban':
if($mybb->input['processed'] == 1)

Zeile 2606Zeile 2633
					$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'");
$db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'");


					$db->delete_query("forumsubscriptions", "uid = '{$user['uid']}'");
$db->delete_query("threadsubscriptions", "uid = '{$user['uid']}'");


					$cache->update_banned();

 
					++$banned_count;
}
$mybb->input['action'] = "inline_banned";

					++$banned_count;
}
$mybb->input['action'] = "inline_banned";

Zeile 2629Zeile 2655
			$table->output($lang->important);

// If there's any errors, display inline

			$table->output($lang->important);

// If there's any errors, display inline

			if($errors)

			if($errors)

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

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

Zeile 2950Zeile 2976

// Do the usergroup update for all those selected
// If the a selected user is a super admin, don't update that user


// Do the usergroup update for all those selected
// If the a selected user is a super admin, don't update that user

 
				$users_to_update = array();

				foreach($selected as $user)
{
if(!is_super_admin($user))

				foreach($selected as $user)
{
if(!is_super_admin($user))

Zeile 2959Zeile 2986
				}

$to_update_count = count($users_to_update);

				}

$to_update_count = count($users_to_update);

				if($to_update_count > 0 && is_array($users_to_update))

				if($to_update_count > 0)

				{
// Update the users in the database
$sql = implode(",", $users_to_update);

				{
// Update the users in the database
$sql = implode(",", $users_to_update);

Zeile 3235Zeile 3262
	// Build the search SQL for users

// List of valid LIKE search fields

	// Build the search SQL for users

// List of valid LIKE search fields

	$user_like_fields = array("username", "email", "website", "icq", "yahoo", "skype", "google", "signature", "usertitle");

	$user_like_fields = array("username", "email", "website", "icq", "skype", "google", "signature", "usertitle");

	foreach($user_like_fields as $search_field)
{
if(!empty($view['conditions'][$search_field]) && !$view['conditions'][$search_field.'_blank'])

	foreach($user_like_fields as $search_field)
{
if(!empty($view['conditions'][$search_field]) && !$view['conditions'][$search_field.'_blank'])

Zeile 3446Zeile 3473
		SELECT COUNT(u.uid) AS num_results
FROM ".TABLE_PREFIX."users u
WHERE {$search_sql}

		SELECT COUNT(u.uid) AS num_results
FROM ".TABLE_PREFIX."users u
WHERE {$search_sql}

	");

	");

	$num_results = $db->fetch_field($query, "num_results");

// No matching results then return false
if(!$num_results)

	$num_results = $db->fetch_field($query, "num_results");

// No matching results then return false
if(!$num_results)

	{

	{

		return false;
}
// Generate the list of results

		return false;
}
// Generate the list of results

Zeile 3460Zeile 3487
		if(!$view['perpage'])
{
$view['perpage'] = 20;

		if(!$view['perpage'])
{
$view['perpage'] = 20;

		}

		}

		$view['perpage'] = (int)$view['perpage'];

// Establish which page we're viewing and the starting index for querying
if(!isset($mybb->input['page']))
{

		$view['perpage'] = (int)$view['perpage'];

// Establish which page we're viewing and the starting index for querying
if(!isset($mybb->input['page']))
{

			$mybb->input['page'] = 1;
}
else
{

			$mybb->input['page'] = 1;
}
else
{

			$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);
}

if($mybb->input['page'])
{
$start = ($mybb->input['page'] - 1) * $view['perpage'];

			$mybb->input['page'] = $mybb->get_input('page', MyBB::INPUT_INT);
}

if($mybb->input['page'])
{
$start = ($mybb->input['page'] - 1) * $view['perpage'];

 
			$pages = ceil($num_results / $view['perpage']);
if($mybb->input['page'] > $pages)
{
$start = 0;
$mybb->input['page'] = 1;
}

		}
else
{
$start = 0;
$mybb->input['page'] = 1;

		}
else
{
$start = 0;
$mybb->input['page'] = 1;

		}

		}


$from_bit = "";
if(isset($mybb->input['from']) && $mybb->input['from'] == "home")
{
$from_bit = "&amp;from=home";


$from_bit = "";
if(isset($mybb->input['from']) && $mybb->input['from'] == "home")
{
$from_bit = "&amp;from=home";

		}


		}


		switch($view['sortby'])
{
case "regdate":

		switch($view['sortby'])
{
case "regdate":

Zeile 3496Zeile 3529
			case "postnum":
case "reputation":
$view['sortby'] = $db->escape_string($view['sortby']);

			case "postnum":
case "reputation":
$view['sortby'] = $db->escape_string($view['sortby']);

				break;

				break;

			case "numposts":
$view['sortby'] = "postnum";
break;

			case "numposts":
$view['sortby'] = "postnum";
break;

Zeile 3508Zeile 3541
				break;
default:
$view['sortby'] = "username";

				break;
default:
$view['sortby'] = "username";

		}


		}


		if($view['sortorder'] != "desc")
{
$view['sortorder'] = "asc";

		if($view['sortorder'] != "desc")
{
$view['sortorder'] = "asc";

		}

$usergroups = $cache->read("usergroups");


		}

$usergroups = $cache->read("usergroups");


		// Fetch matching users
$query = $db->query("
SELECT u.*

		// Fetch matching users
$query = $db->query("
SELECT u.*

Zeile 3549Zeile 3582
			$user['view']['additionalgroups'] = "<small>{$groups_list}</small>";
$user['view']['email'] = "<a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>";
$user['view']['regdate'] = my_date('relative', $user['regdate']);

			$user['view']['additionalgroups'] = "<small>{$groups_list}</small>";
$user['view']['email'] = "<a href=\"mailto:".htmlspecialchars_uni($user['email'])."\">".htmlspecialchars_uni($user['email'])."</a>";
$user['view']['regdate'] = my_date('relative', $user['regdate']);

			$user['view']['lastactive'] = my_date('relative', $user['lastactive']);









			$last_seen = max(array($user['lastactive'], $user['lastvisit']));
if(!empty($last_seen))
{
$user['view']['lastactive'] = my_date('relative', $last_seen);
}
else
{
$user['view']['lastactive'] = $lang->never;
}


// Build popup menu
$popup = new PopupMenu("user_{$user['uid']}", $lang->options);


// Build popup menu
$popup = new PopupMenu("user_{$user['uid']}", $lang->options);

Zeile 3622Zeile 3663
			}

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

			}

$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['view']['avatar'] = "<img src=\"".$avatar['image']."\" alt=\"\" {$avatar['width_height']} />";

// Convert IP's to readable

Zeile 3657Zeile 3698
	if($mybb->input['page'] > 0)
{
$switch_url .= "&amp;page=".$mybb->get_input('page', MyBB::INPUT_INT);

	if($mybb->input['page'] > 0)
{
$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>";

Zeile 3711Zeile 3752
	}
$built_view .= "<script type=\"text/javascript\">
var form = $(\"#search_form\");

	}
$built_view .= "<script type=\"text/javascript\">
var form = $(\"#search_form\");

		form.submit(function() {

		form.on('submit', function() {

			var search = $('#search_keywords');
if(search.val() == '' || search.val() == '".addcslashes($lang->search_for_user, "'")."')
{

			var search = $('#search_keywords');
if(search.val() == '' || search.val() == '".addcslashes($lang->search_for_user, "'")."')
{

				search.focus();

				search.trigger('focus');

				return false;
}
});

var search = $(\"#search_keywords\");

				return false;
}
});

var search = $(\"#search_keywords\");

		search.focus(function()

		search.on('focus', function()

		{
var searched_focus = $(this);
if(searched_focus.val() == '".addcslashes($lang->search_for_user, "'")."')

		{
var searched_focus = $(this);
if(searched_focus.val() == '".addcslashes($lang->search_for_user, "'")."')

Zeile 3729Zeile 3770
				searched_focus.removeClass(\"search_default\");
searched_focus.val(\"\");
}

				searched_focus.removeClass(\"search_default\");
searched_focus.val(\"\");
}

		});

search.blur(function()

		}).on('blur', function()



		{
var searched_blur = $(this);
if(searched_blur.val() == \"\")

		{
var searched_blur = $(this);
if(searched_blur.val() == \"\")

Zeile 3773Zeile 3812
	}

$built_view .= '

	}

$built_view .= '

<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1800"></script>

<script type="text/javascript" src="'.$mybb->settings['bburl'].'/jscripts/inline_moderation.js?ver=1821"></script>

<form action="index.php?module=user-users" method="post">
<input type="hidden" name="my_post_key" value="'.$mybb->post_code.'" />
<input type="hidden" name="action" value="inline_edit" />

<form action="index.php?module=user-users" method="post">
<input type="hidden" name="my_post_key" value="'.$mybb->post_code.'" />
<input type="hidden" name="action" value="inline_edit" />

Zeile 3870Zeile 3909
	}

// And build the final card

	}

// And build the final card

 
	$uname = "";
if(in_array('username', $view['fields']))
{
$uname = $user['view']['username'];
}

	$card = "<fieldset id=\"uid_{$user['uid']}\" style=\"width: 47%; float: {$float};\">\n";

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

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

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

	if($avatar)
{
$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 3920Zeile 3964
		}

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

	}

$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_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_row();
}


Zeile 3940Zeile 3984
 */
function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false)
{

 */
function output_custom_profile_fields($fields, $values, &$form_container, &$form, $search=false)
{

	global $lang;

	global $lang, $mybb;


if(!is_array($fields))
{


if(!is_array($fields))
{

Zeile 3953Zeile 3997
		list($type, $options) = explode("\n", $profile_field['type'], 2);
$type = trim($type);
$field_name = "fid{$profile_field['fid']}";

		list($type, $options) = explode("\n", $profile_field['type'], 2);
$type = trim($type);
$field_name = "fid{$profile_field['fid']}";





		switch($type)
{
case "multiselect":
$selected_options = array();
if(!is_array($values[$field_name]))

		switch($type)
{
case "multiselect":
$selected_options = array();
if(!is_array($values[$field_name]))

				{

				{

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

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

Zeile 3967Zeile 4011
					$user_options = $values[$field_name];
}


					$user_options = $values[$field_name];
}


				



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

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

				}


				}


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

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

Zeile 4041Zeile 4085
				{
$user_options = $values[$field_name];
}

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

				



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

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

				



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

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

Zeile 4122Zeile 4166
	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = htmlspecialchars_uni($usergroup['title']);

	}


	}


	$form_container->output_row($lang->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');

$form_container->output_row($lang->website_contains, "", $form->generate_text_box('conditions[website]', $input['conditions']['website'], array('id' => 'website'))." {$lang->or} ".$form->generate_check_box('conditions[website_blank]', 1, $lang->is_not_blank, array('id' => 'website_blank', 'checked' => $input['conditions']['website_blank'])), 'website');
$form_container->output_row($lang->icq_number_contains, "", $form->generate_text_box('conditions[icq]', $input['conditions']['icq'], array('id' => 'icq'))." {$lang->or} ".$form->generate_check_box('conditions[icq_blank]', 1, $lang->is_not_blank, array('id' => 'icq_blank', 'checked' => $input['conditions']['icq_blank'])), 'icq');

	$form_container->output_row($lang->is_member_of_groups, $lang->additional_user_groups_desc, $form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5)), 'usergroups');

$form_container->output_row($lang->website_contains, "", $form->generate_text_box('conditions[website]', $input['conditions']['website'], array('id' => 'website'))." {$lang->or} ".$form->generate_check_box('conditions[website_blank]', 1, $lang->is_not_blank, array('id' => 'website_blank', 'checked' => $input['conditions']['website_blank'])), 'website');
$form_container->output_row($lang->icq_number_contains, "", $form->generate_text_box('conditions[icq]', $input['conditions']['icq'], array('id' => 'icq'))." {$lang->or} ".$form->generate_check_box('conditions[icq_blank]', 1, $lang->is_not_blank, array('id' => 'icq_blank', 'checked' => $input['conditions']['icq_blank'])), 'icq');

	$form_container->output_row($lang->yahoo_contains, "", $form->generate_text_box('conditions[yahoo]', $input['conditions']['yahoo'], array('id' => 'yahoo'))." {$lang->or} ".$form->generate_check_box('conditions[yahoo_blank]', 1, $lang->is_not_blank, array('id' => 'yahoo_blank', 'checked' => $input['conditions']['yahoo_blank'])), 'yahoo');

 
	$form_container->output_row($lang->skype_contains, "", $form->generate_text_box('conditions[skype]', $input['conditions']['skype'], array('id' => 'skype'))." {$lang->or} ".$form->generate_check_box('conditions[skype_blank]', 1, $lang->is_not_blank, array('id' => 'skype_blank', 'checked' => $input['conditions']['skype_blank'])), 'skype');
$form_container->output_row($lang->google_contains, "", $form->generate_text_box('conditions[google]', $input['conditions']['google'], array('id' => 'google'))." {$lang->or} ".$form->generate_check_box('conditions[google_blank]', 1, $lang->is_not_blank, array('id' => 'google_blank', 'checked' => $input['conditions']['google_blank'])), 'google');
$form_container->output_row($lang->signature_contains, "", $form->generate_text_box('conditions[signature]', $input['conditions']['signature'], array('id' => 'signature'))." {$lang->or} ".$form->generate_check_box('conditions[signature_blank]', 1, $lang->is_not_blank, array('id' => 'signature_blank', 'checked' => $input['conditions']['signature_blank'])), 'signature');

	$form_container->output_row($lang->skype_contains, "", $form->generate_text_box('conditions[skype]', $input['conditions']['skype'], array('id' => 'skype'))." {$lang->or} ".$form->generate_check_box('conditions[skype_blank]', 1, $lang->is_not_blank, array('id' => 'skype_blank', 'checked' => $input['conditions']['skype_blank'])), 'skype');
$form_container->output_row($lang->google_contains, "", $form->generate_text_box('conditions[google]', $input['conditions']['google'], array('id' => 'google'))." {$lang->or} ".$form->generate_check_box('conditions[google_blank]', 1, $lang->is_not_blank, array('id' => 'google_blank', 'checked' => $input['conditions']['google_blank'])), 'google');
$form_container->output_row($lang->signature_contains, "", $form->generate_text_box('conditions[signature]', $input['conditions']['signature'], array('id' => 'signature'))." {$lang->or} ".$form->generate_check_box('conditions[signature_blank]', 1, $lang->is_not_blank, array('id' => 'signature_blank', 'checked' => $input['conditions']['signature_blank'])), 'signature');

Zeile 4223Zeile 4266

// Get all thread ratings from both accounts
$query = $db->simple_select('threadratings', 'tid, uid, rid, rating', "uid IN ({$destination_uid}, {$source_uid})");


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

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

	{
if($rating['uid'] == $destination_uid)
{
$dest_threads[] = $rating['tid'];
}
else

	{
if($rating['uid'] == $destination_uid)
{
$dest_threads[] = $rating['tid'];
}
else

		{

		{

			$source_ratings[] = $rating;
}
}

			$source_ratings[] = $rating;
}
}

Zeile 4259Zeile 4302
	{
$delete_list[] = $rating['rid'];
$decrement_list[$rating['tid']][] = (int) $rating['rating'];

	{
$delete_list[] = $rating['rid'];
$decrement_list[$rating['tid']][] = (int) $rating['rating'];

	}


	}


	// Delete the duplicate/disallowed ratings
if(!empty($delete_list))
{

	// Delete the duplicate/disallowed ratings
if(!empty($delete_list))
{

Zeile 4273Zeile 4316
	{
foreach($decrement_list as $tid => $ratings)
{

	{
foreach($decrement_list as $tid => $ratings)
{

			$db->update_query('threads', array('numratings' => 'numratings-'.count($ratings), 'totalratings' => 'totalratings-'.array_sum($ratings)), "tid='{$tid}'", 1, true);




			if(is_array($ratings))
{
$db->update_query('threads', array('numratings' => 'numratings-'.count($ratings), 'totalratings' => 'totalratings-'.array_sum($ratings)), "tid='{$tid}'", 1, true);
}

		}
}
}

		}
}
}