Vergleich usercp.php - 1.4.3 - 1.4.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright � 2008 MyBB Group, All Rights Reserved

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: usercp.php 4184 2008-09-10 04:40:17Z Tikitiki $

 * $Id: usercp.php 4864 2010-04-10 09:13:19Z RyanGordon $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 73Zeile 73
	}
else if($mybb->settings['siglength'] > 0)
{

	}
else if($mybb->settings['siglength'] > 0)
{

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

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

		{
$parsed_sig = $parser->text_parse_message($mybb->input['signature']);
}

		{
$parsed_sig = $parser->text_parse_message($mybb->input['signature']);
}

Zeile 173Zeile 173
		$awaydate = TIME_NOW;
if($mybb->input['awayday'])
{

		$awaydate = TIME_NOW;
if($mybb->input['awayday'])
{

 
			// If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year

			if(!$mybb->input['awaymonth'])
{
$mybb->input['awaymonth'] = my_date('n', $awaydate);
}

			if(!$mybb->input['awaymonth'])
{
$mybb->input['awaymonth'] = my_date('n', $awaydate);
}



 
			if(!$mybb->input['awayyear'])

			if(!$mybb->input['awayyear'])

			{

			{

				$mybb->input['awayyear'] = my_date('Y', $awaydate);

				$mybb->input['awayyear'] = my_date('Y', $awaydate);

			}





			}

$return_month = intval(substr($mybb->input['awaymonth'], 0, 2));
$return_day = intval(substr($mybb->input['awayday'], 0, 2));
$return_year = min(intval($mybb->input['awayyear']), 9999);





			$returntimestamp = gmmktime(0, 0, 0, $mybb->input['awaymonth'], $mybb->input['awayday'], $mybb->input['awayyear']);


			// Check if return date is after the away date.
$returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);

			$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));

			$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));

			if ($returntimestamp < $awaytimestamp && $mybb->input['awayyear'] < my_date("Y"))

			if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate)))

			{
error($lang->error_usercp_return_date_past);
}

			{
error($lang->error_usercp_return_date_past);
}

			$returndate = intval($mybb->input['awayday'])."-".intval($mybb->input['awaymonth'])."-".intval($mybb->input['awayyear']);


			
$returndate = "{$return_day}-{$return_month}-{$return_year}";

		}
else
{

		}
else
{

Zeile 199Zeile 205
			"away" => 1,
"date" => $awaydate,
"returndate" => $returndate,

			"away" => 1,
"date" => $awaydate,
"returndate" => $returndate,

			"awayreason" => $db->escape_string($mybb->input['awayreason'])

			"awayreason" => $mybb->input['awayreason']

		);
}
else

		);
}
else

Zeile 293Zeile 299
			$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}
}

			$bdaydaysel .= "<option value=\"$i\">$i</option>\n";
}
}

	$bdaymonthsel[$bday[1]] = "selected";

	$bdaymonthsel[$bday[1]] = 'selected="selected"';


$bdayprivacysel = '';
if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])


$bdayprivacysel = '';
if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])

