Vergleich usercp.php - 1.8.23 - 1.8.27

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

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


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

 
require_once MYBB_ROOT."inc/functions_search.php";

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

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

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

// Set to stored value if invalid

		$raw_errors = $userhandler->get_errors();

// Set to stored value if invalid

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

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

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

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

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

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

		}

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

		}

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

	}

	}

	else
{
$userhandler->update_user();

	else
{
$userhandler->update_user();





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

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

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

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

	{

	{

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

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

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

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

	}

$plugins->run_hooks("usercp_profile_start");

	}

$plugins->run_hooks("usercp_profile_start");

Zeile 872Zeile 879
		$allownoticescheck = "";
}


		$allownoticescheck = "";
}


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




	$canbeinvisible = '';

// Check usergroup permission before showing invisible check box
if($mybb->usergroup['canbeinvisible'] == 1)

	{

	{

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





		if(isset($user['invisible']) && $user['invisible'] == 1)
{
$invisiblecheck = "checked=\"checked\"";
}
else
{
$invisiblecheck = "";
}
eval('$canbeinvisible = "'.$templates->get("usercp_options_invisible")."\";");

	}

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

	}

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

Zeile 984Zeile 998
	if(isset($user['dstcorrection']) && $user['dstcorrection'] == 2)
{
$dst_auto_selected = "selected=\"selected\"";

	if(isset($user['dstcorrection']) && $user['dstcorrection'] == 2)
{
$dst_auto_selected = "selected=\"selected\"";

	}

	}

	elseif(isset($user['dstcorrection']) && $user['dstcorrection'] == 1)

	elseif(isset($user['dstcorrection']) && $user['dstcorrection'] == 1)

	{

	{

		$dst_enabled_selected = "selected=\"selected\"";

		$dst_enabled_selected = "selected=\"selected\"";

	}
else
{

	}
else
{

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

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

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

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

	}

	}

	else
{
$showcodebuttonscheck = "";
}

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

	else
{
$showcodebuttonscheck = "";
}

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

	{

	{

		$sourcemodecheck = "checked=\"checked\"";

		$sourcemodecheck = "checked=\"checked\"";

	}

	}

	else
{
$sourcemodecheck = "";

	else
{
$sourcemodecheck = "";

	}


	}


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

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

Zeile 1024Zeile 1038
	if(isset($user['pmnotify']) && $user['pmnotify'] != 0)
{
$pmnotifycheck = "checked=\"checked\"";

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

	}
else

	}
else

	{
$pmnotifycheck = '';
}

	{
$pmnotifycheck = '';
}

Zeile 1040Zeile 1054
	}

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

	}

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

	{

	{

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

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

Zeile 1152Zeile 1166
			}
}
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");

			}
}
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");

	}


	}


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

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

Zeile 1174Zeile 1188
			}
}
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")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if($mybb->input['action'] == "do_email" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	$errors = array();

	$errors = array();





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

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

Zeile 1209Zeile 1223
		$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 1222Zeile 1236
				$activation = $db->fetch_array($query);
}
if($activation)

				$activation = $db->fetch_array($query);
}
if($activation)

			{

			{

				$userhandler->update_user();

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

				$userhandler->update_user();

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

Zeile 1265Zeile 1279
				// Emails require verification
$activationcode = random_str();
$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");

				// Emails require verification
$activationcode = random_str();
$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");





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

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

Zeile 1299Zeile 1313
	{
$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 1314Zeile 1328
	{
$email = $email2 = '';
}

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

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

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


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


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


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


Zeile 1374Zeile 1388
}

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

}

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

{

{

	$plugins->run_hooks("usercp_password");

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

	$plugins->run_hooks("usercp_password");

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

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

$errors = array();

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

$errors = array();


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


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

	}

$user = array();

	}

$user = array();

Zeile 1415Zeile 1429
		$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 1431Zeile 1445
		$mybb->input['action'] = "changename";
}
}

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





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

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

	}


	}


	// Coming back to this page after one or more errors were experienced, show field the user previously entered (with the exception of the password)
if($errors)
{

	// Coming back to this page after one or more errors were experienced, show field the user previously entered (with the exception of the password)
if($errors)
{

Zeile 1454Zeile 1468

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


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

}


}


