Vergleich usercp.php - 1.6.8 - 1.6.10

  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 5789 2012-04-19 13:50:38Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'usercp.php');


 */

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'usercp.php');


$templatelist = "usercp,usercp_home,usercp_nav,usercp_profile,error_nopermission,buddy_online,buddy_offline,usercp_changename,usercp_nav_changename";

$templatelist = "usercp,usercp_nav,usercp_profile,usercp_changename,usercp_email,usercp_password,usercp_subscriptions_thread,forumbit_depth2_forum_lastpost,usercp_forumsubscriptions_forum";

$templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups";
$templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_usergroups_leader_usergroup,usercp_usergroups_leader,usercp_currentavatar,usercp_reputation";

$templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups";
$templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_usergroups_leader_usergroup,usercp_usergroups_leader,usercp_currentavatar,usercp_reputation";

$templatelist .= ",usercp_attachments_attachment,usercp_attachments,usercp_profile_away,usercp_profile_customfield,usercp_profile_profilefields,usercp_profile_customtitle,usercp_forumsubscriptions_none,usercp_forumsubscriptions,usercp_subscriptions_none,usercp_subscriptions,usercp_options_pms_from_buddys,usercp_options_tppselect,usercp_options_pppselect,usercp_options";


$templatelist .= ",usercp_attachments_attachment,usercp_attachments,usercp_profile_away,usercp_profile_customfield,usercp_profile_profilefields,usercp_profile_customtitle,usercp_forumsubscriptions_none";
$templatelist .= ",usercp_forumsubscriptions,usercp_subscriptions_none,usercp_subscriptions,usercp_options_pms_from_buddys,usercp_options_tppselect,usercp_options_pppselect,usercp_options";

$templatelist .= ",usercp_nav_editsignature,usercp_referrals,usercp_notepad,usercp_latest_threads_threads,forumdisplay_thread_gotounread,usercp_latest_threads,usercp_subscriptions_remove";

$templatelist .= ",usercp_nav_editsignature,usercp_referrals,usercp_notepad,usercp_latest_threads_threads,forumdisplay_thread_gotounread,usercp_latest_threads,usercp_subscriptions_remove";

 
$templatelist .= ",usercp_editsig_suspended,usercp_editsig,usercp_avatar_gallery_avatar,usercp_avatar_gallery_blankblock,usercp_avatar_gallery_noavatars,usercp_avatar_gallery,usercp_avatar_current";
$templatelist .= ",usercp_avatar,usercp_editlists_userusercp_editlists,usercp_drafts_draft,usercp_drafts_none,usercp_drafts_submit,usercp_drafts,usercp_usergroups_joingroup,usercp_attachments_none";
$templatelist .= ",usercp_warnings_warning,usercp_warnings,usercp_latest_subscribed_threads,usercp_latest_subscribed,usercp_nav_messenger_tracking,multipage_prevpage,multipage_start,multipage_end";
$templatelist .= ",multipage_nextpage,multipage,multipage_page_current,codebuttons,smilieinsert_getmore,smilieinsert";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 39Zeile 44
}

$errors = '';

}

$errors = '';

 

if(!isset($mybb->input['action']))
{
$mybb->input['action'] = '';
}

$collapse_options = array('usercppms', 'usercpprofile', 'usercpmisc');
foreach($collapse_options as $option)
{
if(!isset($collapsedimg[$option]))
{
$collapsedimg[$option] = '';
}
if(!isset($collapsed[$option.'_e']))
{
$collapsed[$option.'_e'] = '';
}
}


usercp_menu();



usercp_menu();


Zeile 67Zeile 90
		else
{
$imgsallowed = 0;

		else
{
$imgsallowed = 0;

		}

		}

		$lang->too_many_sig_images2 = $lang->sprintf($lang->too_many_sig_images2, $imgsallowed);
$error = inline_error($lang->too_many_sig_images." ".$lang->too_many_sig_images2);
$mybb->input['preview'] = 1;

		$lang->too_many_sig_images2 = $lang->sprintf($lang->too_many_sig_images2, $imgsallowed);
$error = inline_error($lang->too_many_sig_images." ".$lang->too_many_sig_images2);
$mybb->input['preview'] = 1;

