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 2191 2006-09-03 12:11:04Z chris $
| * $Id: global.php 2445 2006-11-27 00:02:54Z CraKteR $
|
*/
// Load main MyBB core file which begins all of the magic
| */
// Load main MyBB core file which begins all of the magic
|
Zeile 38 | Zeile 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 61 | Zeile 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')) { mb_internal_encoding($lang->settings['charset']); }
|
// Which thread mode is our user using? if(!isset($mybb->input['mode']))
| // Which thread mode is our user using? if(!isset($mybb->input['mode']))
|
Zeile 84 | Zeile 89 |
---|
$load_from_forum = 0; $style = array();
|
$load_from_forum = 0; $style = array();
|
// 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; }
| $valid = array( "showthread.php", "forumdisplay.php", "newthread.php", "newreply.php", "ratethread.php", "editpost.php", "polls.php", "sendthread.php", "printthread.php", "moderation.php" );
|
|
|
// 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;
| // 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'])) { $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 168 | Zeile 189 |
---|
if(!empty($mybb->user['language']) && is_dir($theme['imgdir'].'/'.$mybb->user['language'])) { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
|
if(!empty($mybb->user['language']) && is_dir($theme['imgdir'].'/'.$mybb->user['language'])) { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language'];
|
} else
| } else
|
{ // Check if a custom language directory exists for this theme if(is_dir($theme['imgdir'].'/'.$mybb->settings['bblanguage'])) { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
|
{ // Check if a custom language directory exists for this theme if(is_dir($theme['imgdir'].'/'.$mybb->settings['bblanguage'])) { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage'];
|
}
| }
|
// Otherwise, the image language directory is the same as the language directory for the theme else { $theme['imglangdir'] = $theme['imgdir']; }
|
// Otherwise, the image language directory is the same as the language directory for the theme else { $theme['imglangdir'] = $theme['imgdir']; }
|
}
| }
|
// Load Main Templates and Cached Templates if(isset($templatelist))
| // Load Main Templates and Cached Templates if(isset($templatelist))
|
Zeile 214 | Zeile 235 |
---|
if($mybb->settings['boardclosed'] == "yes" && $mybb->usergroup['cancp'] == "yes") { eval("\$bbclosedwarning = \"".$templates->get("global_boardclosed_warning")."\";");
|
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 259 | Zeile 280 |
---|
$lang->unread_reports = sprintf($lang->unread_reports, $reported['unread']); } eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");
|
$lang->unread_reports = sprintf($lang->unread_reports, $reported['unread']); } eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");
|
}
| }
|
}
// Got a character set?
| }
// Got a character set?
|
Zeile 329 | Zeile 350 |
---|
eval("\$footer = \"".$templates->get("footer")."\";");
// Add our main parts to the navigation
|
eval("\$footer = \"".$templates->get("footer")."\";");
// Add our main parts to the navigation
|
| $navbits = array();
|
$navbits[0]['name'] = $mybb->settings['bbname']; $navbits[0]['url'] = $mybb->settings['bburl']."/index.php";
| $navbits[0]['name'] = $mybb->settings['bbname']; $navbits[0]['url'] = $mybb->settings['bburl']."/index.php";
|
Zeile 347 | Zeile 369 |
---|
$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 389 | Zeile 411 |
---|
$referrer = $db->fetch_array($query); if($referrer['uid']) {
|
$referrer = $db->fetch_array($query); if($referrer['uid']) {
|
my_setcookie("mybb[referrer]", $referrer['username']);
| my_setcookie("mybb[referrer]", $referrer['uid']);
|
} }
| } }
|
Zeile 440 | Zeile 462 |
---|
{ $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";
|