if($mybb->input['action'] == "do_subscriptions")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

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

if($mybb->input['action'] == "do_subscriptions")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

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

	{

	{

		error($lang->no_subscriptions_selected);
}


		error($lang->no_subscriptions_selected);
}


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

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

	}

	}

	// Changing subscription type
else
{
if($mybb->get_input('do') == "no_notification")
{
$new_notification = 0;

	// Changing subscription type
else
{
if($mybb->get_input('do') == "no_notification")
{
$new_notification = 0;

		}

		}

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

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

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

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

	}


	}


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

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

Zeile 1507Zeile 1521
	$plugins->run_hooks("usercp_subscriptions_start");

// Thread visiblity

	$plugins->run_hooks("usercp_subscriptions_start");

// Thread visiblity

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










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

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

if($inactive_forums = get_inactive_forums())

	{

	{

		$visible = '';

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

	}

	}

 

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


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


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

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

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

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


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


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

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

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

		WHERE {$where}

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

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

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


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


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

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

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

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

Zeile 1696Zeile 1721

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


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

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


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

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

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

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

				{
$forum_read = $read_cutoff;

				{
$forum_read = $read_cutoff;

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

				}
}


				}
}


Zeile 1712Zeile 1739
			}

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

			}

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

			{
if($thread['lastread'])

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

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

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

Zeile 1727Zeile 1754
			{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
if($readcookie > $forum_read)

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

				{

				{

					$lastread = $readcookie;

					$lastread = $readcookie;

				}

				}

				else
{
$lastread = $forum_read;
}

				else
{
$lastread = $forum_read;
}

			}

			}


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


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

Zeile 1761Zeile 1788
			{
$folder .= "close";
$folder_label .= $lang->icon_close;

			{
$folder .= "close";
$folder_label .= $lang->icon_close;

			}

			}


$folder .= "folder";



$folder .= "folder";


Zeile 1772Zeile 1799

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


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

 
			$lastposteruid = $thread['lastposteruid'];

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

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

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

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

			$lastposteruid = $thread['lastposteruid'];

 

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


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

Zeile 1855Zeile 1882
		LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."'
ORDER BY f.name ASC

		LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."'
ORDER BY f.name ASC

	");


	");


	$forums = '';
while($forum = $db->fetch_array($query))
{

	$forums = '';
while($forum = $db->fetch_array($query))
{

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

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

		}

		}


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


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

	}
else
{

	}
else
{

		$url = get_thread_link($thread['tid']);
}
redirect($url, $lang->redirect_subscriptionadded);

		$url = get_thread_link($thread['tid']);
}
redirect($url, $lang->redirect_subscriptionadded);

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

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

		}

		}

		$forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
error_no_permission();

		$forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
error_no_permission();

		}


		}


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


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


Zeile 2025Zeile 2052
		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;

		}

		}

		else

		else

		{

		{

			$url = "index.php";

			$url = "index.php";

		}

		}

		redirect($url, $lang->redirect_forumsubscriptionadded);

		redirect($url, $lang->redirect_forumsubscriptionadded);

	}
else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
if(!$thread || $thread['visible'] == -1)
{
error($lang->error_invalidthread);
}

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

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

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


	}
else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
if(!$thread || $thread['visible'] == -1)
{
error($lang->error_invalidthread);
}

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

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

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


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

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

Zeile 2179Zeile 2206

$forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)


$forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)

		{
error_no_permission();

		{
error_no_permission();

		}

// check if the forum requires a password to view. If so, we need to show a form to the user

		}

// check if the forum requires a password to view. If so, we need to show a form to the user

Zeile 2204Zeile 2231
		}

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

		}

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

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


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


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

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

Zeile 2229Zeile 2256
		$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$lang->unsubscribe_from_thread = $lang->sprintf($lang->unsubscribe_from_thread, $thread['subject']);

		$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$lang->unsubscribe_from_thread = $lang->sprintf($lang->unsubscribe_from_thread, $thread['subject']);





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


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


Zeile 2245Zeile 2272
	verify_post_check($mybb->get_input('my_post_key'));

if($mybb->get_input('type') == "forum")

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

