Vergleich usercp.php - 1.8.27 - 1.8.28

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

usercp_menu();



usercp_menu();


$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);

if(my_strpos($server_http_referer, $mybb->settings['bburl'].'/') !== 0)

$server_http_referer = '';
if(isset($_SERVER['HTTP_REFERER']))


{

{

	if(my_strpos($server_http_referer, '/') === 0)



	$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);

if(my_strpos($server_http_referer, $mybb->settings['bburl'].'/') !== 0)

	{

	{

		$server_http_referer = my_substr($server_http_referer, 1);






		if(my_strpos($server_http_referer, '/') === 0)
{
$server_http_referer = my_substr($server_http_referer, 1);
}
$url_segments = explode('/', $server_http_referer);
$server_http_referer = $mybb->settings['bburl'].'/'.end($url_segments);

	}

	}

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

 
}

$plugins->run_hooks("usercp_start");

}

$plugins->run_hooks("usercp_start");

Zeile 1378Zeile 1382

$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php?action=password", $lang->redirect_passwordupdated);


$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php?action=password", $lang->redirect_passwordupdated);

		}

		}

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

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

Zeile 1707Zeile 1711
			// Determine the folder
$folder = '';
$folder_label = '';

			// Determine the folder
$folder = '';
$folder_label = '';





			if(isset($thread['doticon']))
{
$folder = "dot_";
$folder_label .= $lang->icon_dot;

			if(isset($thread['doticon']))
{
$folder = "dot_";
$folder_label .= $lang->icon_dot;

			}


			}


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

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

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

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

			{

			{

				$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if(empty($readforums[$thread['fid']]) || $readforums[$thread['fid']] < $read_cutoff)

				$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if(empty($readforums[$thread['fid']]) || $readforums[$thread['fid']] < $read_cutoff)

				{

				{

					$forum_read = $read_cutoff;

					$forum_read = $read_cutoff;

				}
else
{

				}
else
{

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

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

Zeile 1747Zeile 1751
				else
{
$lastread = 1;

				else
{
$lastread = 1;

				}

				}

			}

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

			}

if(!$lastread)
{
$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'])
{
$folder .= "new";

			if($lastread && $lastread < $thread['lastpost'])
{
$folder .= "new";

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

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

			}


			}


			if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
{
$folder .= "hot";
$folder_label .= $lang->icon_hot;

			if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
{
$folder .= "hot";
$folder_label .= $lang->icon_hot;

			}


			}


			if($thread['closed'] == 1)
{
$folder .= "close";
$folder_label .= $lang->icon_close;

			if($thread['closed'] == 1)
{
$folder .= "close";
$folder_label .= $lang->icon_close;

			}

$folder .= "folder";

			}

$folder .= "folder";


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


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

			}


			}


			// Build last post info
$lastpostdate = my_date('relative', $thread['lastpost']);
$lastposteruid = $thread['lastposteruid'];
if(!$lastposteruid && !$thread['lastposter'])
{
$lastposter = htmlspecialchars_uni($lang->guest);

			// Build last post info
$lastpostdate = my_date('relative', $thread['lastpost']);
$lastposteruid = $thread['lastposteruid'];
if(!$lastposteruid && !$thread['lastposter'])
{
$lastposter = htmlspecialchars_uni($lang->guest);

			}

			}

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

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

Zeile 1817Zeile 1821
			else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);

			else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);

			}


			}


			$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);


			$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);


Zeile 2699Zeile 2703
	if($mybb->settings['allowremoteavatars'] == 1)
{
eval("\$avatar_remote = \"".$templates->get("usercp_avatar_remote")."\";");

	if($mybb->settings['allowremoteavatars'] == 1)
{
eval("\$avatar_remote = \"".$templates->get("usercp_avatar_remote")."\";");

	}


	}


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

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

	}


	}


	$plugins->run_hooks("usercp_avatar_end");

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

	$plugins->run_hooks("usercp_avatar_end");

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

	}

	}


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


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

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


		// Now we have the new list, so throw it all back together
$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);

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

		$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'] != '')
{
$mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']);
}
else

		// 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'] = array();
}


