Vergleich usercp.php - 1.6.1 - 1.6.8

  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 5142 2010-07-29 23:36:56Z RyanGordon $

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

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 402Zeile 402
	$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['type'] = htmlspecialchars_uni($profilefield['type']);

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

		$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);
$thing = explode("\n", $profilefield['type'], "2");
$type = $thing[0];

		$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);
$thing = explode("\n", $profilefield['type'], "2");
$type = $thing[0];

Zeile 432Zeile 439
				foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);

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

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

					$val = str_replace("\n", "\\n", $val);

$sel = "";
if($val == $seloptions[$val])

					$val = str_replace("\n", "\\n", $val);

$sel = "";
if($val == $seloptions[$val])

					{

					{

						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>\n";

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

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

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

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

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

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

			}
}

			}
}

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

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

Zeile 576Zeile 583
		{
$defaulttitle = $mybb->usergroup['usertitle'];
}

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

		if(empty($user['usertitle']))



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

		{
$lang->current_custom_usertitle = '';
}

		{
$lang->current_custom_usertitle = '';
}

Zeile 675Zeile 683
	$plugins->run_hooks("usercp_options_start");

if($errors != '')

	$plugins->run_hooks("usercp_options_start");

if($errors != '')

	{

	{

		$user = $mybb->input;
}
else

		$user = $mybb->input;
}
else

Zeile 685Zeile 693
	$languages = $lang->get_languages();
$langoptions = '';
foreach($languages as $lname => $language)

	$languages = $lang->get_languages();
$langoptions = '';
foreach($languages as $lname => $language)

	{

	{

		$sel = "";
if($user['language'] == $lname)
{

		$sel = "";
if($user['language'] == $lname)
{

Zeile 698Zeile 706
	if($user['allownotices'] == 1)
{
$allownoticescheck = "checked=\"checked\"";

	if($user['allownotices'] == 1)
{
$allownoticescheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$allownoticescheck = "";
}

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

		$allownoticescheck = "";
}

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

	{

	{

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

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

Zeile 714Zeile 722
	}

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

	}

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

	{

	{

		$hideemailcheck = "checked=\"checked\"";

		$hideemailcheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$hideemailcheck = "";
}

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

		$hideemailcheck = "";
}

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

	{

	{

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

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

	}
else

{

	}
else

{

		$no_subscribe_selected = "selected=\"selected\"";
}

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

		$no_subscribe_selected = "selected=\"selected\"";
}

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

	{

	{

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

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

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

	else
{
$showavatarscheck = "";

	}


	}


	if($user['showquickreply'] == 1)
{
$showquickreplycheck = "checked=\"checked\"";

	if($user['showquickreply'] == 1)
{
$showquickreplycheck = "checked=\"checked\"";

Zeile 869Zeile 877
		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);


Zeile 1026Zeile 1034

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


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

	{

	{

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

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

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

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

		}

		}

		else
{
$userhandler->update_user();

		else
{
$userhandler->update_user();

Zeile 1065Zeile 1073
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 1182Zeile 1190
	if(is_moderator() == true)
{
$visible = '';

	if(is_moderator() == true)
{
$visible = '';

	}

	}


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


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

Zeile 1248Zeile 1256
	if(is_array($del_subscriptions))
{
$tids = implode(',', $del_subscriptions);

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

 


		if($tids)

		if($tids)

		{

		{

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

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

 
		}

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

if($threadcount < 0)
{
$threadcount = 0;

		}
}


		}
}


Zeile 1259Zeile 1275
		$tids = implode(",", array_keys($subscriptions));

if($mybb->user['uid'] == 0)

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

if($mybb->user['uid'] == 0)

		{
// Build a forum cache.

		{
// Build a forum cache.

			$query = $db->query("
SELECT fid
FROM ".TABLE_PREFIX."forums
WHERE active != 0

			$query = $db->query("
SELECT fid
FROM ".TABLE_PREFIX."forums
WHERE active != 0

				ORDER BY pid, disporder

				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 1281Zeile 1297
				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 1300Zeile 1317
			while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

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

			}

			}

		}

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

		}

// Read threads
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'];

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

			}

			}

		}

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

		}

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

Zeile 1339Zeile 1356

// Fetch the thread icon if we have one
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])


// Fetch the thread icon if we have one
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

			{

			{

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

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

			}
else

			}
else

			{
$icon = "&nbsp;";
}

			{
$icon = "&nbsp;";
}

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

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

			}


			}


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

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





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

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

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

			}

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

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

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

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 1411Zeile 1425
				}
}


				}
}


			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 1490Zeile 1504
	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)
{

	
if($mybb->user['uid'] == 0)
{

Zeile 1509Zeile 1519
			ORDER BY pid, disporder
");


			ORDER BY pid, disporder
");


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

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

	}
else
{

	}
else
{

Zeile 1522Zeile 1532
			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 1533Zeile 1544
		}
$readforums[$forum['fid']] = $forum['lastread'];
}

		}
$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 1546Zeile 1557
		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)
{
continue;
}

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

if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<div align=\"center\">$lang->never</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")."\";");
}
}

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

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

 


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

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

Zeile 1636Zeile 1659
	{
$sig = $mybb->input['signature'];
$template = "usercp_editsig_preview";

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

	}

	}

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

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

	}

	}

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

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

	}


	}


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

	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 1662Zeile 1696
			"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);

		);

$sigpreview = $parser->parse_message($sig, $sig_parser);

Zeile 1675Zeile 1710
		
