Vergleich usercp.php - 1.6.10 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 206Zeile 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 218Zeile 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 254Zeile 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 281Zeile 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';
}

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

Zeile 364Zeile 365
	if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);

	if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);

	}

	}

	if($user['icq'] == 0)
{
$user['icq'] = "";

	if($user['icq'] == 0)
{
$user['icq'] = "";

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

		if($errors)
{
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 403Zeile 404
				$awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
}
else

				$awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
}
else

			{

			{

				$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";
}

				$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";
}

Zeile 415Zeile 416
			if($returndate[0] == $i)
{
$returndatesel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";

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

			}

			}

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

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

			}

			}

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


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


Zeile 433Zeile 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 455Zeile 456
			$userfield = $user[$field];
}
if($type == "multiselect")

			$userfield = $user[$field];
}
if($type == "multiselect")

		{
if($errors)
{
$useropts = $userfield;
}
else
{
$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);
$seloptions[$val] = $val;
}

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









			}

			}

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









			if(is_array($useropts))
{
foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))

			{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);


			{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);


					$sel = "";

					$sel = "";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

				}
if(!$profilefield['length'])

				}
if(!$profilefield['length'])

				{
$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 518Zeile 519
			}
}
elseif($type == "radio")

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

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

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

					if($val == $userfield)
{
$checked = " checked=\"checked\"";
}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";

					if($val == $userfield)
{
$checked = " checked=\"checked\"";
}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";

				}

				}

			}
}
elseif($type == "checkbox")
{
if($errors)

			}
}
elseif($type == "checkbox")
{
if($errors)

			{

			{

				$useropts = $userfield;

				$useropts = $userfield;

			}

			}

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

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

			}

			}

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

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

Zeile 568Zeile 569
		{
$value = htmlspecialchars_uni($userfield);
$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";

		{
$value = htmlspecialchars_uni($userfield);
$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";

		}
else
{

		}
else
{

			$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)

			$value = htmlspecialchars_uni($userfield);
$maxlength = "";
if($profilefield['maxlength'] > 0)

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

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

		}
else

		}
else

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

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

Zeile 612Zeile 613
			{
if($title['posts'] <= $mybb->user['postnum'])
{

			{
if($title['posts'] <= $mybb->user['postnum'])
{

					$defaulttitle = $title['title'];

					$defaulttitle = htmlspecialchars_uni($title['title']);

					break;
}
}

					break;
}
}

		}

		}

		else
{

		else
{

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

			$defaulttitle = htmlspecialchars_uni($mybb->usergroup['usertitle']);

		}

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

		}

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

		{

		{

			$lang->current_custom_usertitle = '';
}
else

			$lang->current_custom_usertitle = '';
}
else

Zeile 640Zeile 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 817Zeile 818
	{
$receivepmscheck = "";
}

	{
$receivepmscheck = "";
}

	



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

	if($user['receivefrombuddy'] == 1)
{
$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 = "";
}

if($user['dstcorrection'] == 2)

	{
$pmnoticecheck = "";
}

if($user['dstcorrection'] == 2)

	{

	{

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

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

Zeile 847Zeile 848
	else
{
$dst_disabled_selected = "selected=\"selected\"";

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

	}


	}


	if($user['showcodebuttons'] == 1)
{
$showcodebuttonscheck = "checked=\"checked\"";

	if($user['showcodebuttons'] == 1)
{
$showcodebuttonscheck = "checked=\"checked\"";

	}
else

	}
else

	{
$showcodebuttonscheck = "";
}

	{
$showcodebuttonscheck = "";
}

Zeile 876Zeile 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

Zeile 919Zeile 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 935Zeile 936
		if(is_array($explodedtpp))
{
foreach($explodedtpp as $key => $val)

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

			{
$val = trim($val);

			{
$val = trim($val);

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

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

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

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

				}
$tppoptions .= "<option value=\"$val\" $selected>".$lang->sprintf($lang->tpp_option, $val)."</option>\n";

				}
$tppoptions .= "<option value=\"$val\" $selected>".$lang->sprintf($lang->tpp_option, $val)."</option>\n";

			}
}

			}
}

		eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");
}
if($mybb->settings['userpppoptions'])

		eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");
}
if($mybb->settings['userpppoptions'])