Zeile 2808Zeile 2812
			'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 2973Zeile 2977
			}
$query = $db->simple_select("users", "uid,buddyrequestsauto,buddyrequestspm,language", "{$field} IN ('".my_strtolower(implode("','", $users))."')");
while($user = $db->fetch_array($query))

			}
$query = $db->simple_select("users", "uid,buddyrequestsauto,buddyrequestspm,language", "{$field} IN ('".my_strtolower(implode("','", $users))."')");
while($user = $db->fetch_array($query))

			{

			{

				++$found_users;

// Make sure we're not adding a duplicate

				++$found_users;

// Make sure we're not adding a duplicate

Zeile 2986Zeile 2990
					else
{
$error_message = "buddy";

					else
{
$error_message = "buddy";

					}

					}


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


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

					}

					}


$error_message = $lang->$string;
array_pop($users); // To maintain a proper count when we call count($users)


$error_message = $lang->$string;
array_pop($users); // To maintain a proper count when we call count($users)

Zeile 3005Zeile 3009
					if($mybb->get_input('manage') != "ignored")
{
$error_message = $lang->users_already_sent_request;

					if($mybb->get_input('manage') != "ignored")
{
$error_message = $lang->users_already_sent_request;

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

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

						$error_message = $lang->users_already_sent_request_alt;
}


						$error_message = $lang->users_already_sent_request_alt;
}


Zeile 3028Zeile 3032

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;

				}


				}


				// Do we have auto approval set to On?
if($user['buddyrequestsauto'] == 1 && $mybb->get_input('manage') != "ignored")

				// Do we have auto approval set to On?
if($user['buddyrequestsauto'] == 1 && $mybb->get_input('manage') != "ignored")

				{
$existing_users[] = $user['uid'];


				{
$existing_users[] = $user['uid'];


					$pm = array(
'subject' => 'buddyrequest_new_buddy',
'message' => 'buddyrequest_new_buddy_message',

					$pm = array(
'subject' => 'buddyrequest_new_buddy',
'message' => 'buddyrequest_new_buddy_message',

						'touid' => $user['uid'],
'receivepms' => (int)$user['buddyrequestspm'],
'language' => $user['language'],
'language_file' => 'usercp'

						'touid' => $user['uid'],
'receivepms' => (int)$user['buddyrequestspm'],
'language' => $user['language'],
'language_file' => 'usercp'

					);

send_pm($pm);

					);

send_pm($pm);

Zeile 3061Zeile 3065
					);

send_pm($pm);

					);

send_pm($pm);





					$sent = true;

					$sent = true;

				}

				}

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

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

			}

			}

		}

if($found_users < count($users))

		}

if($found_users < count($users))

Zeile 3082Zeile 3086
		}

if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))

		}

if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))

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

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

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

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

			}

			}

		}

if($adding_self == true)

		}

if($adding_self == true)

Zeile 3102Zeile 3106
			else
{
$error_message = $lang->cant_add_self_to_buddy_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 3131Zeile 3135
				if($user['buddylist'] != '')
{
$user['buddylist'] = explode(',', $user['buddylist']);

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

				}

				}

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

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





				$key = array_search($mybb->get_input('delete', MyBB::INPUT_INT), $user['buddylist']);

				$key = array_search($mybb->get_input('delete', MyBB::INPUT_INT), $user['buddylist']);

				unset($user['buddylist'][$key]);


				unset($user['buddylist'][$key]);


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


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


Zeile 3246Zeile 3250
				else
{
echo "\$(\"#buddy_list\").html(\"<li>{$lang->buddy_list_empty}</li>\");\n";

				else
{
echo "\$(\"#buddy_list\").html(\"<li>{$lang->buddy_list_empty}</li>\");\n";

				}
}
else
{

				}
}
else
{

				echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"".count(explode(",", $new_list))."\");\n";
}
echo $message_js;

				echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"".count(explode(",", $new_list))."\");\n";
}
echo $message_js;

Zeile 3358Zeile 3362
					$request['username'] = build_profile_link(htmlspecialchars_uni($request['username']), (int)$request['touid']);
