Vergleich usercp.php - 1.4.10 - 1.4.14

  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 4620 2009-12-20 07:29:15Z dennis $

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

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 185Zeile 185
			
$return_month = intval(substr($mybb->input['awaymonth'], 0, 2));
$return_day = intval(substr($mybb->input['awayday'], 0, 2));

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

			$return_year = intval(substr($mybb->input['awayyear'], 0, 4));

			$return_year = min(intval($mybb->input['awayyear']), 9999);


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


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

			if ($returntimestamp < $awaytimestamp)

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

Zeile 299Zeile 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 1508Zeile 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 1524Zeile 1527
		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];
if($forumpermissions['canview'] != 0)

		$forum_url = get_forum_link($forum['fid']);
$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 1564Zeile 1561
	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")."\";");
output_page($forumsubscriptions);

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

Zeile 1642Zeile 1639
		$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 1671Zeile 1668
	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 1703Zeile 1700
		if(empty($mybb->input['avatar']))
{
$avatar_error = $lang->error_noavatar;

		if(empty($mybb->input['avatar']))
{
$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")

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

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

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

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

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

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

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

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

				}
}

				}
}

		}

if(empty($avatar_error))

		}

if(empty($avatar_error))

Zeile 1894Zeile 1894
					$checked = "checked=\"checked\"";
}
if($count == 5)

					$checked = "checked=\"checked\"";
}
if($count == 5)

				{

				{

					$avatarlist .= "</tr>\n<tr>\n";
$count = 0;

					$avatarlist .= "</tr>\n<tr>\n";
$count = 0;

				}

				}

				++$count;
eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_avatar")."\";");

				++$count;
eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_avatar")."\";");

			}

			}

			if($count != 0)
{
for($i = $count; $i <= 5; ++$i)
{
eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_blankblock")."\";");
}

			if($count != 0)
{
for($i = $count; $i <= 5; ++$i)
{
eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_blankblock")."\";");
}

			}
}
else

			}
}
else

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

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

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

		{

		{

			$avatarmsg = "<br /><strong>".$lang->using_gallery_avatar."</strong>";
}
elseif($mybb->user['avatartype'] == "remote" || my_strpos(my_strtolower($mybb->user['avatar']), "http://") !== false)

			$avatarmsg = "<br /><strong>".$lang->using_gallery_avatar."</strong>";
}
elseif($mybb->user['avatartype'] == "remote" || my_strpos(my_strtolower($mybb->user['avatar']), "http://") !== false)

Zeile 2019Zeile 2019
	
// Adding one or more users to this list
if($mybb->input['add_username'])

	
// Adding one or more users to this list
if($mybb->input['add_username'])

	{

	{

		// Split up any usernames we have
$found_users = 0;
$adding_self = false;

		// Split up any usernames we have
$found_users = 0;
$adding_self = false;

Zeile 2050Zeile 2050
			while($user = $db->fetch_array($query))
{
++$found_users;

			while($user = $db->fetch_array($query))
{
++$found_users;





				// Make sure we're not adding a duplicate
if(in_array($user['uid'], $existing_users))
{

				// Make sure we're not adding a duplicate
if(in_array($user['uid'], $existing_users))
{

Zeile 2079Zeile 2079
			else
{
$message = $lang->users_added_to_buddy_list;

			else
{
$message = $lang->users_added_to_buddy_list;

			}
}


			}
}


		if($adding_self == true)
{
if($mybb->input['manage'] == "ignored")

		if($adding_self == true)
{
if($mybb->input['manage'] == "ignored")

			{

			{

				$error_message = $lang->cant_add_self_to_ignore_list;

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

Zeile 2095Zeile 2095
		}

if(count($existing_users) == 0)

		}

if(count($existing_users) == 0)

		{
$message = "";
}

		{
$message = "";
}


if($found_users < count($users))
{


if($found_users < count($users))
{

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

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





	// 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) == ",")

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

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

	}

	}


// And update
$user = array();


// And update
$user = array();

Zeile 2523Zeile 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 2535Zeile 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']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers
");

				WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers
");

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