Zeile 966Zeile 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 1040Zeile 1041
	if(count($errors) > 0)
{
$mybb->input['action'] = "email";

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

			$errors = inline_error($errors);

			$errors = inline_error($errors);

	}
}

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

	}
}

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

{

{

	// Coming back to this page after one or more errors were experienced, show fields the user previously entered (with the exception of the password)
if($errors)
{
$email = htmlspecialchars_uni($mybb->input['email']);
$email2 = htmlspecialchars_uni($mybb->input['email2']);

	// Coming back to this page after one or more errors were experienced, show fields the user previously entered (with the exception of the password)
if($errors)
{
$email = htmlspecialchars_uni($mybb->input['email']);
$email2 = htmlspecialchars_uni($mybb->input['email2']);

	}

	}

	else
{
$email = $email2 = '';

	else
{
$email = $email2 = '';

	}


	}


	$plugins->run_hooks("usercp_email");

	$plugins->run_hooks("usercp_email");

	



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

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





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

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

Zeile 1085Zeile 1086
			"uid" => $mybb->user['uid'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['password2']

			"uid" => $mybb->user['uid'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['password2']

		);

$userhandler->set_data($user);

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

		);

$userhandler->set_data($user);

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

		{
$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey']);
$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php", $lang->redirect_passwordupdated);
}

		{
$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey']);
$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php", $lang->redirect_passwordupdated);
}

	}

	}

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

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

	}
}


	}
}


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

Zeile 1120Zeile 1121
{
// 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_changename_start");
if($mybb->usergroup['canchangename'] != 1)
{
error_no_permission();

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

	}


	}


	if(validate_password_from_uid($mybb->user['uid'], $mybb->input['password']) == false)
{
$errors[] = $lang->error_invalidpassword;

	if(validate_password_from_uid($mybb->user['uid'], $mybb->input['password']) == false)
{
$errors[] = $lang->error_invalidpassword;

Zeile 1145Zeile 1146
		$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 1155Zeile 1156
			redirect("usercp.php", $lang->redirect_namechanged);

}

			redirect("usercp.php", $lang->redirect_namechanged);

}

	}

	}

	if(count($errors) > 0)
{
$errors = inline_error($errors);

	if(count($errors) > 0)
{
$errors = inline_error($errors);

Zeile 1170Zeile 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 1239Zeile 1240
	");
$threadcount = $db->fetch_field($query, "threads");


	");
$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 1248Zeile 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 1311Zeile 1319
	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 1321Zeile 1329
				WHERE active != 0
ORDER BY pid, disporder
");

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

			



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

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

		}

		}

		else
{
// Build a forum cache.

		else
{
// Build a forum cache.

Zeile 1334Zeile 1342
				WHERE f.active != 0
ORDER BY pid, disporder
");

				WHERE f.active != 0
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']];

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

Zeile 1355Zeile 1363
			while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

			while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

			}

			}

		}

// Read threads

		}

// Read threads

Zeile 1365Zeile 1373
			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");


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


// Now we can build our subscription list
foreach($subscriptions as $thread)


// Now we can build our subscription list
foreach($subscriptions as $thread)

Zeile 1377Zeile 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 1396Zeile 1404
			if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{
$icon = $icon_cache[$thread['icon']];

			if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{
$icon = $icon_cache[$thread['icon']];

 
				$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

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

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

Zeile 1421Zeile 1431
			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 1443Zeile 1453
				if($thread['lastread'])
{
$lastread = $thread['lastread'];

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

				}
else
{

				}
else
{

					$lastread = 1;
}
}

					$lastread = 1;
}
}

Zeile 1460Zeile 1470
				else
{
$lastread = $forum_read;

				else
{
$lastread = $forum_read;

				}
}

				}
}


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


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

Zeile 1473Zeile 1483
				$unreadpost = 1;
}
else

				$unreadpost = 1;
}
else

			{

			{

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

if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])

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

