Vergleich global.php - 1.2.1 - 1.2.2

  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 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 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'))
{
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 84Zeile 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 168Zeile 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']))
{

	// Check if a custom language directory exists for this theme
if(is_dir($theme['imgdir'].'/'.$mybb->settings['bblanguage']))
{

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

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

}


}


// Load Main Templates and Cached Templates
if(isset($templatelist))
{
$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 .= "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));

Zeile 199Zeile 220

// 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 214Zeile 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);

// Load appropriate welcome block for the current logged in user
if($mybb->user['uid'] != 0)

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

// Load appropriate welcome block for the current logged in user
if($mybb->user['uid'] != 0)

{

{

	// User can access the admin cp and we're not hiding admin cp links, fetch it
if($mybb->usergroup['cancp'] == "yes" && $mybb->config['hide_admin_links'] != 1)
{

	// User can access the admin cp and we're not hiding admin cp links, fetch it
if($mybb->usergroup['cancp'] == "yes" && $mybb->config['hide_admin_links'] != 1)
{

Zeile 259Zeile 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?
if($lang->settings['charset'])
{
$charset = $lang->settings['charset'];


// Got a character set?
if($lang->settings['charset'])
{
$charset = $lang->settings['charset'];

}

}

// If not, revert to UTF-8
else
{

// If not, revert to UTF-8
else
{

Zeile 294Zeile 315
		$reason = htmlspecialchars_uni($ban['reason']);
}
if(empty($reason))

		$reason = htmlspecialchars_uni($ban['reason']);
}
if(empty($reason))

	{

	{

		$reason = $lang->unknown;
}
if(empty($banlift))

		$reason = $lang->unknown;
}
if(empty($banlift))

Zeile 305Zeile 326
	{
// Display a nice warning to the user
} eval("\$bannedwarning = \"".$templates->get("global_bannedwarning")."\";");

	{
// Display a nice warning to the user
} eval("\$bannedwarning = \"".$templates->get("global_bannedwarning")."\";");

}

}


$lang->ajax_loading = str_replace("'", "\\'", $lang->ajax_loading);



$lang->ajax_loading = str_replace("'", "\\'", $lang->ajax_loading);


Zeile 321Zeile 342
if($mybb->settings['showvernum'] == "on")
{
$mybbversion = $mybb->version;

if($mybb->settings['showvernum'] == "on")
{
$mybbversion = $mybb->version;

}

}

else
{
$mybbversion = '';

else
{
$mybbversion = '';

Zeile 348Zeile 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 441Zeile 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";