Vergleich usercp.php - 1.6.8 - 1.6.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: usercp.php 5789 2012-04-19 13:50:38Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'usercp.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'usercp.php');


$templatelist = "usercp,usercp_home,usercp_nav,usercp_profile,error_nopermission,buddy_online,buddy_offline,usercp_changename,usercp_nav_changename";

$templatelist = "usercp,usercp_nav,usercp_profile,usercp_changename,usercp_email,usercp_password,usercp_subscriptions_thread,forumbit_depth2_forum_lastpost,usercp_forumsubscriptions_forum";

$templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups";
$templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_usergroups_leader_usergroup,usercp_usergroups_leader,usercp_currentavatar,usercp_reputation";

$templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups";
$templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_usergroups_leader_usergroup,usercp_usergroups_leader,usercp_currentavatar,usercp_reputation";

$templatelist .= ",usercp_attachments_attachment,usercp_attachments,usercp_profile_away,usercp_profile_customfield,usercp_profile_profilefields,usercp_profile_customtitle,usercp_forumsubscriptions_none,usercp_forumsubscriptions,usercp_subscriptions_none,usercp_subscriptions,usercp_options_pms_from_buddys,usercp_options_tppselect,usercp_options_pppselect,usercp_options";


$templatelist .= ",usercp_attachments_attachment,usercp_attachments,usercp_profile_away,usercp_profile_customfield,usercp_profile_profilefields,usercp_profile_customtitle,usercp_forumsubscriptions_none";
$templatelist .= ",usercp_forumsubscriptions,usercp_subscriptions_none,usercp_subscriptions,usercp_options_pms_from_buddys,usercp_options_tppselect,usercp_options_pppselect,usercp_options";

$templatelist .= ",usercp_nav_editsignature,usercp_referrals,usercp_notepad,usercp_latest_threads_threads,forumdisplay_thread_gotounread,usercp_latest_threads,usercp_subscriptions_remove";

$templatelist .= ",usercp_nav_editsignature,usercp_referrals,usercp_notepad,usercp_latest_threads_threads,forumdisplay_thread_gotounread,usercp_latest_threads,usercp_subscriptions_remove";

 
$templatelist .= ",usercp_editsig_suspended,usercp_editsig,usercp_avatar_gallery_avatar,usercp_avatar_gallery_blankblock,usercp_avatar_gallery_noavatars,usercp_avatar_gallery,usercp_avatar_current";
$templatelist .= ",usercp_avatar,usercp_editlists_userusercp_editlists,usercp_drafts_draft,usercp_drafts_none,usercp_drafts_submit,usercp_drafts,usercp_usergroups_joingroup,usercp_attachments_none";
$templatelist .= ",usercp_warnings_warning,usercp_warnings,usercp_latest_subscribed_threads,usercp_latest_subscribed,usercp_nav_messenger_tracking,multipage_prevpage,multipage_start,multipage_end";
$templatelist .= ",multipage_nextpage,multipage,multipage_page_current,codebuttons,smilieinsert_getmore,smilieinsert";


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


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

Zeile 39Zeile 44
}

$errors = '';

}

$errors = '';

 

if(!isset($mybb->input['action']))
{
$mybb->input['action'] = '';
}

$collapse_options = array('usercppms', 'usercpprofile', 'usercpmisc');
foreach($collapse_options as $option)
{
if(!isset($collapsedimg[$option]))
{
$collapsedimg[$option] = '';
}
if(!isset($collapsed[$option.'_e']))
{
$collapsed[$option.'_e'] = '';
}
}


usercp_menu();



usercp_menu();


Zeile 59Zeile 82
		(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages'])
)

		(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages'])
)

	{

	{

		if($mybb->settings['sigimgcode'] == 1)
{
$imgsallowed = $mybb->settings['maxsigimages'];

		if($mybb->settings['sigimgcode'] == 1)
{
$imgsallowed = $mybb->settings['maxsigimages'];

Zeile 79Zeile 102
			$parsed_sig = $parser->text_parse_message($mybb->input['signature']);
}
else

			$parsed_sig = $parser->text_parse_message($mybb->input['signature']);
}
else

		{

		{

			$parsed_sig = $mybb->input['signature'];
}
$parsed_sig = preg_replace("#\s#", "", $parsed_sig);

			$parsed_sig = $mybb->input['signature'];
}
$parsed_sig = preg_replace("#\s#", "", $parsed_sig);

Zeile 90Zeile 113
			if($sig_length - $mybb->settings['siglength'] > 1)
{
$lang->sig_too_long .= $lang->sprintf($lang->sig_remove_chars_plural, $sig_length-$mybb->settings['siglength']);

			if($sig_length - $mybb->settings['siglength'] > 1)
{
$lang->sig_too_long .= $lang->sprintf($lang->sig_remove_chars_plural, $sig_length-$mybb->settings['siglength']);

			}
else
{

			}
else
{

				$lang->sig_too_long .= $lang->sig_remove_chars_singular;
}
$error = inline_error($lang->sig_too_long);

				$lang->sig_too_long .= $lang->sig_remove_chars_singular;
}
$error = inline_error($lang->sig_too_long);

Zeile 183Zeile 206
			{
$mybb->input['awayyear'] = my_date('Y', $awaydate);
}

			{
$mybb->input['awayyear'] = my_date('Y', $awaydate);
}

			



			$return_month = intval(substr($mybb->input['awaymonth'], 0, 2));
$return_day = intval(substr($mybb->input['awayday'], 0, 2));
$return_year = min(intval($mybb->input['awayyear']), 9999);

			$return_month = intval(substr($mybb->input['awaymonth'], 0, 2));
$return_day = intval(substr($mybb->input['awayday'], 0, 2));
$return_year = min(intval($mybb->input['awayyear']), 9999);

Zeile 195Zeile 218
			{
error($lang->error_usercp_return_date_past);
}

			{
error($lang->error_usercp_return_date_past);
}

			



			$returndate = "{$return_day}-{$return_month}-{$return_year}";
}
else

			$returndate = "{$return_day}-{$return_month}-{$return_year}";
}
else

Zeile 231Zeile 254

$user = array(
"uid" => $mybb->user['uid'],


$user = array(
"uid" => $mybb->user['uid'],

 
		"postnum" => $mybb->user['postnum'],

		"website" => $mybb->input['website'],
"icq" => intval($mybb->input['icq']),
"aim" => $mybb->input['aim'],

		"website" => $mybb->input['website'],
"icq" => intval($mybb->input['icq']),
"aim" => $mybb->input['aim'],

Zeile 258Zeile 282
	if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

	if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

 

// Set allowed value otherwise select options disappear
if(in_array($lang->userdata_invalid_birthday_privacy, $errors))
{
$mybb->input['birthdayprivacy'] = 'none';
}


		$errors = inline_error($errors);
$mybb->input['action'] = "profile";
}
else
{
$userhandler->update_user();

		$errors = inline_error($errors);
$mybb->input['action'] = "profile";
}
else
{
$userhandler->update_user();





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

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

Zeile 294Zeile 325
		if($bday[0] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		if($bday[0] == $i)
{
$bdaydaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

		}

		}

		else
{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";

		else
{
$bdaydaysel .= "<option value=\"$i\">$i</option>\n";

Zeile 306Zeile 337
	if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])
{
$bdayprivacysel .= "<option value=\"all\" selected=\"selected\">{$lang->birthdayprivacyall}</option>\n";

	if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])
{
$bdayprivacysel .= "<option value=\"all\" selected=\"selected\">{$lang->birthdayprivacyall}</option>\n";

		$bdayprivacysel .= "<option value=\"none\">{$lang->birthdayprivacynone}</option>\n";

		$bdayprivacysel .= "<option value=\"none\">{$lang->birthdayprivacynone}</option>\n";

		$bdayprivacysel .= "<option value=\"age\">{$lang->birthdayprivacyage}</option>";
}
else if($user['birthdayprivacy'] == 'none')

		$bdayprivacysel .= "<option value=\"age\">{$lang->birthdayprivacyage}</option>";
}
else if($user['birthdayprivacy'] == 'none')