if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])

			{

			{

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

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

Zeile 1488Zeile 1498
			{
$folder .= "lock";
$folder_label .= $lang->icon_lock;

			{
$folder .= "lock";
$folder_label .= $lang->icon_lock;

			}

$folder .= "folder";

			}

$folder .= "folder";


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


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





			// Build last post info
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);

			// Build last post info
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);

Zeile 1507Zeile 1517
			if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

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

			}

			}

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

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

Zeile 1536Zeile 1546
	{
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);
}

Zeile 1546Zeile 1556
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 1556Zeile 1566
			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 1603Zeile 1613
		$forumpermissions = $fpermissions[$forum['fid']];

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

		$forumpermissions = $fpermissions[$forum['fid']];

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 = '-';

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

		}
else
{

		}
else
{

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

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

			$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->never}</div>";
}
// Hide last post
elseif($forumpermissions['canonlyviewownthreads'] != 0 && $forum['lastposteruid'] != $mybb->user['uid'])

		{

		{

			$lastpost = "<div align=\"center\">{$lang->na}</div>";
}
else

			$lastpost = "<div align=\"center\">{$lang->na}</div>";
}
else

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

Zeile 1667Zeile 1677
}

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 1758Zeile 1768
	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 1805Zeile 1815
		{
$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 1823Zeile 1833
	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 1840Zeile 1850
		{
$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 2052Zeile 2062
		{
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 2084Zeile 2094
			}
eval("\$currentavatar = \"".$templates->get("usercp_avatar_current")."\";");
$colspan = 1;

			}
eval("\$currentavatar = \"".$templates->get("usercp_avatar_current")."\";");
$colspan = 1;

		}

		}

		else
{
$colspan = 2;
}
if($mybb->settings['maxavatardims'] != "")

		else
{
$colspan = 2;
}
if($mybb->settings['maxavatardims'] != "")

		{

		{

			list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);

			list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);

		}

		}

		if($mybb->settings['avatarsize'])
{
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024);

		if($mybb->settings['avatarsize'])
{
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024);

Zeile 2102Zeile 2112
		if($mybb->settings['avatarresizing'] == "auto")
{
$auto_resize = "<br /><span class=\"smalltext\">{$lang->avatar_auto_resize_note}</span>\n";

		if($mybb->settings['avatarresizing'] == "auto")
{
$auto_resize = "<br /><span class=\"smalltext\">{$lang->avatar_auto_resize_note}</span>\n";

		}

		}

		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 2150Zeile 2160
			$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 2166Zeile 2176
		foreach($users as $key => $username)
{
if(empty($username))

		foreach($users as $key => $username)
{
if(empty($username))

			{
unset($users[$key]);
continue;

			{
unset($users[$key]);
continue;

			}

if(my_strtoupper($mybb->user['username']) == my_strtoupper($username))

			}

if(my_strtoupper($mybb->user['username']) == my_strtoupper($username))

Zeile 2178Zeile 2188
				continue;
}
$users[$key] = $db->escape_string($username);

				continue;
}
$users[$key] = $db->escape_string($username);

		}

		}


// Fetch out new users
if(count($users) > 0)


// Fetch out new users
if(count($users) > 0)

Zeile 2211Zeile 2221
					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($found_users < count($users))

		{

		{

			if($error_message)
{
$error_message .= "<br />";

			if($error_message)
{
$error_message .= "<br />";

			}

			}


$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(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))

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

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

			{
$message = $lang->users_added_to_ignore_list;

			{
$message = $lang->users_added_to_ignore_list;

			}

			}

			else
{
$message = $lang->users_added_to_buddy_list;

			else
{
$message = $lang->users_added_to_buddy_list;

Zeile 2239Zeile 2249
		}

if($adding_self == true)

		}

if($adding_self == true)

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

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

			{
$error_message = $lang->cant_add_self_to_ignore_list;
}

			{
$error_message = $lang->cant_add_self_to_ignore_list;
}

Zeile 2299Zeile 2309
	{
$user['ignorelist'] = $db->escape_string($new_list);
$mybb->user['ignorelist'] = $user['ignorelist'];

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

	}
else

	}
else

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

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