Zeile 527Zeile 533
		else
{
$value = htmlspecialchars_uni($userfield);

		else
{
$value = htmlspecialchars_uni($userfield);

			$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\" maxlength=\"{$profilefield['maxlength']}\" value=\"$value\" />";






			$maxlength = "";
if($profilefield['maxlength'] > 0)
{
$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";

		}
if($profilefield['required'] == 1)
{

		}
if($profilefield['required'] == 1)
{

Zeile 644Zeile 655
		$errors = $userhandler->get_friendly_errors();
$errors = inline_error($errors);
$mybb->input['action'] = "options";

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

	}

	}

	else
{
$userhandler->update_user();

	else
{
$userhandler->update_user();

Zeile 731Zeile 742
	else if($user['subscriptionmethod'] == 2)
{
$instant_email_subscribe_selected = "selected=\"selected\"";

	else if($user['subscriptionmethod'] == 2)
{
$instant_email_subscribe_selected = "selected=\"selected\"";

	}
else

	}
else

	{
$no_subscribe_selected = "selected=\"selected\"";

	{
$no_subscribe_selected = "selected=\"selected\"";

	}


	}


	if($user['showsigs'] == 1)
{
$showsigscheck = "checked=\"checked\"";;

	if($user['showsigs'] == 1)
{
$showsigscheck = "checked=\"checked\"";;

	}

	}

	else
{
$showsigscheck = "";
}

if($user['showavatars'] == 1)

	else
{
$showsigscheck = "";
}

if($user['showavatars'] == 1)

	{

	{

		$showavatarscheck = "checked=\"checked\"";

		$showavatarscheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$showavatarscheck = "";
}

if($user['showquickreply'] == 1)
{
$showquickreplycheck = "checked=\"checked\"";

		$showavatarscheck = "";
}

if($user['showquickreply'] == 1)
{
$showquickreplycheck = "checked=\"checked\"";

	}

	}

	else
{
$showquickreplycheck = "";

	else
{
$showquickreplycheck = "";

	}

	}


if($user['remember'] == 1)
{
$remembercheck = "checked=\"checked\"";


if($user['remember'] == 1)
{
$remembercheck = "checked=\"checked\"";

	}

	}

	else
{
$remembercheck = "";

	else
{
$remembercheck = "";

	}

	}


if($user['receivepms'] == 1)
{
$receivepmscheck = "checked=\"checked\"";


if($user['receivepms'] == 1)
{
$receivepmscheck = "checked=\"checked\"";

	}

	}

	else
{
$receivepmscheck = "";

	else
{
$receivepmscheck = "";

	}

	}


if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)
{


if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)
{

Zeile 789Zeile 800
	else
{
$pmnoticecheck = "";

	else
{
$pmnoticecheck = "";

	}

	}


if($user['dstcorrection'] == 2)
{


if($user['dstcorrection'] == 2)
{

Zeile 798Zeile 809
	else if($user['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

	else if($user['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

	}

	}

	else
{
$dst_disabled_selected = "selected=\"selected\"";

	else
{
$dst_disabled_selected = "selected=\"selected\"";

Zeile 870Zeile 881
		else
{
$time_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";

		else
{
$time_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";

		}

		}

	}

$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);

	}

$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);

Zeile 943Zeile 954
			"uid" => $mybb->user['uid'],
"email" => $mybb->input['email'],
"email2" => $mybb->input['email2']

			"uid" => $mybb->user['uid'],
"email" => $mybb->input['email'],
"email2" => $mybb->input['email2']

		);

		);


$userhandler->set_data($user);



$userhandler->set_data($user);


Zeile 1015Zeile 1026
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

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





	$errors = array();

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

	$errors = array();

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

	{

	{

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

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

	{

	{

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

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

Zeile 1038Zeile 1049
		$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 1052Zeile 1063
	if(count($errors) > 0)
{
$mybb->input['action'] = "password";

	if(count($errors) > 0)
{
$mybb->input['action'] = "password";

			$errors = inline_error($errors);
}
}

			$errors = inline_error($errors);
}
}


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


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

Zeile 1124Zeile 1135
}

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

}

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

{

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 1141Zeile 1152

// Deleting these subscriptions?
if($mybb->input['do'] == "delete")


// Deleting these subscriptions?
if($mybb->input['do'] == "delete")

	{

	{

		$db->delete_query("threadsubscriptions", "tid IN ($tids) AND uid='{$mybb->user['uid']}'");
}
// Changing subscription type

		$db->delete_query("threadsubscriptions", "tid IN ($tids) AND uid='{$mybb->user['uid']}'");
}
// Changing subscription type

Zeile 1150Zeile 1161
		if($mybb->input['do'] == "no_notification")
{
$new_notification = 0;

		if($mybb->input['do'] == "no_notification")
{
$new_notification = 0;

		}

		}

		else if($mybb->input['do'] == "instant_notification")
{
$new_notification = 1;

		else if($mybb->input['do'] == "instant_notification")
{
$new_notification = 1;

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

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

	}


	}


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

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

Zeile 1292Zeile 1303
			}
}


			}
}


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


		// Now we can build our subscription list
foreach($subscriptions as $thread)
{

		// Now we can build our subscription list
foreach($subscriptions as $thread)
{

Zeile 1342Zeile 1355
				if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;

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

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

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

			}

if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)

			}

if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)

Zeile 1355Zeile 1368
			}

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

			}

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

			{

			{

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

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

Zeile 1379Zeile 1392
				else
{
$lastread = $forum_read;

				else
{
$lastread = $forum_read;

				}
}


				}
}


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

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

Zeile 1390Zeile 1403
				$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost");
eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
$unreadpost = 1;

				$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost");
eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
$unreadpost = 1;

			}

			}

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

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

			}

			}


