Vergleich usercp.php - 1.8.25 - 1.8.28

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

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


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

 
require_once MYBB_ROOT."inc/functions_search.php";

require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

Zeile 50Zeile 51

usercp_menu();



usercp_menu();


$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);

if(my_strpos($server_http_referer, $mybb->settings['bburl'].'/') !== 0)

$server_http_referer = '';
if(isset($_SERVER['HTTP_REFERER']))


{

{

	if(my_strpos($server_http_referer, '/') === 0)



	$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);

if(my_strpos($server_http_referer, $mybb->settings['bburl'].'/') !== 0)

	{

	{

		$server_http_referer = my_substr($server_http_referer, 1);






		if(my_strpos($server_http_referer, '/') === 0)
{
$server_http_referer = my_substr($server_http_referer, 1);
}
$url_segments = explode('/', $server_http_referer);
$server_http_referer = $mybb->settings['bburl'].'/'.end($url_segments);

	}

	}

	$url_segments = explode('/', $server_http_referer);
$server_http_referer = $mybb->settings['bburl'].'/'.end($url_segments);

 
}

$plugins->run_hooks("usercp_start");
if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")

}

$plugins->run_hooks("usercp_start");
if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")

{

{

	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler();


	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler();


Zeile 116Zeile 121
		break;
case "forumsubscriptions":
add_breadcrumb($lang->ucp_nav_forum_subscriptions);

		break;
case "forumsubscriptions":
add_breadcrumb($lang->ucp_nav_forum_subscriptions);

		break;

		break;

	case "editsig":
case "do_editsig":
add_breadcrumb($lang->nav_editsig);

	case "editsig":
case "do_editsig":
add_breadcrumb($lang->nav_editsig);

Zeile 124Zeile 129
	case "avatar":
case "do_avatar":
add_breadcrumb($lang->nav_avatar);

	case "avatar":
case "do_avatar":
add_breadcrumb($lang->nav_avatar);

		break;

		break;

	case "notepad":
case "do_notepad":
add_breadcrumb($lang->ucp_nav_notepad);

	case "notepad":
case "do_notepad":
add_breadcrumb($lang->ucp_nav_notepad);

		break;

		break;

	case "editlists":
case "do_editlists":
add_breadcrumb($lang->ucp_nav_editlists);

	case "editlists":
case "do_editlists":
add_breadcrumb($lang->ucp_nav_editlists);

		break;

		break;

	case "drafts":
add_breadcrumb($lang->ucp_nav_drafts);
break;

	case "drafts":
add_breadcrumb($lang->ucp_nav_drafts);
break;

Zeile 157Zeile 162
	{
$awaydate = TIME_NOW;
if(!empty($mybb->input['awayday']))

	{
$awaydate = TIME_NOW;
if(!empty($mybb->input['awayday']))

		{

		{

			// If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year
if(!$mybb->get_input('awaymonth', MyBB::INPUT_INT))
{

			// If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year
if(!$mybb->get_input('awaymonth', MyBB::INPUT_INT))
{

Zeile 191Zeile 196
			"date" => $awaydate,
"returndate" => $returndate,
"awayreason" => $mybb->get_input('awayreason')

			"date" => $awaydate,
"returndate" => $returndate,
"awayreason" => $mybb->get_input('awayreason')

		);
}

		);
}

	else
{
$away = array(

	else
{
$away = array(

Zeile 280Zeile 285
		$raw_errors = $userhandler->get_errors();

// Set to stored value if invalid

		$raw_errors = $userhandler->get_errors();

// Set to stored value if invalid

		if(array_key_exists("invalid_birthday_privacy", $raw_errors))

		if(array_key_exists("invalid_birthday_privacy", $raw_errors) || array_key_exists("conflicted_birthday_privacy", $raw_errors))

		{
$mybb->input['birthdayprivacy'] = $mybb->user['birthdayprivacy'];

		{
$mybb->input['birthdayprivacy'] = $mybb->user['birthdayprivacy'];

 
			$bday = explode("-", $mybb->user['birthday']);

if(isset($bday[2]))
{
$mybb->input['bday3'] = $bday[2];
}

		}

$errors = inline_error($errors);
$mybb->input['action'] = "profile";

		}

$errors = inline_error($errors);
$mybb->input['action'] = "profile";

	}

	}

	else
{
$userhandler->update_user();

	else
{
$userhandler->update_user();





		$plugins->run_hooks("usercp_do_profile_end");
redirect("usercp.php?action=profile", $lang->redirect_profileupdated);
}

		$plugins->run_hooks("usercp_do_profile_end");
redirect("usercp.php?action=profile", $lang->redirect_profileupdated);
}

Zeile 308Zeile 319
		$bday[2] = $mybb->get_input('bday3', MyBB::INPUT_INT);
}
else

		$bday[2] = $mybb->get_input('bday3', MyBB::INPUT_INT);
}
else

	{

	{

		$user = $mybb->user;
$bday = explode("-", $user['birthday']);
if(!isset($bday[1]))
{
$bday[1] = 0;
}

		$user = $mybb->user;
$bday = explode("-", $user['birthday']);
if(!isset($bday[1]))
{
$bday[1] = 0;
}

		if(!isset($bday[2]))
{
$bday[2] = '';
}

	}
if(!isset($bday[2]) || $bday[2] == 0)
{
$bday[2] = '';

	}

$plugins->run_hooks("usercp_profile_start");

	}

$plugins->run_hooks("usercp_profile_start");

Zeile 400Zeile 411
		if(!is_member($mybb->settings[$csetting]))
{
continue;

		if(!is_member($mybb->settings[$csetting]))
{
continue;

		}

		}


$cfieldsshow = true;



$cfieldsshow = true;


Zeile 537Zeile 548
				else
{
$useropts = explode("\n", $userfield);

				else
{
$useropts = explode("\n", $userfield);

				}

				}

				if(is_array($useropts))
{
foreach($useropts as $key => $val)

				if(is_array($useropts))
{
foreach($useropts as $key => $val)

Zeile 545Zeile 556
						$val = htmlspecialchars_uni($val);
$seloptions[$val] = $val;
}

						$val = htmlspecialchars_uni($val);
$seloptions[$val] = $val;
}

				}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);

$sel = "";
if(isset($seloptions[$val]) && $val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
}
if(!$profilefield['length'])

				}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);

$sel = "";
if(isset($seloptions[$val]) && $val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
}
if(!$profilefield['length'])

					{
$profilefield['length'] = 3;
}

					{
$profilefield['length'] = 3;
}

