Vergleich global.php - 1.2.1 - 1.2.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.com
* License: http://www.mybboard.com/eula.html
*

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

 * $Id: global.php 2262 2006-09-26 08:00:35Z chris $

 * $Id: global.php 2791 2007-02-14 02:31:03Z chris $

 */

// Load main MyBB core file which begins all of the magic

 */

// Load main MyBB core file which begins all of the magic

require_once dirname(__FILE__)."/inc/init.php";

require_once "./inc/init.php";


$shutdown_queries = array();



$shutdown_queries = array();


Zeile 38Zeile 38
}

// Do not use session system for defined pages

}

// Do not use session system for defined pages

if((isset($mybb->input['action']) && isset($nosession[$mybb->input['action']])) || isset($mybb->input['thumbnail']))

if((isset($mybb->input['action']) && isset($nosession[$mybb->input['action']])) || (isset($mybb->input['thumbnail']) && strstr($_SERVER["PHP_SELF"], 'attachment.php')))

{
define("NO_ONLINE", 1);
}

{
define("NO_ONLINE", 1);
}

Zeile 61Zeile 61
$lang->set_language($mybb->settings['bblanguage']);
$lang->load("global");
$lang->load("messages");

$lang->set_language($mybb->settings['bblanguage']);
$lang->load("global");
$lang->load("messages");

 

if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))
{
@mb_internal_encoding($lang->settings['charset']);
}


// Which thread mode is our user using?
if(!isset($mybb->input['mode']))
{
if(isset($mybb->user['threadmode']))


// Which thread mode is our user using?
if(!isset($mybb->input['mode']))
{
if(isset($mybb->user['threadmode']))

	{

	{

		$mybb->input['mode'] = $mybb->user['threadmode'];
}
else if($mybb->settings['threadusenetstyle'] == "yes")

		$mybb->input['mode'] = $mybb->user['threadmode'];
}
else if($mybb->settings['threadusenetstyle'] == "yes")

	{

	{

		$mybb->input['mode'] = "threaded";
}
else

		$mybb->input['mode'] = "threaded";
}
else

Zeile 83Zeile 88
$loadstyle = '';
$load_from_forum = 0;
$style = array();

$loadstyle = '';
$load_from_forum = 0;
$style = array();

 

$valid = array(
"showthread.php",
"forumdisplay.php",
"newthread.php",
"newreply.php",
"ratethread.php",
"editpost.php",
"polls.php",
"sendthread.php",
"printthread.php",
"moderation.php"
);


// This user has a custom theme set in their profile
if(isset($mybb->user['style']) && intval($mybb->user['style']) != 0)
{
$loadstyle = "tid='".$mybb->user['style']."'";
}


// This user has a custom theme set in their profile
if(isset($mybb->user['style']) && intval($mybb->user['style']) != 0)
{
$loadstyle = "tid='".$mybb->user['style']."'";
}


// If we're accessing a post, fetch the forum theme for it and if we're overriding it
if(isset($mybb->input['pid']))
{
$query = $db->simple_select(TABLE_PREFIX."forums f, ".TABLE_PREFIX."posts p", "f.style, f.overridestyle", "f.fid=p.fid AND p.pid='".intval($mybb->input['pid'])."'");
$style = $db->fetch_array($query);
$load_from_forum = 1;
}

// We have a thread id and a forum id, we can easily fetch the theme for this forum
else if(isset($mybb->input['tid']))

if(in_array(strtolower(basename($_SERVER['PHP_SELF'])), $valid))











{

{

	$query = $db->simple_select(TABLE_PREFIX."forums f, ".TABLE_PREFIX."threads t", "f.style, f.overridestyle", "f.fid=t.fid AND t.tid='".intval($mybb->input['tid'])."'");
$style = $db->fetch_array($query);
$load_from_forum = 1;
}

// We have a forum id - simply load the theme from it
else if(isset($mybb->input['fid']))
{
$query = $db->simple_select(TABLE_PREFIX."forums", "style, overridestyle", "fid='".intval($mybb->input['fid'])."'");
$style = $db->fetch_array($query);
$load_from_forum = 1;













	// If we're accessing a post, fetch the forum theme for it and if we're overriding it
if(isset($mybb->input['pid']))
{
$query = $db->simple_select(TABLE_PREFIX."forums f, ".TABLE_PREFIX."posts p", "f.style, f.overridestyle", "f.fid=p.fid AND p.pid='".intval($mybb->input['pid'])."'");
$style = $db->fetch_array($query);
$load_from_forum = 1;
}

// We have a thread id and a forum id, we can easily fetch the theme for this forum
else if(isset($mybb->input['tid']))
{
$query = $db->simple_select(TABLE_PREFIX."forums f, ".TABLE_PREFIX."threads t", "f.style, f.overridestyle", "f.fid=t.fid AND t.tid='".intval($mybb->input['tid'])."'");
$style = $db->fetch_array($query);
$load_from_forum = 1;
}

// We have a forum id - simply load the theme from it
else if(isset($mybb->input['fid']))
{
$query = $db->simple_select(TABLE_PREFIX."forums", "style, overridestyle", "fid='".intval($mybb->input['fid'])."'");
$style = $db->fetch_array($query);
$load_from_forum = 1;
}

}

// From all of the above, a theme was found

}

// From all of the above, a theme was found

Zeile 181Zeile 201
	{
$theme['imglangdir'] = $theme['imgdir'];
}

	{
$theme['imglangdir'] = $theme['imgdir'];
}

 
}

// Theme logo - is it a relative URL to the forum root? Append bburl
if(!preg_match("#^(\/|\.\.|\.|([a-z0-9]+)://)#i", $theme['logo']))
{
$theme['logo'] = $mybb->settings['bburl']."/".$theme['logo'];

}

// Load Main Templates and Cached Templates

}

