Vergleich usercp.php - 1.6.4 - 1.6.11

  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 5459 2011-05-10 10:47:56Z 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)

		if($mybb->settings['sigimgcode'] == 1)

		{

		{

			$imgsallowed = $mybb->settings['maxsigimages'];

			$imgsallowed = $mybb->settings['maxsigimages'];

		}
else
{

		}
else
{

			$imgsallowed = 0;
}
$lang->too_many_sig_images2 = $lang->sprintf($lang->too_many_sig_images2, $imgsallowed);

			$imgsallowed = 0;
}
$lang->too_many_sig_images2 = $lang->sprintf($lang->too_many_sig_images2, $imgsallowed);

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

			{
$lang->sig_too_long .= $lang->sig_remove_chars_singular;
}

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





			// Check if return date is after the away date.
$returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);
$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));

			// Check if return date is after the away date.
$returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);
$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));

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

			{
error($lang->error_usercp_return_date_past);
}

			



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

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

		}

		}

		else
{
$returndate = "";

		else
{
$returndate = "";

Zeile 210Zeile 233
		);
}
else

		);
}
else

	{

	{

		$away = array(
"away" => 0,
"date" => '',

		$away = array(
"away" => 0,
"date" => '',

Zeile 223Zeile 246
		"day" => $mybb->input['bday1'],
"month" => $mybb->input['bday2'],
"year" => $mybb->input['bday3']

		"day" => $mybb->input['bday1'],
"month" => $mybb->input['bday2'],
"year" => $mybb->input['bday3']

	);

	);


// Set up user handler.
require_once "inc/datahandlers/user.php";


// Set up user handler.
require_once "inc/datahandlers/user.php";

Zeile 249Zeile 272
			$user['usertitle'] = $mybb->input['usertitle'];
}
else if($mybb->input['reverttitle'])

			$user['usertitle'] = $mybb->input['usertitle'];
}
else if($mybb->input['reverttitle'])

		{

		{

			$user['usertitle'] = '';
}
}
$userhandler->set_data($user);

if(!$userhandler->validate_user())

			$user['usertitle'] = '';
}
}
$userhandler->set_data($user);

if(!$userhandler->validate_user())

	{

	{

		$errors = $userhandler->get_friendly_errors();

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

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

	}
else
{

	}
else
{

		$userhandler->update_user();

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

		$userhandler->update_user();

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





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

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

Zeile 301Zeile 331
		}
}
$bdaymonthsel[$bday[1]] = 'selected="selected"';

		}
}
$bdaymonthsel[$bday[1]] = 'selected="selected"';





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

	$bdayprivacysel = '';
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=\"age\">{$lang->birthdayprivacyage}</option>";

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

	}
else if($user['birthdayprivacy'] == 'none')
{

	}
else if($user['birthdayprivacy'] == 'none')
{

Zeile 325Zeile 355
	if($user['website'] == "" || $user['website'] == "http://")
{
$user['website'] = "http://";

	if($user['website'] == "" || $user['website'] == "http://")
{
$user['website'] = "http://";

	}

	}

	else
{
$user['website'] = htmlspecialchars_uni($user['website']);

	else
{
$user['website'] = htmlspecialchars_uni($user['website']);

Zeile 351Zeile 381
		{
if($user['away'] == 1)
{

		{
if($user['away'] == 1)
{

				$awaycheck[1] = "checked=\"checked\"";
}
else
{

				$awaycheck[1] = "checked=\"checked\"";
}
else
{

				$awaycheck[0] = "checked=\"checked\"";
}
$returndate = array();

				$awaycheck[0] = "checked=\"checked\"";
}
$returndate = array();

Zeile 371Zeile 401
				$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']);
$awaycheck[1] = "checked=\"checked\"";
$awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);

				$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']);
$awaycheck[1] = "checked=\"checked\"";
$awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);

			}
else

			}
else

			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";
}
$returndate = explode("-", $mybb->user['returndate']);

			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";
}
$returndate = explode("-", $mybb->user['returndate']);

		}

		}

		$returndatesel = '';
