Vergleich portal.php - 1.6.0 - 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: portal.php 5147 2010-07-30 23:18:16Z RyanGordon $

 * $Id: portal.php 5744 2012-01-23 16:37:22Z ralgith $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 60Zeile 60

if(!username_exists($mybb->input['username']))
{


if(!username_exists($mybb->input['username']))
{

		error($lang->error_invalidpworusername.$login_text);















		switch($mybb->settings['username_method'])
{
case 0:
error($lang->error_invalidpworusername.$login_text);
break;
case 1:
error($lang->error_invalidpworusername1.$login_text);
break;
case 2:
error($lang->error_invalidpworusername2.$login_text);
break;
default:
error($lang->error_invalidpworusername.$login_text);
break;
}

	}
$user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$user['uid'])

	}
$user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$user['uid'])

Zeile 72Zeile 86
			$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}
error($lang->error_invalidpassword.$login_text);

			$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}
error($lang->error_invalidpassword.$login_text);

	}


	}


	my_setcookie('loginattempts', 1);
$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
$newsession = array(

	my_setcookie('loginattempts', 1);
$db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
$newsession = array(

Zeile 85Zeile 99

my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], ($mybb->input['remember'] == "yes" ? null : 0), true);
my_setcookie("sid", $session->sid, -1, true);


my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], ($mybb->input['remember'] == "yes" ? null : 0), true);
my_setcookie("sid", $session->sid, -1, true);





	if(function_exists("loggedIn"))
{
loggedIn($user['uid']);

	if(function_exists("loggedIn"))
{
loggedIn($user['uid']);

Zeile 98Zeile 112

$plugins->run_hooks("portal_start");



$plugins->run_hooks("portal_start");






// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)

// get forums user cannot view
$unviewable = get_unviewable_forums(true);
if($unviewable)

Zeile 109Zeile 123
if($mybb->settings['portal_showwelcome'] != 0)
{
if($mybb->user['uid'] != 0)

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

	{

	{

		// Get number of new posts, threads, announcements
$query = $db->simple_select("posts", "COUNT(pid) AS newposts", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newposts = $db->fetch_field($query, "newposts");

		// Get number of new posts, threads, announcements
$query = $db->simple_select("posts", "COUNT(pid) AS newposts", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
$newposts = $db->fetch_field($query, "newposts");

Zeile 181Zeile 195
	{
$lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
$mybb->user['username'] = $lang->guest;

	{
$lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
$mybb->user['username'] = $lang->guest;

 
		switch($mybb->settings['username_method'])
{
case 0:
$username = $lang->username;
break;
case 1:
$username = $lang->username1;
break;
case 2:
$username = $lang->username2;
break;
default:
$username = $lang->username;
break;
}

		eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";");
}
$lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);

		eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";");
}
$lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);

Zeile 363Zeile 392
	);
while($thread = $db->fetch_array($query))
{

	);
while($thread = $db->fetch_array($query))
{

 
		$forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);

// Make sure we can view this thread
if($forumpermissions[$thread['fid']]['canview'] == 0 || $forumpermissions[$thread['fid']]['canviewthreads'] == 0 || $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
{
continue;
}


		$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
// Don't link to guest's profiles (they have no profile).

		$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
// Don't link to guest's profiles (they have no profile).

Zeile 380Zeile 417
		}
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$thread['threadlink'] = get_thread_link($thread['tid']);

		}
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$thread['threadlink'] = get_thread_link($thread['tid']);

 
		$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

		eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
$altbg = alt_trow();
}

		eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";");
$altbg = alt_trow();
}

Zeile 406Zeile 444
while($forumrow = $db->fetch_array($query))
{
$forum[$forumrow['fid']] = $forumrow;

while($forumrow = $db->fetch_array($query))
{
$forum[$forumrow['fid']] = $forumrow;

 
}

$numannouncements = intval($mybb->settings['portal_numannouncements']);
if(!$numannouncements)
{
$numannouncements = 10; // Default back to 10

}

$pids = '';

}

$pids = '';

Zeile 417Zeile 461
	LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
ORDER BY t.dateline DESC

	LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid
ORDER BY t.dateline DESC

	LIMIT 0, ".$mybb->settings['portal_numannouncements']

	LIMIT 0, {$numannouncements}"

);
while($getid = $db->fetch_array($query))
{

);
while($getid = $db->fetch_array($query))
{

Zeile 436Zeile 480
if(is_array($forum))
{
foreach($forum as $fid => $forumrow)

if(is_array($forum))
{
foreach($forum as $fid => $forumrow)

	{

	{

		$forumpermissions[$fid] = forum_permissions($fid);
}
}

		$forumpermissions[$fid] = forum_permissions($fid);
}
}

Zeile 450Zeile 494
	LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE t.fid IN (".$announcementsfids.") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.dateline DESC

	LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE t.fid IN (".$announcementsfids.") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.dateline DESC

	LIMIT 0, ".$mybb->settings['portal_numannouncements']

	LIMIT 0, {$numannouncements}"

);
while($announcement = $db->fetch_array($query))
{

);
while($announcement = $db->fetch_array($query))
{

 
	// Make sure we can view this announcement
if($forumpermissions[$announcement['fid']]['canview'] == 0 || $forumpermissions[$announcement['fid']]['canviewthreads'] == 0 || $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid'])
{
continue;
}


	$announcement['message'] = $posts[$announcement['tid']]['message'];
$announcement['pid'] = $posts[$announcement['tid']]['pid'];
$announcement['smilieoff'] = $posts[$announcement['tid']]['smilieoff'];

	$announcement['message'] = $posts[$announcement['tid']]['message'];
$announcement['pid'] = $posts[$announcement['tid']]['pid'];
$announcement['smilieoff'] = $posts[$announcement['tid']]['smilieoff'];