Vergleich usercp.php - 1.8.22 - 1.8.24

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 42Zeile 42
if($mybb->user['uid'] == 0 || $mybb->usergroup['canusercp'] == 0)
{
error_no_permission();

if($mybb->user['uid'] == 0 || $mybb->usergroup['canusercp'] == 0)
{
error_no_permission();

}

if(!$mybb->user['pmfolders'])
{
$mybb->user['pmfolders'] = '1**$%%$2**$%%$3**$%%$4**';
$db->update_query('users', array('pmfolders' => $mybb->user['pmfolders']), "uid = {$mybb->user['uid']}");

 
}

$errors = '';

}

$errors = '';

Zeile 154Zeile 148
{
// 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();


$plugins->run_hooks("usercp_do_profile_start");



$plugins->run_hooks("usercp_do_profile_start");


Zeile 217Zeile 213
	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


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


	$user = array(

	$user = array_merge($user, array(

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

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

Zeile 226Zeile 222
		"birthdayprivacy" => $mybb->get_input('birthdayprivacy'),
"away" => $away,
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY)

		"birthdayprivacy" => $mybb->get_input('birthdayprivacy'),
"away" => $away,
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY)

	);
foreach(array('icq', 'skype', 'google') as $cfield)
{
$csetting = 'allow'.$cfield.'field';

	));
foreach(array('icq', 'skype', 'google') as $cfield)
{
$csetting = 'allow'.$cfield.'field';

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

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

		{
continue;

		{
continue;

		}

if(!is_member($mybb->settings[$csetting]))
{
continue;

		}

if(!is_member($mybb->settings[$csetting]))
{
continue;

		}


		}


		if($cfield == 'icq')
{
$user[$cfield] = $mybb->get_input($cfield, 1);

		if($cfield == 'icq')
{
$user[$cfield] = $mybb->get_input($cfield, 1);

 

if(my_strlen($user[$cfield]) > 10)
{
error($lang->contact_field_icqerror);
}

		}
else
{
$user[$cfield] = $mybb->get_input($cfield);

		}
else
{
$user[$cfield] = $mybb->get_input($cfield);

 

if(my_strlen($user[$cfield]) > 75)
{
error($lang->contact_field_error);
}

		}
}

if($mybb->usergroup['canchangewebsite'] == 1)
{
$user['website'] = $mybb->get_input('website');

		}
}

if($mybb->usergroup['canchangewebsite'] == 1)
{
$user['website'] = $mybb->get_input('website');

	}

	}


if($mybb->usergroup['cancustomtitle'] == 1)
{
if($mybb->get_input('usertitle') != '')
{
$user['usertitle'] = $mybb->get_input('usertitle');


if($mybb->usergroup['cancustomtitle'] == 1)
{
if($mybb->get_input('usertitle') != '')
{
$user['usertitle'] = $mybb->get_input('usertitle');

		}

		}

		elseif(!empty($mybb->input['reverttitle']))
{
$user['usertitle'] = '';
}
}
$userhandler->set_data($user);

		elseif(!empty($mybb->input['reverttitle']))
{
$user['usertitle'] = '';
}
}
$userhandler->set_data($user);





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

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

Zeile 281Zeile 287

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


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

	}
else
{

	}
else
{

		$userhandler->update_user();

$plugins->run_hooks("usercp_do_profile_end");

		$userhandler->update_user();

$plugins->run_hooks("usercp_do_profile_end");

Zeile 306Zeile 312
		$user = $mybb->user;
$bday = explode("-", $user['birthday']);
if(!isset($bday[1]))

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

		{

		{

			$bday[1] = 0;

			$bday[1] = 0;

		}

		}

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

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

		}
}


		}
}


	$plugins->run_hooks("usercp_profile_start");

$bdaydaysel = '';
for($day = 1; $day <= 31; ++$day)
{
if($bday[0] == $day)

	$plugins->run_hooks("usercp_profile_start");

$bdaydaysel = '';
for($day = 1; $day <= 31; ++$day)
{
if($bday[0] == $day)

		{

		{

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

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

		}

		}

		else
{
$selected = '';
}

		else
{
$selected = '';
}





		eval("\$bdaydaysel .= \"".$templates->get("usercp_profile_day")."\";");
}


		eval("\$bdaydaysel .= \"".$templates->get("usercp_profile_day")."\";");
}