for($i = 1; $i <= 31; ++$i)
{

		$returndatesel = '';
for($i = 1; $i <= 31; ++$i)
{

Zeile 390Zeile 420
			{
$returndatesel .= "<option value=\"$i\">$i</option>\n";
}

			{
$returndatesel .= "<option value=\"$i\">$i</option>\n";
}

		}

		}

		$returndatemonthsel[$returndate[1]] = "selected";

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

		$returndatemonthsel[$returndate[1]] = "selected";

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

Zeile 402Zeile 432
	$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder'));
while($profilefield = $db->fetch_array($query))
{

	$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder'));
while($profilefield = $db->fetch_array($query))
{

 
		// Does this field have a minimum post count?
if($profilefield['postnum'] && $profilefield['postnum'] > $user['postnum'])
{
continue;
}


		$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);

		$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);

Zeile 456Zeile 492
					$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

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

			}
}

			}
}

		elseif($type == "select")
{
$expoptions = explode("\n", $options);

		elseif($type == "select")
{
$expoptions = explode("\n", $options);

Zeile 561Zeile 597
		$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 596Zeile 640
	{
$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 722Zeile 766
	else
{
$hideemailcheck = "";

	else
{
$hideemailcheck = "";

	}

	}


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


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

	{

	{

		$instant_email_subscribe_selected = "selected=\"selected\"";
}
else

		$instant_email_subscribe_selected = "selected=\"selected\"";
}
else

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

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

	}
else

	}
else

	{
$showsigscheck = "";
}

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

	{
$showsigscheck = "";
}

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

	{

	{

		$showavatarscheck = "checked=\"checked\"";

		$showavatarscheck = "checked=\"checked\"";

	}

	}

	else
{
$showavatarscheck = "";

	else
{
$showavatarscheck = "";

	}


	}


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

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

	{

	{

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

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

	}
else
{

	}
else
{

		$showquickreplycheck = "";
}

if($user['receivepms'] == 1)
{
$receivepmscheck = "checked=\"checked\"";

		$showquickreplycheck = "";
}

if($user['receivepms'] == 1)
{
$receivepmscheck = "checked=\"checked\"";

	}

	}

	else
{
$receivepmscheck = "";
}

	else
{
$receivepmscheck = "";
}

	



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

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

	{

	{

		$receivefrombuddycheck = "checked=\"checked\"";

		$receivefrombuddycheck = "checked=\"checked\"";

	}

	}

	else
{
$receivefrombuddycheck = "";

	else
{
$receivefrombuddycheck = "";

	}

	}


if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)
{
$pmnoticecheck = " checked=\"checked\"";


if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)
{
$pmnoticecheck = " checked=\"checked\"";

	}
else

	}
else

	{
$pmnoticecheck = "";
}

	{
$pmnoticecheck = "";
}

Zeile 799Zeile 843
	else if($user['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

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

	}
else

	}
else

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

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

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

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

	{

	{

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

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

	}

	}

	else
{
$showcodebuttonscheck = "";

	else
{
$showcodebuttonscheck = "";

	}


	}


	if($user['showredirect'] != 0)

	if($user['showredirect'] != 0)

	{

	{

		$showredirectcheck = "checked=\"checked\"";

		$showredirectcheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$showredirectcheck = "";

		$showredirectcheck = "";

	}

	}


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


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

	}
else

	}
else

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

Zeile 841Zeile 885
	if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";

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

	}

	}

	else
{
$classicpostbitcheck = '';

	else
{
$classicpostbitcheck = '';

Zeile 854Zeile 898
		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
{
$date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";

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

		}
}


		}
}


	$time_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($time_formats as $key => $format)
{
if($user['timeformat'] == $key)
{
$time_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";

	$time_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($time_formats as $key => $format)
{
if($user['timeformat'] == $key)
{
$time_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";

		}

		}

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

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





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

	}


	}


	$threadview[$user['threadmode']] = 'selected="selected"';