Zeile 571Zeile 582
				}
}
elseif($type == "select")

				}
}
elseif($type == "select")

			{

			{

				$expoptions = explode("\n", $options);
if(is_array($expoptions))
{

				$expoptions = explode("\n", $options);
if(is_array($expoptions))
{

Zeile 605Zeile 616
					{
$checked = "";
if($val == $userfield)

					{
$checked = "";
if($val == $userfield)

						{

						{

							$checked = " checked=\"checked\"";
}


							$checked = " checked=\"checked\"";
}


Zeile 742Zeile 753
	}

if($mybb->usergroup['canchangewebsite'] == 1)

	}

if($mybb->usergroup['canchangewebsite'] == 1)

	{

	{

		eval("\$website = \"".$templates->get("usercp_profile_website")."\";");
}


		eval("\$website = \"".$templates->get("usercp_profile_website")."\";");
}


Zeile 870Zeile 881
	else
{
$allownoticescheck = "";

	else
{
$allownoticescheck = "";

	}

if(isset($user['invisible']) && $user['invisible'] == 1)
{
$invisiblecheck = "checked=\"checked\"";
}
else
{
$invisiblecheck = "";
}

if(isset($user['hideemail']) && $user['hideemail'] == 1)
{








	}

$canbeinvisible = '';

// Check usergroup permission before showing invisible check box
if($mybb->usergroup['canbeinvisible'] == 1)
{
if(isset($user['invisible']) && $user['invisible'] == 1)
{
$invisiblecheck = "checked=\"checked\"";
}
else
{
$invisiblecheck = "";
}
eval('$canbeinvisible = "'.$templates->get("usercp_options_invisible")."\";");
}

if(isset($user['hideemail']) && $user['hideemail'] == 1)
{

		$hideemailcheck = "checked=\"checked\"";
}
else

		$hideemailcheck = "checked=\"checked\"";
}
else

Zeile 1019Zeile 1037
	else
{
$showredirectcheck = "";

	else
{
$showredirectcheck = "";

	}

	}


if(isset($user['pmnotify']) && $user['pmnotify'] != 0)
{


if(isset($user['pmnotify']) && $user['pmnotify'] != 0)
{

Zeile 1033Zeile 1051
	if(isset($user['buddyrequestspm']) && $user['buddyrequestspm'] != 0)
{
$buddyrequestspmcheck = "checked=\"checked\"";

	if(isset($user['buddyrequestspm']) && $user['buddyrequestspm'] != 0)
{
$buddyrequestspmcheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$buddyrequestspmcheck = '';

		$buddyrequestspmcheck = '';

	}

	}


if(isset($user['buddyrequestsauto']) && $user['buddyrequestsauto'] != 0)


if(isset($user['buddyrequestsauto']) && $user['buddyrequestsauto'] != 0)

	{

	{

		$buddyrequestsautocheck = "checked=\"checked\"";

		$buddyrequestsautocheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$buddyrequestsautocheck = '';
}

if(!isset($user['threadmode']) || ($user['threadmode'] != "threaded" && $user['threadmode'] != "linear"))
{
$user['threadmode'] = ''; // Leave blank to show default

		$buddyrequestsautocheck = '';
}

if(!isset($user['threadmode']) || ($user['threadmode'] != "threaded" && $user['threadmode'] != "linear"))
{
$user['threadmode'] = ''; // Leave blank to show default

	}


	}


	if(isset($user['classicpostbit']) && $user['classicpostbit'] != 0)

	if(isset($user['classicpostbit']) && $user['classicpostbit'] != 0)

	{

	{

		$classicpostbitcheck = "checked=\"checked\"";
}
else
{
$classicpostbitcheck = '';

		$classicpostbitcheck = "checked=\"checked\"";
}
else
{
$classicpostbitcheck = '';

	}

	}


$date_format_options = $dateformat = '';
foreach($date_formats as $key => $format)
{
$selected = '';
if(isset($user['dateformat']) && $user['dateformat'] == $key)


$date_format_options = $dateformat = '';
foreach($date_formats as $key => $format)
{
$selected = '';
if(isset($user['dateformat']) && $user['dateformat'] == $key)

		{
$selected = " selected=\"selected\"";
}

		{
$selected = " selected=\"selected\"";
}


$dateformat = my_date($format, TIME_NOW, "", 0);
eval("\$date_format_options .= \"".$templates->get("usercp_options_date_format")."\";");


$dateformat = my_date($format, TIME_NOW, "", 0);
eval("\$date_format_options .= \"".$templates->get("usercp_options_date_format")."\";");

Zeile 1086Zeile 1104

$timeformat = my_date($format, TIME_NOW, "", 0);
eval("\$time_format_options .= \"".$templates->get("usercp_options_time_format")."\";");


$timeformat = my_date($format, TIME_NOW, "", 0);
eval("\$time_format_options .= \"".$templates->get("usercp_options_time_format")."\";");

	}


	}


	$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);

$pms_from_buddys = '';

	$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);

$pms_from_buddys = '';

Zeile 1104Zeile 1122

$quick_reply = '';
if($mybb->settings['quickreply'] == 1)


$quick_reply = '';
if($mybb->settings['quickreply'] == 1)

	{

	{

		eval("\$quick_reply = \"".$templates->get("usercp_options_quick_reply")."\";");
}


		eval("\$quick_reply = \"".$templates->get("usercp_options_quick_reply")."\";");
}


Zeile 1121Zeile 1139
	if(!isset($user['style']))
{
$user['style'] = '';

	if(!isset($user['style']))
{
$user['style'] = '';

	}


	}


	$board_style = $stylelist = '';
$stylelist = build_theme_select("style", $user['style']);

	$board_style = $stylelist = '';
$stylelist = build_theme_select("style", $user['style']);





	if(!empty($stylelist))
{
eval('$board_style = "'.$templates->get('usercp_options_style').'";');

	if(!empty($stylelist))
{
eval('$board_style = "'.$templates->get('usercp_options_style').'";');

	}


	}


	$tppselect = $pppselect = '';
if($mybb->settings['usertppoptions'])
{

	$tppselect = $pppselect = '';
if($mybb->settings['usertppoptions'])
{

Zeile 1155Zeile 1173
	}

if($mybb->settings['userpppoptions'])

	}

if($mybb->settings['userpppoptions'])

	{

	{

		$explodedppp = explode(",", $mybb->settings['userpppoptions']);
$pppoptions = $ppp_option = '';
if(is_array($explodedppp))

		$explodedppp = explode(",", $mybb->settings['userpppoptions']);
$pppoptions = $ppp_option = '';
if(is_array($explodedppp))

Zeile 1171Zeile 1189

$ppp_option = $lang->sprintf($lang->ppp_option, $val);
eval("\$pppoptions .= \"".$templates->get("usercp_options_pppselect_option")."\";");


$ppp_option = $lang->sprintf($lang->ppp_option, $val);
eval("\$pppoptions .= \"".$templates->get("usercp_options_pppselect_option")."\";");

			}

			}

		}
eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";");
}

		}
eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";");
}