Zeile 403Zeile 434
	while($profilefield = $db->fetch_array($query))
{
// Does this field have a minimum post count?

	while($profilefield = $db->fetch_array($query))
{
// Does this field have a minimum post count?

		if($profilefield['postnum'] && $profilefield['postnum'] > $user['postnum'])

		if($profilefield['postnum'] && $profilefield['postnum'] > $mybb->user['postnum'])

		{
continue;
}

		{
continue;
}

Zeile 465Zeile 496
			}
}
elseif($type == "select")

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

		{

		{

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

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

Zeile 485Zeile 516
					$profilefield['length'] = 1;
}
$code = "<select name=\"profile_fields[$field]\" size=\"{$profilefield['length']}\">$select</select>";

					$profilefield['length'] = 1;
}
$code = "<select name=\"profile_fields[$field]\" size=\"{$profilefield['length']}\">$select</select>";

			}

			}

		}
elseif($type == "radio")
{
$expoptions = explode("\n", $options);
if(is_array($expoptions))

		}
elseif($type == "radio")
{
$expoptions = explode("\n", $options);
if(is_array($expoptions))

			{

			{

				foreach($expoptions as $key => $val)
{
$checked = "";

				foreach($expoptions as $key => $val)
{
$checked = "";

Zeile 510Zeile 541
				$useropts = $userfield;
}
else

				$useropts = $userfield;
}
else

			{

			{

				$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)

				$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)

				{

				{

					$seloptions[$val] = $val;
}
}

					$seloptions[$val] = $val;
}
}

Zeile 535Zeile 566
			}
}
elseif($type == "textarea")

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

		{
$value = htmlspecialchars_uni($userfield);

		{
$value = htmlspecialchars_uni($userfield);

			$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";
}
else

			$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";
}
else

Zeile 548Zeile 579
				$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";

				$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";

		}

		}

		if($profilefield['required'] == 1)
{
eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");

		if($profilefield['required'] == 1)
{
eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");

Zeile 567Zeile 598
		$seloptions = "";
}
if($customfields)

		$seloptions = "";
}
if($customfields)

	{

	{

		eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");
}

if($mybb->usergroup['cancustomtitle'] == 1)
{
if($mybb->usergroup['usertitle'] == "")

		eval("\$customfields = \"".$templates->get("usercp_profile_profilefields")."\";");
}

if($mybb->usergroup['cancustomtitle'] == 1)
{
if($mybb->usergroup['usertitle'] == "")

		{
$query = $db->simple_select("usertitles", "*", "posts <='".$mybb->user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$utitle = $db->fetch_array($query);
$defaulttitle = $utitle['title'];
}









		{
$defaulttitle = '';
$usertitles = $cache->read('usertitles');

foreach($usertitles as $title)
{
if($title['posts'] <= $mybb->user['postnum'])
{
$defaulttitle = $title['title'];
break;
}
}
}

		else
{
$defaulttitle = $mybb->usergroup['usertitle'];

		else
{
$defaulttitle = $mybb->usergroup['usertitle'];

		}

		}


if(trim($user['usertitle']) == '')
{


if(trim($user['usertitle']) == '')
{

Zeile 602Zeile 641
	{
$customtitle = "";
}

	{
$customtitle = "";
}

	



	$plugins->run_hooks("usercp_profile_end");

	$plugins->run_hooks("usercp_profile_end");

	



	eval("\$editprofile = \"".$templates->get("usercp_profile")."\";");
output_page($editprofile);
}

	eval("\$editprofile = \"".$templates->get("usercp_profile")."\";");
output_page($editprofile);
}

Zeile 724Zeile 763
	if($user['hideemail'] == 1)
{
$hideemailcheck = "checked=\"checked\"";

	if($user['hideemail'] == 1)
{
$hideemailcheck = "checked=\"checked\"";

	}
else

	}
else

	{
$hideemailcheck = "";

	{
$hideemailcheck = "";

	}

if($user['subscriptionmethod'] == 1)

	}

if($user['subscriptionmethod'] == 1)

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

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

Zeile 742Zeile 781

{
$no_subscribe_selected = "selected=\"selected\"";


{
$no_subscribe_selected = "selected=\"selected\"";

	}

	}


if($user['showsigs'] == 1)
{
$showsigscheck = "checked=\"checked\"";


if($user['showsigs'] == 1)
{
$showsigscheck = "checked=\"checked\"";

	}
else

	}
else

	{
$showsigscheck = "";
}

	{
$showsigscheck = "";
}

Zeile 760Zeile 799
	else
{
$showavatarscheck = "";

	else
{
$showavatarscheck = "";

	}


	}


	if($user['showquickreply'] == 1)

	if($user['showquickreply'] == 1)

	{

	{

		$showquickreplycheck = "checked=\"checked\"";

		$showquickreplycheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$showquickreplycheck = "";

		$showquickreplycheck = "";

	}

	}


if($user['receivepms'] == 1)


if($user['receivepms'] == 1)

	{

	{

		$receivepmscheck = "checked=\"checked\"";

		$receivepmscheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$receivepmscheck = "";
}

		$receivepmscheck = "";
}

	



	if($user['receivefrombuddy'] == 1)
{
$receivefrombuddycheck = "checked=\"checked\"";
}

	if($user['receivefrombuddy'] == 1)
{
$receivefrombuddycheck = "checked=\"checked\"";
}

	else
{
$receivefrombuddycheck = "";
}

if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)

	else
{
$receivefrombuddycheck = "";
}

if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)

	{
$pmnoticecheck = " checked=\"checked\"";
}
else
{
$pmnoticecheck = "";

	{
$pmnoticecheck = " checked=\"checked\"";
}
else
{
$pmnoticecheck = "";

	}


	}


	if($user['dstcorrection'] == 2)
{
$dst_auto_selected = "selected=\"selected\"";
}
else if($user['dstcorrection'] == 1)

	if($user['dstcorrection'] == 2)
{
$dst_auto_selected = "selected=\"selected\"";
}
else if($user['dstcorrection'] == 1)

	{

	{

		$dst_enabled_selected = "selected=\"selected\"";
}
else
{
$dst_disabled_selected = "selected=\"selected\"";

		$dst_enabled_selected = "selected=\"selected\"";
}
else
{
$dst_disabled_selected = "selected=\"selected\"";

	}

	}


if($user['showcodebuttons'] == 1)


if($user['showcodebuttons'] == 1)

	{

	{

		$showcodebuttonscheck = "checked=\"checked\"";

		$showcodebuttonscheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$showcodebuttonscheck = "";
}


		$showcodebuttonscheck = "";
}


Zeile 827Zeile 866
	else
{
$showredirectcheck = "";

	else
{
$showredirectcheck = "";

	}


	}


	if($user['pmnotify'] != 0)
{
$pmnotifycheck = "checked=\"checked\"";

	if($user['pmnotify'] != 0)
{
$pmnotifycheck = "checked=\"checked\"";

Zeile 838Zeile 877
		$pmnotifycheck = '';
}


		$pmnotifycheck = '';
}


	



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

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

	}

	}


