Zeile 6 | Zeile 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 2445 2006-11-27 00:02:54Z CraKteR $
| * $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 62 | Zeile 62 |
---|
$lang->load("global"); $lang->load("messages");
|
$lang->load("global"); $lang->load("messages");
|
if(function_exists('mb_internal_encoding'))
| if(function_exists('mb_internal_encoding') && !empty($lang->settings['charset']))
|
{
|
{
|
mb_internal_encoding($lang->settings['charset']);
| @mb_internal_encoding($lang->settings['charset']);
|
}
// Which thread mode is our user using?
| }
// Which thread mode is our user using?
|
Zeile 102 | Zeile 102 |
---|
"moderation.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']."'"; }
|
if(in_array(strtolower(basename($_SERVER['PHP_SELF'])), $valid))
|
if(in_array(strtolower(basename($_SERVER['PHP_SELF'])), $valid))
|
{ // 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']))
|
// 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'])."'");
|
$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; }
| $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']))
|
// 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'])."'");
|
$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; }
| $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']))
| // We have a forum id - simply load the theme from it else if(isset($mybb->input['fid']))
|
Zeile 137 | Zeile 136 |
---|
// From all of the above, a theme was found if(isset($style['style']) && $style['style'] > 0)
|
// From all of the above, a theme was found if(isset($style['style']) && $style['style'] > 0)
|
{
| {
|
// This theme is forced upon the user, overriding their selection if($style['overridestyle'] == "yes" || !isset($mybb->user['style'])) {
| // This theme is forced upon the user, overriding their selection if($style['overridestyle'] == "yes" || !isset($mybb->user['style'])) {
|
Zeile 202 | Zeile 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 if(isset($templatelist))
|
}
// Load Main Templates and Cached Templates if(isset($templatelist))
|
{
| {
|
$templatelist .= ','; } $templatelist .= "css,headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin"; $templatelist .= ",nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active"; $templates->cache($db->escape_string($templatelist));
|
$templatelist .= ','; } $templatelist .= "css,headerinclude,header,footer,gobutton,htmldoctype,header_welcomeblock_member,header_welcomeblock_guest,header_welcomeblock_member_admin"; $templatelist .= ",nav,nav_sep,nav_bit,nav_sep_active,nav_bit_active"; $templates->cache($db->escape_string($templatelist));
|
|
|
// Set the current date and time now $datenow = my_date($mybb->settings['dateformat'], time(), '', false); $timenow = my_date($mybb->settings['timeformat'], time());
| // Set the current date and time now $datenow = my_date($mybb->settings['dateformat'], time(), '', false); $timenow = my_date($mybb->settings['timeformat'], time());
|
Zeile 228 | Zeile 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);
|
|
|
// Load appropriate welcome block for the current logged in user if($mybb->user['uid'] != 0) {
| // Load appropriate welcome block for the current logged in user if($mybb->user['uid'] != 0) {
|
Zeile 259 | Zeile 264 |
---|
else { eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
|
else { eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_guest")."\";");
|
}
| }
|
$unreadreports = ''; // This user is a moderator, super moderator or administrator
|
$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 281 | Zeile 286 |
---|
} eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";"); }
|
} eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";"); }
|
}
| }
|
// Got a character set? if($lang->settings['charset'])
|
// Got a character set? if($lang->settings['charset'])
|
{
| {
|
$charset = $lang->settings['charset']; } // If not, revert to UTF-8 else { $charset = "UTF-8";
|
$charset = $lang->settings['charset']; } // If not, revert to UTF-8 else { $charset = "UTF-8";
|
}
| }
|
// Is this user apart of a banned group? $bannedwarning = '';
| // Is this user apart of a banned group? $bannedwarning = '';
|
Zeile 355 | Zeile 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")))
|