Zeile 1220Zeile 1238
			{
$query = $db->simple_select("awaitingactivation", "*", "uid='".$mybb->user['uid']."' AND (type='r' OR type='b')");
$activation = $db->fetch_array($query);

			{
$query = $db->simple_select("awaitingactivation", "*", "uid='".$mybb->user['uid']."' AND (type='r' OR type='b')");
$activation = $db->fetch_array($query);

			}
if($activation)
{
$userhandler->update_user();


			}
if($activation)
{
$userhandler->update_user();


				$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");

// Send new activation mail for non-activated accounts

				$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");

// Send new activation mail for non-activated accounts

Zeile 1240Zeile 1258
				switch($mybb->settings['username_method'])
{
case 0:

				switch($mybb->settings['username_method'])
{
case 0:

						$emailmessage = $lang->sprintf($lang->email_activateaccount, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;

						$emailmessage = $lang->sprintf($lang->email_activateaccount, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;

					case 1:
$emailmessage = $lang->sprintf($lang->email_activateaccount1, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;

					case 1:
$emailmessage = $lang->sprintf($lang->email_activateaccount1, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;

Zeile 1258Zeile 1276
				redirect("usercp.php?action=email", $lang->redirect_emailupdated);
}
elseif($mybb->usergroup['cancp'] != 1 && ($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "both"))

				redirect("usercp.php?action=email", $lang->redirect_emailupdated);
}
elseif($mybb->usergroup['cancp'] != 1 && ($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "both"))

			{

			{

				$uid = $mybb->user['uid'];
$username = $mybb->user['username'];


				$uid = $mybb->user['uid'];
$username = $mybb->user['username'];


Zeile 1275Zeile 1293
				);

$db->insert_query("awaitingactivation", $newactivation);

				);

$db->insert_query("awaitingactivation", $newactivation);





				$mail_message = $lang->sprintf($lang->email_changeemail, $mybb->user['username'], $mybb->settings['bbname'], $mybb->user['email'], $mybb->get_input('email'), $mybb->settings['bburl'], $activationcode, $mybb->user['username'], $mybb->user['uid']);

$lang->emailsubject_changeemail = $lang->sprintf($lang->emailsubject_changeemail, $mybb->settings['bbname']);

				$mail_message = $lang->sprintf($lang->email_changeemail, $mybb->user['username'], $mybb->settings['bbname'], $mybb->user['email'], $mybb->get_input('email'), $mybb->settings['bburl'], $activationcode, $mybb->user['username'], $mybb->user['uid']);

$lang->emailsubject_changeemail = $lang->sprintf($lang->emailsubject_changeemail, $mybb->settings['bbname']);

Zeile 1292Zeile 1310
				my_mail($mybb->get_input('email'), $lang->sprintf($lang->emailsubject_changeemail, $mybb->settings['bbname']), $mail_message);
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php?action=email", $lang->redirect_emailupdated);

				my_mail($mybb->get_input('email'), $lang->sprintf($lang->emailsubject_changeemail, $mybb->settings['bbname']), $mail_message);
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php?action=email", $lang->redirect_emailupdated);

			}

			}

		}

		}

	}

	}

	if(count($errors) > 0)
{
$mybb->input['action'] = "email";
$errors = inline_error($errors);

	if(count($errors) > 0)
{
$mybb->input['action'] = "email";
$errors = inline_error($errors);

	}
}

	}
}


if($mybb->input['action'] == "email")
{


if($mybb->input['action'] == "email")
{

Zeile 1325Zeile 1343
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$user = array();
$errors = array();


	$user = array();
$errors = array();


Zeile 1360Zeile 1378
			// Notify the user by email that their password has been changed
$mail_message = $lang->sprintf($lang->email_changepassword, $mybb->user['username'], $mybb->user['email'], $mybb->settings['bbname'], $mybb->settings['bburl']);
$lang->emailsubject_changepassword = $lang->sprintf($lang->emailsubject_changepassword, $mybb->settings['bbname']);

			// Notify the user by email that their password has been changed
$mail_message = $lang->sprintf($lang->email_changepassword, $mybb->user['username'], $mybb->user['email'], $mybb->settings['bbname'], $mybb->settings['bburl']);
$lang->emailsubject_changepassword = $lang->sprintf($lang->emailsubject_changepassword, $mybb->settings['bbname']);

			my_mail($mybb->user['email'], $lang->emailsubject_changepassword, $mail_message);


			my_mail($mybb->user['email'], $lang->emailsubject_changepassword, $mail_message);


			$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php?action=password", $lang->redirect_passwordupdated);
}

			$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php?action=password", $lang->redirect_passwordupdated);
}

Zeile 1370Zeile 1388
	{
$mybb->input['action'] = "password";
$errors = inline_error($errors);

	{
$mybb->input['action'] = "password";
$errors = inline_error($errors);

	}

	}

}

if($mybb->input['action'] == "password")

}

if($mybb->input['action'] == "password")

Zeile 1387Zeile 1405
	verify_post_check($mybb->get_input('my_post_key'));

$errors = array();

	verify_post_check($mybb->get_input('my_post_key'));

$errors = array();





	if($mybb->usergroup['canchangename'] != 1)
{
error_no_permission();

	if($mybb->usergroup['canchangename'] != 1)
{
error_no_permission();

Zeile 1429Zeile 1447
	{
$errors = inline_error($errors);
$mybb->input['action'] = "changename";

	{
$errors = inline_error($errors);
$mybb->input['action'] = "changename";

	}

	}

}

if($mybb->input['action'] == "changename")

}

if($mybb->input['action'] == "changename")

Zeile 1444Zeile 1462
	if($errors)
{
$username = htmlspecialchars_uni($mybb->get_input('username'));

	if($errors)
{
$username = htmlspecialchars_uni($mybb->get_input('username'));

	}
else

	}
else

	{
$username = '';
}

	{
$username = '';
}

Zeile 1462Zeile 1480
	verify_post_check($mybb->get_input('my_post_key'));

if(!isset($mybb->input['check']) || !is_array($mybb->input['check']))

	verify_post_check($mybb->get_input('my_post_key'));

if(!isset($mybb->input['check']) || !is_array($mybb->input['check']))

	{

	{

		error($lang->no_subscriptions_selected);
}


		error($lang->no_subscriptions_selected);
}


Zeile 1487Zeile 1505
		elseif($mybb->get_input('do') == "email_notification")
{
$new_notification = 1;

		elseif($mybb->get_input('do') == "email_notification")
{
$new_notification = 1;

		}

		}

		elseif($mybb->get_input('do') == "pm_notification")
{
$new_notification = 2;
}

		elseif($mybb->get_input('do') == "pm_notification")
{
$new_notification = 2;
}





		// Update
$update_array = array("notification" => $new_notification);
$db->update_query("threadsubscriptions", $update_array, "tid IN ($tids) AND uid='{$mybb->user['uid']}'");

		// Update
$update_array = array("notification" => $new_notification);
$db->update_query("threadsubscriptions", $update_array, "tid IN ($tids) AND uid='{$mybb->user['uid']}'");

	}


	}


	// Done, redirect
redirect("usercp.php?action=subscriptions", $lang->redirect_subscriptions_updated);
}

	// Done, redirect