Zeile 343Zeile 349
	if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])
{
$allselected = " selected=\"selected\"";

	if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])
{
$allselected = " selected=\"selected\"";

	}

	}

	elseif($user['birthdayprivacy'] == 'none')
{
$noneselected = " selected=\"selected\"";

	elseif($user['birthdayprivacy'] == 'none')
{
$noneselected = " selected=\"selected\"";

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

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

	}

	}


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


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

Zeile 387Zeile 393
		$contact_fields[$cfield] = '';
$csetting = 'allow'.$cfield.'field';
if($mybb->settings[$csetting] == '')

		$contact_fields[$cfield] = '';
$csetting = 'allow'.$cfield.'field';
if($mybb->settings[$csetting] == '')

		{
continue;
}

		{
continue;
}


if(!is_member($mybb->settings[$csetting]))
{
continue;
}


if(!is_member($mybb->settings[$csetting]))
{
continue;
}





		$cfieldsshow = true;

		$cfieldsshow = true;





		$lang_string = 'contact_field_'.$cfield;
$lang_string = $lang->{$lang_string};
$cfvalue = htmlspecialchars_uni($user[$cfield]);

eval('$contact_fields[$cfield] = "'.$templates->get('usercp_profile_contact_fields_field').'";');

		$lang_string = 'contact_field_'.$cfield;
$lang_string = $lang->{$lang_string};
$cfvalue = htmlspecialchars_uni($user[$cfield]);

eval('$contact_fields[$cfield] = "'.$templates->get('usercp_profile_contact_fields_field').'";');

	}

	}


if($cfieldsshow)
{


if($cfieldsshow)
{

Zeile 523Zeile 529
				$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))
{

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

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

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

Zeile 608Zeile 614
				}
}
elseif($type == "checkbox")

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

			{

			{

				$userfield = htmlspecialchars_uni($userfield);
if($errors)
{

				$userfield = htmlspecialchars_uni($userfield);
if($errors)
{

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

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

					{

					{

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

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

Zeile 639Zeile 645
						eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");
}
}

						eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");
}
}

			}

			}

			elseif($type == "textarea")
{
$value = htmlspecialchars_uni($userfield);
eval("\$code = \"".$templates->get("usercp_profile_profilefields_textarea")."\";");

			elseif($type == "textarea")
{
$value = htmlspecialchars_uni($userfield);
eval("\$code = \"".$templates->get("usercp_profile_profilefields_textarea")."\";");

			}
else

			}
