Vergleich usercp.php - 1.6.4 - 1.6.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: usercp.php 5459 2011-05-10 10:47:56Z Tomm $

 * $Id: usercp.php 5765 2012-03-27 09:52:45Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 402Zeile 402
	$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder'));
while($profilefield = $db->fetch_array($query))
{

	$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder'));
while($profilefield = $db->fetch_array($query))
{

 
		// Does this field have a minimum post count?
if($profilefield['postnum'] && $profilefield['postnum'] > $user['postnum'])
{
continue;
}


		$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);

		$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']);

Zeile 411Zeile 417
		$field = "fid{$profilefield['fid']}";
$select = '';
if($errors)

		$field = "fid{$profilefield['fid']}";
$select = '';
if($errors)

		{

		{

			$userfield = $mybb->input['profile_fields'][$field];
}
else

			$userfield = $mybb->input['profile_fields'][$field];
}
else

		{

		{

			$userfield = $user[$field];
}
if($type == "multiselect")

			$userfield = $user[$field];
}
if($type == "multiselect")

Zeile 433Zeile 439
				foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);

				foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);

					$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)

					$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)

				{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);


				{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);


					$sel = "";

					$sel = "";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";

					if($val == $seloptions[$val])
{
$sel = " selected=\"selected\"";

Zeile 473Zeile 479
						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>";

						$sel = " selected=\"selected\"";
}
$select .= "<option value=\"$val\"$sel>$val</option>";

				}
if(!$profilefield['length'])
{
$profilefield['length'] = 1;
}

				}
if(!$profilefield['length'])
{
$profilefield['length'] = 1;
}

				$code = "<select name=\"profile_fields[$field]\" size=\"{$profilefield['length']}\">$select</select>";
}
}
elseif($type == "radio")

				$code = "<select name=\"profile_fields[$field]\" size=\"{$profilefield['length']}\">$select</select>";
}
}
elseif($type == "radio")

		{

		{

			$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)

			$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)

				{

				{

					$checked = "";
if($val == $userfield)
{

					$checked = "";
if($val == $userfield)
{

Zeile 506Zeile 512
			else
{
$useropts = explode("\n", $userfield);

			else
{
$useropts = explode("\n", $userfield);

			}

			}

			if(is_array($useropts))
{
foreach($useropts as $key => $val)

			if(is_array($useropts))
{
foreach($useropts as $key => $val)

Zeile 515Zeile 521
				}
}
$expoptions = explode("\n", $options);

				}
}
$expoptions = explode("\n", $options);

			if(is_array($expoptions))

			if(is_array($expoptions))

			{
foreach($expoptions as $key => $val)
{

			{
foreach($expoptions as $key => $val)
{

Zeile 591Zeile 597
			}
}
eval("\$customtitle = \"".$templates->get("usercp_profile_customtitle")."\";");

			}
}
eval("\$customtitle = \"".$templates->get("usercp_profile_customtitle")."\";");

	}

	}

	else
{
$customtitle = "";

	else
{
$customtitle = "";

Zeile 667Zeile 673
		$userhandler->update_user();

$plugins->run_hooks("usercp_do_options_end");

		$userhandler->update_user();

$plugins->run_hooks("usercp_do_options_end");





		redirect("usercp.php", $lang->redirect_optionsupdated);
}
}

		redirect("usercp.php", $lang->redirect_optionsupdated);
}
}

Zeile 677Zeile 683
	$plugins->run_hooks("usercp_options_start");

if($errors != '')

	$plugins->run_hooks("usercp_options_start");

if($errors != '')

	{

	{

		$user = $mybb->input;

		$user = $mybb->input;

	}
else
{

	}
else
{

		$user = $mybb->user;
}
$languages = $lang->get_languages();

		$user = $mybb->user;
}
$languages = $lang->get_languages();

Zeile 704Zeile 710
	else
{
$allownoticescheck = "";

	else
{
$allownoticescheck = "";

	}

	}


if($user['invisible'] == 1)
{


if($user['invisible'] == 1)
{

Zeile 1250Zeile 1256
	if(is_array($del_subscriptions))
{
$tids = implode(',', $del_subscriptions);

	if(is_array($del_subscriptions))
{
$tids = implode(',', $del_subscriptions);

 


		if($tids)

		if($tids)

		{

		{

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

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

 
		}

$threadcount = $threadcount - count($del_subscriptions);

if($threadcount < 0)
{
$threadcount = 0;

		}
}


		}
}


Zeile 1270Zeile 1284
				ORDER BY pid, disporder
");


				ORDER BY pid, disporder
");


			$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

			$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);

		}
else

		}
