Vergleich usercp.php - 1.8.17 - 1.8.19

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 582Zeile 582
			}
elseif($type == "radio")
{

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

 
				$userfield = htmlspecialchars_uni($userfield);

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

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

Zeile 599Zeile 600
			}
elseif($type == "checkbox")
{

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

 
				$userfield = htmlspecialchars_uni($userfield);

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

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

Zeile 1195Zeile 1197
		}
else
{

		}
else
{

			if($mybb->user['usergroup'] != "5" && $mybb->usergroup['cancp'] != 1 && $mybb->settings['regtype'] != "verify")












































			$activation = false;
// Checking for pending activations for non-activated accounts
if($mybb->user['usergroup'] == 5 && ($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "both"))
{
$query = $db->simple_select("awaitingactivation", "*", "uid='".$mybb->user['uid']."' AND (type='r' OR type='b')");
$activation = $db->fetch_array($query);
}
if($activation)
{
$userhandler->update_user();

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

// Send new activation mail for non-activated accounts
$activationcode = random_str();
$activationarray = array(
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"code" => $activationcode,
"type" => $activation['type']
);
$db->insert_query("awaitingactivation", $activationarray);
$emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);
switch($mybb->settings['username_method'])
{
case 0:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
case 1:
$emailmessage = $lang->sprintf($lang->email_activateaccount1, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
case 2:
$emailmessage = $lang->sprintf($lang->email_activateaccount2, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
default:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
}
my_mail($mybb->user['email'], $emailsubject, $emailmessage);

$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php?action=email", $lang->redirect_emailupdated);
}
elseif($mybb->usergroup['cancp'] != 1 && ($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "both"))

			{
$uid = $mybb->user['uid'];
$username = $mybb->user['username'];

			{
$uid = $mybb->user['uid'];
$username = $mybb->user['username'];

Zeile 1855Zeile 1900
	if(!$forums)
{
eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");

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

	}


	}


	$plugins->run_hooks("usercp_forumsubscriptions_end");

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

	$plugins->run_hooks("usercp_forumsubscriptions_end");

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

Zeile 1869Zeile 1914
	verify_post_check($mybb->get_input('my_post_key'));

$thread = get_thread($mybb->get_input('tid'));

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

$thread = get_thread($mybb->get_input('tid'));

	if(!$thread)

	if(!$thread || $thread['visible'] == -1)

	{
error($lang->error_invalidthread);
}

	{
error($lang->error_invalidthread);
}

Zeile 1940Zeile 1985
		else
{
$url = "index.php";

		else
{
$url = "index.php";

		}

		}

		redirect($url, $lang->redirect_forumsubscriptionadded);
}
else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));

		redirect($url, $lang->redirect_forumsubscriptionadded);
}
else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));

		if(!$thread)

		if(!$thread || $thread['visible'] == -1)

		{
error($lang->error_invalidthread);
}

		{
error($lang->error_invalidthread);
}

Zeile 2018Zeile 2063
		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')
{

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

			$url = $server_http_referer;
}
else

			$url = $server_http_referer;
}
else

Zeile 2041Zeile 2086
	{
$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);
}

		{
error($lang->error_invalidthread);
}


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


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

Zeile 2062Zeile 2107

remove_subscribed_thread($thread['tid']);
if($server_http_referer && $mybb->request_method != 'post')


remove_subscribed_thread($thread['tid']);
if($server_http_referer && $mybb->request_method != 'post')

		{
$url = $server_http_referer;
}

		{
$url = $server_http_referer;
}

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

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

Zeile 2187Zeile 2232
	{
// Usergroup can use this facility, but only after x posts
error($lang->sprintf($lang->sig_suspended_posts, $mybb->usergroup['canusesigxposts']));

	{
// Usergroup can use this facility, but only after x posts
error($lang->sprintf($lang->sig_suspended_posts, $mybb->usergroup['canusesigxposts']));

	}

	}


$signature = '';
if($sig && $template)


$signature = '';
if($sig && $template)

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

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

		}
else

		}