Zeile 88Zeile 111
		{
$lang->sig_too_long = $lang->sprintf($lang->sig_too_long, $mybb->settings['siglength']);
if($sig_length - $mybb->settings['siglength'] > 1)

		{
$lang->sig_too_long = $lang->sprintf($lang->sig_too_long, $mybb->settings['siglength']);
if($sig_length - $mybb->settings['siglength'] > 1)

			{

			{

				$lang->sig_too_long .= $lang->sprintf($lang->sig_remove_chars_plural, $sig_length-$mybb->settings['siglength']);
}
else
{
$lang->sig_too_long .= $lang->sig_remove_chars_singular;

				$lang->sig_too_long .= $lang->sprintf($lang->sig_remove_chars_plural, $sig_length-$mybb->settings['siglength']);
}
else
{
$lang->sig_too_long .= $lang->sig_remove_chars_singular;

			}

			}

			$error = inline_error($lang->sig_too_long);
}
}

			$error = inline_error($lang->sig_too_long);
}
}

Zeile 176Zeile 199
		{
// 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'])

		{
// 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['awayyear'])

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

Zeile 258Zeile 281
	if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

	if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

 
		
// Set allowed value otherwise select options disappear
if(in_array($lang->userdata_invalid_birthday_privacy, $errors))
{
$mybb->input['birthdayprivacy'] = 'none';
}


		$errors = inline_error($errors);
$mybb->input['action'] = "profile";
}

		$errors = inline_error($errors);
$mybb->input['action'] = "profile";
}