if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";
}
else


if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";
}
else

	{

	{

		$classicpostbitcheck = '';
}


		$classicpostbitcheck = '';
}


Zeile 860Zeile 899
		if($user['dateformat'] == $key)
{
$date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";

		if($user['dateformat'] == $key)
{
$date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";

		}
else

		}
else

		{
$date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";
}

		{
$date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";
}

Zeile 881Zeile 920
	}

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

	}

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

	



	if($mybb->settings['allowbuddyonly'] == 1)
{
eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";");

	if($mybb->settings['allowbuddyonly'] == 1)
{
eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";");

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

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

	



	$plugins->run_hooks("usercp_options_end");

	$plugins->run_hooks("usercp_options_end");

	



	eval("\$editprofile = \"".$templates->get("usercp_options")."\";");
output_page($editprofile);
}

	eval("\$editprofile = \"".$templates->get("usercp_options")."\";");
output_page($editprofile);
}

Zeile 1020Zeile 1059
	}

$plugins->run_hooks("usercp_email");

	}

$plugins->run_hooks("usercp_email");

	



	eval("\$changemail = \"".$templates->get("usercp_email")."\";");
output_page($changemail);
}

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

	eval("\$changemail = \"".$templates->get("usercp_email")."\";");
output_page($changemail);
}

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

{
// Verify incoming POST request

{
// Verify incoming POST request

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

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





	$errors = array();

$plugins->run_hooks("usercp_do_password_start");
if(validate_password_from_uid($mybb->user['uid'], $mybb->input['oldpassword']) == false)

	$errors = array();

$plugins->run_hooks("usercp_do_password_start");
if(validate_password_from_uid($mybb->user['uid'], $mybb->input['oldpassword']) == false)

	{

	{

		$errors[] = $lang->error_invalidpassword;
}
else

		$errors[] = $lang->error_invalidpassword;
}
else

Zeile 1052Zeile 1091
		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		{

		{

			$errors = $userhandler->get_friendly_errors();
}
else

			$errors = $userhandler->get_friendly_errors();
}
else

Zeile 1073Zeile 1112
if($mybb->input['action'] == "password")
{
$plugins->run_hooks("usercp_password");

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

	



	eval("\$editpassword = \"".$templates->get("usercp_password")."\";");

	eval("\$editpassword = \"".$templates->get("usercp_password")."\";");

	output_page($editpassword);
}


	output_page($editpassword);
}


if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{
// Verify incoming POST request

Zeile 1132Zeile 1171
	{
error_no_permission();
}

	{
error_no_permission();
}

	



	$plugins->run_hooks("usercp_changename_end");

	$plugins->run_hooks("usercp_changename_end");

	



	eval("\$changename = \"".$templates->get("usercp_changename")."\";");
output_page($changename);
}

	eval("\$changename = \"".$templates->get("usercp_changename")."\";");
output_page($changename);
}

Zeile 1149Zeile 1188
	if(!is_array($mybb->input['check']))
{
error($lang->no_subscriptions_selected);

	if(!is_array($mybb->input['check']))
{
error($lang->no_subscriptions_selected);

	}


	}


	// Clean input - only accept integers thanks!
$mybb->input['check'] = array_map('intval', $mybb->input['check']);
$tids = implode(",", $mybb->input['check']);

	// Clean input - only accept integers thanks!
$mybb->input['check'] = array_map('intval', $mybb->input['check']);
$tids = implode(",", $mybb->input['check']);

Zeile 1166Zeile 1205
		if($mybb->input['do'] == "no_notification")
{
$new_notification = 0;

		if($mybb->input['do'] == "no_notification")
{
$new_notification = 0;

		}

		}

		else if($mybb->input['do'] == "instant_notification")
{
$new_notification = 1;

		else if($mybb->input['do'] == "instant_notification")
{
$new_notification = 1;

Zeile 1175Zeile 1214
		// 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);
}

Zeile 1200Zeile 1239
		WHERE ts.uid = '".$mybb->user['uid']."' {$visible}
");
$threadcount = $db->fetch_field($query, "threads");

		WHERE ts.uid = '".$mybb->user['uid']."' {$visible}
");
$threadcount = $db->fetch_field($query, "threads");


if(!$mybb->settings['threadsperpage'])
{


if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
{

		$mybb->settings['threadsperpage'] = 20;
}


		$mybb->settings['threadsperpage'] = 20;
}


Zeile 1210Zeile 1249
	$page = intval($mybb->input['page']);
if($page > 0)
{

	$page = intval($mybb->input['page']);
if($page > 0)
{

		$start = ($page-1) *$perpage;








		$start = ($page-1) * $perpage;
$pages = $threadcount / $perpage;
$pages = ceil($pages);
if($page > $pages || $page <= 0)
{
$start = 0;
$page = 1;
}

	}
else
{

	}
else
{

Zeile 1242Zeile 1288
	{
$forumpermissions = $fpermissions[$subscription['fid']];


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


		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)

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

		{
// Hmm, you don't have permission to view this thread - unsubscribe!

		{
// Hmm, you don't have permission to view this thread - unsubscribe!

			$del_subscriptions[] = $subscription['tid'];
}

			$del_subscriptions[] = $subscription['sid'];
}

		else if($subscription['tid'])
{
$subscriptions[$subscription['tid']] = $subscription;

		else if($subscription['tid'])
{
$subscriptions[$subscription['tid']] = $subscription;

Zeile 1254Zeile 1300
	}

if(is_array($del_subscriptions))

	}

if(is_array($del_subscriptions))

	{
$tids = implode(',', $del_subscriptions);

if($tids)
{
$db->delete_query("threadsubscriptions", "tid IN ({$tids}) AND uid='{$mybb->user['uid']}'");

	{
$sids = implode(',', $del_subscriptions);

if($sids)
{
$db->delete_query("threadsubscriptions", "sid IN ({$sids}) AND uid='{$mybb->user['uid']}'");

		}

$threadcount = $threadcount - count($del_subscriptions);

		}

$threadcount = $threadcount - count($del_subscriptions);

Zeile 1269Zeile 1315
			$threadcount = 0;
}
}

			$threadcount = 0;
}
}





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

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

		



		if($mybb->user['uid'] == 0)
{
// Build a forum cache.

		if($mybb->user['uid'] == 0)
{
// Build a forum cache.

Zeile 1283Zeile 1329
				WHERE active != 0
ORDER BY pid, disporder
");

				WHERE active != 0
ORDER BY pid, disporder
");

			



			$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
}
else

			$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
}
else

Zeile 1306Zeile 1352
				{
$forum['lastread'] = $forumsread[$forum['fid']];
}

				{
$forum['lastread'] = $forumsread[$forum['fid']];
}

			}

			}

			$readforums[$forum['fid']] = $forum['lastread'];
}

// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0)

			$readforums[$forum['fid']] = $forum['lastread'];
}

// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0)

		{

		{

			$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

			$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

			}

			}

		}

// Read threads

		}

// Read threads

Zeile 1329Zeile 1375
				$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}

				$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}

		



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

// Now we can build our subscription list

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

// Now we can build our subscription list

Zeile 1339Zeile 1385

$folder = '';
$prefix = '';


$folder = '';
$prefix = '';

			



			// If this thread has a prefix, insert a space between prefix and subject
if($thread['prefix'] != 0)
{
$thread['threadprefix'] .= '&nbsp;';
}

			// If this thread has a prefix, insert a space between prefix and subject
if($thread['prefix'] != 0)
{
$thread['threadprefix'] .= '&nbsp;';
}

			



			// Sanitize
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);

			// Sanitize
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);

Zeile 1359Zeile 1405
			{
$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

			{
$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

			}
else

			}
else

			{
$icon = "&nbsp;";
}

			{
$icon = "&nbsp;";
}

Zeile 1373Zeile 1419
			{
$folder = "dot_";
$folder_label .= $lang->icon_dot;

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

			}


			}


			$gotounread = '';
$isnew = 0;
$donenew = 0;

			$gotounread = '';
$isnew = 0;
$donenew = 0;

Zeile 1383Zeile 1429
			if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
{
$forum_read = $readforums[$thread['fid']];

			if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
{
$forum_read = $readforums[$thread['fid']];

			



				$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{

				$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{

Zeile 1393Zeile 1439
			else
{
$forum_read = $forumsread[$thread['fid']];

			else
{
$forum_read = $forumsread[$thread['fid']];

			}


			}


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

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

Zeile 1498Zeile 1544
	{
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
}

	{
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
}

	



	$plugins->run_hooks("usercp_subscriptions_end");

	$plugins->run_hooks("usercp_subscriptions_end");

	



	eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";");
output_page($subscriptions);
}

	eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";");
output_page($subscriptions);
}





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

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

	



	if($mybb->user['uid'] == 0)
{
// Build a forum cache.

	if($mybb->user['uid'] == 0)
{
// Build a forum cache.

Zeile 1518Zeile 1564
			WHERE active != 0
ORDER BY pid, disporder
");

			WHERE active != 0
ORDER BY pid, disporder
");

		



		$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
}
else

		$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
}
else

Zeile 1564Zeile 1610
		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];


		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];


		if($forumpermissions['canview'] == 0)

		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)

		{
continue;

		{
continue;

		}


		}


		$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost']));
$folder = $lightbulb['folder'];

		$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost']));
$folder = $lightbulb['folder'];

 

if($forumpermissions['canonlyviewownthreads'] != 0)
{
$posts = '-';
$threads = '-';
}
else
{
$posts = my_number_format($forum['posts']);
$threads = my_number_format($forum['threads']);
}


if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{


if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{

			$lastpost = "<div align=\"center\">$lang->never</div>";






			$lastpost = "<div align=\"center\">{$lang->never}</div>";
}
// Hide last post
elseif($forumpermissions['canonlyviewownthreads'] != 0 && $forum['lastposteruid'] != $mybb->user['uid'])
{
$lastpost = "<div align=\"center\">{$lang->na}</div>";

		}
else
{

		}
else
{

Zeile 1592Zeile 1654
			$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")."\";");
}


$posts = my_number_format($forum['posts']);
$threads = my_number_format($forum['threads']);

 

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


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

Zeile 1616Zeile 1675
}

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

}

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

{	

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 1632Zeile 1691
	{
$update_signature = array(
"includesig" => 1

	{
$update_signature = array(
"includesig" => 1

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

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

	elseif($mybb->input['updateposts'] == "disable")
{
$update_signature = array(

	elseif($mybb->input['updateposts'] == "disable")
{
$update_signature = array(

Zeile 1664Zeile 1723
	{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";

	{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";

	}

	}

	else if($error)
{
$sig = $mybb->input['signature'];
$template = false;

	else if($error)
{
$sig = $mybb->input['signature'];
$template = false;

	}


	}


	if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
{
// User currently has no signature and they're suspended
error($lang->sig_suspended);

	if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
{
// User currently has no signature and they're suspended
error($lang->sig_suspended);

	}

	}


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


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

Zeile 1707Zeile 1766
	if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW)
{
$plugins->run_hooks("usercp_editsig_end");

	if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW)
{
$plugins->run_hooks("usercp_editsig_end");

		



		// User either doesn't have permission, or has their signature suspended
eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";");
}

		// User either doesn't have permission, or has their signature suspended
eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";");
}

Zeile 1754Zeile 1813
		{
$codebuttons = build_mycode_inserter("signature");
}

		{
$codebuttons = build_mycode_inserter("signature");
}

		



		$plugins->run_hooks("usercp_editsig_end");

		$plugins->run_hooks("usercp_editsig_end");

		



		eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");
}

		eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");
}

	



	output_page($editsig);
}

	output_page($editsig);
}





if($mybb->input['action'] == "do_avatar" && $mybb->request_method == "post")
{
// Verify incoming POST request

if($mybb->input['action'] == "do_avatar" && $mybb->request_method == "post")
{
// Verify incoming POST request

Zeile 1772Zeile 1831
	require_once MYBB_ROOT."inc/functions_upload.php";

$avatar_error = "";

	require_once MYBB_ROOT."inc/functions_upload.php";

$avatar_error = "";





	if($mybb->input['remove']) // remove avatar
{
$updated_avatar = array(

	if($mybb->input['remove']) // remove avatar
{
$updated_avatar = array(

Zeile 1786Zeile 1845
	elseif($mybb->input['gallery']) // Gallery avatar
{
if(empty($mybb->input['avatar']))

	elseif($mybb->input['gallery']) // Gallery avatar
{
if(empty($mybb->input['avatar']))

		{

		{

			$avatar_error = $lang->error_noavatar;
}

			$avatar_error = $lang->error_noavatar;
}

		



		$mybb->input['gallery'] = str_replace(array("./", ".."), "", $mybb->input['gallery']);
$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


		$mybb->input['gallery'] = str_replace(array("./", ".."), "", $mybb->input['gallery']);
$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


Zeile 1800Zeile 1859
				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']);
}
else

				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']);
}
else

			{

			{

				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);
}


				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);
}


Zeile 1826Zeile 1885
		}
$avatar = upload_avatar();
if($avatar['error'])

		}
$avatar = upload_avatar();
if($avatar['error'])

		{

		{

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

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

Zeile 1985Zeile 2044
				{
$avatarlist .= "</tr>\n<tr>\n";
$count = 0;

				{
$avatarlist .= "</tr>\n<tr>\n";
$count = 0;

				}

				}

				++$count;
eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_avatar")."\";");
}

				++$count;
eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_avatar")."\";");
}

Zeile 2001Zeile 2060
		{
eval("\$avatarlist = \"".$templates->get("usercp_avatar_gallery_noavatars")."\";");
}

		{
eval("\$avatarlist = \"".$templates->get("usercp_avatar_gallery_noavatars")."\";");
}

		



		$plugins->run_hooks("usercp_avatar_end");

		$plugins->run_hooks("usercp_avatar_end");

		



		eval("\$gallery = \"".$templates->get("usercp_avatar_gallery")."\";");
output_page($gallery);
}

		eval("\$gallery = \"".$templates->get("usercp_avatar_gallery")."\";");