if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
{


if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
{

Zeile 1408Zeile 1421
				$folder .= "lock";
$folder_label .= $lang->icon_lock;
}

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





			$folder .= "folder";

// Build last post info

			$folder .= "folder";

// Build last post info

Zeile 1417Zeile 1430
			$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
$lastposter = $thread['lastposter'];
$lastposteruid = $thread['lastposteruid'];

			$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
$lastposter = $thread['lastposter'];
$lastposteruid = $thread['lastposteruid'];





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

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

Zeile 1495Zeile 1508
		}
$readforums[$forum['fid']] = $forum['lastread'];
}

		}
$readforums[$forum['fid']] = $forum['lastread'];
}

 
	
require_once MYBB_ROOT."inc/functions_forumlist.php";

	
$fpermissions = forum_permissions();
$query = $db->query("

	
$fpermissions = forum_permissions();
$query = $db->query("

		SELECT fs.*, f.*, t.subject AS lastpostsubject

		SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread

		FROM ".TABLE_PREFIX."forumsubscriptions fs
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid = fs.fid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = f.lastposttid)

		FROM ".TABLE_PREFIX."forumsubscriptions fs
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid = fs.fid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = f.lastposttid)

 
		LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')

		WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."'
ORDER BY f.name ASC
");

		WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."'
ORDER BY f.name ASC
");

Zeile 1512Zeile 1528
		$forumpermissions = $fpermissions[$forum['fid']];
if($forumpermissions['canview'] != 0)
{

		$forumpermissions = $fpermissions[$forum['fid']];
if($forumpermissions['canview'] != 0)
{

			if(($forum['lastpost'] > $mybb->user['lastvisit'] || $readforums[$forum['fid']] > $mybb->user['lastvisit']) && $forum['lastpost'] != 0)
{
$folder = "on";
}
else
{
$folder = "off";
}

			$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost']));
$folder = $lightbulb['folder'];







			if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<div align=\"center\">$lang->never</div>";

			if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<div align=\"center\">$lang->never</div>";

Zeile 1571Zeile 1581
		$db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
}
elseif($mybb->input['updateposts'] == "disable")

		$db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
}
elseif($mybb->input['updateposts'] == "disable")

	{

	{

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

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

Zeile 1584Zeile 1594
	$db->update_query("users", $new_signature, "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_editsig_end");
redirect("usercp.php?action=editsig", $lang->redirect_sigupdated);

	$db->update_query("users", $new_signature, "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_editsig_end");
redirect("usercp.php?action=editsig", $lang->redirect_sigupdated);





}

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

}

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

Zeile 1607Zeile 1617
	}

if($sig && $template)

	}