else

		{

		{

			// Build a forum cache.
$query = $db->query("
SELECT f.fid, fr.dateline AS lastread

			// Build a forum cache.
$query = $db->query("
SELECT f.fid, fr.dateline AS lastread

Zeile 1283Zeile 1297
				ORDER BY pid, disporder
");
}

				ORDER BY pid, disporder
");
}

 


		while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

		while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

Zeile 1310Zeile 1325
		{
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($readthread = $db->fetch_array($query))

		{
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($readthread = $db->fetch_array($query))

			{

			{

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

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

Zeile 1329Zeile 1344
			if($thread['prefix'] != 0)
{
$thread['threadprefix'] .= '&nbsp;';

			if($thread['prefix'] != 0)
{
$thread['threadprefix'] .= '&nbsp;';

			}

			}

			
// Sanitize
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);

			
// Sanitize
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);





			// Build our links
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

			// Build our links
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

Zeile 1348Zeile 1363
			else
{
$icon = "&nbsp;";

			else
{
$icon = "&nbsp;";

			}

			}


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


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





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

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

			}

			}


$gotounread = '';
$isnew = 0;


$gotounread = '';
$isnew = 0;

Zeile 1386Zeile 1401
			}

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

			}

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

			{
if($thread['lastpost'] > $cutoff)
{
if($thread['lastread'])
{
$lastread = $thread['lastread'];
}
else
{
$lastread = 1;
}

			{
if($thread['lastread'])
{
$lastread = $thread['lastread'];
}
else
{
$lastread = 1;




				}
}


				}
}


Zeile 1413Zeile 1425
				}
}


				}
}


			if($thread['lastpost'] > $lastread && $lastread)

			if($lastread && $lastread < $thread['lastpost'])

			{
$folder .= "new";
$folder_label .= $lang->icon_new;

			{
$folder .= "new";
$folder_label .= $lang->icon_new;

Zeile 1429Zeile 1441
			}

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

			}

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

			{

			{

				$folder .= "hot";
$folder_label .= $lang->icon_hot;
}

				$folder .= "hot";
$folder_label .= $lang->icon_hot;
}

Zeile 1492Zeile 1504
	eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";");
output_page($subscriptions);
}

	eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";");
output_page($subscriptions);
}

 


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

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

	$query = $db->simple_select("forumpermissions", "*", "gid='".$db->escape_string($mybb->user['usergroup'])."'");
while($permissions = $db->fetch_array($query))
{
$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions;
}

 
	
if($mybb->user['uid'] == 0)
{

	
if($mybb->user['uid'] == 0)
{

Zeile 1511Zeile 1519
			ORDER BY pid, disporder
");


			ORDER BY pid, disporder
");


		$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

		$forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);

	}
else
{

	}
else
{

Zeile 1524Zeile 1532
			ORDER BY pid, disporder
");
}

			ORDER BY pid, disporder
");
}

 


	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

Zeile 1535Zeile 1544
		}
$readforums[$forum['fid']] = $forum['lastread'];
}

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

	
require_once MYBB_ROOT."inc/functions_forumlist.php";






	$fpermissions = forum_permissions();

	$fpermissions = forum_permissions();

 
	require_once MYBB_ROOT."inc/functions_forumlist.php";


	$query = $db->query("
SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forumsubscriptions fs

	$query = $db->query("
SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread
FROM ".TABLE_PREFIX."forumsubscriptions fs

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

 


	$forums = '';
while($forum = $db->fetch_array($query))
{
$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];

	$forums = '';
while($forum = $db->fetch_array($query))
{
$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];

		if($forumpermissions['canview'] != 0)















if($forumpermissions['canview'] == 0)
{
continue;
}

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

		{

		{

			$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_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);
$lastpost_time = my_date($mybb->settings['timeformat'], $forum['lastpost']);
$lastposttid = $forum['lastposttid'];
$lastposter = $forum['lastposter'];
$lastpost_profilelink = build_profile_link($lastposter, $forum['lastposteruid']);
$lastpost_subject = htmlspecialchars_uni($forum['lastpostsubject']);
if(my_strlen($lastpost_subject) > 25)

			{

			{

				$lastpost = "<div align=\"center\">$lang->never</div>";

				$lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";

			}

			}

			else
{
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);
$lastpost_time = my_date($mybb->settings['timeformat'], $forum['lastpost']);
$lastposttid = $forum['lastposttid'];
$lastposter = $forum['lastposter'];
$lastpost_profilelink = build_profile_link($lastposter, $forum['lastposteruid']);
$lastpost_subject = $forum['lastpostsubject'];
if(my_strlen($lastpost_subject) > 25)
{
$lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";
}
$lastpost_link = get_thread_link($forum['lastposttid'], 0, "lastpost");
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost")."\";");
}
}

			$lastpost_link = get_thread_link($forum['lastposttid'], 0, "lastpost");
eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost")."\";");
}














		$posts = my_number_format($forum['posts']);
$threads = my_number_format($forum['threads']);

		$posts = my_number_format($forum['posts']);
$threads = my_number_format($forum['threads']);

 


		if($mybb->settings['showdescriptions'] == 0)
{
$forum['description'] = "";
}

		if($mybb->settings['showdescriptions'] == 0)
{
$forum['description'] = "";
}

 


		eval("\$forums .= \"".$templates->get("usercp_forumsubscriptions_forum")."\";");
}

		eval("\$forums .= \"".$templates->get("usercp_forumsubscriptions_forum")."\";");
}

 


	if(!$forums)
{
eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");
}

	if(!$forums)
{
eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";");
}

 


	$plugins->run_hooks("usercp_forumsubscriptions_end");

	$plugins->run_hooks("usercp_forumsubscriptions_end");

 


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

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

Zeile 1635Zeile 1655
{
$plugins->run_hooks("usercp_editsig_start");
if($mybb->input['preview'] && !$error)

{
$plugins->run_hooks("usercp_editsig_start");
if($mybb->input['preview'] && !$error)

	{
$sig = $mybb->input['signature'];

	{
$sig = $mybb->input['signature'];

		$template = "usercp_editsig_preview";
}
elseif(!$error)
{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";

		$template = "usercp_editsig_preview";
}
elseif(!$error)
{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";

	}

	}

	else if($error)

	else if($error)

	{

	{

		$sig = $mybb->input['signature'];
$template = false;

		$sig = $mybb->input['signature'];
$template = false;

	}


	}


	if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))

	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

		// User currently has no signature and they're suspended

 
		error($lang->sig_suspended);
}

if($mybb->usergroup['canusesig'] != 1)
{
// Usergroup has no permission to use this facility

		error_no_permission();

		error_no_permission();

 
	}
else if($mybb->usergroup['canusesig'] == 1 && $mybb->usergroup['canusesigxposts'] > 0 && $mybb->user['postnum'] < $mybb->usergroup['canusesigxposts'])
{
// Usergroup can use this facility, but only after x posts
error($lang->sprintf($lang->sig_suspended_posts, $mybb->usergroup['canusesigxposts']));

	}

if($sig && $template)

	}

if($sig && $template)

Zeile 1664Zeile 1695
			"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],
"me_username" => $mybb->user['username'],

			"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],
"me_username" => $mybb->user['username'],

 
			"filter_badwords" => 1

		);

$sigpreview = $parser->parse_message($sig, $sig_parser);

		);

$sigpreview = $parser->parse_message($sig, $sig_parser);

Zeile 2241Zeile 2273
		if($message)
{
$message_js = "var success = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(success, element); success.innerHTML = '{$message}'; success.className = 'success_message'; window.setTimeout(function() { Element.remove(success) }, 5000);";

		if($message)
{
$message_js = "var success = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(success, element); success.innerHTML = '{$message}'; success.className = 'success_message'; window.setTimeout(function() { Element.remove(success) }, 5000);";

		}

		}


if($error_message)
{


if($error_message)
{

Zeile 2839Zeile 2871
			$attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['threadlink'] = get_thread_link($attachment['tid']);
$attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));

			$attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']);
$attachment['threadlink'] = get_thread_link($attachment['tid']);
$attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));

 


			$size = get_friendly_size($attachment['filesize']);
$icon = get_attachment_icon(get_extension($attachment['filename']));

			$size = get_friendly_size($attachment['filesize']);
$icon = get_attachment_icon(get_extension($attachment['filename']));

 
			$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);


			$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']);
$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateline']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateline']);
$altbg = alt_trow();

			$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']);
$attachdate = my_date($mybb->settings['dateformat'], $attachment['dateline']);
$attachtime = my_date($mybb->settings['timeformat'], $attachment['dateline']);
$altbg = alt_trow();

 


			eval("\$attachments .= \"".$templates->get("usercp_attachments_attachment")."\";");

			eval("\$attachments .= \"".$templates->get("usercp_attachments_attachment")."\";");

 


			// Add to bandwidth total
$bandwidth += ($attachment['filesize'] * $attachment['downloads']);
$totaldownloads += $attachment['downloads'];

			// Add to bandwidth total
$bandwidth += ($attachment['filesize'] * $attachment['downloads']);
$totaldownloads += $attachment['downloads'];

Zeile 3155Zeile 3192
				{
$folder = '';
$folder_label = '';

				{
$folder = '';
$folder_label = '';

 
					$gotounread = '';


if($thread['tid'])
{


if($thread['tid'])
{