redirect("usercp.php?action=subscriptions", $lang->redirect_subscriptions_updated);
}





if($mybb->input['action'] == "subscriptions")
{
$plugins->run_hooks("usercp_subscriptions_start");

// Thread visiblity

if($mybb->input['action'] == "subscriptions")
{
$plugins->run_hooks("usercp_subscriptions_start");

// Thread visiblity

	$visible = "AND t.visible != 0";
if(is_moderator() == true)










	$where = array(
"s.uid={$mybb->user['uid']}",
get_visible_where('t')
);

if($unviewable_forums = get_unviewable_forums(true))
{
$where[] = "t.fid NOT IN ({$unviewable_forums})";
}

if($inactive_forums = get_inactive_forums())

	{

	{

		$visible = '';

		$where[] = "t.fid NOT IN ({$inactive_forums})";

	}

	}

 

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


// Do Multi Pages
$query = $db->query("


// Do Multi Pages
$query = $db->query("

		SELECT COUNT(ts.tid) as threads
FROM ".TABLE_PREFIX."threadsubscriptions ts
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = ts.tid)
WHERE ts.uid = '".$mybb->user['uid']."' AND t.visible >= 0 {$visible}

		SELECT COUNT(s.tid) as threads
FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = s.tid)
WHERE {$where}

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


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


Zeile 1562Zeile 1591
		FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

		FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

		WHERE s.uid='".$mybb->user['uid']."' and t.visible >= 0 {$visible}

		WHERE {$where}

		ORDER BY t.lastpost DESC
LIMIT $start, $perpage
");

		ORDER BY t.lastpost DESC
LIMIT $start, $perpage
");

Zeile 1570Zeile 1599
	{
$forumpermissions = $fpermissions[$subscription['fid']];


	{
$forumpermissions = $fpermissions[$subscription['fid']];


		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))

		if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid'])

		{
// Hmm, you don't have permission to view this thread - unsubscribe!
$del_subscriptions[] = $subscription['sid'];

		{
// Hmm, you don't have permission to view this thread - unsubscribe!
$del_subscriptions[] = $subscription['sid'];

Zeile 1696Zeile 1725

if($mybb->settings['threadreadcut'] > 0)
{


if($mybb->settings['threadreadcut'] > 0)
{

				$forum_read = $readforums[$thread['fid']];


 
				$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;

				$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;

				if($forum_read == 0 || $forum_read < $read_cutoff)

				if(empty($readforums[$thread['fid']]) || $readforums[$thread['fid']] < $read_cutoff)

				{
$forum_read = $read_cutoff;
}

				{
$forum_read = $read_cutoff;
}

			}





				else
{
$forum_read = $readforums[$thread['fid']];
}
}


$cutoff = 0;
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)


$cutoff = 0;
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)

Zeile 1712Zeile 1743
			}

if($thread['lastpost'] > $cutoff)

			}

if($thread['lastpost'] > $cutoff)

			{
if($thread['lastread'])
{

			{
if(!empty($thread['lastread']))
{

					$lastread = $thread['lastread'];
}
else

					$lastread = $thread['lastread'];
}
else

Zeile 1755Zeile 1786
			{
$folder .= "hot";
$folder_label .= $lang->icon_hot;

			{
$folder .= "hot";
$folder_label .= $lang->icon_hot;

			}


			}


			if($thread['closed'] == 1)
{
$folder .= "close";

			if($thread['closed'] == 1)
{
$folder .= "close";

Zeile 1764Zeile 1795
			}

$folder .= "folder";

			}

$folder .= "folder";





			if($thread['visible'] == 0)
{
$bgcolor = "trow_shaded";

			if($thread['visible'] == 0)
{
$bgcolor = "trow_shaded";

Zeile 1772Zeile 1803

// Build last post info
$lastpostdate = my_date('relative', $thread['lastpost']);


// Build last post info
$lastpostdate = my_date('relative', $thread['lastpost']);

 
			$lastposteruid = $thread['lastposteruid'];

			if(!$lastposteruid && !$thread['lastposter'])
{
$lastposter = htmlspecialchars_uni($lang->guest);

			if(!$lastposteruid && !$thread['lastposter'])
{
$lastposter = htmlspecialchars_uni($lang->guest);

Zeile 1780Zeile 1812
			{
$lastposter = htmlspecialchars_uni($thread['lastposter']);
}

			{
$lastposter = htmlspecialchars_uni($thread['lastposter']);
}

			$lastposteruid = $thread['lastposteruid'];

 

// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)


// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)

Zeile 1919Zeile 1950
			}
$lastpost_link = get_thread_link($forum['lastposttid'], 0, "lastpost");
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost")."\";");

			}
$lastpost_link = get_thread_link($forum['lastposttid'], 0, "lastpost");
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost")."\";");

		}


		}


		if($mybb->settings['showdescriptions'] == 0)
{
$forum['description'] = "";
}

eval("\$forums .= \"".$templates->get("usercp_forumsubscriptions_forum")."\";");

		if($mybb->settings['showdescriptions'] == 0)
{
$forum['description'] = "";
}

eval("\$forums .= \"".$templates->get("usercp_forumsubscriptions_forum")."\";");

	}


	}


	if(!$forums)
{
eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");

	if(!$forums)
{
eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");

	}

$plugins->run_hooks("usercp_forumsubscriptions_end");


	}

$plugins->run_hooks("usercp_forumsubscriptions_end");


	eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";");
output_page($forumsubscriptions);
}

	eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";");
output_page($forumsubscriptions);
}

Zeile 1944Zeile 1975
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$thread = get_thread($mybb->get_input('tid'));
if(!$thread || $thread['visible'] == -1)
{

	$thread = get_thread($mybb->get_input('tid'));
if(!$thread || $thread['visible'] == -1)
{

Zeile 1952Zeile 1983
	}

// Is the currently logged in user a moderator of this forum?

	}

// Is the currently logged in user a moderator of this forum?

	$ismod = is_moderator($thread['fid']);

	$ismod = is_moderator($thread['fid']);


// Make sure we are looking at a real thread here.
if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))


// Make sure we are looking at a real thread here.
if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))

Zeile 1977Zeile 2008
	if($mybb->get_input('referrer'))
{
$mybb->input['referrer'] = $mybb->get_input('referrer');

	if($mybb->get_input('referrer'))
{
$mybb->input['referrer'] = $mybb->get_input('referrer');





		if(my_strpos($mybb->input['referrer'], $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($mybb->input['referrer'], '/') === 0)

		if(my_strpos($mybb->input['referrer'], $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($mybb->input['referrer'], '/') === 0)

Zeile 1986Zeile 2017
			}
$url_segments = explode('/', $mybb->input['referrer']);
$mybb->input['referrer'] = $mybb->settings['bburl'].'/'.end($url_segments);

			}
$url_segments = explode('/', $mybb->input['referrer']);
$mybb->input['referrer'] = $mybb->settings['bburl'].'/'.end($url_segments);

		}


		}


		$url = htmlspecialchars_uni($mybb->input['referrer']);
}
else

		$url = htmlspecialchars_uni($mybb->input['referrer']);
}
else