if($sig && $template)

	{

	{

		$sig_parser = array(
"allow_html" => $mybb->settings['sightml'],
"allow_mycode" => $mybb->settings['sigmycode'],

		$sig_parser = array(
"allow_html" => $mybb->settings['sightml'],
"allow_mycode" => $mybb->settings['sigmycode'],

Zeile 1620Zeile 1630
		eval("\$signature = \"".$templates->get($template)."\";");
}
if($mybb->settings['sigsmilies'] == 1)

		eval("\$signature = \"".$templates->get($template)."\";");
}
if($mybb->settings['sigsmilies'] == 1)

	{

	{

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

		$sigmycode = $lang->on;

	}
else
{

	}
else
{

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

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

Zeile 1643Zeile 1653
	else
{
$sightml = $lang->off;

	else
{
$sightml = $lang->off;

	}

	}

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

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

Zeile 1691Zeile 1701
		{
$avatar_error = $lang->error_noavatar;
}

		{
$avatar_error = $lang->error_noavatar;
}






		
$mybb->input['gallery'] = str_replace(array("./", ".."), "", $mybb->input['gallery']);
$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


		if(empty($avatar_error))
{
if($mybb->input['gallery'] == "default")

		if(empty($avatar_error))
{
if($mybb->input['gallery'] == "default")

			{

			{

				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']);
}
else
{
$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);

				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']);
}
else
{
$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);

			}

			}


if(file_exists($avatarpath))
{


if(file_exists($avatarpath))
{

Zeile 1713Zeile 1726
					"avatartype" => "gallery"
);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");

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

			}
remove_avatars($mybb->user['uid']);
}

			}
remove_avatars($mybb->user['uid']);
}

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

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

		{

		{

			error_no_permission();
}
$avatar = upload_avatar();
if($avatar['error'])

			error_no_permission();
}
$avatar = upload_avatar();
if($avatar['error'])

		{

		{

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

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

		{

		{

			if($avatar['width'] > 0 && $avatar['height'] > 0)
{
$avatar_dimensions = $avatar['width']."|".$avatar['height'];

			if($avatar['width'] > 0 && $avatar['height'] > 0)
{
$avatar_dimensions = $avatar['width']."|".$avatar['height'];

Zeile 1752Zeile 1765
		if(!$file)
{
$avatar_error = $lang->error_invalidavatarurl;

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

		}

		}

		else
{

		else
{

			$tmp_name = $mybb->settings['avataruploadpath']."/remote_".md5(uniqid(rand(), true));

			$tmp_name = $mybb->settings['avataruploadpath']."/remote_".md5(random_str());

			$fp = @fopen($tmp_name, "wb");
if(!$fp)

			$fp = @fopen($tmp_name, "wb");
if(!$fp)

			{

			{

				$avatar_error = $lang->error_invalidavatarurl;
}
else

				$avatar_error = $lang->error_invalidavatarurl;
}
else

			{

			{

				fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);

				fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);

Zeile 1770Zeile 1783
				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", $mybb->settings['maxavatardims']);

				list($maxwidth, $maxheight) = explode("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 1790Zeile 1803
		if(empty($avatar_error))
{
if($width > 0 && $height > 0)

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

			{

			{

				$avatar_dimensions = intval($width)."|".intval($height);
}
$updated_avatar = array(

				$avatar_dimensions = intval($width)."|".intval($height);
}
$updated_avatar = array(

Zeile 1804Zeile 1817
	}

if(empty($avatar_error))

	}

if(empty($avatar_error))

	{

	{

		$plugins->run_hooks("usercp_do_avatar_end");
redirect("usercp.php", $lang->redirect_avatarupdated);
}

		$plugins->run_hooks("usercp_do_avatar_end");
redirect("usercp.php", $lang->redirect_avatarupdated);
}

Zeile 1826Zeile 1839
		if(is_dir($mybb->settings['avatardir']."/$dir") && substr($dir, 0, 1) != ".")
{
$gallerylist[$dir] = str_replace("_", " ", $dir);

		if(is_dir($mybb->settings['avatardir']."/$dir") && substr($dir, 0, 1) != ".")
{
$gallerylist[$dir] = str_replace("_", " ", $dir);

		}

		}

	}
@closedir($avatardir);
natcasesort($gallerylist);

	}
@closedir($avatardir);
natcasesort($gallerylist);

Zeile 1899Zeile 1912
		else
{
eval("\$avatarlist = \"".$templates->get("usercp_avatar_gallery_noavatars")."\";");

		else
{
eval("\$avatarlist = \"".$templates->get("usercp_avatar_gallery_noavatars")."\";");

		}

		}

		eval("\$gallery = \"".$templates->get("usercp_avatar_gallery")."\";");
$plugins->run_hooks("usercp_avatar_end");
output_page($gallery);

		eval("\$gallery = \"".$templates->get("usercp_avatar_gallery")."\";");
$plugins->run_hooks("usercp_avatar_end");
output_page($gallery);

Zeile 1908Zeile 1921
	else
{
if($mybb->user['avatartype'] == "upload" || stristr($mybb->user['avatar'], $mybb->settings['avataruploadpath']))

	else
{
if($mybb->user['avatartype'] == "upload" || stristr($mybb->user['avatar'], $mybb->settings['avataruploadpath']))

		{

		{

			$avatarmsg = "<br /><strong>".$lang->already_uploaded_avatar."</strong>";
}
elseif($mybb->user['avatartype'] == "gallery" || stristr($mybb->user['avatar'], $mybb->settings['avatardir']))

			$avatarmsg = "<br /><strong>".$lang->already_uploaded_avatar."</strong>";
}
elseif($mybb->user['avatartype'] == "gallery" || stristr($mybb->user['avatar'], $mybb->settings['avatardir']))

Zeile 1922Zeile 1935
		}
$urltoavatar = htmlspecialchars_uni($mybb->user['avatar']);
if($mybb->user['avatar'])

		}
$urltoavatar = htmlspecialchars_uni($mybb->user['avatar']);
if($mybb->user['avatar'])

		{

		{

			$avatar_dimensions = explode("|", $mybb->user['avatardimensions']);
if($avatar_dimensions[0] && $avatar_dimensions[1])
{

			$avatar_dimensions = explode("|", $mybb->user['avatardimensions']);
if($avatar_dimensions[0] && $avatar_dimensions[1])
{

Zeile 1936Zeile 1949
			$colspan = 2;
}
if($mybb->settings['maxavatardims'] != "")

			$colspan = 2;
}
if($mybb->settings['maxavatardims'] != "")

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

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

			$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);
}
if($mybb->settings['avatarsize'])

			$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);
}
if($mybb->settings['avatarsize'])

Zeile 2074Zeile 2087
			if($mybb->input['manage'] == "ignored")
{
$error_message = $lang->cant_add_self_to_ignore_list;

			if($mybb->input['manage'] == "ignored")
{
$error_message = $lang->cant_add_self_to_ignore_list;

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

		}

if(count($existing_users) == 0)

Zeile 2087Zeile 2100
		}

if($found_users < count($users))

		}

if($found_users < count($users))

		{

		{

			if($error_message)
{
$error_message .= "<br />";

			if($error_message)
{
$error_message .= "<br />";

			}


			}


			$error_message .= $lang->invalid_user_selected;
}
}

			$error_message .= $lang->invalid_user_selected;
}
}

Zeile 2113Zeile 2126
			else
{
$message = $lang->removed_from_buddy_list;

			else
{
$message = $lang->removed_from_buddy_list;

			}

			}

			$message = $lang->sprintf($message, $user['username']);
}
}

			$message = $lang->sprintf($message, $user['username']);
}
}