Zeile 575Zeile 605
	{
if($mybb->usergroup['usertitle'] == "")
{

	{
if($mybb->usergroup['usertitle'] == "")
{

			$query = $db->simple_select("usertitles", "*", "posts <='".$mybb->user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$utitle = $db->fetch_array($query);
$defaulttitle = $utitle['title'];









			$defaulttitle = '';
$usertitles = $cache->read('usertitles');

foreach($usertitles as $title)
{
if($title['posts'] <= $mybb->user['postnum'])
{
$defaulttitle = $title['title'];
break;
}
}

		}
else
{

		}
else
{

Zeile 693Zeile 731
	$languages = $lang->get_languages();
$langoptions = '';
foreach($languages as $lname => $language)

	$languages = $lang->get_languages();
$langoptions = '';
foreach($languages as $lname => $language)

	{

	{

		$sel = "";
if($user['language'] == $lname)
{

		$sel = "";
if($user['language'] == $lname)
{

Zeile 706Zeile 744
	if($user['allownotices'] == 1)
{
$allownoticescheck = "checked=\"checked\"";

	if($user['allownotices'] == 1)
{
$allownoticescheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$allownoticescheck = "";
}

if($user['invisible'] == 1)
{
$invisiblecheck = "checked=\"checked\"";

		$allownoticescheck = "";
}

if($user['invisible'] == 1)
{
$invisiblecheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$invisiblecheck = "";
}

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

		$invisiblecheck = "";
}

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

	{

	{

		$hideemailcheck = "checked=\"checked\"";
}
else

		$hideemailcheck = "checked=\"checked\"";
}
else

Zeile 731Zeile 769
	}

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

	}

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

	{

	{

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

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

	{

	{

		$instant_email_subscribe_selected = "selected=\"selected\"";

		$instant_email_subscribe_selected = "selected=\"selected\"";

	}
else

{

	}
else

{

		$no_subscribe_selected = "selected=\"selected\"";
}

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

		$no_subscribe_selected = "selected=\"selected\"";
}

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

	{

	{

		$showsigscheck = "checked=\"checked\"";

		$showsigscheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$showsigscheck = "";
}

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

		$showsigscheck = "";
}

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

	{

	{

		$showavatarscheck = "checked=\"checked\"";
}
else

		$showavatarscheck = "checked=\"checked\"";
}
else

Zeile 769Zeile 807
	else
{
$showquickreplycheck = "";

	else
{
$showquickreplycheck = "";

	}


	}


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

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

Zeile 847Zeile 885
	if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";

	if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";

	}

	}

	else
{
$classicpostbitcheck = '';

	else
{
$classicpostbitcheck = '';

	}


	}



$date_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($date_formats as $key => $format)


$date_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($date_formats as $key => $format)

Zeile 861Zeile 899
		{
$date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";
}

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

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


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


	$time_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($time_formats as $key => $format)
{
if($user['timeformat'] == $key)

	$time_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($time_formats as $key => $format)
{
if($user['timeformat'] == $key)

		{

		{

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

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

Zeile 885Zeile 923
	if($mybb->settings['allowbuddyonly'] == 1)
{
eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";");

	if($mybb->settings['allowbuddyonly'] == 1)
{
eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";");

	}

	}


$threadview[$user['threadmode']] = 'selected="selected"';
$daysprunesel[$user['daysprune']] = 'selected="selected"';


$threadview[$user['threadmode']] = 'selected="selected"';
$daysprunesel[$user['daysprune']] = 'selected="selected"';

Zeile 897Zeile 935
		if(is_array($explodedtpp))
{
foreach($explodedtpp as $key => $val)

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

			{
$val = trim($val);

			{
$val = trim($val);

				$selected = "";
if($user['tpp'] == $val)
{

				$selected = "";
if($user['tpp'] == $val)
{

Zeile 936Zeile 974
}

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

}

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

{
// Verify incoming POST request

{
// Verify incoming POST request

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

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





	$errors = array();

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

	$errors = array();

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

	{

	{

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

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

Zeile 990Zeile 1028

$plugins->run_hooks("usercp_do_email_verify");
error($lang->redirect_changeemail_activation);


$plugins->run_hooks("usercp_do_email_verify");
error($lang->redirect_changeemail_activation);

			}

			}

			else
{
$userhandler->update_user();

			else
{
$userhandler->update_user();

Zeile 1000Zeile 1038
		}
}
if(count($errors) > 0)

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

	{

	{

			$mybb->input['action'] = "email";
$errors = inline_error($errors);
}

			$mybb->input['action'] = "email";
$errors = inline_error($errors);
}

Zeile 1017Zeile 1055
	else
{
$email = $email2 = '';

	else
{
$email = $email2 = '';

	}

	}


$plugins->run_hooks("usercp_email");



$plugins->run_hooks("usercp_email");


Zeile 1034Zeile 1072

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


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

	{
$errors[] = $lang->error_invalidpassword;
}
else
{
// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


	{
$errors[] = $lang->error_invalidpassword;
}
else
{
// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


		$user = array(
"uid" => $mybb->user['uid'],
"password" => $mybb->input['password'],

		$user = array(
"uid" => $mybb->user['uid'],
"password" => $mybb->input['password'],

Zeile 1200Zeile 1238
		WHERE ts.uid = '".$mybb->user['uid']."' {$visible}
");
$threadcount = $db->fetch_field($query, "threads");

		WHERE ts.uid = '".$mybb->user['uid']."' {$visible}
");
$threadcount = $db->fetch_field($query, "threads");





	if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;

	if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;

Zeile 1213Zeile 1251
		$start = ($page-1) *$perpage;
}
else

		$start = ($page-1) *$perpage;
}
else

	{

	{

		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

Zeile 1226Zeile 1264
	}
$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");
$fpermissions = forum_permissions();

	}
$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");
$fpermissions = forum_permissions();





	// Fetch subscriptions
$query = $db->query("
SELECT s.*, t.*, t.username AS threadusername, u.username, p.displaystyle AS threadprefix

	// Fetch subscriptions
$query = $db->query("
SELECT s.*, t.*, t.username AS threadusername, u.username, p.displaystyle AS threadprefix

Zeile 1239Zeile 1277
		LIMIT $start, $perpage
");
while($subscription = $db->fetch_array($query))

		LIMIT $start, $perpage
");
while($subscription = $db->fetch_array($query))

	{

	{

		$forumpermissions = $fpermissions[$subscription['fid']];


		$forumpermissions = $fpermissions[$subscription['fid']];


		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)

		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || ($forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))

		{
// Hmm, you don't have permission to view this thread - unsubscribe!

		{
// Hmm, you don't have permission to view this thread - unsubscribe!

			$del_subscriptions[] = $subscription['tid'];

			$del_subscriptions[] = $subscription['sid'];

		}
else if($subscription['tid'])
{

		}
else if($subscription['tid'])
{

Zeile 1254Zeile 1292
	}

if(is_array($del_subscriptions))

	}

if(is_array($del_subscriptions))

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

if($tids)

	{
$sids = implode(',', $del_subscriptions);

if($sids)

		{

		{

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

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

		}

		}





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

if($threadcount < 0)

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

if($threadcount < 0)

		{

		{

			$threadcount = 0;
}
}

			$threadcount = 0;
}
}

Zeile 1296Zeile 1334
				WHERE f.active != 0
ORDER BY pid, disporder
");

				WHERE f.active != 0
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 1311Zeile 1349
		}

// Check participation by the current user in any of these threads - for 'dot' folder icons

		}

// Check participation by the current user in any of these threads - for 'dot' folder icons

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

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

		{
$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

		{
$query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
while($post = $db->fetch_array($query))
{
$subscriptions[$post['tid']]['doticon'] = 1;

			}

			}

		}

// Read threads

		}

// Read threads

Zeile 1336Zeile 1374
		foreach($subscriptions as $thread)
{
$bgcolor = alt_trow();

		foreach($subscriptions as $thread)
{
$bgcolor = alt_trow();





			$folder = '';
$prefix = '';


			$folder = '';
$prefix = '';


Zeile 1349Zeile 1387
			// 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");

// Fetch the thread icon if we have one
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

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

// Fetch the thread icon if we have one
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])

			{

			{

				$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

				$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

			}

			}

			else
{
$icon = "&nbsp;";

			else
{
$icon = "&nbsp;";

			}


			}


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

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

Zeile 1469Zeile 1507
			if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

			if($lastposteruid == 0)
{
$lastposterlink = $lastposter;

			}

			}

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

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

Zeile 1493Zeile 1531

// Provide remove options
eval("\$remove_options = \"".$templates->get("usercp_subscriptions_remove")."\";");


// Provide remove options
eval("\$remove_options = \"".$templates->get("usercp_subscriptions_remove")."\";");

	}
else

	}
else

	{
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
}

$plugins->run_hooks("usercp_subscriptions_end");

	{
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
}

$plugins->run_hooks("usercp_subscriptions_end");

	

	

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

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

Zeile 1520Zeile 1558
		");

$forumsread = my_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 1536Zeile 1574
	while($forum = $db->fetch_array($query))
{
if($mybb->user['uid'] == 0)

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

		{

		{

			if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];

			if($forumsread[$forum['fid']])
{
$forum['lastread'] = $forumsread[$forum['fid']];

Zeile 1564Zeile 1602
		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];


		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];


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

		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)

		{
continue;
}

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

		{
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>";
}

















		
if($forumpermissions['canonlyviewownthreads'] != 0)
{
$posts = '-';
$threads = '-';
}
else
{
$posts = my_number_format($forum['posts']);
$threads = my_number_format($forum['threads']);
}

if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<div align=\"center\">{$lang->never}</div>";
}
// Hide last post
elseif($forumpermissions['canonlyviewownthreads'] != 0 && $forum['lastposteruid'] != $mybb->user['uid'])
{
$lastpost = "<div align=\"center\">{$lang->na}</div>";
}

		else
{
$forum['lastpostsubject'] = $parser->parse_badwords($forum['lastpostsubject']);

		else
{
$forum['lastpostsubject'] = $parser->parse_badwords($forum['lastpostsubject']);

Zeile 1592Zeile 1646
			$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']);

 

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


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

Zeile 1734Zeile 1785
		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 2163Zeile 2214
				
$existing_users[] = $user['uid'];
}

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

 
		}

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

$error_message .= $lang->invalid_user_selected;

		}

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

Zeile 2174Zeile 2235
			else
{
$message = $lang->users_added_to_buddy_list;

			else
{
$message = $lang->users_added_to_buddy_list;

			}

			}

		}

if($adding_self == true)

		}

if($adding_self == true)

		{

		{

			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;

Zeile 2192Zeile 2253
		if(count($existing_users) == 0)
{
$message = "";

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

		}

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

$error_message .= $lang->invalid_user_selected;

 
		}
}


		}
}


Zeile 2369Zeile 2420
			}
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)
{

Zeile 2425Zeile 2476
		}
elseif($draft['threadvisible'] == -2) // We're looking at a draft thread
{

		}
elseif($draft['threadvisible'] == -2) // We're looking at a draft thread
{

			$detail = $lang->forum." <a href=\"".get_forum_link($draft['fid'])."\">".htmlspecialchars_uni($draft['forumname'])."</a>";

			$detail = $lang->forum." <a href=\"".get_forum_link($draft['fid'])."\">{$draft['forumname']}</a>";

			$editurl = "newthread.php?action=editdraft&amp;tid={$draft['tid']}";
$id = $draft['tid'];
$type = "thread";

			$editurl = "newthread.php?action=editdraft&amp;tid={$draft['tid']}";
$id = $draft['tid'];
$type = "thread";

Zeile 2526Zeile 2577
		$cache->update_moderators();
$plugins->run_hooks("usercp_usergroups_change_displaygroup");
redirect("usercp.php?action=usergroups", $lang->display_group_changed);

		$cache->update_moderators();
$plugins->run_hooks("usercp_usergroups_change_displaygroup");
redirect("usercp.php?action=usergroups", $lang->display_group_changed);

		exit;
}


		exit;
}


	// Leaving a group
if($mybb->input['leavegroup'])
{

	// Leaving a group
if($mybb->input['leavegroup'])
{

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

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

		}
if($mybb->user['usergroup'] == $mybb->input['leavegroup'])
{
error($lang->cannot_leave_primary_group);

		}
if($mybb->user['usergroup'] == $mybb->input['leavegroup'])
{
error($lang->cannot_leave_primary_group);

		}
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['leavegroup'])."'");
$usergroup = $db->fetch_array($query);
if($usergroup['type'] != 4 && $usergroup['type'] != 3)
{
error($lang->cannot_leave_group);

		}
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['leavegroup'])."'");
$usergroup = $db->fetch_array($query);
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);
exit;
}

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





	// Joining a group