else

			{
$value = htmlspecialchars_uni($userfield);
$maxlength = "";

			{
$value = htmlspecialchars_uni($userfield);
$maxlength = "";

Zeile 750Zeile 756
{
// 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();


$plugins->run_hooks("usercp_do_options_start");



$plugins->run_hooks("usercp_do_options_start");


Zeile 757Zeile 765
	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


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


	$user = array(

	$user = array_merge($user, array(

		"uid" => $mybb->user['uid'],
"style" => $mybb->get_input('style', MyBB::INPUT_INT),
"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),

		"uid" => $mybb->user['uid'],
"style" => $mybb->get_input('style', MyBB::INPUT_INT),
"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),

Zeile 766Zeile 774
		"language" => $mybb->get_input('language'),
'usergroup' => $mybb->user['usergroup'],
'additionalgroups' => $mybb->user['additionalgroups']

		"language" => $mybb->get_input('language'),
'usergroup' => $mybb->user['usergroup'],
'additionalgroups' => $mybb->user['additionalgroups']

	);

	));


$user['options'] = array(
"allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),


$user['options'] = array(
"allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),

Zeile 823Zeile 831

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


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

	$plugins->run_hooks("usercp_options_start");


 
	if($errors != '')

	if($errors != '')

	{

	{

		$user = $mybb->input;
}
else
{
$user = $mybb->user;
}

		$user = $mybb->input;
}
else
{
$user = $mybb->user;
}

 

$plugins->run_hooks("usercp_options_start");


$languages = $lang->get_languages();
$board_language = $langoptions = '';


$languages = $lang->get_languages();
$board_language = $langoptions = '';

Zeile 1318Zeile 1326
	// 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();

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

	$errors = array();

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

	{

	{

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

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

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

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


$user = array(


$user = array_merge($user, array(

			"uid" => $mybb->user['uid'],
"password" => $mybb->get_input('password'),
"password2" => $mybb->get_input('password2')

			"uid" => $mybb->user['uid'],
"password" => $mybb->get_input('password'),
"password2" => $mybb->get_input('password2')

		);


		));


		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		$userhandler->set_data($user);

if(!$userhandler->validate_user())

Zeile 1370Zeile 1379

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


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

}


}


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

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

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

$errors = array();

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





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

$errors = array();

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

$user = array();

$plugins->run_hooks("usercp_do_changename_start");


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

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

Zeile 1395Zeile 1407
		require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


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


		$user = array(

		$user = array_merge($user, array(

			"uid" => $mybb->user['uid'],
"username" => $mybb->get_input('username')

			"uid" => $mybb->user['uid'],
"username" => $mybb->get_input('username')

		);


		));


		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		{

		{

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

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

Zeile 1411Zeile 1423
			$userhandler->update_user();
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php?action=changename", $lang->redirect_namechanged);

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



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

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

Zeile 1437Zeile 1448
	else
{
$username = '';

	else
{
$username = '';

	}


	}


	$plugins->run_hooks("usercp_changename_end");

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

	$plugins->run_hooks("usercp_changename_end");

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

Zeile 1449Zeile 1460
{
// 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_subscriptions_start");

 

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


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

 

$plugins->run_hooks("usercp_do_subscriptions_start");


// Clean input - only accept integers thanks!
$mybb->input['check'] = array_map('intval', $mybb->get_input('check', MyBB::INPUT_ARRAY));


// Clean input - only accept integers thanks!
$mybb->input['check'] = array_map('intval', $mybb->get_input('check', MyBB::INPUT_ARRAY));

Zeile 1987Zeile 1998
}

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

}

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

{
// 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'));


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


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

Zeile 2085Zeile 2096
	}
}


	}
}


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

if($mybb->input['action'] == "removesubscription" && ($mybb->request_method == "post" || verify_post_check($mybb->get_input('my_post_key'), true)))

{
// 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'));

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

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

		}


		}


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





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

remove_subscribed_forum($forum['fid']);

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

remove_subscribed_forum($forum['fid']);

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=forumsubscriptions";

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=forumsubscriptions";

		}
redirect($url, $lang->redirect_forumsubscriptionremoved);
}

		}
redirect($url, $lang->redirect_forumsubscriptionremoved);
}

Zeile 2119Zeile 2130
	{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
if(!$thread)

	{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
if(!$thread)

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

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


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

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


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


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


Zeile 2142Zeile 2153
		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 = "usercp.php?action=subscriptions";

			$url = "usercp.php?action=subscriptions";

		}

		}

		redirect($url, $lang->redirect_subscriptionremoved);
}
}

		redirect($url, $lang->redirect_subscriptionremoved);
}
}

















































































// Show remove subscription form when GET method and without valid my_post_key
if($mybb->input['action'] == "removesubscription")
{
$referrer = '';
if($mybb->get_input('type') == "forum")
{
$forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT));
if(!$forum)
{
error($lang->error_invalidforum);
}

add_breadcrumb($lang->nav_forumsubscriptions, "usercp.php?action=forumsubscriptions");
add_breadcrumb($lang->nav_removesubscription);

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

$lang->unsubscribe_from_forum = $lang->sprintf($lang->unsubscribe_from_forum, $forum['name']);

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

eval("\$remove_forum_subscription = \"".$templates->get("usercp_removesubscription_forum")."\";");
output_page($remove_forum_subscription);
exit;
}
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_removesubscription);

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

require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
$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");

eval("\$remove_thread_subscription = \"".$templates->get("usercp_removesubscription_thread")."\";");
output_page($remove_thread_subscription);
exit;
}
}


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

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

Zeile 2162Zeile 2250
		$plugins->run_hooks("usercp2_removesubscriptions_forum");

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

		$plugins->run_hooks("usercp2_removesubscriptions_forum");

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

		if($server_http_referer)
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);
}
else

		if($server_http_referer)
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);
}
else

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

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





		$db->delete_query("threadsubscriptions", "uid='".$mybb->user['uid']."'");
if($server_http_referer)
{

		$db->delete_query("threadsubscriptions", "uid='".$mybb->user['uid']."'");
if($server_http_referer)
{

Zeile 2187Zeile 2275
			$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionsremoved);

			$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionsremoved);

	}

	}

}

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

}

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