$daysprunesel[$user['daysprune']] = 'selected="selected"';
$stylelist = build_theme_select("style", $user['style']);
if($mybb->settings['usertppoptions'])

	$threadview[$user['threadmode']] = 'selected="selected"';
$daysprunesel[$user['daysprune']] = 'selected="selected"';
$stylelist = build_theme_select("style", $user['style']);
if($mybb->settings['usertppoptions'])

	{

	{

		$explodedtpp = explode(",", $mybb->settings['usertppoptions']);
$tppoptions = '';
if(is_array($explodedtpp))
{
foreach($explodedtpp as $key => $val)

		$explodedtpp = explode(",", $mybb->settings['usertppoptions']);
$tppoptions = '';
if(is_array($explodedtpp))
{
foreach($explodedtpp as $key => $val)

			{

			{

				$val = trim($val);
$selected = "";
if($user['tpp'] == $val)

				$val = trim($val);
$selected = "";
if($user['tpp'] == $val)

Zeile 922Zeile 966
		}
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);
}





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

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

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

$errors = array();

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

$errors = array();


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


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

Zeile 954Zeile 998
		);

$userhandler->set_data($user);

		);

$userhandler->set_data($user);





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

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

Zeile 986Zeile 1030
				error($lang->redirect_changeemail_activation);
}
else

				error($lang->redirect_changeemail_activation);
}
else

			{

			{

				$userhandler->update_user();
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);

				$userhandler->update_user();
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);

Zeile 997Zeile 1041
	{
$mybb->input['action'] = "email";
$errors = inline_error($errors);

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

	}

	}

}

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

}

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

Zeile 1007Zeile 1051
	{
$email = htmlspecialchars_uni($mybb->input['email']);
$email2 = htmlspecialchars_uni($mybb->input['email2']);

	{
$email = htmlspecialchars_uni($mybb->input['email']);
$email2 = htmlspecialchars_uni($mybb->input['email2']);

	}

	}

	else
{
$email = $email2 = '';
}

$plugins->run_hooks("usercp_email");

	else
{
$email = $email2 = '';
}

$plugins->run_hooks("usercp_email");

	



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

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

Zeile 1067Zeile 1111
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")."\";");
output_page($editpassword);
}

	eval("\$editpassword = \"".$templates->get("usercp_password")."\";");
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 1092Zeile 1136
		// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");

		// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");





		$user = array(
"uid" => $mybb->user['uid'],
"username" => $mybb->input['username']
);

		$user = array(
"uid" => $mybb->user['uid'],
"username" => $mybb->input['username']
);





		$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 1109Zeile 1153
			$userhandler->update_user();
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php", $lang->redirect_namechanged);

			$userhandler->update_user();
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php", $lang->redirect_namechanged);





		}
}
if(count($errors) > 0)

		}
}
if(count($errors) > 0)

Zeile 1118Zeile 1162
		$mybb->input['action'] = "changename";
}
}

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





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

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

Zeile 1126Zeile 1170
	{
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 1198Zeile 1242
	if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;

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

	}

	}


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


$perpage = $mybb->settings['threadsperpage'];
$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
{
$start = 0;

	else
{
$start = 0;

Zeile 1217Zeile 1268
	if($upper > $threadcount)
{
$upper = $threadcount;

	if($upper > $threadcount)
{
$upper = $threadcount;

	}

	}

	$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");
$fpermissions = forum_permissions();


	$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");
$fpermissions = forum_permissions();


Zeile 1235Zeile 1286
	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)
{


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

		}
else if($subscription['tid'])

		{

		{

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

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

		}

		}

	}

	}





	if(is_array($del_subscriptions))
{

	if(is_array($del_subscriptions))
{

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









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

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

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

if($threadcount < 0)

		{

		{

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

			$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 1269Zeile 1328
				WHERE active != 0
ORDER BY pid, disporder
");

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

			
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);


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

		}
else

		}
else

		{

		{

			// Build a forum cache.
$query = $db->query("
SELECT f.fid, fr.dateline AS lastread

			// Build a forum cache.
$query = $db->query("
SELECT f.fid, fr.dateline AS lastread

Zeile 1283Zeile 1342
				ORDER BY pid, disporder
");
}

				ORDER BY pid, disporder
");
}

 


		while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

		while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

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

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

			}

			}

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


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


Zeile 1306Zeile 1366
		}