if($mybb->input['joingroup'])
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

	// Joining a group
if($mybb->input['joingroup'])
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);





		$mybb->input['joingroup'] = intval($mybb->input['joingroup']);
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['joingroup'])."'");
$usergroup = $db->fetch_array($query);

		$mybb->input['joingroup'] = intval($mybb->input['joingroup']);
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['joingroup'])."'");
$usergroup = $db->fetch_array($query);

Zeile 2573Zeile 2624
		if(my_strpos($ingroups, ",".intval($mybb->input['joingroup']).",") !== false)
{
error($lang->already_member_of_group);

		if(my_strpos($ingroups, ",".intval($mybb->input['joingroup']).",") !== false)
{
error($lang->already_member_of_group);

		}

		}


$query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."' AND gid='".intval($mybb->input['joingroup'])."'");
$joinrequest = $db->fetch_array($query);
if($joinrequest['rid'])
{
error($lang->already_sent_join_request);


$query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."' AND gid='".intval($mybb->input['joingroup'])."'");
$joinrequest = $db->fetch_array($query);
if($joinrequest['rid'])
{
error($lang->already_sent_join_request);

		}

		}

		if($mybb->input['do'] == "joingroup" && $usergroup['type'] == 4)
{
$reason = $db->escape_string($reason);

		if($mybb->input['do'] == "joingroup" && $usergroup['type'] == 4)
{
$reason = $db->escape_string($reason);

Zeile 3006Zeile 3057
		{
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
}

		{
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
}

		$mybb->user['avatar'] = htmlspecialchars($mybb->user['avatar']);

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

		eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";");
$colspan = 2;
}

		eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";");
