Zeile 111 | Zeile 111 |
---|
// The user used our new quick theme changer if(isset($mybb->input['theme']) && verify_post_check($mybb->get_input('my_post_key'), true)) {
|
// The user used our new quick theme changer if(isset($mybb->input['theme']) && verify_post_check($mybb->get_input('my_post_key'), true)) {
|
$mybb->user['style'] = $mybb->get_input('theme'); // If user is logged in, update their theme selection with the new one if($mybb->user['uid'])
| // Set up user handler. require_once MYBB_ROOT.'inc/datahandlers/user.php'; $userhandler = new UserDataHandler('update');
$user = array( 'uid' => $mybb->user['uid'], 'style' => $mybb->get_input('theme', MyBB::INPUT_INT), 'usergroup' => $mybb->user['usergroup'], 'additionalgroups' => $mybb->user['additionalgroups'] );
$userhandler->set_data($user);
// validate_user verifies the style if it is set in the data array. if($userhandler->validate_user())
|
{
|
{
|
if(isset($mybb->cookies['mybbtheme']))
| $mybb->user['style'] = $user['style'];
// If user is logged in, update their theme selection with the new one if($mybb->user['uid']) { if(isset($mybb->cookies['mybbtheme'])) { my_unsetcookie('mybbtheme'); }
$userhandler->update_user(); } // Guest = cookie else
|
{
|
{
|
my_unsetcookie('mybbtheme');
| my_setcookie('mybbtheme', $user['style']);
|
}
|
}
|
$db->update_query('users', array('style' => (int)$mybb->user['style']), "uid = '{$mybb->user['uid']}'"); } // Guest = cookie else { my_setcookie('mybbtheme', $mybb->get_input('theme'));
| |
} } // Cookied theme!
| } } // Cookied theme!
|
Zeile 224 | Zeile 242 |
---|
}
// Fetch the theme to load from the cache
|
}
// Fetch the theme to load from the cache
|
| if($loadstyle != "def='1'") { $query = $db->simple_select('themes', 'name, tid, properties, stylesheets, allowedgroups', $loadstyle, array('limit' => 1)); $theme = $db->fetch_array($query);
if(isset($theme['tid']) && !$load_from_forum && !is_member($theme['allowedgroups']) && $theme['allowedgroups'] != 'all') { if($load_from_user == 1) { $db->update_query('users', array('style' => 0), "style='{$mybb->user['style']}' AND uid='{$mybb->user['uid']}'"); }
if(isset($mybb->cookies['mybbtheme'])) { my_unsetcookie('mybbtheme'); }
$loadstyle = "def='1'"; } }
|
if($loadstyle == "def='1'") { if(!$cache->read('default_theme')) { $cache->update_default_theme(); }
|
if($loadstyle == "def='1'") { if(!$cache->read('default_theme')) { $cache->update_default_theme(); }
|
|
|
$theme = $cache->read('default_theme');
|
$theme = $cache->read('default_theme');
|
} else { $query = $db->simple_select('themes', 'name, tid, properties, stylesheets', $loadstyle, array('limit' => 1)); $theme = $db->fetch_array($query);
| $load_from_forum = $load_from_user = 0;
|
}
// No theme was found - we attempt to load the master or any other theme
| }
// No theme was found - we attempt to load the master or any other theme
|
Zeile 243 | Zeile 280 |
---|
{ // Missing theme was from a forum, run a query to set any forums using the theme to the default if($load_from_forum == 1)
|
{ // Missing theme was from a forum, run a query to set any forums using the theme to the default if($load_from_forum == 1)
|
{
| {
|
$db->update_query('forums', array('style' => 0), "style = '{$style['style']}'"); } // Missing theme was from a user, run a query to set any users using the theme to the default
| $db->update_query('forums', array('style' => 0), "style = '{$style['style']}'"); } // Missing theme was from a user, run a query to set any users using the theme to the default
|
Zeile 280 | Zeile 317 |
---|
{ continue; }
|
{ continue; }
|
|
|
if(!empty($theme['stylesheets'][$stylesheet_script][$stylesheet_action])) { // Actually add the stylesheets to the list
| if(!empty($theme['stylesheets'][$stylesheet_script][$stylesheet_action])) { // Actually add the stylesheets to the list
|
Zeile 289 | Zeile 326 |
---|
if(!empty($already_loaded[$page_stylesheet])) { continue;
|
if(!empty($already_loaded[$page_stylesheet])) { continue;
|
}
| }
|
if(strpos($page_stylesheet, 'css.php') !== false)
|
if(strpos($page_stylesheet, 'css.php') !== false)
|
{
| {
|
$stylesheet_url = $mybb->settings['bburl'] . '/' . $page_stylesheet; } else { $stylesheet_url = $mybb->get_asset_url($page_stylesheet);
|
$stylesheet_url = $mybb->settings['bburl'] . '/' . $page_stylesheet; } else { $stylesheet_url = $mybb->get_asset_url($page_stylesheet);
|
}
| }
|
if($mybb->settings['minifycss']) { $stylesheet_url = str_replace('.css', '.min.css', $stylesheet_url); }
if(strpos($page_stylesheet, 'css.php') !== false)
|
if($mybb->settings['minifycss']) { $stylesheet_url = str_replace('.css', '.min.css', $stylesheet_url); }
if(strpos($page_stylesheet, 'css.php') !== false)
|
{
| {
|
// We need some modification to get it working with the displayorder $query_string = parse_url($stylesheet_url, PHP_URL_QUERY); $id = (int) my_substr($query_string, 11);
| // We need some modification to get it working with the displayorder $query_string = parse_url($stylesheet_url, PHP_URL_QUERY); $id = (int) my_substr($query_string, 11);
|
Zeile 321 | Zeile 358 |
---|
$already_loaded[$page_stylesheet] = 1; }
|
$already_loaded[$page_stylesheet] = 1; }
|
} }
| } }
|
} unset($actions);
|
} unset($actions);
|
if(!empty($theme_stylesheets))
| if(!empty($theme_stylesheets) && is_array($theme['disporder']))
|
{ foreach($theme['disporder'] as $style_name => $order) { if(!empty($theme_stylesheets[$style_name]))
|
{ foreach($theme['disporder'] as $style_name => $order) { if(!empty($theme_stylesheets[$style_name]))
|
{
| {
|
$stylesheets .= $theme_stylesheets[$style_name];
|
$stylesheets .= $theme_stylesheets[$style_name];
|
} } }
| } } }
|
// Are we linking to a remote theme server? if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://') { // If a language directory for the current language exists within the theme - we use it
|
// Are we linking to a remote theme server? if(my_substr($theme['imgdir'], 0, 7) == 'http://' || my_substr($theme['imgdir'], 0, 8) == 'https://') { // If a language directory for the current language exists within the theme - we use it
|
if(!empty($mybb->user['language']))
| if(!empty($mybb->user['language'])) { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language']; } else { // Check if a custom language directory exists for this theme if(!empty($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']; } } } else { $img_directory = $theme['imgdir'];
if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath'])) { $img_directory = rtrim($mybb->settings['cdnpath'], '/') . '/' . ltrim($theme['imgdir'], '/'); }
if(!@is_dir($img_directory)) { $theme['imgdir'] = 'images'; }
// If a language directory for the current language exists within the theme - we use it if(!empty($mybb->user['language']) && is_dir($img_directory.'/'.$mybb->user['language']))
|
{ $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language']; } else { // Check if a custom language directory exists for this theme
|
{ $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language']; } else { // Check if a custom language directory exists for this theme
|
if(!empty($mybb->settings['bblanguage']))
| if(is_dir($img_directory.'/'.$mybb->settings['bblanguage']))
|
{ $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage']; }
| { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->settings['bblanguage']; }
|
Zeile 358 | Zeile 428 |
---|
$theme['imglangdir'] = $theme['imgdir']; } }
|
$theme['imglangdir'] = $theme['imgdir']; } }
|
} else { $img_directory = $theme['imgdir'];
if($mybb->settings['usecdn'] && !empty($mybb->settings['cdnpath'])) { $img_directory = rtrim($mybb->settings['cdnpath'], '/') . '/' . ltrim($theme['imgdir'], '/'); }
if(!@is_dir($img_directory)) { $theme['imgdir'] = 'images'; }
// If a language directory for the current language exists within the theme - we use it if(!empty($mybb->user['language']) && is_dir($img_directory.'/'.$mybb->user['language'])) { $theme['imglangdir'] = $theme['imgdir'].'/'.$mybb->user['language']; } else { // Check if a custom language directory exists for this theme if(is_dir($img_directory.'/'.$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']; } }
| |
|
|
$theme['imgdir'] = $mybb->get_asset_url($theme['imgdir']); $theme['imglangdir'] = $mybb->get_asset_url($theme['imglangdir']);
| $theme['imgdir'] = $mybb->get_asset_url($theme['imgdir']); $theme['imglangdir'] = $mybb->get_asset_url($theme['imglangdir']);
|
}
// Theme logo - is it a relative URL to the forum root? Append bburl
| }
// Theme logo - is it a relative URL to the forum root? Append bburl
|
Zeile 510 | Zeile 547 |
---|
if($mybb->settings['portal'] == 1) { eval('$menu_portal = "'.$templates->get('header_menu_portal').'";');
|
if($mybb->settings['portal'] == 1) { eval('$menu_portal = "'.$templates->get('header_menu_portal').'";');
|
}
| }
|
// See if there are any pending join requests for group leaders $pending_joinrequests = '';
| // See if there are any pending join requests for group leaders $pending_joinrequests = '';
|
Zeile 533 | Zeile 570 |
---|
$query = $db->simple_select('joinrequests', 'COUNT(uid) as total', "gid IN ({$gids}) AND invite='0'"); $total_joinrequests = $db->fetch_field($query, 'total');
|
$query = $db->simple_select('joinrequests', 'COUNT(uid) as total', "gid IN ({$gids}) AND invite='0'"); $total_joinrequests = $db->fetch_field($query, 'total');
|
|
|
if($total_joinrequests > 0) { if($total_joinrequests == 1)
|
if($total_joinrequests > 0) { if($total_joinrequests == 1)
|
{
| {
|
$lang->pending_joinrequests = $lang->pending_joinrequest;
|
$lang->pending_joinrequests = $lang->pending_joinrequest;
|
}
| }
|
else { $total_joinrequests = my_number_format($total_joinrequests); $lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);
|
else { $total_joinrequests = my_number_format($total_joinrequests); $lang->pending_joinrequests = $lang->sprintf($lang->pending_joinrequests, $total_joinrequests);
|
}
| }
|
eval('$pending_joinrequests = "'.$templates->get('global_pending_joinrequests').'";'); } }
| eval('$pending_joinrequests = "'.$templates->get('global_pending_joinrequests').'";'); } }
|
Zeile 556 | Zeile 593 |
---|
{ // Only worth checking if we are here because we have ACP permissions and the other condition fails if($mybb->usergroup['cancp'] == 1 && !($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))
|
{ // Only worth checking if we are here because we have ACP permissions and the other condition fails if($mybb->usergroup['cancp'] == 1 && !($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1))
|
{
| {
|
// First we check if the user's a super admin: if yes, we don't care about permissions $can_access_moderationqueue = true; $is_super_admin = is_super_admin($recipient['uid']);
| // First we check if the user's a super admin: if yes, we don't care about permissions $can_access_moderationqueue = true; $is_super_admin = is_super_admin($recipient['uid']);
|
Zeile 566 | Zeile 603 |
---|
if(!file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php")) { $can_access_moderationqueue = false;
|
if(!file_exists(MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php")) { $can_access_moderationqueue = false;
|
}
| }
|
require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";
// Verify if we have permissions to access forum-moderation_queue
| require_once MYBB_ROOT.$mybb->config['admin_dir']."/inc/functions.php";
// Verify if we have permissions to access forum-moderation_queue
|
Zeile 589 | Zeile 626 |
---|
{ $can_access_moderationqueue = false; }
|
{ $can_access_moderationqueue = false; }
|
|
|
if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1)) { // Read the reported content cache
| if($can_access_moderationqueue || ($mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'] == 1 && $mybb->usergroup['canmanagereportedcontent'] == 1)) { // Read the reported content cache
|
Zeile 602 | Zeile 639 |
---|
if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod']) { $unread = (int)$reported['unread'];
|
if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod']) { $unread = (int)$reported['unread'];
|
}
| }
|
else { $unread = 0;
| else { $unread = 0;
|
Zeile 724 | Zeile 761 |
---|
{ $awaitingusers = $cache->read('awaitingactivation');
|
{ $awaitingusers = $cache->read('awaitingactivation');
|
if(isset($awaitingusers['time']) && $awaitingusers['time'] < TIME_NOW + 86400)
| if(isset($awaitingusers['time']) && $awaitingusers['time'] + 86400 < TIME_NOW)
|
{ $cache->update_awaitingactivation(); $awaitingusers = $cache->read('awaitingactivation');
| { $cache->update_awaitingactivation(); $awaitingusers = $cache->read('awaitingactivation');
|
Zeile 747 | Zeile 784 |
---|
{ $awaitingusers = my_number_format($awaitingusers); }
|
{ $awaitingusers = my_number_format($awaitingusers); }
|
|
|
if($awaitingusers > 0) { if($awaitingusers == 1)
|
if($awaitingusers > 0) { if($awaitingusers == 1)
|
{
| {
|
$awaiting_message = $lang->awaiting_message_single; } else
| $awaiting_message = $lang->awaiting_message_single; } else
|
Zeile 765 | Zeile 802 |
---|
}
eval('$awaitingusers = "'.$templates->get('global_awaiting_activation').'";');
|
}
eval('$awaitingusers = "'.$templates->get('global_awaiting_activation').'";');
|
}
| }
|
else { $awaitingusers = ''; }
|
else { $awaitingusers = ''; }
|
}
| }
|
// Set up some of the default templates eval('$headerinclude = "'.$templates->get('headerinclude').'";');
| // Set up some of the default templates eval('$headerinclude = "'.$templates->get('headerinclude').'";');
|
Zeile 785 | Zeile 822 |
---|
if($mybb->settings['showvernum'] == 1) { $mybbversion = ' '.$mybb->version;
|
if($mybb->settings['showvernum'] == 1) { $mybbversion = ' '.$mybb->version;
|
}
| }
|
// Check to see if we have any tasks to run $task_image = ''; $task_cache = $cache->read('tasks'); if(!$task_cache['nextrun'])
|
// Check to see if we have any tasks to run $task_image = ''; $task_cache = $cache->read('tasks'); if(!$task_cache['nextrun'])
|
{
| {
|
$task_cache['nextrun'] = TIME_NOW; }
if($task_cache['nextrun'] <= TIME_NOW) { eval("\$task_image = \"".$templates->get("task_image")."\";");
|
$task_cache['nextrun'] = TIME_NOW; }
if($task_cache['nextrun'] <= TIME_NOW) { eval("\$task_image = \"".$templates->get("task_image")."\";");
|
}
| }
|
// Are we showing the quick language selection box? $lang_select = $lang_options = '';
| // Are we showing the quick language selection box? $lang_select = $lang_options = '';
|
Zeile 853 | Zeile 890 |
---|
}
eval('$contact_us = "'.$templates->get('footer_contactus').'";');
|
}
eval('$contact_us = "'.$templates->get('footer_contactus').'";');
|
}
| }
|
// DST Auto detection enabled? $auto_dst_detection = ''; if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
| // DST Auto detection enabled? $auto_dst_detection = ''; if($mybb->user['uid'] > 0 && $mybb->user['dstcorrection'] == 2)
|
Zeile 875 | Zeile 912 |
---|
if(is_banned_ip($session->ipaddress, true)) { if($mybb->user['uid'])
|
if(is_banned_ip($session->ipaddress, true)) { if($mybb->user['uid'])
|
{
| {
|
$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip)." OR uid='{$mybb->user['uid']}'");
|
$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip)." OR uid='{$mybb->user['uid']}'");
|
} else {
| } else {
|
$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip));
|
$db->delete_query('sessions', "ip = ".$db->escape_binary($session->packedip));
|
}
| }
|
error($lang->error_banned); }
| error($lang->error_banned); }
|
Zeile 905 | Zeile 942 |
---|
$lang->error_boardclosed .= "<blockquote>{$mybb->settings['boardclosed_reason']}</blockquote>";
|
$lang->error_boardclosed .= "<blockquote>{$mybb->settings['boardclosed_reason']}</blockquote>";
|
if(!$mybb->get_input('modal'))
| if(!$mybb->get_input('modal'))
|
{ error($lang->error_boardclosed); }
| { error($lang->error_boardclosed); }
|