Vergleich portal.php - 1.2.3 - 1.2.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html

 *

 *

 * $Id: portal.php 2741 2007-02-08 23:11:12Z CraKteR $

 * $Id: portal.php 3595 2008-01-09 00:10:57Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);



define("IN_PORTAL", 1);


// set the path to your forums directory here (without trailing slash)
$forumdir = "./";


// set the path to your forums directory here (without trailing slash)
$forumdir = "./";

Zeile 33Zeile 33

$templatelist = "portal_welcome,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread_lastpost,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_announcement_numcomments,portal";



$templatelist = "portal_welcome,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread_lastpost,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_announcement_numcomments,portal";


require_once $change_dir."global.php";

require_once $change_dir."/global.php";

require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";

require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";

Zeile 48Zeile 48
$lang->load("portal");

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

$lang->load("portal");

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

// 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")
{

Zeile 60Zeile 60
	$login_text = '';

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

	$login_text = '';

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

	{
my_setcookie('loginattempts', $logins + 1);
$db->query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");
if($mybb->settings['failedlogintext'] == "yes")
{
$login_text = sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);

	{
my_setcookie('loginattempts', $logins + 1);
$db->query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");
if($mybb->settings['failedlogintext'] == "yes")
{
$login_text = sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);

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

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

	{

	{

		my_setcookie('loginattempts', $logins + 1);
$db->query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");
if($mybb->settings['failedlogintext'] == "yes")

		my_setcookie('loginattempts', $logins + 1);
$db->query("UPDATE ".TABLE_PREFIX."sessions SET loginattempts=loginattempts+1 WHERE sid = '{$session->sid}'");
if($mybb->settings['failedlogintext'] == "yes")

Zeile 91Zeile 91

// Temporarily set the cookie remember option for the login cookies
$mybb->user['remember'] = $user['remember'];


// Temporarily set the cookie remember option for the login cookies
$mybb->user['remember'] = $user['remember'];





	my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], null, true);
my_setcookie("sid", $session->sid, -1, true);

if(function_exists("loggedIn"))

	my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], null, true);
my_setcookie("sid", $session->sid, -1, true);

if(function_exists("loggedIn"))

	{

	{

		loggedIn($user['uid']);
}

$plugins->run_hooks("portal_do_login_end");

		loggedIn($user['uid']);
}

$plugins->run_hooks("portal_do_login_end");





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

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

}


}


$plugins->run_hooks("portal_start");


$plugins->run_hooks("portal_start");


 
// First validate announcement fids:
$mybb->settings['portal_announcementsfid'] = explode(',', $mybb->settings['portal_announcementsfid']);
if(is_array($mybb->settings['portal_announcementsfid']))
{
foreach($mybb->settings['portal_announcementsfid'] as $fid)
{
$fid_array[] = intval($fid);
}
$mybb->settings['portal_announcementsfid'] = implode(',', $fid_array);
}


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


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

Zeile 172Zeile 182
		if($newthreads == 1)
{
$lang->new_threads = $lang->new_thread;

		if($newthreads == 1)
{
$lang->new_threads = $lang->new_thread;

		}
else

		}
else

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

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

Zeile 205Zeile 215
if($mybb->settings['portal_showstats'] != "no")
{
$stats = $cache->read("stats");

if($mybb->settings['portal_showstats'] != "no")
{
$stats = $cache->read("stats");

	$threadsnum = $stats['numthreads'];
$postsnum = $stats['numposts'];
$membersnum = $stats['numusers'];

	$stats['numthreads'] = my_number_format($stats['numthreads']);
$stats['numposts'] = my_number_format($stats['numposts']);
$stats['numusers'] = my_number_format($stats['numusers']);

	if(!$stats['lastusername'])
{
$newestmember = "<b>" . $lang->no_one . "</b>";

	if(!$stats['lastusername'])
{
$newestmember = "<b>" . $lang->no_one . "</b>";

Zeile 317Zeile 327
	$recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']);
$recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);


	$recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']);
$recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);


	$lang->online_users = sprintf($lang->online_users, $onlinecount);








	if($onlinecount == 1)
{
$lang->online_users = $lang->online_user;
}
else
{
$lang->online_users = sprintf($lang->online_users, $onlinecount);
}

	$lang->online_counts = sprintf($lang->online_counts, $membercount, $guestcount);
eval("\$whosonline = \"".$templates->get("portal_whosonline")."\";");
}

	$lang->online_counts = sprintf($lang->online_counts, $membercount, $guestcount);
eval("\$whosonline = \"".$templates->get("portal_whosonline")."\";");
}

Zeile 363Zeile 380
}

// Get latest news announcements

}

// Get latest news announcements

// First validate announcement fids:
$mybb->settings['portal_announcementsfid'] = explode(',', $mybb->settings['portal_announcementsfid']);
if(is_array($mybb->settings['portal_announcementsfid']))
{
foreach($mybb->settings['portal_announcementsfid'] as $fid)
{
$fid_array[] = intval($fid);
}
$mybb->settings['portal_announcementsfid'] = implode(',', $fid_array);
}
// And get them!

 
$query = $db->simple_select(TABLE_PREFIX."forums", "*", "fid IN (".$mybb->settings['portal_announcementsfid'].")");
while($forumrow = $db->fetch_array($query))
{

$query = $db->simple_select(TABLE_PREFIX."forums", "*", "fid IN (".$mybb->settings['portal_announcementsfid'].")");
while($forumrow = $db->fetch_array($query))
{

Zeile 447Zeile 453
		if($avatar_dimensions[0] && $avatar_dimensions[1])
{
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";

		if($avatar_dimensions[0] && $avatar_dimensions[1])
{
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";

		}		





		}
if (!stristr($announcement['avatar'], 'http://'))
{
$announcement['avatar'] = $mybb->settings['bburl'] . '/' . $announcement['avatar'];
}

		$avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><img src=\"$announcement[avatar]\" alt=\"0\" {$avatar_width_height} /></td>";
}
else

		$avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><img src=\"$announcement[avatar]\" alt=\"0\" {$avatar_width_height} /></td>";
}
else

Zeile 490Zeile 500
		{
if($attachment['visible'])
{ // There is an attachment thats visible!

		{
if($attachment['visible'])
{ // There is an attachment thats visible!

				$attachment['name'] = htmlspecialchars_uni($attachment['name']);

				$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);

				$attachment['filesize'] = get_friendly_size($attachment['filesize']);
$ext = get_extension($attachment['filename']);
if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")

				$attachment['filesize'] = get_friendly_size($attachment['filesize']);
$ext = get_extension($attachment['filename']);
if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")