$colspan = 2;
}

Zeile 3028Zeile 3079
		eval("\$reputation = \"".$templates->get("usercp_reputation")."\";");
}


		eval("\$reputation = \"".$templates->get("usercp_reputation")."\";");
}


 
	$latest_warnings = '';

	if($mybb->settings['enablewarningsystem'] != 0 && $mybb->settings['canviewownwarning'] != 0)
{
$warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100);

	if($mybb->settings['enablewarningsystem'] != 0 && $mybb->settings['canviewownwarning'] != 0)
{
$warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100);

Zeile 3132Zeile 3184
	$plugins->run_hooks("usercp_notepad_end");

// Thread Subscriptions with New Posts

	$plugins->run_hooks("usercp_notepad_end");

// Thread Subscriptions with New Posts

 
	$latest_subscribed = '';

	$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1));
if($db->num_rows($query))
{

	$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1));
if($db->num_rows($query))
{

Zeile 3155Zeile 3208
		while($subscription = $db->fetch_array($query))
{
$forumpermissions = $fpermissions[$subscription['fid']];

		while($subscription = $db->fetch_array($query))
{
$forumpermissions = $fpermissions[$subscription['fid']];

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

			if($forumpermissions['canview'] != 0 && $forumpermissions['canviewthreads'] != 0 && ($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid']))

			{
$subscriptions[$subscription['tid']] = $subscription;
}

			{
$subscriptions[$subscription['tid']] = $subscription;
}

Zeile 3290Zeile 3343
	// User's Latest Threads

// Get unviewable forums

	// User's Latest Threads

// Get unviewable forums

 
	$f_perm_sql = '';

	$unviewable_forums = get_unviewable_forums();
if($unviewable_forums)
{

	$unviewable_forums = get_unviewable_forums();
if($unviewable_forums)
{

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

// Run the threads...

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

// Run the threads...

 
		$latest_threads_threads = '';

		foreach($threadcache as $thread)
{
if($thread['tid'])

		foreach($threadcache as $thread)
{
if($thread['tid'])

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

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

	



$cutoff = 0;

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

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