else

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

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

		{

		{

			$sigmycode = $lang->on;
}
else

			$sigmycode = $lang->on;
}
else

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

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

		}

		}

		else
{
$sightml = $lang->off;

		else
{
$sightml = $lang->off;

Zeile 2251Zeile 2296
			$sigimgcode = $lang->on;
}
else

			$sigimgcode = $lang->on;
}
else

		{

		{

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

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





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

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





		$plugins->run_hooks("usercp_editsig_end");

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

		$plugins->run_hooks("usercp_editsig_end");

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

	}

	}


output_page($editsig);
}


output_page($editsig);
}

Zeile 2333Zeile 2378
			}

// Because Gravatars are square, hijack the width

			}

// Because Gravatars are square, hijack the width

			list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

			list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

			$maxheight = (int)$maxwidth;

// Rating?

			$maxheight = (int)$maxwidth;

// Rating?

Zeile 2343Zeile 2388
			if(!in_array($rating, $types))
{
$rating = 'g';

			if(!in_array($rating, $types))
{
$rating = 'g';

			}

$s = "?s={$maxheight}&r={$rating}&d=mm";

			}

$s = "?s={$maxheight}&r={$rating}&d=mm";


$updated_avatar = array(
"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",
"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);


$updated_avatar = array(
"avatar" => "https://www.gravatar.com/avatar/{$email}{$s}",
"avatardimensions" => "{$maxheight}|{$maxheight}",
"avatartype" => "gravatar"
);





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

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

Zeile 2383Zeile 2428
					if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

					if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

					}
}
}

					}
}
}


if(empty($avatar_error))
{
if($width && $height && $mybb->settings['maxavatardims'] != "")


if(empty($avatar_error))
{
if($width && $height && $mybb->settings['maxavatardims'] != "")

				{
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

				{
list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

					if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);

					if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);

Zeile 2425Zeile 2470
	{
$plugins->run_hooks("usercp_do_avatar_end");
redirect("usercp.php?action=avatar", $lang->redirect_avatarupdated);

	{
$plugins->run_hooks("usercp_do_avatar_end");
redirect("usercp.php?action=avatar", $lang->redirect_avatarupdated);

	}

	}

	else
{
$mybb->input['action'] = "avatar";

	else
{
$mybb->input['action'] = "avatar";

Zeile 2454Zeile 2499

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


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

		list($maxwidth, $maxheight) = explode("x", my_strtolower($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);
}


		$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);
}


Zeile 2506Zeile 2551
}

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(!empty($user))
{
// We want to add us to this user's buddy list

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

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

		}

		}


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



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


Zeile 2541Zeile 2586
		// 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);

		// 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, 0, 1) == ",")
{
$new_list = my_substr($new_list, 1);

Zeile 2552Zeile 2597
		}

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


// We want to add the user to our buddy list
if($mybb->user['buddylist'] != '')

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


// We want to add the user to our buddy list
if($mybb->user['buddylist'] != '')

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

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


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

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


		// Now we have the new list, so throw it all back together
$new_list = implode(",", $mybb->user['buddylist']);


		// Now we have the new list, so throw it all back together
$new_list = implode(",", $mybb->user['buddylist']);


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

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

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

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





		$pm = array(
'subject' => 'buddyrequest_accepted_request',
'message' => 'buddyrequest_accepted_request_message',

		$pm = array(
'subject' => 'buddyrequest_accepted_request',
'message' => 'buddyrequest_accepted_request_message',

Zeile 2598Zeile 2643

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

}


}


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

elseif($mybb->input['action'] == "declinerequest")
{
// 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))

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

		error($lang->invalid_request);

	}

$plugins->run_hooks("usercp_declinerequest_start");


	}

$plugins->run_hooks("usercp_declinerequest_start");


	$user = get_user($request['uid']);