$request['date'] = my_date('relative', $request['date']);
eval("\$sent_rows .= \"".$templates->get("usercp_editlists_sent_request", 1, 0)."\";");

					$request['username'] = build_profile_link(htmlspecialchars_uni($request['username']), (int)$request['touid']);
$request['date'] = my_date('relative', $request['date']);
eval("\$sent_rows .= \"".$templates->get("usercp_editlists_sent_request", 1, 0)."\";");

				}


				}


				if($sent_rows == '')
{
eval("\$sent_rows = \"".$templates->get("usercp_editlists_no_requests", 1, 0)."\";");
}

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

				if($sent_rows == '')
{
eval("\$sent_rows = \"".$templates->get("usercp_editlists_no_requests", 1, 0)."\";");
}

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





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

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

Zeile 3379Zeile 3383
	}

$received_rows = $bgcolor = '';

	}

$received_rows = $bgcolor = '';

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

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

		FROM ".TABLE_PREFIX."buddyrequests r
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.uid)
WHERE r.touid=".(int)$mybb->user['uid']);

		FROM ".TABLE_PREFIX."buddyrequests r
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=r.uid)
WHERE r.touid=".(int)$mybb->user['uid']);


while($request = $db->fetch_array($query))
{
$bgcolor = alt_trow();


while($request = $db->fetch_array($query))
{
$bgcolor = alt_trow();

		$request['username'] = build_profile_link(htmlspecialchars_uni($request['username']), (int)$request['uid']);
$request['date'] = my_date('relative', $request['date']);
eval("\$received_rows .= \"".$templates->get("usercp_editlists_received_request")."\";");
}

if($received_rows == '')

		$request['username'] = build_profile_link(htmlspecialchars_uni($request['username']), (int)$request['uid']);
$request['date'] = my_date('relative', $request['date']);
eval("\$received_rows .= \"".$templates->get("usercp_editlists_received_request")."\";");
}

if($received_rows == '')

	{

	{

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


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


Zeile 3413Zeile 3417
		$request['username'] = build_profile_link(htmlspecialchars_uni($request['username']), (int)$request['touid']);
$request['date'] = my_date('relative', $request['date']);
eval("\$sent_rows .= \"".$templates->get("usercp_editlists_sent_request")."\";");

		$request['username'] = build_profile_link(htmlspecialchars_uni($request['username']), (int)$request['touid']);
$request['date'] = my_date('relative', $request['date']);
eval("\$sent_rows .= \"".$templates->get("usercp_editlists_sent_request")."\";");

	}


	}


	if($sent_rows == '')
{
eval("\$sent_rows = \"".$templates->get("usercp_editlists_no_requests")."\";");

	if($sent_rows == '')
{
eval("\$sent_rows = \"".$templates->get("usercp_editlists_no_requests")."\";");

Zeile 3524Zeile 3528
		$tidinp = "OR tid IN ($tidin)";
}
else

		$tidinp = "OR tid IN ($tidin)";
}
else

	{

	{

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

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

		{

		{

			$pidin = implode(",", $pidin);
$pidinq = "pid IN ($pidin)";
}
else
{
$pidinq = "1=0";

			$pidin = implode(",", $pidin);
$pidinq = "pid IN ($pidin)";
}
else
{
$pidinq = "1=0";

		}

		}

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

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

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

$plugins->run_hooks("usercp_usergroups_start");

	$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 3580Zeile 3584
	if($mybb->get_input('leavegroup', MyBB::INPUT_INT))
{
// Verify incoming POST request

	if($mybb->get_input('leavegroup', MyBB::INPUT_INT))
{
// Verify incoming POST request

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

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


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


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

Zeile 4367Zeile 4371
			LIMIT 0, 10
");


			LIMIT 0, 10
");


 
		$subscriptions = array();

		$fpermissions = forum_permissions();

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

		$fpermissions = forum_permissions();

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

Zeile 4379Zeile 4384
			}
}


			}
}


		if(is_array($subscriptions))

		if($subscriptions)

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


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