if($mybb->get_input('type') == "forum")

	{

	{

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


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


Zeile 2374Zeile 2401

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


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

Zeile 2383Zeile 2410

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

	else
{
// User is allowed to edit their signature

Zeile 2391Zeile 2418
		{
$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();

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

		}

		}

		else

		else

		{

		{

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

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

		}

		}

		else

		else

		{

		{

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

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

		}

		}

		else

		else

		{

		{

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

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

		}










		}
else
{
$sigimgcode = $lang->off;
}

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

		else
{

		else
{

			$sigimgcode = $lang->off;

			$siglength = $mybb->settings['siglength'];

		}

		}

 


		$sig = htmlspecialchars_uni($sig);

		$sig = htmlspecialchars_uni($sig);

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

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


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


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

Zeile 2432Zeile 2469

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


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





	output_page($editsig);
}

	output_page($editsig);
}





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

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

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


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


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


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


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

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

	}

	}

	elseif($_FILES['avatarupload']['name']) // upload avatar
{
if($mybb->usergroup['canuploadavatars'] == 0)

	elseif($_FILES['avatarupload']['name']) // upload avatar
{
if($mybb->usergroup['canuploadavatars'] == 0)

		{

		{

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

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

		if($avatar['error'])

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

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

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

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

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

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

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

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

Zeile 2570Zeile 2611
			if(strlen($mybb->input['avatarurl']) > 200)
{
$avatar_error = $lang->error_avatarurltoolong;

			if(strlen($mybb->input['avatarurl']) > 200)
{
$avatar_error = $lang->error_avatarurltoolong;

			}


			}


			if(empty($avatar_error))
{
if($width > 0 && $height > 0)

			if(empty($avatar_error))
{
if($width > 0 && $height > 0)

Zeile 2625Zeile 2666
	eval("\$currentavatar = \"".$templates->get("usercp_avatar_current")."\";");

if($mybb->settings['maxavatardims'] != "")

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

if($mybb->settings['maxavatardims'] != "")

	{

	{

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

		list($maxwidth, $maxheight) = preg_split('/[|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);
$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_size, $maxsize);

	if($mybb->settings['avatarsize'])
{
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024);
$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_size, $maxsize);

	}

$plugins->run_hooks("usercp_avatar_intermediate");

	}

$plugins->run_hooks("usercp_avatar_intermediate");


$auto_resize = '';
if($mybb->settings['avatarresizing'] == "auto")


$auto_resize = '';
if($mybb->settings['avatarresizing'] == "auto")

Zeile 2652Zeile 2693
	if($mybb->usergroup['canuploadavatars'] == 1)
{
eval("\$avatarupload = \"".$templates->get("usercp_avatar_upload")."\";");

	if($mybb->usergroup['canuploadavatars'] == 1)
{
eval("\$avatarupload = \"".$templates->get("usercp_avatar_upload")."\";");

	}


	}


	$avatar_remote = '';
if($mybb->settings['allowremoteavatars'] == 1)
{

	$avatar_remote = '';
if($mybb->settings['allowremoteavatars'] == 1)
{

Zeile 2669Zeile 2710
	$plugins->run_hooks("usercp_avatar_end");

if(!isset($avatar_error))

	$plugins->run_hooks("usercp_avatar_end");

if(!isset($avatar_error))

	{

	{

		$avatar_error = '';
}


		$avatar_error = '';
}


Zeile 2699Zeile 2740
		if($user['buddylist'] != '')
{
$user['buddylist'] = explode(',', $user['buddylist']);

		if($user['buddylist'] != '')
{
$user['buddylist'] = explode(',', $user['buddylist']);

		}
else
{

		}
else
{

			$user['buddylist'] = array();
}


			$user['buddylist'] = array();
}


Zeile 2895Zeile 2936
				$adding_self = true;
unset($users[$key]);
continue;

				$adding_self = true;
unset($users[$key]);
continue;

			}

			}

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


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


Zeile 2968Zeile 3009
					elseif($mybb->get_input('manage') == "ignored")
{
$error_message = $lang->users_already_sent_request_alt;

					elseif($mybb->get_input('manage') == "ignored")
{
$error_message = $lang->users_already_sent_request_alt;

					}

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;

				}

if(isset($requests_rec[$user['uid']]))

				}

if(isset($requests_rec[$user['uid']]))

Zeile 3045Zeile 3086
			if($mybb->get_input('manage') == "ignored")
{
$message = $lang->users_added_to_ignore_list;

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

			}
else

			}
else

			{
$message = $lang->users_added_to_buddy_list;
}

			{
$message = $lang->users_added_to_buddy_list;
}

Zeile 3121Zeile 3162
			}

if($mybb->get_input('manage') == "ignored")

			}

if($mybb->get_input('manage') == "ignored")

			{

			{

				$message = $lang->removed_from_ignore_list;
}
else

				$message = $lang->removed_from_ignore_list;
}
else

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

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

				



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

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

Zeile 3326Zeile 3367

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



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


				echo $sentrequests;

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

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

Zeile 3338Zeile 3378
		exit;
}


		exit;
}


	$received_rows = '';

	$received_rows = $bgcolor = '';

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

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

