Vergleich portal.php - 1.6.7 - 1.6.9

  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 5744 2012-01-23 16:37:22Z ralgith $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 47Zeile 47
$portal_url = get_current_location();

add_breadcrumb($lang->nav_portal, "portal.php");

$portal_url = get_current_location();

add_breadcrumb($lang->nav_portal, "portal.php");


// This allows users to login if the portal is stored offsite or in a different directory
if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")
{
$plugins->run_hooks("portal_do_login_start");

// Checks to make sure the user can login; they haven't had too many tries at logging in.
// Is a fatal call if user has had too many tries
$logins = login_attempt_check();
$login_text = '';

if(!username_exists($mybb->input['username']))
{
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'])
{
my_setcookie('loginattempts', $logins + 1);
$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true);
if($mybb->settings['failedlogintext'] == 1)
{
$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(
"uid" => $user['uid'],
);
$db->update_query("sessions", $newsession, "sid='".$session->sid."'");

$db->update_query("users", array("loginattempts" => 1), "uid='{$mybb->user['uid']}'");

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']);
}

$plugins->run_hooks("portal_do_login_end");

redirect("portal.php", $lang->redirect_loggedin);
}

 

$plugins->run_hooks("portal_start");



$plugins->run_hooks("portal_start");


Zeile 144Zeile 82
				$announcementsfids = implode(',', $fid_array);
$query = $db->simple_select("threads", "COUNT(tid) AS newann", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$announcementsfids.") $unviewwhere");
$newann = $db->fetch_field($query, "newann");

				$announcementsfids = implode(',', $fid_array);
$query = $db->simple_select("threads", "COUNT(tid) AS newann", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$announcementsfids.") $unviewwhere");
$newann = $db->fetch_field($query, "newann");

			}

			}


if(!$newthreads)
{


if(!$newthreads)
{

Zeile 171Zeile 109
		else
{
$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);

		else
{
$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);

		}

		}

		if($newthreads == 1)

		if($newthreads == 1)

		{

		{

			$lang->new_threads = $lang->new_thread;

			$lang->new_threads = $lang->new_thread;

		}

		}

		else
{
$lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);

		else
{
$lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);

		}

		}

		if($newposts == 1)
{
$lang->new_posts = $lang->new_post;

		if($newposts == 1)
{
$lang->new_posts = $lang->new_post;

Zeile 440Zeile 378
	$announcementsfids = implode(',', $fid_array);
}
// And get them!

	$announcementsfids = implode(',', $fid_array);
}
// And get them!

$query = $db->simple_select("forums", "*", "fid IN (".$announcementsfids.")");
while($forumrow = $db->fetch_array($query))

foreach($forum_cache as $fid => $f)


{

{

    $forum[$forumrow['fid']] = $forumrow;




	if(is_array($fid_array) && in_array($fid, $fid_array))
{
$forum[$fid] = $f;
}

}

$numannouncements = intval($mybb->settings['portal_numannouncements']);

}

$numannouncements = intval($mybb->settings['portal_numannouncements']);

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

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

	}
else

	}
else

	{
$icon = "&nbsp;";
}

	{
$icon = "&nbsp;";
}

Zeile 668Zeile 608

eval("\$portal = \"".$templates->get("portal")."\";");
output_page($portal);


eval("\$portal = \"".$templates->get("portal")."\";");
output_page($portal);



 
?>

?>