Zeile 2403Zeile 2413

// Fetch out ignore list users
$ignore_count = 0;


// Fetch out ignore list users
$ignore_count = 0;

	if($mybb->user['ignorelist'])

	if($mybb->user['ignorelist'])

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

	{
$type = "ignored";
$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['ignorelist']})", array("order_by" => "username"));
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'])
{
$status = "online";

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

			}

			}

			else
{
$status = "offline";

			else
{
$status = "offline";

Zeile 2427Zeile 2437
	if(!$ignore_list)
{
$ignore_list = "<li>{$lang->ignore_list_empty}</li>";

	if(!$ignore_list)
{
$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($mybb->input['manage'] == "ignored")

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

		{

		{

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

Zeile 2444Zeile 2454
		}
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 2496Zeile 2506
		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 2559Zeile 2569

// Changing our display group
if($mybb->input['displaygroup'])


// Changing our display group
if($mybb->input['displaygroup'])

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

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


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


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

Zeile 2634Zeile 2644
		}
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 2685Zeile 2695
		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))

				LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)

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

				WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers
");

Zeile 2710Zeile 2720
	{
$memberlistlink = $moderaterequestslink = '';
$memberlistlink = " [<a href=\"managegroup.php?gid=".$usergroup['gid']."\">".$lang->view_members."</a>]";

	{
$memberlistlink = $moderaterequestslink = '';
$memberlistlink = " [<a href=\"managegroup.php?gid=".$usergroup['gid']."\">".$lang->view_members."</a>]";

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

		if($usergroup['type'] != 4)
{
$usergroup['joinrequests'] = '--';

		if($usergroup['type'] != 4)
{
$usergroup['joinrequests'] = '--';

Zeile 2717Zeile 2728
		if($usergroup['joinrequests'] > 0 && $usergroup['canmanagerequests'] == 1)
{
$moderaterequestslink = " [<a href=\"managegroup.php?action=joinrequests&amp;gid={$usergroup['gid']}\">{$lang->view_requests}</a>]";

		if($usergroup['joinrequests'] > 0 && $usergroup['canmanagerequests'] == 1)
{
$moderaterequestslink = " [<a href=\"managegroup.php?action=joinrequests&amp;gid={$usergroup['gid']}\">{$lang->view_requests}</a>]";

		}

		}

		$groupleader[$usergroup['gid']] = 1;
$trow = alt_trow();
eval("\$groupsledlist .= \"".$templates->get("usercp_usergroups_leader_usergroup")."\";");

		$groupleader[$usergroup['gid']] = 1;
$trow = alt_trow();
eval("\$groupsledlist .= \"".$templates->get("usercp_usergroups_leader_usergroup")."\";");

Zeile 2731Zeile 2742
	// Do the primary group first
$query = $db->simple_select("usergroups", "*", "gid='".$mybb->user['usergroup']."'");
$usergroup = $db->fetch_array($query);

	// Do the primary group first
$query = $db->simple_select("usergroups", "*", "gid='".$mybb->user['usergroup']."'");
$usergroup = $db->fetch_array($query);

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

	$leavelink = "<div style=\"text-align:center;\"><span class=\"smalltext\">{$lang->usergroup_leave_primary}</span></div>";
$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])

	$leavelink = "<div style=\"text-align:center;\"><span class=\"smalltext\">{$lang->usergroup_leave_primary}</span></div>";
$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])

Zeile 2767Zeile 2781
			{
$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>";
}

 
			$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);
$usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);

			if($usergroup['description'])
{

			if($usergroup['description'])
{

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

				$description = "<br /><span class=\"smalltext\">".$usergroup['description']."</span>";
}
else
{
$description = '';

				$description = "<br /><span class=\"smalltext\">".$usergroup['description']."</span>";
}
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 2816Zeile 2829
	while($usergroup = $db->fetch_array($query))
{
$trow = alt_trow();

	while($usergroup = $db->fetch_array($query))
{
$trow = alt_trow();

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

		if($usergroup['description'])
{

		if($usergroup['description'])
{

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

			$description = "<br /><span class=\"smallfont\">".$usergroup['description']."</span>";
}
else

			$description = "<br /><span class=\"smallfont\">".$usergroup['description']."</span>";
}
else

Zeile 2833Zeile 2848
		else
{
$conditions = $lang->usergroup_joins_anyone;

		else
{
$conditions = $lang->usergroup_joins_anyone;

		}

		}


if($appliedjoin[$usergroup['gid']])
{


if($appliedjoin[$usergroup['gid']])
{

Zeile 2858Zeile 2873
				$comma = $lang->comma;
}
$usergroupleaders = $lang->usergroup_leaders." ".$usergroupleaders;

				$comma = $lang->comma;
}
$usergroupleaders = $lang->usergroup_leaders." ".$usergroupleaders;

		}


		}


		if(my_strpos($usergroupleaders, $mybb->user['username']) === false)
{
// User is already a leader of the group, so don't show as a "Join Group"

		if(my_strpos($usergroupleaders, $mybb->user['username']) === false)
{
// User is already a leader of the group, so don't show as a "Join Group"

Zeile 2869Zeile 2884
	if($joinablegrouplist)
{
eval("\$joinablegroups = \"".$templates->get("usercp_usergroups_joinable")."\";");

	if($joinablegrouplist)
{
eval("\$joinablegroups = \"".$templates->get("usercp_usergroups_joinable")."\";");

	}


	}


	$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 2884Zeile 2899
	$attachments = '';

// Pagination

	$attachments = '';

// Pagination

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

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

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

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

Zeile 2972Zeile 2987
		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);
}

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

Zeile 3047Zeile 3062
	}

$lang->posts_day = $lang->sprintf($lang->posts_day, my_number_format($perday), $percent);

	}

$lang->posts_day = $lang->sprintf($lang->posts_day, my_number_format($perday), $percent);

	$usergroup = $groupscache[$mybb->user['usergroup']]['title'];

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


$colspan = 1;
if($mybb->user['avatar'])


$colspan = 1;
if($mybb->user['avatar'])

Zeile 3169Zeile 3184

// 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 3182Zeile 3197
	$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
$latest_subscribed = '';
$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1));

	// Thread Subscriptions with New Posts
$latest_subscribed = '';
$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1));

Zeile 3203Zeile 3218
			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))
{

		$fpermissions = forum_permissions();
while($subscription = $db->fetch_array($query))
{

Zeile 3213Zeile 3228
				$subscriptions[$subscription['tid']] = $subscription;
}
}

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

		



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

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

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

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

			{

			{

				$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($readthread = $db->fetch_array($query))
{

				$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($readthread = $db->fetch_array($query))
{

Zeile 3229Zeile 3244
						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 3247Zeile 3262
				}

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

				}

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

				



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

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





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

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

Zeile 3267Zeile 3282
						{
$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
{

						}
else
{

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

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

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

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

						{

						{

							$icon = $icon_cache[$thread['icon']];

							$icon = $icon_cache[$thread['icon']];

 
							$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

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

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

						}
else
{

						}
else
{

							$icon = "&nbsp;";
}

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

						{

						{

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

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

Zeile 3327Zeile 3344
						{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);
}

						{
$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 3339Zeile 3356
			}
}
}

			}
}
}

	



	// User's Latest Threads

// Get unviewable forums

	// User's Latest Threads

// Get unviewable forums

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

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

		



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

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

		



		// Run the threads...
$latest_threads_threads = '';
foreach($threadcache as $thread)

		// Run the threads...
$latest_threads_threads = '';
foreach($threadcache as $thread)

Zeile 3436Zeile 3453
				$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 3444Zeile 3461
					$threadprefix = $db->fetch_array($query);

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

					$threadprefix = $db->fetch_array($query);

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

				}

				}

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

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

				}


				}


				$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

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

				$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

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

				{

				{

					$icon = $icon_cache[$thread['icon']];

					$icon = $icon_cache[$thread['icon']];

 
					$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);

					$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
}
else
{
$icon = "&nbsp;";
}

					$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
}
else
{
$icon = "&nbsp;";
}





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

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

Zeile 3489Zeile 3508
						$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 3569Zeile 3588

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