Zeile 3360Zeile 3400

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



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


	$sent_rows = '';

	$sent_rows = $bgcolor = '';

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

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

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

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

			ORDER BY p.dateline DESC

			ORDER BY p.dateline DESC, p.pid DESC

		");

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

		");

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

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

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

 
	}
else
{
$tidinp = '';

	}
if($pidin || $tidinp)
{

	}
if($pidin || $tidinp)
{

Zeile 3490Zeile 3534
		{
$pidin = implode(",", $pidin);
$pidinq = "pid IN ($pidin)";

		{
$pidin = implode(",", $pidin);
$pidinq = "pid IN ($pidin)";

		}

		}

		else
{
$pidinq = "1=0";

		else
{
$pidinq = "1=0";

Zeile 3504Zeile 3548
if($mybb->input['action'] == "usergroups")
{
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";

if($mybb->input['action'] == "usergroups")
{
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";





	$usergroups = $mybb->cache->read('usergroups');

	$usergroups = $mybb->cache->read('usergroups');





	$plugins->run_hooks("usercp_usergroups_start");

// Changing our display group
if($mybb->get_input('displaygroup', MyBB::INPUT_INT))

	$plugins->run_hooks("usercp_usergroups_start");

// Changing our display group
if($mybb->get_input('displaygroup', MyBB::INPUT_INT))

	{

	{

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

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

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

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

		}

		}


$dispgroup = $usergroups[$mybb->get_input('displaygroup', MyBB::INPUT_INT)];
if($dispgroup['candisplaygroup'] != 1)


$dispgroup = $usergroups[$mybb->get_input('displaygroup', MyBB::INPUT_INT)];
if($dispgroup['candisplaygroup'] != 1)

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

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

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

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

		{

		{

			error($lang->not_member_of_group);
}
if($mybb->user['usergroup'] == $mybb->get_input('leavegroup', MyBB::INPUT_INT))

			error($lang->not_member_of_group);
}
if($mybb->user['usergroup'] == $mybb->get_input('leavegroup', MyBB::INPUT_INT))

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

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

	{

	{

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


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


Zeile 3588Zeile 3632
		if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid'])
{
error($lang->cannot_join_group);

		if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid'])
{
error($lang->cannot_join_group);

		}


		}


		if(my_strpos($ingroups, ",".$mybb->get_input('joingroup', MyBB::INPUT_INT).",") !== false)
{
error($lang->already_member_of_group);
}

$query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."' AND gid='".$mybb->get_input('joingroup', MyBB::INPUT_INT)."'");

		if(my_strpos($ingroups, ",".$mybb->get_input('joingroup', MyBB::INPUT_INT).",") !== false)
{
error($lang->already_member_of_group);
}

$query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."' AND gid='".$mybb->get_input('joingroup', MyBB::INPUT_INT)."'");

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

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


if($joinrequest['rid'])


if($joinrequest['rid'])

		{

		{

			error($lang->already_sent_join_request);
}

			error($lang->already_sent_join_request);
}





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

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

			



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

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

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

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

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





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

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

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

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

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

	{

	{

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

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

	}

	}

	else

	else

	{

	{

		$displaycode = '';
}


		$displaycode = '';
}


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

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

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








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

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

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

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

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

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








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

	}

$joinablegroups = $joinablegrouplist = '';

	}

$joinablegroups = $joinablegrouplist = '';

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

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





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

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

Zeile 3942Zeile 4004
	else
{
$start = 0;

	else
{
$start = 0;

		$page = 1;

		$page = 1;

	}

$end = $start + $perpage;

	}

$end = $start + $perpage;

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

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

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

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

	");

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

	");

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

Zeile 3991Zeile 4053
		++$processedattachments;
}


		++$processedattachments;
}


 
	$multipage = '';

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

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

Zeile 4022Zeile 4085
	}