$plugins->run_hooks("usercp_do_editsig_start");

 

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


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

 

$plugins->run_hooks("usercp_do_editsig_start");


if($mybb->get_input('updateposts') == "enable")
{


if($mybb->get_input('updateposts') == "enable")
{

Zeile 2335Zeile 2423
		$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)

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

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

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

Zeile 2355Zeile 2443

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





	$avatar_error = "";

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

	$avatar_error = "";

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

Zeile 2474Zeile 2562
					{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;

					{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;

					}
}
}







					}
}
}

// Limiting URL string to stay within database limit
if(strlen($mybb->input['avatarurl']) > 200)
{
$avatar_error = $lang->error_avatarurltoolong;
}


if(empty($avatar_error))
{


if(empty($avatar_error))
{

Zeile 2522Zeile 2616
		$avatarmsg = "<br /><strong>".$lang->already_uploaded_avatar."</strong>";
}
elseif($mybb->user['avatartype'] == "remote" || my_validate_url($mybb->user['avatar']))

		$avatarmsg = "<br /><strong>".$lang->already_uploaded_avatar."</strong>";
}
elseif($mybb->user['avatartype'] == "remote" || my_validate_url($mybb->user['avatar']))

	{

	{

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

Zeile 2537Zeile 2631
	}

if($mybb->settings['avatarsize'])

	}

if($mybb->settings['avatarsize'])

	{

	{

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

		$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")
{
eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_auto")."\";");


$auto_resize = '';
if($mybb->settings['avatarresizing'] == "auto")
{
eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_auto")."\";");

	}

	}

	elseif($mybb->settings['avatarresizing'] == "user")
{
eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_user")."\";");

	elseif($mybb->settings['avatarresizing'] == "user")
{
eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_user")."\";");

Zeile 2570Zeile 2664
	if(!empty($mybb->user['avatar']))
{
eval("\$removeavatar = \"".$templates->get("usercp_avatar_remove")."\";");

	if(!empty($mybb->user['avatar']))
{
eval("\$removeavatar = \"".$templates->get("usercp_avatar_remove")."\";");

	}

$plugins->run_hooks("usercp_avatar_end");

	}

$plugins->run_hooks("usercp_avatar_end");


if(!isset($avatar_error))
{
$avatar_error = '';


if(!isset($avatar_error))
{
$avatar_error = '';

	}


	}


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

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





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

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

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

// Validate request
$query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']);
$request = $db->fetch_array($query);
if(empty($request))
{
error($lang->invalid_request);
}

$plugins->run_hooks("usercp_acceptrequest_start");

$user = get_user($request['uid']);

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

// Validate request
$query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']);
$request = $db->fetch_array($query);
if(empty($request))
{
error($lang->invalid_request);
}

$plugins->run_hooks("usercp_acceptrequest_start");