Zeile 2220Zeile 2233
	{
$type = "buddy";
$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array("order_by" => "username"));

	{
$type = "buddy";
$query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array("order_by" => "username"));

		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $user['lastvisit'] != $user['lastactive'])
{
$status = "online";
}
else
{
$status = "offline";

		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
{
$status = "online";
}
else
{
$status = "offline";

			}
eval("\$buddy_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$buddy_count;

			}
eval("\$buddy_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$buddy_count;

Zeile 2251Zeile 2264
		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $user['lastvisit'] != $user['lastactive'])

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])

			{
$status = "online";
}

			{
$status = "online";
}

Zeile 2303Zeile 2316
		LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
WHERE p.uid='".$mybb->user['uid']."' AND p.visible='-2'
ORDER BY p.dateline DESC

		LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid)
WHERE p.uid='".$mybb->user['uid']."' AND p.visible='-2'
ORDER BY p.dateline DESC

	");

	");

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

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

Zeile 2340Zeile 2353

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


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

{

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 2348Zeile 2361
	if(!$mybb->input['deletedraft'])
{
error($lang->no_drafts_selected);

	if(!$mybb->input['deletedraft'])
{
error($lang->no_drafts_selected);

	}

	}

	$pidin = array();
$tidin = array();
foreach($mybb->input['deletedraft'] as $id => $val)

	$pidin = array();
$tidin = array();
foreach($mybb->input['deletedraft'] as $id => $val)

	{

	{

		if($val == "post")
{
$pidin[] = "'".intval($id)."'";

		if($val == "post")
{
$pidin[] = "'".intval($id)."'";

		}

		}

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

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

		}
}

		}
}

	if($tidin)
{
$tidin = implode(",", $tidin);

	if($tidin)
{
$tidin = implode(",", $tidin);

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

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

		}
else
{

		}
else
{

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

Zeile 2449Zeile 2462
		$usergroup = $db->fetch_array($query);

if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid'])

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

if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid'])

		{

		{

			error($lang->cannot_join_group);
}


			error($lang->cannot_join_group);
}


Zeile 2510Zeile 2523

// List of groups this user is a leader of
$groupsledlist = '';


// List of groups this user is a leader of
$groupsledlist = '';



 

switch($db->type)
{


switch($db->type)
{

Zeile 2522Zeile 2534
				FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))

				FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))

				LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid)

				LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)

				WHERE l.uid='".$mybb->user['uid']."'

				WHERE l.uid='".$mybb->user['uid']."'

				GROUP BY l.gid

				GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers

			");
break;
default:

			");
break;
default:

Zeile 2533Zeile 2545
				FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%')) OR u.usergroup = g.gid))

				FROM ".TABLE_PREFIX."groupleaders l
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%')) OR u.usergroup = g.gid))

				LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid)

				LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)

				WHERE l.uid='".$mybb->user['uid']."'
GROUP BY l.gid
");

				WHERE l.uid='".$mybb->user['uid']."'
GROUP BY l.gid
");

Zeile 2598Zeile 2610
			}
else
{

			}
else
{

				$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."&amp;my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";

				$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&amp;leavegroup=".$usergroup['gid']."&amp;my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";

			}
if($usergroup['description'])
{

			}
if($usergroup['description'])
{