Zeile 2042Zeile 2073

// Is the currently logged in user a moderator of this forum?
$ismod = is_moderator($thread['fid']);


// Is the currently logged in user a moderator of this forum?
$ismod = is_moderator($thread['fid']);





		// Make sure we are looking at a real thread here.
if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))

		// Make sure we are looking at a real thread here.
if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))

		{

		{

			error($lang->error_invalidthread);

			error($lang->error_invalidthread);

		}


		}


		add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions");
add_breadcrumb($lang->nav_addsubscription);


		add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions");
add_breadcrumb($lang->nav_addsubscription);


		$forumpermissions = forum_permissions($thread['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))
{
error_no_permission();
}


		$forumpermissions = forum_permissions($thread['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))
{
error_no_permission();
}


		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($thread['fid']);


		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($thread['fid']);


Zeile 2075Zeile 2106

$notification_none_checked = $notification_email_checked = $notification_pm_checked = '';
if($mybb->user['subscriptionmethod'] == 1 || $mybb->user['subscriptionmethod'] == 0)


$notification_none_checked = $notification_email_checked = $notification_pm_checked = '';
if($mybb->user['subscriptionmethod'] == 1 || $mybb->user['subscriptionmethod'] == 0)

		{

		{

			$notification_none_checked = "checked=\"checked\"";

			$notification_none_checked = "checked=\"checked\"";

		}

		}

		elseif($mybb->user['subscriptionmethod'] == 2)

		elseif($mybb->user['subscriptionmethod'] == 2)

		{

		{

			$notification_email_checked = "checked=\"checked\"";
}
elseif($mybb->user['subscriptionmethod'] == 3)

			$notification_email_checked = "checked=\"checked\"";
}
elseif($mybb->user['subscriptionmethod'] == 3)

		{

		{

			$notification_pm_checked = "checked=\"checked\"";
}


			$notification_pm_checked = "checked=\"checked\"";
}


Zeile 2107Zeile 2138
		if(!$forum)
{
error($lang->error_invalidforum);

		if(!$forum)
{
error($lang->error_invalidforum);

		}


		}


		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);

		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);





		// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_forum");

remove_subscribed_forum($forum['fid']);

		// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_forum");

remove_subscribed_forum($forum['fid']);

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionremoved);

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionremoved);

	}
else
{

	}
else
{

Zeile 2259Zeile 2290
			$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);

			$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);

	}
else

	}
else

	{
// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscriptions_thread");

	{
// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscriptions_thread");

Zeile 2275Zeile 2306
			$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionsremoved);

			$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionsremoved);

	}

	}

}

if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")

}

if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")

Zeile 2285Zeile 2316

// User currently has a suspended signature
if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW)


// User currently has a suspended signature
if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW)

	{
error_no_permission();
}


	{
error_no_permission();
}


	$plugins->run_hooks("usercp_do_editsig_start");

if($mybb->get_input('updateposts') == "enable")

	$plugins->run_hooks("usercp_do_editsig_start");

if($mybb->get_input('updateposts') == "enable")

	{

	{

		$update_signature = array(
"includesig" => 1

		$update_signature = array(
"includesig" => 1

		);

		);

		$db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
}
elseif($mybb->get_input('updateposts') == "disable")

		$db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
}
elseif($mybb->get_input('updateposts') == "disable")

Zeile 2315Zeile 2346
}

if($mybb->input['action'] == "editsig")

}

if($mybb->input['action'] == "editsig")

{

{

	$plugins->run_hooks("usercp_editsig_start");
if(!empty($mybb->input['preview']) && empty($error))

	$plugins->run_hooks("usercp_editsig_start");
if(!empty($mybb->input['preview']) && empty($error))

	{
$sig = $mybb->get_input('signature');

	{
$sig = $mybb->get_input('signature');

		$template = "usercp_editsig_preview";
}
elseif(empty($error))
{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";

		$template = "usercp_editsig_preview";
}
elseif(empty($error))
{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";

	}

	}

	else
{
$sig = $mybb->get_input('signature');
$template = false;

	else
{
$sig = $mybb->get_input('signature');
$template = false;

	}


	}


	if(!isset($error))
{
$error = '';

	if(!isset($error))
{
$error = '';

Zeile 2342Zeile 2373
	{
// User currently has no signature and they're suspended
error($lang->sig_suspended);

	{
// User currently has no signature and they're suspended
error($lang->sig_suspended);

	}

	}


if($mybb->usergroup['canusesig'] != 1)
{


if($mybb->usergroup['canusesig'] != 1)
{

Zeile 2420Zeile 2451
		{
$sigimgcode = $lang->off;
}

		{
$sigimgcode = $lang->off;
}

 

if($mybb->settings['siglength'] == 0)
{
$siglength = $lang->unlimited;
}
else
{
$siglength = $mybb->settings['siglength'];
}


		$sig = htmlspecialchars_uni($sig);

		$sig = htmlspecialchars_uni($sig);

		$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);

		$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $siglength);


if($mybb->settings['sigmycode'] != 0 && $mybb->settings['bbcodeinserter'] != 0 && $mybb->user['showcodebuttons'] != 0)


if($mybb->settings['sigmycode'] != 0 && $mybb->settings['bbcodeinserter'] != 0 && $mybb->user['showcodebuttons'] != 0)

		{

		{

			$codebuttons = build_mycode_inserter("signature");
}


			$codebuttons = build_mycode_inserter("signature");
}


Zeile 2463Zeile 2504
			error_no_permission();
}
$avatar = upload_avatar();

			error_no_permission();
}
$avatar = upload_avatar();

		if($avatar['error'])

		if(!empty($avatar['error']))

		{
$avatar_error = $avatar['error'];
}

		{
$avatar_error = $avatar['error'];
}

Zeile 2480Zeile 2521
			);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
}

			);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
}

 
	}
elseif(!$mybb->settings['allowremoteavatars'] && !$_FILES['avatarupload']['name']) // missing avatar image
{
$avatar_error = $lang->error_avatarimagemissing;

	}
elseif($mybb->settings['allowremoteavatars']) // remote avatar
{

	}
elseif($mybb->settings['allowremoteavatars']) // remote avatar
{

Zeile 3197Zeile 3242
			{
echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n";
echo "\$(\"#buddylink\").remove();\n";

			{
echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n";
echo "\$(\"#buddylink\").remove();\n";

				



				if($mybb->get_input('manage') == "ignored")
{
echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";

				if($mybb->get_input('manage') == "ignored")
{
echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";

Zeile 3236Zeile 3281
	$buddy_count = 0;
$buddy_list = '';
if($mybb->user['buddylist'])

	$buddy_count = 0;
$buddy_list = '';
if($mybb->user['buddylist'])

	{

	{

		$type = "buddy";
$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array("order_by" => "username"));
while($user = $db->fetch_array($query))

		$type = "buddy";
$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array("order_by" => "username"));
while($user = $db->fetch_array($query))

Zeile 3244Zeile 3289
			$user['username'] = htmlspecialchars_uni($user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])

			$user['username'] = htmlspecialchars_uni($user['username']);
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])

			{

			{

				$status = "online";

				$status = "online";

			}

			}

			else
{
$status = "offline";
}
eval("\$buddy_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$buddy_count;

			else
{
$status = "offline";
}
eval("\$buddy_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$buddy_count;

		}
}


		}
}


	$lang->current_buddies = $lang->sprintf($lang->current_buddies, $buddy_count);