$bandwidth = get_friendly_size($bandwidth);

	}

$bandwidth = get_friendly_size($bandwidth);

 

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


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


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

 
		$delete_button = '';

	}

$plugins->run_hooks("usercp_attachments_end");

	}

$plugins->run_hooks("usercp_attachments_end");

Zeile 4134Zeile 4200

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


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

	{

	{

		eval("\$usergroup .= \"".$templates->get("usercp_resendactivation")."\";");
}
// Make reputations row

		eval("\$usergroup .= \"".$templates->get("usercp_resendactivation")."\";");
}
// Make reputations row

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

// Build referral link

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

// Build referral link

 
	$referral_info = '';

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

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

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

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

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











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

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

if($inactive_forums = get_inactive_forums())

		{

		{

			$visible = '';

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

		}

		}

 

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


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


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

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

			WHERE {$where}

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

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





		$fpermissions = forum_permissions();

		$fpermissions = forum_permissions();

 


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

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

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



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

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

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

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

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

					{

					{

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

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





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

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




				$latest_subscribed_threads = '';


				foreach($subscriptions as $thread)
{
$plugins->run_hooks("usercp_thread_subscriptions_thread");

				foreach($subscriptions as $thread)
{
$plugins->run_hooks("usercp_thread_subscriptions_thread");

Zeile 4356Zeile 4438
						else
{
$thread['displayprefix'] = '';

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

						}

						}


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


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

Zeile 4370Zeile 4452
						else
{
$icon = "&nbsp;";

						else
{
$icon = "&nbsp;";

						}

if($thread['doticon'])
{

						}

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

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

// Check to see which icon we display

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

// Check to see which icon we display

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

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

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

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

Zeile 4391Zeile 4473
						{
$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";

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

						}

$folder .= "folder";

						}

$folder .= "folder";


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


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

						}


						}


						$lastpostdate = my_date('relative', $thread['lastpost']);
$lastposteruid = $thread['lastposteruid'];
if(!$lastposteruid && !$thread['lastposter'])

						$lastpostdate = my_date('relative', $thread['lastpost']);
$lastposteruid = $thread['lastposteruid'];
if(!$lastposteruid && !$thread['lastposter'])

						{

						{

							$lastposter = htmlspecialchars_uni($lang->guest);

							$lastposter = htmlspecialchars_uni($lang->guest);

						}
else
{

						}
else
{

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


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


Zeile 4430Zeile 4512
				}
eval("\$latest_subscribed = \"".$templates->get("usercp_latest_subscribed")."\";");
}

				}
eval("\$latest_subscribed = \"".$templates->get("usercp_latest_subscribed")."\";");
}

		}
}


		}
}


	// User's Latest Threads

	// User's Latest Threads

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





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

	if($unviewable_forums = get_unviewable_forums(true))









	{

	{

		$f_perm_sql .= " AND t.fid NOT IN ($inactiveforums)";

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

	}


	}


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

	if($inactive_forums = get_inactive_forums())


	{

	{

		$visible = '';

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

	}

	}

 

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


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


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

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

		WHERE {$where}

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

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

Zeile 4468Zeile 4547
	$fpermissions = forum_permissions();
while($thread = $db->fetch_array($query))
{

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

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

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

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











	}

$latest_threads = '';

	}

$latest_threads = '';

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

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

			$plugins->run_hooks("usercp_latest_threads_thread"); 

			$plugins->run_hooks("usercp_latest_threads_thread");

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

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

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

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

					if($thread['lastread'])

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

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

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