ate('Errors'); $context['sub_template'] = 'fatal_error'; } // We want whatever for the header, and a footer. (footer includes sub template!) obExit(null, true); /* DO NOT IGNORE: If you are creating a bridge to SMF or modifying this function, you MUST make ABSOLUTELY SURE that this function quits and DOES NOT RETURN TO NORMAL PROGRAM FLOW. Otherwise, security error messages will not be shown, and your forum will be in a very easily hackable state. */ trigger_error('Hacking attempt...', E_USER_ERROR); } // A fatal error with a message stored in the language file. function fatal_lang_error($error, $log = true, $sprintf = array()) { global $txt; // Load the language file... loadLanguage('Errors'); // Are we formatting anything? if (empty($sprintf)) fatal_error($txt[$error], $log); else fatal_error(vsprintf($txt[$error], $sprintf), $log); } // Handler for standard error messages. function error_handler($error_level, $error_string, $file, $line) { global $settings, $modSettings, $db_show_debug; // Ignore errors if we're ignoring them or they are strict notices from PHP 5 (which cannot be solved without breaking PHP 4.) if (error_reporting() == 0 || (defined('E_STRICT') && $error_level == E_STRICT && (empty($modSettings['enableErrorLogging']) || $modSettings['enableErrorLogging'] != 2))) return; if (strpos($file, 'eval()') !== false && !empty($settings['current_include_filename'])) { if (function_exists('debug_backtrace')) { $array = debug_backtrace(); for ($i = 0; $i < count($array); $i++) { if ($array[$i]['function'] != 'loadSubTemplate') continue; // This is a bug in PHP, with eval, it seems! if (empty($array[$i]['args'])) $i++; break; } if (isset($array[$i]) && !empty($array[$i]['args'])) $file = realpath($settings['current_include_filename']) . ' (' . $array[$i]['args'][0] . ' sub template - eval?)'; else $file = realpath($settings['current_include_filename']) . ' (eval?)'; } else $file = realpath($settings['current_include_filename']) . ' (eval?)'; } if (isset($db_show_debug) && $db_show_debug === true) { // Commonly, undefined indexes will occur inside attributes; try to show them anyway! if ($error_level % 255 != E_ERROR) { $temporary = ob_get_contents(); if (substr($temporary, -2) == '="') echo '"'; } // Debugging! This should look like a PHP error message. echo '
', $error_level % 255 == E_ERROR ? 'Error' : ($error_level % 255 == E_WARNING ? 'Warning' : 'Notice'), ': ', $error_string, ' in ', $file, ' on line ', $line, '
'; } $message = log_error($error_level . ': ' . $error_string, $file, $line); // Dying on these errors only causes MORE problems (blank pages!) if ($file == 'Unknown') return; // If this is an E_ERROR or E_USER_ERROR.... die. Violently so. if ($error_level % 255 == E_ERROR) obExit(false); else return; // If this is an E_ERROR, E_USER_ERROR, E_WARNING, or E_USER_WARNING.... die. Violently so. if ($error_level % 255 == E_ERROR || $error_level % 255 == E_WARNING) fatal_error(allowedTo('admin_forum') ? $message : $error_string, false); // We should NEVER get to this point. Any fatal error MUST quit, or very bad things can happen. if ($error_level % 255 == E_ERROR) die('Hacking attempt...'); } // Just wrap it so we don't take up time and space here in Errors.php. function db_fatal_error($loadavg = false) { global $sourcedir; // Just load the other file and run it. require_once($sourcedir . '/Subs-Auth.php'); show_db_error($loadavg); // Since we use "or db_fatal_error();" this is needed... return false; } ?> "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20) codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px"; } }'; elseif ($context['browser']['is_firefox']) echo ' window.addEventListener("load", smf_codeFix, false); function smf_codeFix() { var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div"); for (var i = 0; i < codeFix.length; i++) { if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0)) codeFix[i].style.overflow = "scroll"; } }'; else echo ' var window_oldOnload = window.onload; window.onload = smf_codeFix; function smf_codeFix() { var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div"); for (var i = codeFix.length - 1; i > 0; i--) { if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code")) codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px"; } if (window_oldOnload) { window_oldOnload(); window_oldOnload = null; } }'; echo ' // ]]>'; } echo ' '; // The following will be used to let the user know that some AJAX process is running echo ' '; } // Show a linktree. This is that thing that shows "My Community | General Category | General Discussion".. function theme_linktree() { global $context, $settings, $options; echo ''; } // Show the menu up top. Something like [home] [help] [profile] [logout]... function template_menu() { global $context, $settings, $options, $scripturl, $txt; // Work out where we currently are. $current_action = 'home'; if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers'))) $current_action = 'admin'; if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm'))) $current_action = $context['current_action']; if ($context['current_action'] == 'search2') $current_action = 'search'; if ($context['current_action'] == 'theme') $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin'; // Are we using right-to-left orientation? if ($context['right_to_left']) { $first = 'last'; $last = 'first'; } else { $first = 'first'; $last = 'last'; } // Show the start of the tab section. echo ' '; // Show the [home] button. echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'home' ? '' : ''; // Show the [help] button. echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'help' ? '' : ''; // How about the [search] button? if ($context['allow_search']) echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'search' ? '' : ''; // Is the user allowed to administrate at all? ([admin]) if ($context['allow_admin']) echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'admin' ? '' : ''; // Edit Profile... [profile] if ($context['allow_edit_profile']) echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'profile' ? '' : ''; // Go to PM center... [pm] if ($context['user']['is_logged'] && $context['allow_pm']) echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'pm' ? '' : ''; // The [calendar]! if ($context['allow_calendar']) echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'calendar' ? '' : ''; // the [member] list button if ($context['allow_memberlist']) echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'mlist' ? '' : ''; // If the user is a guest, show [login] button. if ($context['user']['is_guest']) echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'login' ? '' : ''; // If the user is a guest, also show [register] button. if ($context['user']['is_guest']) echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'register' ? '' : ''; // Otherwise, they might want to [logout]... if ($context['user']['is_logged']) echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' : '' , ' ' , $current_action == 'logout' ? '' : ''; // The end of tab section. echo '
   ' , $txt[103] , '    ' , $txt[119] , '    ' , $txt[182] , '    ' , $txt[2] , '    ' , $txt[79] , '    ' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '['. $context['user']['unread_messages'] . ']' : '' , '    ' , $txt['calendar24'] , '    ' , $txt[331] , '    ' , $txt[34] , '    ' , $txt[97] , '    ' , $txt[108] , '   
'; } // Generate a strip of buttons. function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '') { global $settings, $buttons, $context, $txt, $scripturl; // Create the buttons... foreach ($button_strip as $key => $value) { if (isset($value['test']) && empty($context[$value['test']])) { unset($button_strip[$key]); continue; } elseif (!isset($buttons[$key]) || $force_reset) $buttons[$key] = '' . $txt[$value['text']] . ''; $button_strip[$key] = $buttons[$key]; } if (empty($button_strip)) return ' '; echo '   ', implode('  |  ', $button_strip) , '  '; } ?>mber";s:5:"\d+";})$~', $row['extra'], $matches) === 1) db_query(" UPDATE {$db_prefix}log_actions SET extra = '$matches[1]" . strlen($matches[3]) . ":\"$matches[3]\"$matches[4]' WHERE ID_ACTION = $row[ID_ACTION] LIMIT 1", __FILE__, __LINE__); } mysql_free_result($request); // Refresh some serialized strings stored in the settings table. updateStats('calendar'); // The memberlist cache needs to be recalculated too. updateSettings(array('memberlist_updated' => time())); } ?> Login

The Bloggers Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Warning!
The topic or board you are looking for appears to be either missing or off limits to you.
Please login below or register an account with The Bloggers Forum.
Login
Username:
Password:
Minutes to stay logged in:
Always stay logged in:
Forgot your password?