$user = get_user($request['uid']);

	if(!empty($user))
{
// We want to add us to this user's buddy list
if($user['buddylist'] != '')
{
$user['buddylist'] = explode(',', $user['buddylist']);

	if(!empty($user))
{
// We want to add us to this user's buddy list
if($user['buddylist'] != '')
{
$user['buddylist'] = explode(',', $user['buddylist']);

		}
else

		}
else

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

$user['buddylist'][] = (int)$mybb->user['uid'];

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

$user['buddylist'][] = (int)$mybb->user['uid'];


// Now we have the new list, so throw it all back together


// Now we have the new list, so throw it all back together

		$new_list = implode(",", $user['buddylist']);

		$new_list = implode(",", $user['buddylist']);


// And clean it up a little to ensure there is no possibility of bad values
$new_list = preg_replace("#,{2,}#", ",", $new_list);
$new_list = preg_replace("#[^0-9,]#", "", $new_list);

if(my_substr($new_list, 0, 1) == ",")
{
$new_list = my_substr($new_list, 1);
}
if(my_substr($new_list, -1) == ",")
{
$new_list = my_substr($new_list, 0, my_strlen($new_list)-2);
}



// And clean it up a little to ensure there is no possibility of bad values
$new_list = preg_replace("#,{2,}#", ",", $new_list);
$new_list = preg_replace("#[^0-9,]#", "", $new_list);

if(my_substr($new_list, 0, 1) == ",")
{
$new_list = my_substr($new_list, 1);
}
if(my_substr($new_list, -1) == ",")
{
$new_list = my_substr($new_list, 0, my_strlen($new_list)-2);
}


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

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





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


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






		// We want to add the user to our buddy list

		// We want to add the user to our buddy list

		if($mybb->user['buddylist'] != '')
{

		if($mybb->user['buddylist'] != '')
{

			$mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']);

			$mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']);

		}

		}

		else
{
$mybb->user['buddylist'] = array();
}

		else
{
$mybb->user['buddylist'] = array();
}





		$mybb->user['buddylist'][] = (int)$request['uid'];

// Now we have the new list, so throw it all back together

		$mybb->user['buddylist'][] = (int)$request['uid'];

// Now we have the new list, so throw it all back together

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

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

		{

		{

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


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


Zeile 2676Zeile 2770

send_pm($pm, $mybb->user['uid'], true);



send_pm($pm, $mybb->user['uid'], true);


		$db->delete_query('buddyrequests', 'id='.(int)$request['id']);
}
else
{
error($lang->user_doesnt_exist);
}


		$db->delete_query('buddyrequests', 'id='.(int)$request['id']);
}
else
{
error($lang->user_doesnt_exist);
}


	$plugins->run_hooks("usercp_acceptrequest_end");

redirect("usercp.php?action=editlists", $lang->buddyrequest_accepted);

	$plugins->run_hooks("usercp_acceptrequest_end");

redirect("usercp.php?action=editlists", $lang->buddyrequest_accepted);

Zeile 2697Zeile 2791
	$query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']);
$request = $db->fetch_array($query);
if(empty($request))

	$query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']);
$request = $db->fetch_array($query);
if(empty($request))

	{

	{

		error($lang->invalid_request);
}


		error($lang->invalid_request);
}


Zeile 2712Zeile 2806
	{
error($lang->user_doesnt_exist);
}

	{
error($lang->user_doesnt_exist);
}





	$plugins->run_hooks("usercp_declinerequest_end");

	$plugins->run_hooks("usercp_declinerequest_end");





	redirect("usercp.php?action=editlists", $lang->buddyrequest_declined);
}

elseif($mybb->input['action'] == "cancelrequest")

	redirect("usercp.php?action=editlists", $lang->buddyrequest_declined);
}

elseif($mybb->input['action'] == "cancelrequest")

{

{

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


Zeile 2840Zeile 2934
			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 2959Zeile 3053
		}

if($adding_self == true)

		}

if($adding_self == true)

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

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

				$error_message = $lang->cant_add_self_to_ignore_list;
}
else
{
$error_message = $lang->cant_add_self_to_buddy_list;

				$error_message = $lang->cant_add_self_to_ignore_list;
}
else
{
$error_message = $lang->cant_add_self_to_buddy_list;

			}
}


			}
}


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

if($sent === true)

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

if($sent === true)

			{

			{

				$message = $lang->buddyrequests_sent_success;
}
}

				$message = $lang->buddyrequests_sent_success;
}
}

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

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

				}

				}

				else
{
$user['buddylist'] = array();

				else
{
$user['buddylist'] = array();

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

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

				{

				{

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


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


Zeile 3129Zeile 3223
			$message .= "<br />".$error_message;
}
redirect("usercp.php?action=editlists#".$mybb->get_input('manage'), $message);

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

	}

	}

}

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

}

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

Zeile 3297Zeile 3391
if($mybb->input['action'] == "drafts")
{
$plugins->run_hooks("usercp_drafts_start");

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





	$query = $db->simple_select("posts", "COUNT(pid) AS draftcount", "visible='-2' AND uid='{$mybb->user['uid']}'");
$draftcount = $db->fetch_field($query, 'draftcount');


	$query = $db->simple_select("posts", "COUNT(pid) AS draftcount", "visible='-2' AND uid='{$mybb->user['uid']}'");
$draftcount = $db->fetch_field($query, 'draftcount');


Zeile 3361Zeile 3455
	// 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_drafts_start");

 
	$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY);
if(empty($mybb->input['deletedraft']))
{
error($lang->no_drafts_selected);
}

	$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY);
if(empty($mybb->input['deletedraft']))
{
error($lang->no_drafts_selected);
}

 

$plugins->run_hooks("usercp_do_drafts_start");


	$pidin = array();
$tidin = array();

	$pidin = array();