output_page($gallery);
}

Zeile 2056Zeile 2115
		{
$auto_resize = "<br /><span class=\"smalltext\"><input type=\"checkbox\" name=\"auto_resize\" value=\"1\" checked=\"checked\" id=\"auto_resize\" /> <label for=\"auto_resize\">{$lang->avatar_auto_resize_option}</label></span>";
}

		{
$auto_resize = "<br /><span class=\"smalltext\"><input type=\"checkbox\" name=\"auto_resize\" value=\"1\" checked=\"checked\" id=\"auto_resize\" /> <label for=\"auto_resize\">{$lang->avatar_auto_resize_option}</label></span>";
}

		



		$plugins->run_hooks("usercp_avatar_end");

		$plugins->run_hooks("usercp_avatar_end");

		



		eval("\$avatar = \"".$templates->get("usercp_avatar")."\";");
output_page($avatar);
}

		eval("\$avatar = \"".$templates->get("usercp_avatar")."\";");
output_page($avatar);
}

Zeile 2099Zeile 2158
			$selected_list = explode(",", $mybb->user['ignorelist']);
}
}

			$selected_list = explode(",", $mybb->user['ignorelist']);
}
}

	



	$error_message = "";
$message = "";

	$error_message = "";
$message = "";

	



	// Adding one or more users to this list
if($mybb->input['add_username'])
{

	// Adding one or more users to this list
if($mybb->input['add_username'])
{

Zeile 2160Zeile 2219
					array_pop($users); // To maintain a proper count when we call count($users)
continue;
}

					array_pop($users); // To maintain a proper count when we call count($users)
continue;
}

				



				$existing_users[] = $user['uid'];

				$existing_users[] = $user['uid'];

			}
}

if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))
{
if($mybb->input['manage'] == "ignored")
{
$message = $lang->users_added_to_ignore_list;
}
else
{
$message = $lang->users_added_to_buddy_list;
}
}

if($adding_self == true)
{
if($mybb->input['manage'] == "ignored")
{
$error_message = $lang->cant_add_self_to_ignore_list;
}
else
{
$error_message = $lang->cant_add_self_to_buddy_list;
}
}

if(count($existing_users) == 0)
{
$message = "";
}


			}
}































		if($found_users < count($users))
{
if($error_message)

		if($found_users < count($users))
{
if($error_message)

Zeile 2203Zeile 2233

$error_message .= $lang->invalid_user_selected;
}


$error_message .= $lang->invalid_user_selected;
}

	}































if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))
{
if($mybb->input['manage'] == "ignored")
{
$message = $lang->users_added_to_ignore_list;
}
else
{
$message = $lang->users_added_to_buddy_list;
}
}

if($adding_self == true)
{
if($mybb->input['manage'] == "ignored")
{
$error_message = $lang->cant_add_self_to_ignore_list;
}
else
{
$error_message = $lang->cant_add_self_to_buddy_list;
}
}

if(count($existing_users) == 0)
{
$message = "";
}
}


// Removing a user from this list
else if($mybb->input['delete'])


// Removing a user from this list
else if($mybb->input['delete'])

Zeile 2217Zeile 2276
			if($mybb->input['manage'] == "ignored")
{
$message = $lang->removed_from_ignore_list;

			if($mybb->input['manage'] == "ignored")
{
$message = $lang->removed_from_ignore_list;

			}

			}

			else
{
$message = $lang->removed_from_buddy_list;

			else
{
$message = $lang->removed_from_buddy_list;

Zeile 2253Zeile 2312
	{
$user['buddylist'] = $db->escape_string($new_list);
$mybb->user['buddylist'] = $user['buddylist'];

	{
$user['buddylist'] = $db->escape_string($new_list);
$mybb->user['buddylist'] = $user['buddylist'];

	}

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


	}

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


	$plugins->run_hooks("usercp_do_editlists_end");

// Ajax based request, throw new list to browser
if($mybb->input['ajax'])
{
if($mybb->input['manage'] == "ignored")

	$plugins->run_hooks("usercp_do_editlists_end");

// Ajax based request, throw new list to browser
if($mybb->input['ajax'])
{
if($mybb->input['manage'] == "ignored")

		{

		{

			$list = "ignore";

			$list = "ignore";

		}

		}

		else
{
$list = "buddy";

		else
{
$list = "buddy";

		}


		}


		if($message)
{
$message_js = "var success = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(success, element); success.innerHTML = '{$message}'; success.className = 'success_message'; window.setTimeout(function() { Element.remove(success) }, 5000);";

		if($message)
{
$message_js = "var success = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(success, element); success.innerHTML = '{$message}'; success.className = 'success_message'; window.setTimeout(function() { Element.remove(success) }, 5000);";

		}

if($error_message)

		}

if($error_message)

		{
$message_js .= " var error = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(error, element); error.innerHTML = '{$error_message}'; error.className = 'error_message'; window.setTimeout(function() { Element.remove(error) }, 5000);";
}

		{
$message_js .= " var error = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(error, element); error.innerHTML = '{$error_message}'; error.className = 'error_message'; window.setTimeout(function() { Element.remove(error) }, 5000);";
}

Zeile 2296Zeile 2355
				{
echo "\$('buddy_list').innerHTML = '<li>{$lang->buddy_list_empty}</li>';\n";
}

				{
echo "\$('buddy_list').innerHTML = '<li>{$lang->buddy_list_empty}</li>';\n";
}

			}

			}

			else
{
echo "\$('{$mybb->input['manage']}_count').innerHTML = '".count(explode(",", $new_list))."';\n";

			else
{
echo "\$('{$mybb->input['manage']}_count').innerHTML = '".count(explode(",", $new_list))."';\n";

Zeile 2309Zeile 2368
	else
{
if($error_message)

	else
{
if($error_message)

		{

		{

			$message .= "<br />".$error_message;
}
redirect("usercp.php?action=editlists#{$mybb->input['manage']}", $message);

			$message .= "<br />".$error_message;
}
redirect("usercp.php?action=editlists#{$mybb->input['manage']}", $message);

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

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

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

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

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

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

Zeile 2342Zeile 2401
			eval("\$buddy_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$buddy_count;
}

			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 2362Zeile 2421
			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
{
$status = "online";

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
{
$status = "online";

			}

			}

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

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

		}
}

		}
}


$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
if(!$ignore_list)


$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
if(!$ignore_list)

	{

	{

		$ignore_list = "<li>{$lang->ignore_list_empty}</li>";

		$ignore_list = "<li>{$lang->ignore_list_empty}</li>";

	}


	}


	// If an AJAX request from buddy management, echo out whatever the new list is.
if($mybb->request_method == "post" && $mybb->input['ajax'] == 1)
{

	// If an AJAX request from buddy management, echo out whatever the new list is.
if($mybb->request_method == "post" && $mybb->input['ajax'] == 1)
{

Zeile 2385Zeile 2444
		{
echo $ignore_list;
echo "<script type=\"text/javascript\"> $('ignored_count').innerHTML = '{$ignore_count}'; {$message_js}</script>";

		{
echo $ignore_list;
echo "<script type=\"text/javascript\"> $('ignored_count').innerHTML = '{$ignore_count}'; {$message_js}</script>";

		}

		}

		else
{
echo $buddy_list;

		else
{
echo $buddy_list;

Zeile 2393Zeile 2452
		}
exit;
}

		}
exit;
}

	



	$plugins->run_hooks("usercp_editlists_end");

eval("\$listpage = \"".$templates->get("usercp_editlists")."\";");

	$plugins->run_hooks("usercp_editlists_end");

eval("\$listpage = \"".$templates->get("usercp_editlists")."\";");

Zeile 2425Zeile 2484
		}
elseif($draft['threadvisible'] == -2) // We're looking at a draft thread
{

		}
elseif($draft['threadvisible'] == -2) // We're looking at a draft thread
{

			$detail = $lang->forum." <a href=\"".get_forum_link($draft['fid'])."\">".htmlspecialchars_uni($draft['forumname'])."</a>";

			$detail = $lang->forum." <a href=\"".get_forum_link($draft['fid'])."\">{$draft['forumname']}</a>";

			$editurl = "newthread.php?action=editdraft&amp;tid={$draft['tid']}";
$id = $draft['tid'];
$type = "thread";

			$editurl = "newthread.php?action=editdraft&amp;tid={$draft['tid']}";
$id = $draft['tid'];
$type = "thread";

Zeile 2445Zeile 2504
		eval("\$draftsubmit = \"".$templates->get("usercp_drafts_submit")."\";");
$disable_delete_drafts = '';
}

		eval("\$draftsubmit = \"".$templates->get("usercp_drafts_submit")."\";");
$disable_delete_drafts = '';
}

	



	$query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='".$mybb->user['uid']."'");