if(!$buddy_list)
{

	$lang->current_buddies = $lang->sprintf($lang->current_buddies, $buddy_count);
if(!$buddy_list)
{

Zeile 3326Zeile 3371

eval("\$sent_requests = \"".$templates->get("usercp_editlists_sent_requests", 1, 0)."\";");



eval("\$sent_requests = \"".$templates->get("usercp_editlists_sent_requests", 1, 0)."\";");


				echo $sentrequests;

 
				echo $sent_requests."<script type=\"text/javascript\">{$message_js}</script>";
}
else

				echo $sent_requests."<script type=\"text/javascript\">{$message_js}</script>";
}
else

Zeile 3338Zeile 3382
		exit;
}


		exit;
}


	$received_rows = '';

	$received_rows = $bgcolor = '';

	$query = $db->query("
SELECT r.*, u.username
FROM ".TABLE_PREFIX."buddyrequests r

	$query = $db->query("
SELECT r.*, u.username
FROM ".TABLE_PREFIX."buddyrequests r

Zeile 3356Zeile 3400
	if($received_rows == '')
{
eval("\$received_rows = \"".$templates->get("usercp_editlists_no_requests")."\";");

	if($received_rows == '')
{
eval("\$received_rows = \"".$templates->get("usercp_editlists_no_requests")."\";");

	}

eval("\$received_requests = \"".$templates->get("usercp_editlists_received_requests")."\";");

$sent_rows = '';

	}

eval("\$received_requests = \"".$templates->get("usercp_editlists_received_requests")."\";");

$sent_rows = $bgcolor = '';

	$query = $db->query("
SELECT r.*, u.username
FROM ".TABLE_PREFIX."buddyrequests r

	$query = $db->query("
SELECT r.*, u.username
FROM ".TABLE_PREFIX."buddyrequests r

Zeile 3407Zeile 3451
			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
WHERE p.uid = '{$mybb->user['uid']}' AND p.visible = '-2'

			LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
WHERE p.uid = '{$mybb->user['uid']}' AND p.visible = '-2'

			ORDER BY p.dateline DESC

			ORDER BY p.dateline DESC, p.pid DESC

		");

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

		");

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

Zeile 3482Zeile 3526
		$tidin = implode(",", $tidin);
$db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'");
$tidinp = "OR tid IN ($tidin)";

		$tidin = implode(",", $tidin);
$db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'");
$tidinp = "OR tid IN ($tidin)";

 
	}
else
{
$tidinp = '';

	}
if($pidin || $tidinp)
{

	}
if($pidin || $tidinp)
{

Zeile 3536Zeile 3584
	if($mybb->get_input('leavegroup', MyBB::INPUT_INT))
{
// Verify incoming POST request

	if($mybb->get_input('leavegroup', MyBB::INPUT_INT))
{
// Verify incoming POST request

		verify_post_check($mybb->input['my_post_key']);

		verify_post_check($mybb->get_input('my_post_key'));


if(my_strpos($ingroups, ",".$mybb->get_input('leavegroup', MyBB::INPUT_INT).",") === false)
{


if(my_strpos($ingroups, ",".$mybb->get_input('leavegroup', MyBB::INPUT_INT).",") === false)
{

Zeile 3568Zeile 3616
		ORDER BY u.username ASC
");
while($leader = $db->fetch_array($query))

		ORDER BY u.username ASC
");
while($leader = $db->fetch_array($query))

	{

	{

		$groupleaders[$leader['gid']][$leader['uid']] = $leader;
}


		$groupleaders[$leader['gid']][$leader['uid']] = $leader;
}


Zeile 3606Zeile 3654
		if($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4)
{
$reasonlength = my_strlen($mybb->get_input('reason'));

		if($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4)
{
$reasonlength = my_strlen($mybb->get_input('reason'));

			



			if($reasonlength > 250) // Reason field is varchar(250) in database
{
error($lang->sprintf($lang->joinreason_too_long, ($reasonlength - 250)));

			if($reasonlength > 250) // Reason field is varchar(250) in database
{
error($lang->sprintf($lang->joinreason_too_long, ($reasonlength - 250)));

Zeile 3745Zeile 3793
	$usergroup = $usergroups[$mybb->user['usergroup']];
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);
$usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);

	$usergroup = $usergroups[$mybb->user['usergroup']];
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);
$usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);

	$usergroup['description'] = htmlspecialchars_uni($usergroup['description']);





	if($usergroup['description'])
{
$usergroup['description'] = htmlspecialchars_uni($usergroup['description']);
eval("\$description = \"".$templates->get("usercp_usergroups_memberof_usergroup_description")."\";");
}

	eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveprimary")."\";");
$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])

	eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveprimary")."\";");
$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])

Zeile 3753Zeile 3805
		eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_display")."\";");
}
elseif($usergroup['candisplaygroup'] == 1)

		eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_display")."\";");
}
elseif($usergroup['candisplaygroup'] == 1)

	{

	{

		eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");

		eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");

	}

	}

	else

	else

	{

	{

		$displaycode = '';
}


		$displaycode = '';
}


Zeile 3765Zeile 3817
	$showmemberof = false;