// Read threads

		}

// Read threads

		if($mybb->settings['threadreadcut'] > 0)
{
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");

		if($mybb->settings['threadreadcut'] > 0)
{
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");

			while($readthread = $db->fetch_array($query))
{
$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}

			while($readthread = $db->fetch_array($query))
{
$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}

		



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

// Now we can build our subscription list
foreach($subscriptions as $thread)
{
$bgcolor = alt_trow();

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

// Now we can build our subscription list
foreach($subscriptions as $thread)
{
$bgcolor = alt_trow();





			$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 1368Zeile 1428
			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 1376Zeile 1436
				}
}
else

				}
}
else

			{

			{

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

				$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 1387Zeile 1447

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


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

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

				if($thread['lastread'])

				{

				{

					if($thread['lastread'])
{
$lastread = $thread['lastread'];
}
else
{
$lastread = 1;
}

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




				}
}


				}
}


Zeile 1413Zeile 1470
				}
}


				}
}


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

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

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

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

Zeile 1468Zeile 1525

// What kind of notification type do we have here?
switch($thread['notification'])


// What kind of notification type do we have here?
switch($thread['notification'])

			{

			{

				case "1": // Instant
$notification_type = $lang->instant_notification;
break;
default: // No notification
$notification_type = $lang->no_notification;
}

				case "1": // Instant
$notification_type = $lang->instant_notification;
break;
default: // No notification
$notification_type = $lang->no_notification;
}





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

// Provide remove options
eval("\$remove_options = \"".$templates->get("usercp_subscriptions_remove")."\";");

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

// Provide remove options
eval("\$remove_options = \"".$templates->get("usercp_subscriptions_remove")."\";");

	}

	}

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

	else
{
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");

	$query = $db->simple_select("forumpermissions", "*", "gid='".$db->escape_string($mybb->user['usergroup'])."'");
while($permissions = $db->fetch_array($query))
{
$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions;
}









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

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

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

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

		
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);


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

	}
else
{

	}
else
{

Zeile 1524Zeile 1577
			ORDER BY pid, disporder
");
}

			ORDER BY pid, disporder
");
}

 


	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

		{

		{

			if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];
}
}
$readforums[$forum['fid']] = $forum['lastread'];

			if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];
}
}
$readforums[$forum['fid']] = $forum['lastread'];

	}

require_once MYBB_ROOT."inc/functions_forumlist.php";


	}




	$fpermissions = forum_permissions();

	$fpermissions = forum_permissions();

 
	require_once MYBB_ROOT."inc/functions_forumlist.php";


	$query = $db->query("
SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forumsubscriptions fs

	$query = $db->query("
SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forumsubscriptions fs

Zeile 1548Zeile 1602
		WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."'
ORDER BY f.name ASC
");

		WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."'
ORDER BY f.name ASC
");

 


	$forums = '';
while($forum = $db->fetch_array($query))
{
$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];

	$forums = '';
while($forum = $db->fetch_array($query))
{
$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];

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































if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
continue;
}

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

		{

		{

			$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost']));
$folder = $lightbulb['folder'];
if($forum['lastpost'] == 0 || $forum['lastposter'] == "")






			$forum['lastpostsubject'] = $parser->parse_badwords($forum['lastpostsubject']);
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);
$lastpost_time = my_date($mybb->settings['timeformat'], $forum['lastpost']);
$lastposttid = $forum['lastposttid'];
$lastposter = $forum['lastposter'];
$lastpost_profilelink = build_profile_link($lastposter, $forum['lastposteruid']);
$lastpost_subject = htmlspecialchars_uni($forum['lastpostsubject']);
if(my_strlen($lastpost_subject) > 25)

			{

			{

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

				$lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";

			}

			}

			else
{
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);
$lastpost_time = my_date($mybb->settings['timeformat'], $forum['lastpost']);
$lastposttid = $forum['lastposttid'];
$lastposter = $forum['lastposter'];
$lastpost_profilelink = build_profile_link($lastposter, $forum['lastposteruid']);
$lastpost_subject = $forum['lastpostsubject'];
if(my_strlen($lastpost_subject) > 25)
{
$lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";
}
$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']);

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
















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

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

 


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

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

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

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

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


	$plugins->run_hooks("usercp_do_editsig_start");

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

	$plugins->run_hooks("usercp_do_editsig_start");

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

	}

	}