// Load Main Templates and Cached Templates

Zeile 199Zeile 225

// Format the last visit date of this user appropriately
if(isset($mybb->user['lastvisit']))


// Format the last visit date of this user appropriately
if(isset($mybb->user['lastvisit']))

{

{

	$lastvisit = my_date($mybb->settings['dateformat'], $mybb->user['lastvisit']) . ', ' . my_date($mybb->settings['timeformat'], $mybb->user['lastvisit']);
}


	$lastvisit = my_date($mybb->settings['dateformat'], $mybb->user['lastvisit']) . ', ' . my_date($mybb->settings['timeformat'], $mybb->user['lastvisit']);
}


Zeile 207Zeile 233
else
{
$lastvisit = $lang->lastvisit_never;

else
{
$lastvisit = $lang->lastvisit_never;

}


}


// If the board is closed and we have an Administrator, show board closed warning
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] == "yes")
{
eval("\$bbclosedwarning = \"".$templates->get("global_boardclosed_warning")."\";");

// If the board is closed and we have an Administrator, show board closed warning
$bbclosedwarning = '';
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] == "yes")
{
eval("\$bbclosedwarning = \"".$templates->get("global_boardclosed_warning")."\";");

}

}


// Prepare the main templates for use
unset($admincplink);


// Prepare the main templates for use
unset($admincplink);

Zeile 236Zeile 262
}
// Otherwise, we have a guest
else

}
// Otherwise, we have a guest
else

{

{

	eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
}

$unreadreports = '';
// This user is a moderator, super moderator or administrator

	eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
}

$unreadreports = '';
// This user is a moderator, super moderator or administrator

if($mybb->usergroup['cancp'] == "yes" || $mybb->usergroup['issupermod'] == "yes" || $mybb->usergroup['gid'] == 6)

if($mybb->usergroup['cancp'] == "yes" || $mybb->usergroup['issupermod'] == "yes" || $mybb->user['usergroup'] == 6)

{
// Read the reported posts cache
$reported = $cache->read("reportedposts");

{
// Read the reported posts cache
$reported = $cache->read("reportedposts");

Zeile 253Zeile 279
		if($reported['unread'] == 1)
{
$lang->unread_reports = $lang->unread_report;

		if($reported['unread'] == 1)
{
$lang->unread_reports = $lang->unread_report;

		}

		}

		else
{
$lang->unread_reports = sprintf($lang->unread_reports, $reported['unread']);

		else
{
$lang->unread_reports = sprintf($lang->unread_reports, $reported['unread']);

Zeile 334Zeile 360
$navbits[0]['url'] = $mybb->settings['bburl']."/index.php";

// Check banned ip addresses

$navbits[0]['url'] = $mybb->settings['bburl']."/index.php";

// Check banned ip addresses

$bannedips = explode(",", $mybb->settings['bannedips']);
if(is_array($bannedips))

if(is_banned_ip($session->ipaddress))


{

{

	foreach($bannedips as $key => $bannedip)
{
$bannedip = trim($bannedip);
if($bannedip != '')
{
// This address is banned, show an error and delete the session
if(strstr($session->ipaddress, $bannedip))
{
$db->delete_query(TABLE_PREFIX."sessions", "ip='".$db->escape_string($session->ipaddress)."' OR uid='{$mybb->user['uid']}'");
error($lang->error_banned);
}
}
}

	$db->delete_query(TABLE_PREFIX."sessions", "ip='".$db->escape_string($session->ipaddress)."' OR uid='{$mybb->user['uid']}'");
error($lang->error_banned);












}
// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] != "yes" && !(basename($_SERVER['PHP_SELF']) == "member.php" && ($mybb->input['action'] == "login" || $mybb->input['action'] == "do_login" || $mybb->input['action'] == "logout")))

}
// If the board is closed, the user is not an administrator and they're not trying to login, show the board closed message
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] != "yes" && !(basename($_SERVER['PHP_SELF']) == "member.php" && ($mybb->input['action'] == "login" || $mybb->input['action'] == "do_login" || $mybb->input['action'] == "logout")))

Zeile 441Zeile 455
{
$db->delete_query(TABLE_PREFIX."threads", "deletetime != '0' AND deletetime < '".time()."'");
}

{
$db->delete_query(TABLE_PREFIX."threads", "deletetime != '0' AND deletetime < '".time()."'");
}

 

// Randomly clear out old guest sessions (older than 24 hours)
if($rand > 4 && $rand < 8)
{
$timecut = time()-60*60*24;
$db->delete_query(TABLE_PREFIX."sessions", "uid=0 AND time<='$timecut'");
}



// Set the link to the archive.
$archive_url = $mybb->settings['bburl']."/archive/index.php";


// Set the link to the archive.
$archive_url = $mybb->settings['bburl']."/archive/index.php";