if($mybb->user['additionalgroups'])
{

	$showmemberof = false;
if($mybb->user['additionalgroups'])
{

		$query = $db->simple_select("usergroups", "*", "gid IN (".$mybb->user['additionalgroups'].") AND gid !='".$mybb->user['usergroup']."'", array('order_by' => 'title'));








		$additionalgroups = implode(
',',
array_map(
'intval',
explode(',', $mybb->user['additionalgroups'])
)
);
$query = $db->simple_select("usergroups", "*", "gid IN (".$additionalgroups.") AND gid !='".$mybb->user['usergroup']."'", array('order_by' => 'title'));

		while($usergroup = $db->fetch_array($query))
{
$showmemberof = true;

		while($usergroup = $db->fetch_array($query))
{
$showmemberof = true;

Zeile 3820Zeile 3879
	$existinggroups = $mybb->user['usergroup'];
if($mybb->user['additionalgroups'])
{

	$existinggroups = $mybb->user['usergroup'];
if($mybb->user['additionalgroups'])
{

		$existinggroups .= ",".$mybb->user['additionalgroups'];








		$additionalgroups = implode(
',',
array_map(
'intval',
explode(',', $mybb->user['additionalgroups'])
)
);
$existinggroups .= ",".$additionalgroups;

	}

$joinablegroups = $joinablegrouplist = '';

	}

$joinablegroups = $joinablegrouplist = '';

Zeile 3839Zeile 3905

// Moderating join requests?
if($usergroup['type'] == 4)


// Moderating join requests?
if($usergroup['type'] == 4)

		{

		{

			$conditions = $lang->usergroup_joins_moderated;
}
elseif($usergroup['type'] == 5)
{
$conditions = $lang->usergroup_joins_invite;

			$conditions = $lang->usergroup_joins_moderated;
}
elseif($usergroup['type'] == 5)
{
$conditions = $lang->usergroup_joins_invite;

		}

		}

		else

		else

		{

		{

			$conditions = $lang->usergroup_joins_anyone;
}

if(isset($appliedjoin[$usergroup['gid']]) && $usergroup['type'] != 5)

			$conditions = $lang->usergroup_joins_anyone;
}

if(isset($appliedjoin[$usergroup['gid']]) && $usergroup['type'] != 5)

		{

		{

			$applydate = my_date('relative', $appliedjoin[$usergroup['gid']]);
$joinlink = $lang->sprintf($lang->join_group_applied, $applydate);
}

			$applydate = my_date('relative', $appliedjoin[$usergroup['gid']]);
$joinlink = $lang->sprintf($lang->join_group_applied, $applydate);
}

Zeile 3867Zeile 3933
		else
{
eval("\$joinlink = \"".$templates->get("usercp_usergroups_joinable_usergroup_join")."\";");

		else
{
eval("\$joinlink = \"".$templates->get("usercp_usergroups_joinable_usergroup_join")."\";");

		}


		}


		$usergroupleaders = '';
if(!empty($groupleaders[$usergroup['gid']]))
{

		$usergroupleaders = '';
if(!empty($groupleaders[$usergroup['gid']]))
{

Zeile 3899Zeile 3965
	eval("\$groupmemberships = \"".$templates->get("usercp_usergroups")."\";");
output_page($groupmemberships);
}

	eval("\$groupmemberships = \"".$templates->get("usercp_usergroups")."\";");
output_page($groupmemberships);
}





if($mybb->input['action'] == "attachments")
{
require_once MYBB_ROOT."inc/functions_upload.php";

if($mybb->input['action'] == "attachments")
{
require_once MYBB_ROOT."inc/functions_upload.php";





	if($mybb->settings['enableattachments'] == 0)
{
error($lang->attachments_disabled);

	if($mybb->settings['enableattachments'] == 0)
{
error($lang->attachments_disabled);

	}

$plugins->run_hooks("usercp_attachments_start");

// Get unviewable forums
$f_perm_sql = '';
$unviewable_forums = get_unviewable_forums(true);

	}

$plugins->run_hooks("usercp_attachments_start");

// Get unviewable forums
$f_perm_sql = '';
$unviewable_forums = get_unviewable_forums(true);

	$inactiveforums = get_inactive_forums();
if($unviewable_forums)
{

	$inactiveforums = get_inactive_forums();
if($unviewable_forums)
{

Zeile 3954Zeile 4020
		LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE a.uid='".$mybb->user['uid']."' {$f_perm_sql}

		LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE a.uid='".$mybb->user['uid']."' {$f_perm_sql}

		ORDER BY p.dateline DESC LIMIT {$start}, {$perpage}

		ORDER BY p.dateline DESC, p.pid DESC LIMIT {$start}, {$perpage}

	");

$bandwidth = $totaldownloads = $totalusage = $totalattachments = $processedattachments = 0;

	");

$bandwidth = $totaldownloads = $totalusage = $totalattachments = $processedattachments = 0;

Zeile 3991Zeile 4057
		++$processedattachments;
}


		++$processedattachments;
}


 
	$multipage = '';

	if($processedattachments >= $perpage || $page > 1)
{
$query = $db->query("

	if($processedattachments >= $perpage || $page > 1)
{
$query = $db->query("

Zeile 4022Zeile 4089
	}

$bandwidth = get_friendly_size($bandwidth);

	}

$bandwidth = get_friendly_size($bandwidth);

 

eval("\$delete_button = \"".$templates->get("delete_attachments_button")."\";");


if(!$attachments)
{
eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";");
$usagenote = '';


if(!$attachments)
{
eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";");
$usagenote = '';

 
		$delete_button = '';

	}

$plugins->run_hooks("usercp_attachments_end");

	}

$plugins->run_hooks("usercp_attachments_end");

Zeile 4119Zeile 4189
		$percent = "0";
}
else

		$percent = "0";
}
else

	{

	{

		$percent = $mybb->user['postnum']*100/$posts;
$percent = round($percent, 2);
}

		$percent = $mybb->user['postnum']*100/$posts;
$percent = round($percent, 2);
}

Zeile 4136Zeile 4206
	if($mybb->user['usergroup'] == 5 && $mybb->settings['regtype'] != "admin")
{
eval("\$usergroup .= \"".$templates->get("usercp_resendactivation")."\";");

	if($mybb->user['usergroup'] == 5 && $mybb->settings['regtype'] != "admin")
{
eval("\$usergroup .= \"".$templates->get("usercp_resendactivation")."\";");

	}

	}

	// Make reputations row
$reputations = '';
if($mybb->usergroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)

	// Make reputations row
$reputations = '';
if($mybb->usergroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)

Zeile 4162Zeile 4232
		{
$mybb->user['warningpoints'] = $mybb->settings['maxwarningpoints'];
}

		{
$mybb->user['warningpoints'] = $mybb->settings['maxwarningpoints'];
}





		if($warning_level > 0)
{
require_once MYBB_ROOT.'inc/datahandlers/warnings.php';

		if($warning_level > 0)
{
require_once MYBB_ROOT.'inc/datahandlers/warnings.php';

Zeile 4187Zeile 4257
			{
$post_link = "";
if($warning['post_subject'])

			{
$post_link = "";
if($warning['post_subject'])

				{

				{

					$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$warning['postlink'] = get_post_link($warning['pid']);

					$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$warning['postlink'] = get_post_link($warning['pid']);

Zeile 4213Zeile 4283

// Figure out expiration time
if($warning['daterevoked'])


// Figure out expiration time
if($warning['daterevoked'])

				{

				{

					$expires = $lang->warning_revoked;
}
elseif($warning['expired'])

					$expires = $lang->warning_revoked;
}
elseif($warning['expired'])

Zeile 4231Zeile 4301

$alt_bg = alt_trow();
eval("\$warnings .= \"".$templates->get("usercp_warnings_warning")."\";");


$alt_bg = alt_trow();
eval("\$warnings .= \"".$templates->get("usercp_warnings_warning")."\";");

			}

			}

			if($warnings)
{
eval("\$latest_warnings = \"".$templates->get("usercp_warnings")."\";");

			if($warnings)
{
eval("\$latest_warnings = \"".$templates->get("usercp_warnings")."\";");

Zeile 4247Zeile 4317
	$mybb->user['posts'] = my_number_format($mybb->user['postnum']);

// Build referral link

	$mybb->user['posts'] = my_number_format($mybb->user['postnum']);

// Build referral link

 
	$referral_info = '';

	if($mybb->settings['usereferrals'] == 1)
{
$referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);

	if($mybb->settings['usereferrals'] == 1)
{
$referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);

Zeile 4256Zeile 4327
		{
$uid = (int) $mybb->user['uid'];
eval("\$mybb->user['referrals'] = \"".$templates->get('member_referrals_link')."\";");

		{
$uid = (int) $mybb->user['uid'];
eval("\$mybb->user['referrals'] = \"".$templates->get('member_referrals_link')."\";");

		}

		}


eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
}


eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
}





	// User Notepad
$plugins->run_hooks("usercp_notepad_start");
$mybb->user['notepad'] = htmlspecialchars_uni($mybb->user['notepad']);

	// User Notepad
$plugins->run_hooks("usercp_notepad_start");
$mybb->user['notepad'] = htmlspecialchars_uni($mybb->user['notepad']);

Zeile 4272Zeile 4343
	$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1));
if($db->num_rows($query))
{

	$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1));
if($db->num_rows($query))
{

		$visible = "AND t.visible != 0";
if(is_moderator() == true)
{
$visible = '';











		$where = array(
"s.uid={$mybb->user['uid']}",
"t.lastposteruid!={$mybb->user['uid']}",
get_visible_where('t')
);

if($unviewable_forums = get_unviewable_forums(true))
{
$where[] = "t.fid NOT IN ({$unviewable_forums})";
}

if($inactive_forums = get_inactive_forums())
{
$where[] = "t.fid NOT IN ({$inactive_forums})";

		}

		}

 

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


$query = $db->query("
SELECT s.*, t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)


$query = $db->query("
SELECT s.*, t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threadsubscriptions s
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

			WHERE s.uid='".$mybb->user['uid']."' {$visible}

			WHERE {$where}

			ORDER BY t.lastpost DESC
LIMIT 0, 10
");


			ORDER BY t.lastpost DESC
LIMIT 0, 10
");


 
		$subscriptions = array();

		$fpermissions = forum_permissions();

		$fpermissions = forum_permissions();

 


		while($subscription = $db->fetch_array($query))
{
$forumpermissions = $fpermissions[$subscription['fid']];

		while($subscription = $db->fetch_array($query))
{
$forumpermissions = $fpermissions[$subscription['fid']];

			if($forumpermissions['canview'] != 0 && $forumpermissions['canviewthreads'] != 0 && ($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid']))



if($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid'])

			{
$subscriptions[$subscription['tid']] = $subscription;
}
}


			{
$subscriptions[$subscription['tid']] = $subscription;
}
}


		if(is_array($subscriptions))

		if($subscriptions)

		{
$tids = implode(",", array_keys($subscriptions));


		{
$tids = implode(",", array_keys($subscriptions));


Zeile 4332Zeile 4418

$icon_cache = $cache->read("posticons");
$threadprefixes = build_prefixes();


$icon_cache = $cache->read("posticons");
$threadprefixes = build_prefixes();

 
				$latest_subscribed_threads = '';


foreach($subscriptions as $thread)
{


foreach($subscriptions as $thread)
{

Zeile 4372Zeile 4459
							$icon = "&nbsp;";
}


							$icon = "&nbsp;";
}


						if($thread['doticon'])

						if(!isset($thread['doticon']))

						{
$folder = "dot_";
$folder_label .= $lang->icon_dot;
}

// Check to see which icon we display

						{
$folder = "dot_";
$folder_label .= $lang->icon_dot;
}

// Check to see which icon we display

						if($thread['lastread'] && $thread['lastread'] < $thread['lastpost'])

						if(!empty($thread['lastread']) && $thread['lastread'] < $thread['lastpost'])

						{
$folder .= "new";
$folder_label .= $lang->icon_new;

						{
$folder .= "new";
$folder_label .= $lang->icon_new;

Zeile 4434Zeile 4521
	}

// User's Latest Threads

	}

// User's Latest Threads

 
	$where = array(
"t.uid={$mybb->user['uid']}",
get_visible_where('t')
);

if($unviewable_forums = get_unviewable_forums(true))
{
$where[] = "t.fid NOT IN ({$unviewable_forums})";
}

if($inactive_forums = get_inactive_forums())
{
$where[] = "t.fid NOT IN ({$inactive_forums})";
}

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





	// Get unviewable forums
$f_perm_sql = '';
$unviewable_forums = get_unviewable_forums();
$inactiveforums = get_inactive_forums();
if($unviewable_forums)
{
$f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)";
}
if($inactiveforums)
{
$f_perm_sql .= " AND t.fid NOT IN ($inactiveforums)";
}

$visible = " AND t.visible != 0";
if(is_moderator() == true)
{
$visible = '';
}


 
	$query = $db->query("
SELECT t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

	$query = $db->query("
SELECT t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)

		WHERE t.uid='".$mybb->user['uid']."' AND t.firstpost != 0 AND t.visible >= 0 {$visible}{$f_perm_sql}

		WHERE {$where}

		ORDER BY t.lastpost DESC
LIMIT 0, 5
");

		ORDER BY t.lastpost DESC
LIMIT 0, 5
");





	// Figure out whether we can view these threads...
$threadcache = array();
$fpermissions = forum_permissions();
while($thread = $db->fetch_array($query))
{

	// Figure out whether we can view these threads...
$threadcache = array();
$fpermissions = forum_permissions();
while($thread = $db->fetch_array($query))
{

		// Moderated, and not moderator?
if($thread['visible'] == 0 && is_moderator($thread['fid'], "canviewunapprove") === false)
{
continue;
}

$forumpermissions = $fpermissions[$thread['fid']];
if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0)
{
$threadcache[$thread['tid']] = $thread;
}

		$threadcache[$thread['tid']] = $thread;











	}

$latest_threads = '';

	}

$latest_threads = '';

Zeile 4528Zeile 4602
		$latest_threads_threads = '';
foreach($threadcache as $thread)
{

		$latest_threads_threads = '';
foreach($threadcache as $thread)
{

			$plugins->run_hooks("usercp_latest_threads_thread"); 

			$plugins->run_hooks("usercp_latest_threads_thread");

			if($thread['tid'])
{
$bgcolor = alt_trow();

			if($thread['tid'])
{
$bgcolor = alt_trow();

Zeile 4590Zeile 4664
				$cutoff = 0;
if($thread['lastpost'] > $cutoff)
{

				$cutoff = 0;
if($thread['lastpost'] > $cutoff)
{

					if($thread['lastread'])

					if(!empty($thread['lastread']))

					{
$lastread = $thread['lastread'];
}

					{
$lastread = $thread['lastread'];
}