if($mybb->input['updateposts'] == "enable")
{
$update_signature = array(
"includesig" => 1


if($mybb->input['updateposts'] == "enable")
{
$update_signature = array(
"includesig" => 1

		);

		);

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

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

Zeile 1648Zeile 1727
	{
$sig = $mybb->input['signature'];
$template = false;

	{
$sig = $mybb->input['signature'];
$template = false;

	}


	}


	if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))

	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

		// User currently has no signature and they're suspended

 
		error($lang->sig_suspended);
}

if($mybb->usergroup['canusesig'] != 1)
{
// Usergroup has no permission to use this facility

		error_no_permission();

		error_no_permission();

 
	}
else if($mybb->usergroup['canusesig'] == 1 && $mybb->usergroup['canusesigxposts'] > 0 && $mybb->user['postnum'] < $mybb->usergroup['canusesigxposts'])
{
// Usergroup can use this facility, but only after x posts
error($lang->sprintf($lang->sig_suspended_posts, $mybb->usergroup['canusesigxposts']));

	}

if($sig && $template)

	}

if($sig && $template)

Zeile 1664Zeile 1754
			"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],
"me_username" => $mybb->user['username'],

			"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],
"me_username" => $mybb->user['username'],

 
			"filter_badwords" => 1

		);

$sigpreview = $parser->parse_message($sig, $sig_parser);
eval("\$signature = \"".$templates->get($template)."\";");

		);

$sigpreview = $parser->parse_message($sig, $sig_parser);
eval("\$signature = \"".$templates->get($template)."\";");

	}


	}


	// User has a current signature, so let's display it (but show an error message)
if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW)
{
$plugins->run_hooks("usercp_editsig_end");

	// User has a current signature, so let's display it (but show an error message)
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 1682Zeile 1773
	{
// User is allowed to edit their signature
if($mybb->settings['sigsmilies'] == 1)

	{
// User is allowed to edit their signature
if($mybb->settings['sigsmilies'] == 1)

		{

		{

			$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();
}
else
{
$sigsmilies = $lang->off;

			$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();
}
else
{
$sigsmilies = $lang->off;

		}

		}

		if($mybb->settings['sigmycode'] == 1)
{
$sigmycode = $lang->on;
}
else

		if($mybb->settings['sigmycode'] == 1)
{
$sigmycode = $lang->on;
}
else

		{

		{

			$sigmycode = $lang->off;
}
if($mybb->settings['sightml'] == 1)
{
$sightml = $lang->on;

			$sigmycode = $lang->off;
}
if($mybb->settings['sightml'] == 1)
{
$sightml = $lang->on;

		}

		}

		else
{
$sightml = $lang->off;

		else
{
$sightml = $lang->off;

Zeile 1721Zeile 1812
		{
$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);
}


Zeile 1756Zeile 1847
		{
$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 1968Zeile 2059
		{
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 2022Zeile 2113
		else if($mybb->settings['avatarresizing'] == "user")
{
$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>";

		else if($mybb->settings['avatarresizing'] == "user")
{
$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 2035Zeile 2126
{
// 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_editlists_start");

$existing_users = array();

	$plugins->run_hooks("usercp_do_editlists_start");

$existing_users = array();

Zeile 2051Zeile 2142
		{
// Create a list of buddies...
$selected_list = explode(",", $mybb->user['buddylist']);

		{
// Create a list of buddies...
$selected_list = explode(",", $mybb->user['buddylist']);

		}

		}

	}
else
{
if($mybb->user['buddylist'])
{
$existing_users = explode(",", $mybb->user['buddylist']);

	}
else
{
if($mybb->user['buddylist'])
{
$existing_users = explode(",", $mybb->user['buddylist']);

		}


		}


		if($mybb->user['ignorelist'])
{
// Create a list of ignored users
$selected_list = explode(",", $mybb->user['ignorelist']);
}
}

		if($mybb->user['ignorelist'])
{
// Create a list of ignored users
$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 2127Zeile 2218
					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($found_users < count($users))
{
if($error_message)
{
$error_message .= "<br />";
}

$error_message .= $lang->invalid_user_selected;

		}

if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))

		}

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;

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

Zeile 2159Zeile 2260
		if(count($existing_users) == 0)
{
$message = "";

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

		}

if($found_users < count($users))
{
if($error_message)
{
$error_message .= "<br />";
}

$error_message .= $lang->invalid_user_selected;

 
		}
}


		}
}


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

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

			}
else

			}
else

			{
$message = $lang->removed_from_buddy_list;
}
$message = $lang->sprintf($message, $user['username']);

			{
$message = $lang->removed_from_buddy_list;
}
$message = $lang->sprintf($message, $user['username']);

		}
}


		}
}


	// Now we have the new list, so throw it all back together