if(!empty($user))
{
$db->delete_query('buddyrequests', 'id='.(int)$request['id']);

	$user = get_user($request['uid']);
if(!empty($user))
{
$db->delete_query('buddyrequests', 'id='.(int)$request['id']);

	}

	}

	else
{
error($lang->user_doesnt_exist);
}

	else
{
error($lang->user_doesnt_exist);
}





	$plugins->run_hooks("usercp_declinerequest_end");

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

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

	$plugins->run_hooks("usercp_declinerequest_end");

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


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

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

Zeile 2685Zeile 2730
		}
}
else

		}
}
else

	{

	{

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

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

Zeile 2850Zeile 2895
					send_pm($pm);

$sent = true;

					send_pm($pm);

$sent = true;

				}

				}

				elseif($mybb->get_input('manage') == "ignored")
{
$existing_users[] = $user['uid'];

				elseif($mybb->get_input('manage') == "ignored")
{
$existing_users[] = $user['uid'];

Zeile 2933Zeile 2978
				// 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);

				// 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, 0, 1) == ",")
{
$new_list = my_substr($new_list, 1);

Zeile 3015Zeile 3060
		if($error_message)
{
$message_js .= " $.jGrowl('{$error_message}', {theme:'jgrowl_error'});";

		if($error_message)
{
$message_js .= " $.jGrowl('{$error_message}', {theme:'jgrowl_error'});";

		}

		}


if($mybb->get_input('delete', MyBB::INPUT_INT))
{


if($mybb->get_input('delete', MyBB::INPUT_INT))
{

Zeile 3057Zeile 3102
	$plugins->run_hooks("usercp_editlists_start");

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

	$plugins->run_hooks("usercp_editlists_start");

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





	// Fetch out buddies
$buddy_count = 0;
$buddy_list = '';

	// Fetch out buddies
$buddy_count = 0;
$buddy_list = '';

Zeile 3180Zeile 3225
	}

if($received_rows == '')

	}

if($received_rows == '')

	{

	{

		eval("\$received_rows = \"".$templates->get("usercp_editlists_no_requests")."\";");
}


		eval("\$received_rows = \"".$templates->get("usercp_editlists_no_requests")."\";");
}


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

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

 
	}

// Get unviewable forums
$f_perm_sql = '';
$unviewable_forums = get_unviewable_forums(true);
$inactiveforums = get_inactive_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 = '';

	}

$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 3746Zeile 3808
	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
{
$start = 0;
$page = 1;
}

	}
else
{
$start = 0;
$page = 1;
}





	$end = $start + $perpage;
$lower = $start+1;

$query = $db->query("
SELECT a.*, p.subject, p.dateline, t.tid, t.subject AS threadsubject

	$end = $start + $perpage;
$lower = $start+1;

$query = $db->query("
SELECT a.*, p.subject, p.dateline, t.tid, t.subject AS threadsubject

		FROM ".TABLE_PREFIX."attachments a

		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)

		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']."'

		WHERE a.uid='".$mybb->user['uid']."' {$f_perm_sql}

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


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


Zeile 3796Zeile 3864
		}
}


		}
}


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

 
	$totalusage = $usage['ausage'];

	$totalusage = $usage['ausage'];

	$totalattachments = $usage['acount'];

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

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

Zeile 3812Zeile 3877
	{
$attachquota = $lang->unlimited;
$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);

	{
$attachquota = $lang->unlimited;
$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);

	}


	}


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


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


Zeile 3840Zeile 3905
	{
error($lang->no_attachments_selected);
}

	{
error($lang->no_attachments_selected);
}

 

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


	$aids = implode(',', array_map('intval', $mybb->input['attachments']));

	$aids = implode(',', array_map('intval', $mybb->input['attachments']));

	$query = $db->simple_select("attachments", "*", "aid IN ($aids) AND uid='".$mybb->user['uid']."'");









$query = $db->query("
SELECT a.*, p.fid
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
WHERE aid IN ({$aids}) AND a.uid={$mybb->user['uid']} {$f_perm_sql}
");


	while($attachment = $db->fetch_array($query))
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

	while($attachment = $db->fetch_array($query))
{
remove_attachment($attachment['pid'], '', $attachment['aid']);