Vergleich usercp.php - 1.4.1 - 1.4.4

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * 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 4081 2008-08-08 01:47:02Z Tikitiki $

 * $Id: usercp.php 4254 2008-10-29 21:52:31Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

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

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

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

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

		);
}
else

		);
}
else

Zeile 1136Zeile 1136
	}

// Clean input - only accept integers thanks!

	}

// Clean input - only accept integers thanks!

	array_walk($mybb->input['check'], 'intval');

	$mybb->input['check'] = array_map('intval', $mybb->input['check']);

	$tids = implode(",", $mybb->input['check']);

// Deleting these subscriptions?

	$tids = implode(",", $mybb->input['check']);

// Deleting these subscriptions?

Zeile 1236Zeile 1236
	if(is_array($subscriptions))
{
$tids = implode(",", array_keys($subscriptions));

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

 
		
if($mybb->user['uid'] == 0)
{
// Build a forum cache.
$query = $db->query("
SELECT fid
FROM ".TABLE_PREFIX."forums
WHERE active != 0
ORDER BY pid, disporder
");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
}
else
{
// Build a forum cache.
$query = $db->query("
SELECT f.fid, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.active != 0
ORDER BY pid, disporder
");
}
while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)
{
if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];
}
}
$readforums[$forum['fid']] = $forum['lastread'];
}


// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0)


// Check participation by the current user in any of these threads - for 'dot' folder icons
if($mybb->settings['dotfolders'] != 0)

Zeile 1256Zeile 1291
				$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}

				$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}



 

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


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

Zeile 1283Zeile 1317
			else
{
$icon = " ";

			else
{
$icon = " ";

			}

			}


// Determine the folder
$folder = '';


// Determine the folder
$folder = '';

Zeile 1300Zeile 1334
			$donenew = 0;
$lastread = 0;


			$donenew = 0;
$lastread = 0;


			$forumread = my_get_array_cookie("forumread", $thread['fid']);
if($mybb->user['lastvisit'] > $forumread)










			if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
{
$forum_read = $readforums[$thread['fid']];

$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
if($forum_read == 0 || $forum_read < $read_cutoff)
{
$forum_read = $read_cutoff;
}
}
else

			{

			{

				$forumread = $mybb->user['lastvisit'];

				$forum_read = $forumsread[$thread['fid']];

			}


			}


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

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

			{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
}

			{
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
}

Zeile 1317Zeile 1360
				{
if($thread['lastread'])
{

				{
if($thread['lastread'])
{

							$lastread = $thread['lastread'];

						$lastread = $thread['lastread'];

					}
else
{

					}
else
{

							$lastread = 1;

						$lastread = 1;

					}
}
}

					}
}
}

Zeile 1329Zeile 1372
			if(!$lastread)
{
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);

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

				if($readcookie > $forumread)

				if($readcookie > $forum_read)

				{
$lastread = $readcookie;
}
else
{

				{
$lastread = $readcookie;
}
else
{

					$lastread = $forumread;

					$lastread = $forum_read;

				}
}


				}
}


Zeile 1412Zeile 1455
if($mybb->input['action'] == "forumsubscriptions")
{
$plugins->run_hooks("usercp_forumsubscriptions_start");

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

	$query = $db->query("
SELECT *
FROM ".TABLE_PREFIX."forumpermissions
WHERE gid='".$mybb->user['usergroup']."'
");

	$query = $db->simple_select("forumpermissions", "*", "gid='".$db->escape_string($mybb->user['usergroup'])."'");





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

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

	{

	{

		$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions;
}

		$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions;
}

 
	
if($mybb->user['uid'] == 0)
{
// Build a forum cache.
$query = $db->query("
SELECT fid
FROM ".TABLE_PREFIX."forums
WHERE active != 0
ORDER BY pid, disporder
");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
}
else
{
// Build a forum cache.
$query = $db->query("
SELECT f.fid, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forums f
LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}')
WHERE f.active != 0
ORDER BY pid, disporder
");
}
while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)
{
if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];
}
}
$readforums[$forum['fid']] = $forum['lastread'];
}


	$fpermissions = forum_permissions();
$query = $db->query("
SELECT fs.*, f.*, t.subject AS lastpostsubject

	$fpermissions = forum_permissions();
$query = $db->query("
SELECT fs.*, f.*, t.subject AS lastpostsubject

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

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

			if(($forum['lastpost'] > $mybb->user['lastvisit'] || $mybbforumread[$forum['fid']] > $mybb->user['lastvisit']) && $forum['lastpost'] != 0)

			if(($forum['lastpost'] > $mybb->user['lastvisit'] || $readforums[$forum['fid']] > $mybb->user['lastvisit']) && $forum['lastpost'] != 0)

			{
$folder = "on";
}

			{
$folder = "on";
}

Zeile 1448Zeile 1523
			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>";

			}

			}

			else
{
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);

			else
{
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);

Zeile 1480Zeile 1555
	$plugins->run_hooks("usercp_forumsubscriptions_end");
eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";");
output_page($forumsubscriptions);

	$plugins->run_hooks("usercp_forumsubscriptions_end");
eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";");
output_page($forumsubscriptions);

}


}


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

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