// 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")."\";");

	}

	}

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

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

		{

		{

			$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();

			$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();

		}
else
{

		}
else
{

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

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

Zeile 1695Zeile 1730
		else
{
$sigmycode = $lang->off;

		else
{
$sigmycode = $lang->off;

		}

		}

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

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

		}
else

		}
else

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

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

		{

		{

			$sigimgcode = $lang->on;
}
else

			$sigimgcode = $lang->on;
}
else

Zeile 1714Zeile 1749
		}
$sig = htmlspecialchars_uni($sig);
$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);

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





		if($mybb->settings['bbcodeinserter'] != 0 || $mybb->user['showcodebuttons'] != 0)
{
$codebuttons = build_mycode_inserter("signature");
}

		if($mybb->settings['bbcodeinserter'] != 0 || $mybb->user['showcodebuttons'] != 0)
{
$codebuttons = build_mycode_inserter("signature");
}

		

		

		$plugins->run_hooks("usercp_editsig_end");

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

		$plugins->run_hooks("usercp_editsig_end");

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

Zeile 1739Zeile 1774
	$avatar_error = "";

if($mybb->input['remove']) // remove avatar

	$avatar_error = "";

if($mybb->input['remove']) // remove avatar

	{

	{

		$updated_avatar = array(
"avatar" => "",
"avatardimensions" => "",

		$updated_avatar = array(
"avatar" => "",
"avatardimensions" => "",

Zeile 1753Zeile 1788
		if(empty($mybb->input['avatar']))
{
$avatar_error = $lang->error_noavatar;

		if(empty($mybb->input['avatar']))
{
$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 1870Zeile 1905
	}

if(empty($avatar_error))

	}

if(empty($avatar_error))

	{

	{

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

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

Zeile 1987Zeile 2022
		{
$avatarmsg = "<br /><strong>".$lang->using_remote_avatar."</strong>";
$avatarurl = htmlspecialchars_uni($mybb->user['avatar']);

		{
$avatarmsg = "<br /><strong>".$lang->using_remote_avatar."</strong>";
$avatarurl = htmlspecialchars_uni($mybb->user['avatar']);

		}

		}

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

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

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

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

		}
}

		}
}

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

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

Zeile 2078Zeile 2113
		$users = array_map("trim", $users);
$users = array_unique($users);
foreach($users as $key => $username)

		$users = array_map("trim", $users);
$users = array_unique($users);
foreach($users as $key => $username)

		{

		{

			if(empty($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 2101Zeile 2136
			while($user = $db->fetch_array($query))
{
++$found_users;

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





				// Make sure we're not adding a duplicate
if(in_array($user['uid'], $existing_users) || in_array($user['uid'], $selected_list))
{

				// Make sure we're not adding a duplicate
if(in_array($user['uid'], $existing_users) || in_array($user['uid'], $selected_list))
{

Zeile 2112Zeile 2147
					else
{
$error_message = "buddy";

					else
{
$error_message = "buddy";

					}


					}


					// On another list?
$string = "users_already_on_".$error_message."_list";
if(in_array($user['uid'], $selected_list))

					// On another list?
$string = "users_already_on_".$error_message."_list";
if(in_array($user['uid'], $selected_list))

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

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

			}
else
{
$message = $lang->users_added_to_buddy_list;
}

			}
else
{
$message = $lang->users_added_to_buddy_list;
}

		}

if($adding_self == true)

		}

if($adding_self == true)

Zeile 2254Zeile 2289
			{
echo "\$('{$mybb->input['manage']}_count').innerHTML = '0';\n";
if($mybb->input['manage'] == "ignored")

			{
echo "\$('{$mybb->input['manage']}_count').innerHTML = '0';\n";
if($mybb->input['manage'] == "ignored")

				{

				{

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

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

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

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

		while($user = $db->fetch_array($query))
{
$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";
}

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

			else
{
$status = "offline";

			else
{
$status = "offline";

Zeile 2837Zeile 2872
			$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'];

		}

		}

		else
{
// This little thing delets attachments without a thread/post

		else
{
// This little thing delets attachments without a thread/post

Zeile 2880Zeile 2920
	{
eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";");
$usagenote = '';

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

	}


	}


	$plugins->run_hooks("usercp_attachments_end");

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

	$plugins->run_hooks("usercp_attachments_end");

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

Zeile 2889Zeile 2929
}

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

}

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

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

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


$plugins->run_hooks("usercp_do_attachments_start");
require_once MYBB_ROOT."inc/functions_upload.php";


$plugins->run_hooks("usercp_do_attachments_start");
require_once MYBB_ROOT."inc/functions_upload.php";

Zeile 2902Zeile 2942
	$aids = implode(',', array_map('intval', $mybb->input['attachments']));
$query = $db->simple_select("attachments", "*", "aid IN ($aids) AND uid='".$mybb->user['uid']."'");
while($attachment = $db->fetch_array($query))

	$aids = implode(',', array_map('intval', $mybb->input['attachments']));
$query = $db->simple_select("attachments", "*", "aid IN ($aids) AND uid='".$mybb->user['uid']."'");
while($attachment = $db->fetch_array($query))

	{

	{

		remove_attachment($attachment['pid'], '', $attachment['aid']);
}
$plugins->run_hooks("usercp_do_attachments_end");

		remove_attachment($attachment['pid'], '', $attachment['aid']);
}
$plugins->run_hooks("usercp_do_attachments_end");

Zeile 2913Zeile 2953
{
// 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");

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

Zeile 2924Zeile 2970
{
// Get posts per day
$daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);

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

 

if($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 3147Zeile 3199
				{
$folder = '';
$folder_label = '';

				{
$folder = '';
$folder_label = '';

 
					$gotounread = '';


if($thread['tid'])
{


if($thread['tid'])
{