function bb_die($message, $title = '', $header = 0) { global $bb_locale; if ($header && !headers_sent()) { status_header($header); } if (function_exists('is_nxt_error') && is_nxt_error($message)) { if (empty($title)) { $error_data = $message->get_error_data(); if (is_array($error_data) && isset($error_data['title'])) { $title = $error_data['title']; } } $errors = $message->get_error_messages(); switch (count($errors)) { case 0: $message = ''; break; case 1: $message = "<p>{$errors[0]}</p>"; break; default: $message = "<ul>\n\t\t<li>" . join("</li>\n\t\t<li>", $errors) . "</li>\n\t</ul>"; break; } } elseif (is_string($message)) { $message = bb_autop($message); } if (empty($title)) { $title = __('bbPress › Error'); } bb_install_header($title); ?> <?php echo $message; if ($uri = bb_get_uri()) { ?> <p class="last"><?php printf(__('Back to <a href="%s">%s</a>.'), $uri, bb_get_option('name')); ?> </p> <?php } bb_install_footer(); die; }
$upgrade_log = array_merge($upgrade_log, $messages['messages']); } $upgrade_log[] = '>>> ' . __('Done'); $error_log = array(); if (is_array($messages['errors'])) { $error_log = $messages['errors']; } if (bb_get_option('bb_db_version') === bb_get_option_from_db('bb_db_version') && !count($error_log)) { $step = 'complete'; } else { $step = 'error'; } nxt_cache_flush(); } } bb_install_header(__('bbPress database upgrade'), false, true); ?> <script type="text/javascript" charset="utf-8"> function toggleAdvanced(toggle, target) { var toggleObj = document.getElementById(toggle); var targetObj = document.getElementById(target); if (toggleObj.checked) { targetObj.style.display = 'block'; } else { targetObj.style.display = 'none'; } } </script> <?php switch ($step) { case 'unrequired':
/** * Sends HTTP headers and prints the page header. * * @return void **/ function header() { nocache_headers(); bb_install_header($this->strings[$this->step]['title'], $this->strings[$this->step]['h1'], true); }