Zeile 1528Zeile 1603
	else if($error)
{
$sig = $mybb->input['signature'];

	else if($error)
{
$sig = $mybb->input['signature'];

 
		$template = false;

	}

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 1548Zeile 1624
		$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();
}

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

	else
{
$sigsmilies = $lang->off;
}

	else
{
$sigsmilies = $lang->off;
}

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

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

	{

	{

		$sigmycode = $lang->on;
}

		$sigmycode = $lang->on;
}

	else
{
$sigmycode = $lang->off;
}

	else
{
$sigmycode = $lang->off;
}

	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)

Zeile 1582Zeile 1658
	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");

	}


	}


	eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");
$plugins->run_hooks("usercp_editsig_end");
output_page($editsig);

	eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");
$plugins->run_hooks("usercp_editsig_end");
output_page($editsig);

Zeile 1657Zeile 1733
			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'];

			}

			}

			$updated_avatar = array(
"avatar" => $avatar['avatar'],
"avatardimensions" => $avatar_dimensions,

			$updated_avatar = array(
"avatar" => $avatar['avatar'],
"avatardimensions" => $avatar_dimensions,

Zeile 1694Zeile 1770
				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 1861Zeile 1937
		}
if($mybb->settings['maxavatardims'] != "")
{

		}
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 1998Zeile 2074
			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

			}
else

			{
$error_message = $lang->cant_add_self_to_buddy_list;

			{
$error_message = $lang->cant_add_self_to_buddy_list;

			}
}

			}
}


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


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





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

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

			}


			}


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

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

Zeile 2033Zeile 2109
			if($mybb->input['manage'] == "ignored")
{
$message = $lang->removed_from_ignore_list;

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

			}
else

			}
else

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

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





	// Now we have the new list, so throw it all back together
$new_list = implode(",", $existing_users);


	// Now we have the new list, so throw it all back together
$new_list = implode(",", $existing_users);


Zeile 2052Zeile 2128
	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) == ",")

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

	}

	}


// And update
$user = array();


// And update
$user = array();

Zeile 2064Zeile 2140
	{
$user['ignorelist'] = $db->escape_string($new_list);
$mybb->user['ignorelist'] = $user['ignorelist'];

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

	}

	}

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

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

	}


	}


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

$plugins->run_hooks("usercp_do_editlists_end");

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

$plugins->run_hooks("usercp_do_editlists_end");

Zeile 2107Zeile 2183
				if($mybb->input['manage'] == "ignored")
{
echo "\$('ignore_list').innerHTML = '<li>{$lang->ignore_list_empty}</li>';\n";

				if($mybb->input['manage'] == "ignored")
{
echo "\$('ignore_list').innerHTML = '<li>{$lang->ignore_list_empty}</li>';\n";

				}

				}

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

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

Zeile 2125Zeile 2201
	else
{
if($error_message)

	else
{
if($error_message)

		{

		{

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

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

Zeile 2144Zeile 2220
	{
$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";

		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
{

			}
else
{

Zeile 2185Zeile 2261
			}
eval("\$ignore_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$ignore_count;

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

		}
}


		}
}


	$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
if(!$ignore_list)

	$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
if(!$ignore_list)

	{

	{

		$ignore_list = "<li>{$lang->ignore_list_empty}</li>";
}


		$ignore_list = "<li>{$lang->ignore_list_empty}</li>";
}


Zeile 2206Zeile 2282
		{
echo $buddy_list;
echo "<script type=\"text/javascript\"> $('buddy_count').innerHTML = '{$buddy_count}'; {$message_js}</script>";

		{
echo $buddy_list;
echo "<script type=\"text/javascript\"> $('buddy_count').innerHTML = '{$buddy_count}'; {$message_js}</script>";

		}

		}

		exit;
}


		exit;
}


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

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

		}
else

		}
else

		{
$pidinq = "1=0";
}

		{
$pidinq = "1=0";
}

Zeile 2312Zeile 2388
{
$plugins->run_hooks("usercp_usergroups_start");
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";

{
$plugins->run_hooks("usercp_usergroups_start");
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";





	// Changing our display group
if($mybb->input['displaygroup'])

	// Changing our display group
if($mybb->input['displaygroup'])

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


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


		if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)
{
error($lang->not_member_of_group);

		if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)
{
error($lang->not_member_of_group);

Zeile 2355Zeile 2431
		if($usergroup['type'] != 4 && $usergroup['type'] != 3)
{
error($lang->cannot_leave_group);

		if($usergroup['type'] != 4 && $usergroup['type'] != 3)
{
error($lang->cannot_leave_group);

		}

		}

		leave_usergroup($mybb->user['uid'], $mybb->input['leavegroup']);
$plugins->run_hooks("usercp_usergroups_leave_group");
redirect("usercp.php?action=usergroups", $lang->left_group);

		leave_usergroup($mybb->user['uid'], $mybb->input['leavegroup']);
$plugins->run_hooks("usercp_usergroups_leave_group");
redirect("usercp.php?action=usergroups", $lang->left_group);

Zeile 2448Zeile 2524
				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)
WHERE l.uid='".$mybb->user['uid']."'

				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)
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 2731Zeile 2807
	{
error($lang->no_attachments_selected);
}

	{
error($lang->no_attachments_selected);
}

	$aids = $db->escape_string(implode(",", $mybb->input['attachments']));

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

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

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