$tidin = array();

 


	foreach($mybb->input['deletedraft'] as $id => $val)
{
if($val == "post")

	foreach($mybb->input['deletedraft'] as $id => $val)
{
if($val == "post")

Zeile 3378Zeile 3475
		elseif($val == "thread")
{
$tidin[] = "'".(int)$id."'";

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

		}
}

		}
}

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

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

	}

	}

	if($pidin || $tidinp)
{
$pidinq = $tidin = '';

	if($pidin || $tidinp)
{
$pidinq = $tidin = '';

Zeile 3403Zeile 3500
	$plugins->run_hooks("usercp_do_drafts_end");
redirect("usercp.php?action=drafts", $lang->selected_drafts_deleted);
}

	$plugins->run_hooks("usercp_do_drafts_end");
redirect("usercp.php?action=drafts", $lang->selected_drafts_deleted);
}





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

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

	$plugins->run_hooks("usercp_usergroups_start");

 
	$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";

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


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

Zeile 3804Zeile 3902

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


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

	$plugins->run_hooks("usercp_attachments_start");

 
	require_once MYBB_ROOT."inc/functions_upload.php";

if($mybb->settings['enableattachments'] == 0)
{
error($lang->attachments_disabled);
}

	require_once MYBB_ROOT."inc/functions_upload.php";

if($mybb->settings['enableattachments'] == 0)
{
error($lang->attachments_disabled);
}

 

$plugins->run_hooks("usercp_attachments_start");


// Get unviewable forums
$f_perm_sql = '';


// Get unviewable forums
$f_perm_sql = '';

Zeile 3819Zeile 3918
	if($unviewable_forums)
{
$f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)";

	if($unviewable_forums)
{
$f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)";

	}

	}

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

$attachments = '';

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

$attachments = '';


$query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
$totalattachments = $usage['acount'];

 

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


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

Zeile 3843Zeile 3938
	if($page > 0)
{
$start = ($page-1) * $perpage;

	if($page > 0)
{
$start = ($page-1) * $perpage;

		$pages = ceil($totalattachments / $perpage);
if($page > $pages)
{
$start = 0;
$page = 1;
}

 
	}
else
{

	}
else
{

Zeile 3868Zeile 3957
		ORDER BY p.dateline DESC LIMIT {$start}, {$perpage}
");


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


	$bandwidth = $totaldownloads = 0;

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

	while($attachment = $db->fetch_array($query))
{
if($attachment['dateline'] && $attachment['tid'])

	while($attachment = $db->fetch_array($query))
{
if($attachment['dateline'] && $attachment['tid'])

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

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

 
			$totalusage += $attachment['filesize'];
++$totalattachments;

		}
else
{
// This little thing delets attachments without a thread/post
remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']);
}

		}
else
{
// This little thing delets attachments without a thread/post
remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']);
}

 
		++$processedattachments;
}

if($processedattachments >= $perpage || $page > 1)
{
$query = $db->query("
SELECT SUM(a.filesize) AS ausage, COUNT(a.aid) AS acount
FROM ".TABLE_PREFIX."attachments a
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}
");
$usage = $db->fetch_array($query);
$totalusage = $usage['ausage'];
$totalattachments = $usage['acount'];

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

	}


	}


	$totalusage = $usage['ausage'];

 
	$friendlyusage = get_friendly_size((int)$totalusage);
if($mybb->usergroup['attachquota'])
{

	$friendlyusage = get_friendly_size((int)$totalusage);
if($mybb->usergroup['attachquota'])
{

Zeile 3914Zeile 4021
		$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);
}


		$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);
}


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

 
	$bandwidth = get_friendly_size($bandwidth);

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

	$bandwidth = get_friendly_size($bandwidth);

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

	}

$plugins->run_hooks("usercp_attachments_end");

	}

$plugins->run_hooks("usercp_attachments_end");


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


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

Zeile 3933Zeile 4039
{
// 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_attachments_start");




	require_once MYBB_ROOT."inc/functions_upload.php";
if(!isset($mybb->input['attachments']) || !is_array($mybb->input['attachments']))
{
error($lang->no_attachments_selected);
}

	require_once MYBB_ROOT."inc/functions_upload.php";
if(!isset($mybb->input['attachments']) || !is_array($mybb->input['attachments']))
{
error($lang->no_attachments_selected);
}

 

$plugins->run_hooks("usercp_do_attachments_start");


// Get unviewable forums
$f_perm_sql = '';


// Get unviewable forums
$f_perm_sql = '';