$new_list = implode(",", $existing_users);


	// Now we have the new list, so throw it all back together
$new_list = implode(",", $existing_users);


Zeile 2205Zeile 2296
		$new_list = my_substr($new_list, 1);
}
if(my_substr($new_list, -1) == ",")

		$new_list = my_substr($new_list, 1);
}
if(my_substr($new_list, -1) == ",")

	{

	{

		$new_list = my_substr($new_list, 0, my_strlen($new_list)-2);
}


		$new_list = my_substr($new_list, 0, my_strlen($new_list)-2);
}


Zeile 2238Zeile 2329
			$list = "buddy";
}


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

		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)

		{
$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 2263Zeile 2354
				{
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 2282Zeile 2373
		redirect("usercp.php?action=editlists#{$mybb->input['manage']}", $message);
}
}

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





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

$timecut = TIME_NOW - $mybb->settings['wolcutoff'];

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

$timecut = TIME_NOW - $mybb->settings['wolcutoff'];





	// Fetch out buddies
$buddy_count = 0;
if($mybb->user['buddylist'])

	// Fetch out buddies
$buddy_count = 0;
if($mybb->user['buddylist'])

Zeile 2360Zeile 2451
		}
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 2391Zeile 2482
			$type = "post";
}
elseif($draft['threadvisible'] == -2) // We're looking at a draft thread

			$type = "post";
}
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 2401Zeile 2492
		$savedate = my_date($mybb->settings['dateformat'], $draft['dateline']);
$savetime = my_date($mybb->settings['timeformat'], $draft['dateline']);
eval("\$drafts .= \"".$templates->get("usercp_drafts_draft")."\";");

		$savedate = my_date($mybb->settings['dateformat'], $draft['dateline']);
$savetime = my_date($mybb->settings['timeformat'], $draft['dateline']);
eval("\$drafts .= \"".$templates->get("usercp_drafts_draft")."\";");

	}

	}

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

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

Zeile 2412Zeile 2503
		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);


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

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

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

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

			$reason = $db->escape_string($reason);
$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 2601Zeile 2693
		case "pgsql":
case "sqlite":
$query = $db->query("

		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

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

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

Zeile 2788Zeile 2880
	}

$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 2839Zeile 2931
			$attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['threadlink'] = get_thread_link($attachment['tid']);
$attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));

			$attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['threadlink'] = get_thread_link($attachment['tid']);
$attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));

 


			$size = get_friendly_size($attachment['filesize']);
