Vergleich usercp.php - 1.8.18 - 1.8.20

  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 1904Zeile 1949
	else
{
$url = get_thread_link($thread['tid']);

	else
{
$url = get_thread_link($thread['tid']);

	}

	}

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


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


Zeile 1914Zeile 1959
	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")

	{

	{

		$forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT));
if(!$forum)
{

		$forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT));
if(!$forum)
{

Zeile 1924Zeile 1969
		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
error_no_permission();

		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 1936Zeile 1981
		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
{
$url = "index.php";

		else
{
$url = "index.php";

Zeile 1947Zeile 1992
	{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
if(!$thread || $thread['visible'] == -1)

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

		{
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 2036Zeile 2081
			$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionremoved);

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

	}
else

	}
else

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

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

Zeile 2126Zeile 2171
	}

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

	}

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

	{

	{

		$update_signature = array(
"includesig" => 1
);

		$update_signature = array(
"includesig" => 1
);

Zeile 2170Zeile 2215
	if(!isset($error))
{
$error = '';

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

	}

	}


if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
{
// User currently has no signature and they're suspended
error($lang->sig_suspended);


if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
{
// User currently has no signature and they're suspended
error($lang->sig_suspended);

	}

	}


if($mybb->usergroup['canusesig'] != 1)
{


if($mybb->usergroup['canusesig'] != 1)
{

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 2214Zeile 2259
	if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW)
{
$plugins->run_hooks("usercp_editsig_end");

	if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW)
{
$plugins->run_hooks("usercp_editsig_end");





		// User either doesn't have permission, or has their signature suspended
eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";");
}

		// User either doesn't have permission, or has their signature suspended
eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";");
}

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

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

		}

		}

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

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

		}
else

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

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

		{

		{

			$sigimgcode = $lang->on;
}
else

			$sigimgcode = $lang->on;
}
else

Zeile 2258Zeile 2303
		$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)

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


			$codebuttons = build_mycode_inserter("signature");
}


Zeile 2434Zeile 2479
}

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

}

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

{
$plugins->run_hooks("usercp_avatar_start");

{
$plugins->run_hooks("usercp_avatar_start");


$avatarmsg = $avatarurl = '';



$avatarmsg = $avatarurl = '';


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

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

		}

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


		}

$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 2578Zeile 2623
		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);

		}

		}

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

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

Zeile 2595Zeile 2640
			'language' => $user['language'],
'language_file' => 'usercp'
);

			'language' => $user['language'],
'language_file' => 'usercp'
);





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

$db->delete_query('buddyrequests', 'id='.(int)$request['id']);

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

$db->delete_query('buddyrequests', 'id='.(int)$request['id']);

Zeile 2606Zeile 2651
	}

$plugins->run_hooks("usercp_acceptrequest_end");

	}

$plugins->run_hooks("usercp_acceptrequest_end");





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

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

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


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


Zeile 3319Zeile 3364
			$pidinq = "1=0";
}
$db->delete_query("posts", "($pidinq $tidinp) AND visible='-2' AND uid='".$mybb->user['uid']."'");

			$pidinq = "1=0";
}
$db->delete_query("posts", "($pidinq $tidinp) AND visible='-2' AND uid='".$mybb->user['uid']."'");

	}

	}

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

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

Zeile 3768Zeile 3826

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


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

Zeile 3992Zeile 4071

// Figure out expiration time
if($warning['daterevoked'])


// Figure out expiration time
if($warning['daterevoked'])

				{

				{

					$expires = $lang->warning_revoked;
}
elseif($warning['expired'])

					$expires = $lang->warning_revoked;
}
elseif($warning['expired'])

Zeile 4010Zeile 4089

$alt_bg = alt_trow();
eval("\$warnings .= \"".$templates->get("usercp_warnings_warning")."\";");


$alt_bg = alt_trow();
eval("\$warnings .= \"".$templates->get("usercp_warnings_warning")."\";");

			}

			}

			if($warnings)
{
eval("\$latest_warnings = \"".$templates->get("usercp_warnings")."\";");
}

			if($warnings)
{
eval("\$latest_warnings = \"".$templates->get("usercp_warnings")."\";");
}

		}

		}

	}

// Format username

	}

// Format username

Zeile 4024Zeile 4103

// Format post numbers
$mybb->user['posts'] = my_number_format($mybb->user['postnum']);


// Format post numbers
$mybb->user['posts'] = my_number_format($mybb->user['postnum']);





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

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

 

$referral_count = (int) $mybb->user['referrals'];
if($referral_count > 0)
{
$uid = (int) $mybb->user['uid'];
eval("\$mybb->user['referrals'] = \"".$templates->get('member_referrals_link')."\";");
}


		eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
}


		eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
}


Zeile 4106Zeile 4193

foreach($subscriptions as $thread)
{


foreach($subscriptions as $thread)
{

 
					$plugins->run_hooks("usercp_thread_subscriptions_thread");

					$folder = '';
$folder_label = '';
$gotounread = '';

					$folder = '';
$folder_label = '';
$gotounread = '';

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

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

 
			$plugins->run_hooks("usercp_latest_threads_thread"); 

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

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

Zeile 4414Zeile 4503

if($thread['closed'] == 1)
{


if($thread['closed'] == 1)
{

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

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

				}

$folder .= "folder";

				}

$folder .= "folder";