Vergleich inc/functions_user.php - 1.8.24 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 62Zeile 62

$user = get_user_by_username($username, $options);



$user = get_user_by_username($username, $options);


	if(!$user['uid'])

	if(!$user)

	{
return false;
}

	{
return false;
}

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(!$subscription)

	{
$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(!$fsubscription)

	{
$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 589Zeile 583
{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


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


	$draftstart = $draftend = '';

	$draftstart = $draftend = $attachmentop = '';

	$draftcount = $lang->ucp_nav_drafts;

$query = $db->simple_select("posts", "COUNT(pid) AS draftcount", "visible = '-2' AND uid = '{$mybb->user['uid']}'");

	$draftcount = $lang->ucp_nav_drafts;

$query = $db->simple_select("posts", "COUNT(pid) AS draftcount", "visible = '-2' AND uid = '{$mybb->user['uid']}'");

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