Vergleich inc/functions_user.php - 1.8.26 - 1.8.34

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 88Zeile 88
	if(!$user['password'])
{
$user = get_user($uid);

	if(!$user['password'])
{
$user = get_user($uid);

	}
if(!$user['salt'])
{
// Generate a salt for this user and assume the password stored in db is a plain md5 password
$password_fields = create_password($user['password'], false, $user);
$db->update_query("users", $password_fields, "uid='".$user['uid']."'");

 
	}

if(!$user['loginkey'])

	}

if(!$user['loginkey'])

Zeile 333Zeile 327

$query = $db->simple_select("threadsubscriptions", "*", "tid='".(int)$tid."' AND uid='".(int)$uid."'");
$subscription = $db->fetch_array($query);


$query = $db->simple_select("threadsubscriptions", "*", "tid='".(int)$tid."' AND uid='".(int)$uid."'");
$subscription = $db->fetch_array($query);

	if(!$subscription['tid'])

	if(empty($subscription) || !$subscription['tid'])

	{
$insert_array = array(
'uid' => (int)$uid,
'tid' => (int)$tid,
'notification' => (int)$notification,
'dateline' => TIME_NOW

	{
$insert_array = array(
'uid' => (int)$uid,
'tid' => (int)$tid,
'notification' => (int)$notification,
'dateline' => TIME_NOW

		);
$db->insert_query("threadsubscriptions", $insert_array);
}
else
{

		);
$db->insert_query("threadsubscriptions", $insert_array);
}
else
{

		// Subscription exists - simply update notification
$update_array = array(
"notification" => (int)$notification

		// Subscription exists - simply update notification
$update_array = array(
"notification" => (int)$notification

Zeile 363Zeile 357
 * @return boolean True when success, false when otherwise.
*/
function remove_subscribed_thread($tid, $uid=0)

 * @return boolean True when success, false when otherwise.
*/
function remove_subscribed_thread($tid, $uid=0)

{
global $mybb, $db;

if(!$uid)
{

{
global $mybb, $db;

if(!$uid)
{

		$uid = $mybb->user['uid'];
}


		$uid = $mybb->user['uid'];
}


Zeile 376Zeile 370
		return false;
}
$db->delete_query("threadsubscriptions", "tid='".$tid."' AND uid='{$uid}'");

		return false;
}
$db->delete_query("threadsubscriptions", "tid='".$tid."' AND uid='{$uid}'");





	return true;
}


	return true;
}


Zeile 385Zeile 379
 * If no uid is supplied, the currently logged in user's id will be used.
*
* @param int $fid The fid of the forum to add to the list.

 * If no uid is supplied, the currently logged in user's id will be used.
*
* @param int $fid The fid of the forum to add to the list.

 * @param int $uid (Optional) The uid of the user who's list to update.
* @return boolean True when success, false when otherwise.

 * @param int $uid (Optional) The uid of the user who's list to update.
* @return boolean True when success, false when otherwise.

 */
function add_subscribed_forum($fid, $uid=0)
{
global $mybb, $db;

 */
function add_subscribed_forum($fid, $uid=0)
{
global $mybb, $db;





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

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

	}


	}


	if(!$uid)
{
return false;

	if(!$uid)
{
return false;

Zeile 407Zeile 401

$query = $db->simple_select("forumsubscriptions", "*", "fid='".$fid."' AND uid='{$uid}'", array('limit' => 1));
$fsubscription = $db->fetch_array($query);


$query = $db->simple_select("forumsubscriptions", "*", "fid='".$fid."' AND uid='{$uid}'", array('limit' => 1));
$fsubscription = $db->fetch_array($query);

	if(!$fsubscription['fid'])

	if(empty($fsubscription) || !$fsubscription['fid'])

	{
$insert_array = array(
'fid' => $fid,

	{
$insert_array = array(
'fid' => $fid,

Zeile 428Zeile 422
 * @return boolean True when success, false when otherwise.
*/
function remove_subscribed_forum($fid, $uid=0)

 * @return boolean True when success, false when otherwise.
*/
function remove_subscribed_forum($fid, $uid=0)

{

{

	global $mybb, $db;

if(!$uid)

	global $mybb, $db;

if(!$uid)

Zeile 489Zeile 483
{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


	$expaltext = (in_array("usercppms", $collapse)) ? "[+]" : "[-]";

	$expaltext = (in_array("usercppms", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

	$usercp_nav_messenger = $templates->get("usercp_nav_messenger");
// Hide tracking link if no permission
$tracking = '';

	$usercp_nav_messenger = $templates->get("usercp_nav_messenger");
// Hide tracking link if no permission
$tracking = '';

Zeile 577Zeile 571
		$collapsed['usercpprofile_e'] = '';
}


		$collapsed['usercpprofile_e'] = '';
}


	$expaltext = (in_array("usercpprofile", $collapse)) ? "[+]" : "[-]";

	$expaltext = (in_array("usercpprofile", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_profile")."\";");
}


	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_profile")."\";");
}


Zeile 596Zeile 590
	$count = $db->fetch_field($query, 'draftcount');

if($count > 0)

	$count = $db->fetch_field($query, 'draftcount');

if($count > 0)

	{

	{

		$draftcount = $lang->sprintf($lang->ucp_nav_drafts_active, my_number_format($count));

		$draftcount = $lang->sprintf($lang->ucp_nav_drafts_active, my_number_format($count));

	}


	}


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

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

	{

	{

		eval("\$attachmentop = \"".$templates->get("usercp_nav_attachments")."\";");
}

if(!isset($collapsedimg['usercpmisc']))

		eval("\$attachmentop = \"".$templates->get("usercp_nav_attachments")."\";");
}

if(!isset($collapsedimg['usercpmisc']))

	{

	{

		$collapsedimg['usercpmisc'] = '';
}


		$collapsedimg['usercpmisc'] = '';
}


Zeile 616Zeile 610
	}

$profile_link = get_profile_link($mybb->user['uid']);

	}

$profile_link = get_profile_link($mybb->user['uid']);

	$expaltext = (in_array("usercpmisc", $collapse)) ? "[+]" : "[-]";

	$expaltext = (in_array("usercpmisc", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_misc")."\";");
}


	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_misc")."\";");
}


Zeile 627Zeile 621
 * @return string The usertitle of the user.
*/
function get_usertitle($uid=0)

 * @return string The usertitle of the user.
*/
function get_usertitle($uid=0)

{
global $db, $mybb;

{
global $db, $mybb;


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


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

	{

	{

		$user = $mybb->user;
}
else
{
$query = $db->simple_select("users", "usertitle,postnum", "uid='$uid'", array('limit' => 1));
$user = $db->fetch_array($query);

		$user = $mybb->user;
}
else
{
$query = $db->simple_select("users", "usertitle,postnum", "uid='$uid'", array('limit' => 1));
$user = $db->fetch_array($query);

	}

	}


if($user['usertitle'])
{


if($user['usertitle'])
{

Zeile 659Zeile 653
		return $usertitle['title'];
}
}

		return $usertitle['title'];
}
}





/**
* Updates a users private message count in the users table with the number of pms they have.
*

/**
* Updates a users private message count in the users table with the number of pms they have.
*

Zeile 680Zeile 674
	$uid = (int)$uid;
$pmcount = array();
if($uid == 0)

	$uid = (int)$uid;
$pmcount = array();
if($uid == 0)

	{

	{

		return $pmcount;

		return $pmcount;

	}

	}


// Update total number of messages.
if($count_to_update & 1)


// Update total number of messages.
if($count_to_update & 1)

Zeile 690Zeile 684
		$query = $db->simple_select("privatemessages", "COUNT(pmid) AS pms_total", "uid='".$uid."'");
$total = $db->fetch_array($query);
$pmcount['totalpms'] = $total['pms_total'];

		$query = $db->simple_select("privatemessages", "COUNT(pmid) AS pms_total", "uid='".$uid."'");
$total = $db->fetch_array($query);
$pmcount['totalpms'] = $total['pms_total'];

	}

	}


// Update number of unread messages.
if($count_to_update & 2 && $db->field_exists("unreadpms", "users") == true)


// Update number of unread messages.
if($count_to_update & 2 && $db->field_exists("unreadpms", "users") == true)

Zeile 721Zeile 715
	if($name != '')
{
return $name;

	if($name != '')
{
return $name;

	}

	}


switch($fid)
{


switch($fid)
{

Zeile 742Zeile 736
			break;
default:
return $lang->folder_untitled;

			break;
default:
return $lang->folder_untitled;

	}

	}

}

/**

}

/**

Zeile 763Zeile 757
	{
$order_by = 'RAND()';
}

	{
$order_by = 'RAND()';
}

	



$excl_old = '';

	if($old_qid)
{
$excl_old = ' AND qid != '.(int)$old_qid;

	if($old_qid)
{
$excl_old = ' AND qid != '.(int)$old_qid;