$icon = get_attachment_icon(get_extension($attachment['filename']));

			$size = get_friendly_size($attachment['filesize']);
$icon = get_attachment_icon(get_extension($attachment['filename']));

 
			$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);


			$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']);
$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateline']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateline']);
$altbg = alt_trow();

			$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']);
$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateline']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateline']);
$altbg = alt_trow();

 


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

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

 


			// Add to bandwidth total
$bandwidth += ($attachment['filesize'] * $attachment['downloads']);
$totaldownloads += $attachment['downloads'];

			// Add to bandwidth total
$bandwidth += ($attachment['filesize'] * $attachment['downloads']);
$totaldownloads += $attachment['downloads'];

Zeile 2877Zeile 2974

$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
$bandwidth = get_friendly_size($bandwidth);


$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
$bandwidth = get_friendly_size($bandwidth);





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

	if(!$attachments)
{
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);
}

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

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

 

// Cap at 60,000 chars; text will allow up to 65535?
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(!$mybb->input['action'])
{
// Get posts per day
$daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);





	if($daysreg < 1)
{
$daysreg = 1;
}

	if($daysreg < 1)
{
$daysreg = 1;
}

	



	$perday = $mybb->user['postnum'] / $daysreg;
$perday = round($perday, 2);
if($perday > $mybb->user['postnum'])
{
$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)

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

	{

	{

		$percent = "0";

		$percent = "0";

	}
else
{

	}
else
{

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

		$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 2962Zeile 3065
		{
$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 2984Zeile 3087
		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 3027Zeile 3131
				if($warning['type_title'])
{
$warning_type = $warning['type_title'];

				if($warning['type_title'])
{
$warning_type = $warning['type_title'];

				}

				}

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

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

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

Zeile 3047Zeile 3151
				elseif($warning['expired'])
{
$expires = $lang->already_expired;

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

				}

				}

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

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

Zeile 3066Zeile 3170
			}
}
}

			}
}
}





	// 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)
{
$referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);
eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");

	// Build referral link
if($mybb->settings['usereferrals'] == 1)
{
$referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);
eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");

	}


	}


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

	// User Notepad
$plugins->run_hooks("usercp_notepad_start");
$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 3106Zeile 3211
			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 3132Zeile 3237
						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)

			if($subscriptions)
{
if($mybb->settings['dotfolders'] != 0)

Zeile 3150Zeile 3255
				}

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

				}

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

				



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

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




					$gotounread = '';


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

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

Zeile 3169Zeile 3275
						{
$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;';

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

						}

						}

						else
{
$thread['displayprefix'] = '';

						else
{
$thread['displayprefix'] = '';

						}


						}


						// Icons
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{

						// Icons
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{

Zeile 3186Zeile 3292
						else
{
$icon = "&nbsp;";

						else
{
$icon = "&nbsp;";

						}


						}


						if($thread['doticon'])
{
$folder = "dot_";
$folder_label .= $lang->icon_dot;
}

						if($thread['doticon'])
{
$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'])
{

Zeile 3208Zeile 3314
							$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";
}

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

						



						$folder .= "folder";

if($thread['visible'] == 0)

						$folder .= "folder";

if($thread['visible'] == 0)

						{

						{

							$bgcolor = "trow_shaded";
}

							$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)
{
$lastposterlink = $lastposter;

						if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

						}

						}

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

						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 3241Zeile 3347
			}
}
}

			}
}
}

	



	// 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 3320Zeile 3427
				$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 3336Zeile 3444
				$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)
{

Zeile 3346Zeile 3454
					$thread['displayprefix'] = $threadprefix['displaystyle'].'&nbsp;';
}
else

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

				{

				{

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

					$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 3359Zeile 3467
				{
$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;";

				}

				}


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


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

				{

				{

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

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

				



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

					}

					}

				}

				}

	



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

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

				{

				{

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

					$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 3388Zeile 3497
						$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 3468Zeile 3577

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")."\";");