$count = $db->fetch_array($query);
$draftcount = "(".my_number_format($count['draftcount']).")";

	$query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='".$mybb->user['uid']."'");
$count = $db->fetch_array($query);
$draftcount = "(".my_number_format($count['draftcount']).")";

	



	$plugins->run_hooks("usercp_drafts_end");

	$plugins->run_hooks("usercp_drafts_end");

	



	eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";");
output_page($draftlist);

	eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";");
output_page($draftlist);





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

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

Zeile 2473Zeile 2532
		if($val == "post")
{
$pidin[] = "'".intval($id)."'";

		if($val == "post")
{
$pidin[] = "'".intval($id)."'";

		}

		}

		elseif($val == "thread")
{
$tidin[] = "'".intval($id)."'";
}
}
if($tidin)

		elseif($val == "thread")
{
$tidin[] = "'".intval($id)."'";
}
}
if($tidin)

	{

	{

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

Zeile 2493Zeile 2552
			$pidinq = "pid IN ($pidin)";
}
else

			$pidinq = "pid IN ($pidin)";
}
else

		{

		{

			$pidinq = "1=0";
}
$db->delete_query("posts", "($pidinq $tidinp) AND visible='-2' AND uid='".$mybb->user['uid']."'");

			$pidinq = "1=0";
}
$db->delete_query("posts", "($pidinq $tidinp) AND visible='-2' AND uid='".$mybb->user['uid']."'");

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

if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)

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

if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)

		{

		{

			error($lang->not_member_of_group);
}
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['displaygroup'])."'");

			error($lang->not_member_of_group);
}
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['displaygroup'])."'");

Zeile 2526Zeile 2585
		$cache->update_moderators();
$plugins->run_hooks("usercp_usergroups_change_displaygroup");
redirect("usercp.php?action=usergroups", $lang->display_group_changed);

		$cache->update_moderators();
$plugins->run_hooks("usercp_usergroups_change_displaygroup");
redirect("usercp.php?action=usergroups", $lang->display_group_changed);

		exit;

		exit;

	}

// Leaving a group

	}

// Leaving a group

Zeile 2583Zeile 2642
		}
if($mybb->input['do'] == "joingroup" && $usergroup['type'] == 4)
{

		}
if($mybb->input['do'] == "joingroup" && $usergroup['type'] == 4)
{

			$reason = $db->escape_string($reason);

			$reason = $db->escape_string($mybb->input['reason']);

			$now = TIME_NOW;
$joinrequest = array(
"uid" => $mybb->user['uid'],
"gid" => intval($mybb->input['joingroup']),

			$now = TIME_NOW;
$joinrequest = array(
"uid" => $mybb->user['uid'],
"gid" => intval($mybb->input['joingroup']),

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

				"reason" => $reason,

				"dateline" => TIME_NOW
);


				"dateline" => TIME_NOW
);


Zeile 2633Zeile 2692
	{
case "pgsql":
case "sqlite":

	{
case "pgsql":
case "sqlite":

			$query = $db->query("
SELECT g.title, g.gid, g.type, COUNT(u.uid) AS users, COUNT(j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers

			$query = $db->query("
SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers

				FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)
WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers

				FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)
WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers

			");

			");

			break;
default:
$query = $db->query("

			break;
default:
$query = $db->query("

Zeile 2653Zeile 2712
				WHERE l.uid='".$mybb->user['uid']."'
GROUP BY l.gid
");

				WHERE l.uid='".$mybb->user['uid']."'
GROUP BY l.gid
");

	}


	}


	while($usergroup = $db->fetch_array($query))
{
$memberlistlink = $moderaterequestslink = '';

	while($usergroup = $db->fetch_array($query))
{
$memberlistlink = $moderaterequestslink = '';

Zeile 2674Zeile 2733
	if($groupsledlist)
{
eval("\$leadinggroups = \"".$templates->get("usercp_usergroups_leader")."\";");

	if($groupsledlist)
{
eval("\$leadinggroups = \"".$templates->get("usercp_usergroups_leader")."\";");

	}

	}


// Fetch the list of groups the member is in
// Do the primary group first


// Fetch the list of groups the member is in
// Do the primary group first

Zeile 2687Zeile 2746
		$displaycode = " ({$lang->display_group})";
}
elseif($usergroup['candisplaygroup'] == 1)

		$displaycode = " ({$lang->display_group})";
}
elseif($usergroup['candisplaygroup'] == 1)

	{

	{

		$displaycode = " (<a href=\"usercp.php?action=usergroups&amp;displaygroup={$usergroup['gid']}&amp;my_post_key={$mybb->post_code}\">{$lang->set_as_display_group}</a>)";
}
else

		$displaycode = " (<a href=\"usercp.php?action=usergroups&amp;displaygroup={$usergroup['gid']}&amp;my_post_key={$mybb->post_code}\">{$lang->set_as_display_group}</a>)";
}
else

Zeile 2711Zeile 2770
			elseif($usergroup['type'] != 4 && $usergroup['type'] != 3)
{
$leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">{$lang->usergroup_cannot_leave}</span></div>";

			elseif($usergroup['type'] != 4 && $usergroup['type'] != 3)
{
$leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">{$lang->usergroup_cannot_leave}</span></div>";

			}
else

			}
else

			{
$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&amp;leavegroup=".$usergroup['gid']."&amp;my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";
}

			{
$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&amp;leavegroup=".$usergroup['gid']."&amp;my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";
}

Zeile 2723Zeile 2782
			else
{
$description = '';

			else
{
$description = '';

			}
if(!$usergroup['usertitle'])
{
// fetch title here

 
			}
$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])

			}
$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])

Zeile 2742Zeile 2797
				$displaycode = '';
}
eval("\$memberoflist .= \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");

				$displaycode = '';
}
eval("\$memberoflist .= \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");

		}

		}

	}
eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");


	}
eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");


Zeile 2821Zeile 2876
	}

$plugins->run_hooks("usercp_usergroups_end");

	}

$plugins->run_hooks("usercp_usergroups_end");

	



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

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

Zeile 2831Zeile 2886
	require_once MYBB_ROOT."inc/functions_upload.php";

$attachments = '';

	require_once MYBB_ROOT."inc/functions_upload.php";

$attachments = '';





	// Pagination

	// Pagination

	if(!$mybb->settings['threadsperpage'])

	if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)

	{
$mybb->settings['threadsperpage'] = 20;
}

	{
$mybb->settings['threadsperpage'] = 20;
}

Zeile 2842Zeile 2897
	$page = intval($mybb->input['page']);

if(intval($mybb->input['page']) > 0)

	$page = intval($mybb->input['page']);

if(intval($mybb->input['page']) > 0)

	{

	{

		$start = ($page-1) *$perpage;
}
else
{
$start = 0;
$page = 1;

		$start = ($page-1) *$perpage;
}
else
{
$start = 0;
$page = 1;

	}


	}


	$end = $start + $perpage;
$lower = $start+1;


	$end = $start + $perpage;
$lower = $start+1;


Zeile 2921Zeile 2976
		eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";");
$usagenote = '';
}

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

	



	$plugins->run_hooks("usercp_attachments_end");

	$plugins->run_hooks("usercp_attachments_end");

	



	eval("\$manageattachments = \"".$templates->get("usercp_attachments")."\";");
output_page($manageattachments);

	eval("\$manageattachments = \"".$templates->get("usercp_attachments")."\";");
output_page($manageattachments);

}


}


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

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

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

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


$plugins->run_hooks("usercp_do_attachments_start");
require_once MYBB_ROOT."inc/functions_upload.php";
if(!is_array($mybb->input['attachments']))


$plugins->run_hooks("usercp_do_attachments_start");
require_once MYBB_ROOT."inc/functions_upload.php";
if(!is_array($mybb->input['attachments']))

	{

	{

		error($lang->no_attachments_selected);
}
$aids = implode(',', array_map('intval', $mybb->input['attachments']));

		error($lang->no_attachments_selected);
}
$aids = implode(',', array_map('intval', $mybb->input['attachments']));

Zeile 2958Zeile 3013
	if(my_strlen($mybb->input['notepad']) > 60000)
{
$mybb->input['notepad'] = my_substr($mybb->input['notepad'], 0, 60000);

	if(my_strlen($mybb->input['notepad']) > 60000)
{
$mybb->input['notepad'] = my_substr($mybb->input['notepad'], 0, 60000);

	}

	}


$plugins->run_hooks("usercp_do_notepad_start");
$db->update_query("users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_notepad_end");
redirect("usercp.php", $lang->redirect_notepadupdated);
}


$plugins->run_hooks("usercp_do_notepad_start");
$db->update_query("users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_notepad_end");
redirect("usercp.php", $lang->redirect_notepadupdated);
}





if(!$mybb->input['action'])
{
// Get posts per day
$daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);

if($daysreg < 1)

if(!$mybb->input['action'])
{
// Get posts per day
$daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);

if($daysreg < 1)

	{

	{

		$daysreg = 1;
}

		$daysreg = 1;
}

	



	$perday = $mybb->user['postnum'] / $daysreg;
$perday = round($perday, 2);
if($perday > $mybb->user['postnum'])

	$perday = $mybb->user['postnum'] / $daysreg;
$perday = round($perday, 2);
if($perday > $mybb->user['postnum'])

	{

	{

		$perday = $mybb->user['postnum'];
}

$stats = $cache->read("stats");
$posts = $stats['numposts'];
if($posts == 0)

		$perday = $mybb->user['postnum'];
}

$stats = $cache->read("stats");
$posts = $stats['numposts'];
if($posts == 0)

	{

	{

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

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

	}

	}


$lang->posts_day = $lang->sprintf($lang->posts_day, my_number_format($perday), $percent);
$usergroup = $groupscache[$mybb->user['usergroup']]['title'];


$lang->posts_day = $lang->sprintf($lang->posts_day, my_number_format($perday), $percent);
$usergroup = $groupscache[$mybb->user['usergroup']]['title'];

Zeile 3006Zeile 3061
		{
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
}

		{
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
}

		$mybb->user['avatar'] = htmlspecialchars($mybb->user['avatar']);

		$mybb->user['avatar'] = htmlspecialchars_uni($mybb->user['avatar']);

		eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";");
$colspan = 2;
}
else
{
$avatar = '';

		eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";");
$colspan = 2;
}
else
{
$avatar = '';

	}

	}

	$regdate = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $mybb->user['regdate']);

if($mybb->user['usergroup'] == 5 && $mybb->settings['regtype'] != "admin")

	$regdate = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $mybb->user['regdate']);

if($mybb->user['usergroup'] == 5 && $mybb->settings['regtype'] != "admin")

Zeile 3028Zeile 3083
		eval("\$reputation = \"".$templates->get("usercp_reputation")."\";");
}


		eval("\$reputation = \"".$templates->get("usercp_reputation")."\";");
}


 
	$latest_warnings = '';

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

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

Zeile 3065Zeile 3121
					$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$post_link = "<br /><small>{$lang->warning_for_post} <a href=\"".get_post_link($warning['pid'])."\">{$warning['post_subject']}</a></small>";

					$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$post_link = "<br /><small>{$lang->warning_for_post} <a href=\"".get_post_link($warning['pid'])."\">{$warning['post_subject']}</a></small>";

				}

				}

				$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date($mybb->settings['dateformat'], $warning['dateline']).", ".my_date($mybb->settings['timeformat'], $warning['dateline']);
if($warning['type_title'])
{
$warning_type = $warning['type_title'];

				$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date($mybb->settings['dateformat'], $warning['dateline']).", ".my_date($mybb->settings['timeformat'], $warning['dateline']);
if($warning['type_title'])
{
$warning_type = $warning['type_title'];

				}
else

				}
else

				{
$warning_type = $warning['title'];
}
$warning_type = htmlspecialchars_uni($warning_type);
if($warning['points'] > 0)

				{
$warning_type = $warning['title'];
}
$warning_type = htmlspecialchars_uni($warning_type);
if($warning['points'] > 0)

				{

				{

					$warning['points'] = "+{$warning['points']}";
}
$points = $lang->sprintf($lang->warning_points, $warning['points']);

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

					$warning['points'] = "+{$warning['points']}";
}
$points = $lang->sprintf($lang->warning_points, $warning['points']);

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

				{

				{

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

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

				}

				}

				elseif($warning['expires'] == 0)
{
$expires = $lang->never;

				elseif($warning['expires'] == 0)
{
$expires = $lang->never;

Zeile 3110Zeile 3166
			}
}
}

			}
}
}





	// Format username
$username = format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']);
$username = build_profile_link($username, $mybb->user['uid']);

	// Format username
$username = format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']);
$username = build_profile_link($username, $mybb->user['uid']);





	// Format post numbers
$mybb->user['posts'] = my_number_format($mybb->user['postnum']);

	// Format post numbers
$mybb->user['posts'] = my_number_format($mybb->user['postnum']);

	



	// Build referral link
if($mybb->settings['usereferrals'] == 1)
{

	// Build referral link
if($mybb->settings['usereferrals'] == 1)
{

Zeile 3130Zeile 3186
	$mybb->user['notepad'] = htmlspecialchars_uni($mybb->user['notepad']);
eval("\$user_notepad = \"".$templates->get("usercp_notepad")."\";");
$plugins->run_hooks("usercp_notepad_end");

	$mybb->user['notepad'] = htmlspecialchars_uni($mybb->user['notepad']);
eval("\$user_notepad = \"".$templates->get("usercp_notepad")."\";");
$plugins->run_hooks("usercp_notepad_end");

	



	// Thread Subscriptions with New Posts

	// Thread Subscriptions with New Posts

 
	$latest_subscribed = '';

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

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

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

		



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

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

			if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0)

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

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

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

		



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

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

Zeile 3176Zeile 3233
						unset($subscriptions[$readthread['tid']]); // If it's already been read, then don't display the thread
}
else

						unset($subscriptions[$readthread['tid']]); // If it's already been read, then don't display the thread
}
else

					{			

					{

						$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}
}

						$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}
}

			



			if($subscriptions)
{
if($mybb->settings['dotfolders'] != 0)
{
$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($post = $db->fetch_array($query))

			if($subscriptions)
{
if($mybb->settings['dotfolders'] != 0)
{
$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($post = $db->fetch_array($query))

					{

					{

						$subscriptions[$post['tid']]['doticon'] = 1;
}
}

						$subscriptions[$post['tid']]['doticon'] = 1;
}
}





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

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

				



				foreach($subscriptions as $thread)
{
$folder = '';

				foreach($subscriptions as $thread)
{
$folder = '';

Zeile 3214Zeile 3271
						{
$query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'");
$threadprefix = $db->fetch_array($query);

						{
$query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'");
$threadprefix = $db->fetch_array($query);

	



							$thread['displayprefix'] = $threadprefix['displaystyle'].'&nbsp;';
}
else
{
$thread['displayprefix'] = '';

							$thread['displayprefix'] = $threadprefix['displaystyle'].'&nbsp;';
}
else
{
$thread['displayprefix'] = '';

						}


						}


						// Icons
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{
$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

						// Icons
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{
$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

						}

						}

						else
{
$icon = "&nbsp;";
}

						else
{
$icon = "&nbsp;";
}

						



						if($thread['doticon'])

						if($thread['doticon'])

						{

						{

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

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

						



						// Check to see which icon we display
if($thread['lastread'] && $thread['lastread'] < $thread['lastpost'])

						// Check to see which icon we display
if($thread['lastread'] && $thread['lastread'] < $thread['lastpost'])

						{

						{

							$folder .= "new";
$folder_label .= $lang->icon_new;
$new_class = "subject_new";
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost");
eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");

							$folder .= "new";
$folder_label .= $lang->icon_new;
$new_class = "subject_new";
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost");
eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");

						}

						}

						else
{
$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";

						else
{
$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";

						}


						}


						$folder .= "folder";

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

						$folder .= "folder";

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

						}


						}


						$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
$lastposter = $thread['lastposter'];
$lastposteruid = $thread['lastposteruid'];

						$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
$lastposter = $thread['lastposter'];
$lastposteruid = $thread['lastposteruid'];

		



						if($lastposteruid == 0)

						if($lastposteruid == 0)

						{

						{

							$lastposterlink = $lastposter;
}
else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);
}

							$lastposterlink = $lastposter;
}
else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);
}

			



						$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);
$thread['author'] = build_profile_link($thread['username'], $thread['uid']);

						$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);
$thread['author'] = build_profile_link($thread['username'], $thread['uid']);

	



						eval("\$latest_subscribed_threads .= \"".$templates->get("usercp_latest_subscribed_threads")."\";");
}
}

						eval("\$latest_subscribed_threads .= \"".$templates->get("usercp_latest_subscribed_threads")."\";");
}
}

Zeile 3286Zeile 3343
			}
}
}

			}
}
}

	



	// User's Latest Threads

// Get unviewable forums

	// User's Latest Threads

// Get unviewable forums

 
	$f_perm_sql = '';

	$unviewable_forums = get_unviewable_forums();
if($unviewable_forums)
{

	$unviewable_forums = get_unviewable_forums();
if($unviewable_forums)
{

Zeile 3365Zeile 3423
				$threadcache[$post['tid']]['doticon'] = 1;
}
}

				$threadcache[$post['tid']]['doticon'] = 1;
}
}

		



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

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

		



		// Run the threads...

		// Run the threads...

 
		$latest_threads_threads = '';

		foreach($threadcache as $thread)
{
if($thread['tid'])

		foreach($threadcache as $thread)
{
if($thread['tid'])

Zeile 3381Zeile 3440
				$isnew = 0;
$donenew = 0;
$lastread = 0;

				$isnew = 0;
$donenew = 0;
$lastread = 0;

				



				// If this thread has a prefix...
if($thread['prefix'] != 0)

				// If this thread has a prefix...
if($thread['prefix'] != 0)

				{

				{

					$query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'");
$threadprefix = $db->fetch_array($query);

					$query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'");
$threadprefix = $db->fetch_array($query);





					$thread['displayprefix'] = $threadprefix['displaystyle'].'&nbsp;';
}
else
{
$thread['displayprefix'] = '';
}

					$thread['displayprefix'] = $threadprefix['displaystyle'].'&nbsp;';
}
else
{
$thread['displayprefix'] = '';
}

				



				$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['threadlink'] = get_thread_link($thread['tid']);

				$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['threadlink'] = get_thread_link($thread['tid']);

Zeile 3413Zeile 3472
				if($mybb->settings['threadreadcut'] > 0)
{
$forum_read = $readforums[$thread['fid']];

				if($mybb->settings['threadreadcut'] > 0)
{
$forum_read = $readforums[$thread['fid']];

				



					$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)

					$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)

					{

					{

						$forum_read = $read_cutoff;

						$forum_read = $read_cutoff;

					}

					}

				}

				}

	



				if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)
{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
}

				if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)
{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
}

	



$cutoff = 0;

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

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

Zeile 3433Zeile 3493
						$lastread = $thread['lastread'];
}
}

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

	



				if(!$lastread)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);

				if(!$lastread)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);

Zeile 3513Zeile 3573

eval("\$latest_threads = \"".$templates->get("usercp_latest_threads")."\";");
}


eval("\$latest_threads = \"".$templates->get("usercp_latest_threads")."\";");
}

	



	$plugins->run_hooks("usercp_end");

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

	$plugins->run_hooks("usercp_end");

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