当前位置: 首页>>代码示例>>PHP>>正文


PHP adm_page_footer函数代码示例

本文整理汇总了PHP中adm_page_footer函数的典型用法代码示例。如果您正苦于以下问题:PHP adm_page_footer函数的具体用法?PHP adm_page_footer怎么用?PHP adm_page_footer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了adm_page_footer函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: adm_page_confirm

function adm_page_confirm($title, $message)
{
    global $_CLASS;
    // Grab data from GET and POST arrays ... note this is _not_
    // validated! Everything is typed as string to ensure no
    // funny business on displayed hidden field data. Validation
    // will be carried out by whatever processes this form.
    $var_ary = array_merge($_GET, $_POST);
    $s_hidden_fields = '';
    foreach ($var_ary as $key => $var) {
        if (empty($var)) {
            continue;
        }
        if (is_array($var)) {
            foreach ($var as $k => $v) {
                if (is_array($v)) {
                    foreach ($v as $_k => $_v) {
                        set_var($var[$k][$_k], $_v, 'string');
                        $s_hidden_fields .= "<input type=\"hidden\" name=\"{$key}[{$k}][{$_k}]\" value=\"" . addslashes($_v) . '" />';
                    }
                } else {
                    set_var($var[$k], $v, 'string');
                    $s_hidden_fields .= "<input type=\"hidden\" name=\"{$key}[{$k}]\" value=\"" . addslashes($v) . '" />';
                }
            }
        } else {
            set_var($var, $var, 'string');
            $s_hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . addslashes($var) . '" />';
        }
        unset($var_ary[$key]);
    }
    ?>

<br /><br />

<form name="confirm" method="post" action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
">
<table class="tablebg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
	<tr>
		<th><?php 
    echo $title;
    ?>
</th>
	</tr>
	<tr>
		<td class="row1" align="center"><?php 
    echo $message;
    ?>
<br /><br /><input class="btnlite" type="submit" name="confirm" value="<?php 
    echo $_CLASS['core_user']->lang['YES'];
    ?>
" />&nbsp;&nbsp;<input class="btnmain" type="submit" name="cancel" value="<?php 
    echo $_CLASS['core_user']->lang['NO'];
    ?>
" /></td>
	</tr>
</table>

<?php 
    echo $s_hidden_fields;
    ?>
</form>

<br />

<?php 
    adm_page_footer();
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:70,代码来源:index.php

示例2: msg_handler


//.........这里部分代码省略.........
                $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
                $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
                echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
            }
            return;
            break;
        case E_USER_ERROR:
            if (!empty($user) && !empty($user->lang)) {
                $msg_text = !empty($user->lang[$msg_text]) ? $user->lang[$msg_text] : $msg_text;
                $msg_title = !isset($msg_title) ? $user->lang['GENERAL_ERROR'] : (!empty($user->lang[$msg_title]) ? $user->lang[$msg_title] : $msg_title);
                $l_return_index = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $phpbb_root_path . '">', '</a>');
                $l_notify = '';
                if (!empty($config['board_contact'])) {
                    $l_notify = '<p>' . sprintf($user->lang['NOTIFY_ADMIN_EMAIL'], $config['board_contact']) . '</p>';
                }
            } else {
                $msg_title = 'General Error';
                $l_return_index = '<a href="' . $phpbb_root_path . '">Return to index page</a>';
                $l_notify = '';
                if (!empty($config['board_contact'])) {
                    $l_notify = '<p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
                }
            }
            garbage_collection();
            // Try to not call the adm page data...
            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
            echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
            echo '<head>';
            echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
            echo '<title>' . $msg_title . '</title>';
            echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
            echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
            echo 'a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } ';
            echo '#wrap { padding: 0 20px 15px 20px; min-width: 615px; } #page-header { text-align: right; height: 40px; } #page-footer { clear: both; font-size: 1em; text-align: center; } ';
            echo '.panel { margin: 4px 0; background-color: #FFFFFF; border: solid 1px  #A9B8C2; } ';
            echo '#errorpage #page-header a { font-weight: bold; line-height: 6em; } #errorpage #content { padding: 10px; } #errorpage #content h1 { line-height: 1.2em; margin-bottom: 0; color: #DF075C; } ';
            echo '#errorpage #content div { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; } ';
            echo "\n" . '/* ]]> */' . "\n";
            echo '</style>';
            echo '</head>';
            echo '<body id="errorpage">';
            echo '<div id="wrap">';
            echo '	<div id="page-header">';
            echo '		' . $l_return_index;
            echo '	</div>';
            echo '	<div id="acp">';
            echo '	<div class="panel">';
            echo '		<div id="content">';
            echo '			<h1>' . $msg_title . '</h1>';
            echo '			<div>' . $msg_text . '</div>';
            echo $l_notify;
            echo '		</div>';
            echo '	</div>';
            echo '	</div>';
            echo '	<div id="page-footer">';
            echo '		Powered by phpBB &copy; 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>';
            echo '	</div>';
            echo '</div>';
            echo '</body>';
            echo '</html>';
            exit_handler();
            // On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
            exit;
            break;
        case E_USER_WARNING:
        case E_USER_NOTICE:
            define('IN_ERROR_HANDLER', true);
            if (empty($user->data)) {
                $user->session_begin();
            }
            // We re-init the auth array to get correct results on login/logout
            $auth->acl($user->data);
            if (empty($user->lang)) {
                $user->setup();
            }
            $msg_text = !empty($user->lang[$msg_text]) ? $user->lang[$msg_text] : $msg_text;
            $msg_title = !isset($msg_title) ? $user->lang['INFORMATION'] : (!empty($user->lang[$msg_title]) ? $user->lang[$msg_title] : $msg_title);
            if (!defined('HEADER_INC')) {
                if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                    adm_page_header($msg_title);
                } else {
                    page_header($msg_title);
                }
            }
            $template->set_filenames(array('body' => 'message_body.html'));
            $template->assign_vars(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text, 'S_USER_WARNING' => $errno == E_USER_WARNING ? true : false, 'S_USER_NOTICE' => $errno == E_USER_NOTICE ? true : false));
            // We do not want the cron script to be called on error messages
            define('IN_CRON', true);
            if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                adm_page_footer();
            } else {
                page_footer();
            }
            exit_handler();
            break;
    }
    // If we notice an error not handled here we pass this back to PHP by returning false
    // This may not work for all php versions
    return false;
}
开发者ID:Phatboy82,项目名称:phpbbgarage,代码行数:101,代码来源:functions.php

示例3: template_cache

    /**
     * Allows the admin to view cached versions of template files and clear single template cache files
     *
     * @param int $template_id specifies which template's cache is shown
     */
    function template_cache($template_id)
    {
        global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
        $source = str_replace('/', '.', request_var('source', ''));
        $file_ary = array_diff(request_var('delete', array('')), array(''));
        $submit = isset($_POST['submit']) ? true : false;
        $sql = 'SELECT *
			FROM ' . STYLES_TEMPLATE_TABLE . "\n\t\t\tWHERE template_id = {$template_id}";
        $result = $db->sql_query($sql);
        $template_row = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        if (!$template_row) {
            trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
        }
        // User wants to delete one or more files ...
        if ($submit && $file_ary) {
            $this->clear_template_cache($template_row, $file_ary);
            trigger_error($user->lang['TEMPLATE_CACHE_CLEARED'] . adm_back_link($this->u_action . "&amp;action=cache&amp;id={$template_id}"));
        }
        $cache_prefix = 'tpl_' . str_replace('_', '-', $template_row['template_path']);
        // Someone wants to see the cached source ... so we'll highlight it,
        // add line numbers and indent it appropriately. This could be nasty
        // on larger source files ...
        if ($source && file_exists("{$phpbb_root_path}cache/{$cache_prefix}_{$source}.html.{$phpEx}")) {
            adm_page_header($user->lang['TEMPLATE_CACHE']);
            $template->set_filenames(array('body' => 'viewsource.html'));
            $template->assign_vars(array('FILENAME' => str_replace('.', '/', $source) . '.html'));
            $code = str_replace(array("\r\n", "\r"), array("\n", "\n"), file_get_contents("{$phpbb_root_path}cache/{$cache_prefix}_{$source}.html.{$phpEx}"));
            $conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string');
            foreach ($conf as $ini_var) {
                @ini_set($ini_var, str_replace('highlight.', 'syntax', $ini_var));
            }
            $marker = 'MARKER' . time();
            $code = highlight_string(str_replace("\n", $marker, $code), true);
            $code = str_replace($marker, "\n", $code);
            $str_from = array('<span style="color: ', '<font color="syntax', '</font>', '<code>', '</code>', '[', ']', '.', ':');
            $str_to = array('<span class="', '<span class="syntax', '</span>', '', '', '&#91;', '&#93;', '&#46;', '&#58;');
            $code = str_replace($str_from, $str_to, $code);
            $code = preg_replace('#^(<span class="[a-z_]+">)\\n?(.*?)\\n?(</span>)$#ism', '$1$2$3', $code);
            $code = substr($code, strlen('<span class="syntaxhtml">'));
            $code = substr($code, 0, -1 * strlen('</ span>'));
            $code = explode("\n", $code);
            foreach ($code as $key => $line) {
                $template->assign_block_vars('source', array('LINENUM' => $key + 1, 'LINE' => preg_replace('#([^ ;])&nbsp;([^ &])#', '$1 $2', $line)));
                unset($code[$key]);
            }
            adm_page_footer();
        }
        $filemtime = array();
        if ($template_row['template_storedb']) {
            $ids = array();
            if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id']) {
                $ids[] = $template_row['template_inherits_id'];
            }
            $ids[] = $template_row['template_id'];
            $filemtime = array();
            $file_template_db = array();
            foreach ($ids as $id) {
                $sql = 'SELECT template_filename, template_mtime
					FROM ' . STYLES_TEMPLATE_DATA_TABLE . "\n\t\t\t\t\tWHERE template_id = {$id}";
                $result = $db->sql_query($sql);
                while ($row = $db->sql_fetchrow($result)) {
                    $filemtime[$row['template_filename']] = $row['template_mtime'];
                    $file_template_db[$row['template_filename']] = $id;
                }
                $db->sql_freeresult($result);
            }
        }
        // Get a list of cached template files and then retrieve additional information about them
        $file_ary = $this->template_cache_filelist($template_row['template_path']);
        foreach ($file_ary as $file) {
            $file = str_replace('/', '.', $file);
            // perform some dirty guessing to get the path right.
            // We assume that three dots in a row were '../'
            $tpl_file = str_replace('.', '/', $file);
            $tpl_file = str_replace('///', '../', $tpl_file);
            $filename = "{$cache_prefix}_{$file}.html.{$phpEx}";
            if (!file_exists("{$phpbb_root_path}cache/{$filename}")) {
                continue;
            }
            $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_path']}/template/{$tpl_file}.html";
            $inherited = false;
            if (isset($template_row['template_inherits_id']) && $template_row['template_inherits_id']) {
                if (!$template_row['template_storedb']) {
                    if (!file_exists($file_tpl)) {
                        $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_inherit_path']}/template/{$tpl_file}.html";
                        $inherited = true;
                    }
                } else {
                    if ($file_template_db[$file . '.html'] == $template_row['template_inherits_id']) {
                        $file_tpl = "{$phpbb_root_path}styles/{$template_row['template_inherit_path']}/template/{$tpl_file}.html";
                        $inherited = true;
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:101,代码来源:acp_styles.php

示例4: adminlink

        ?>

<h1><?php 
        echo $_CLASS['core_user']->lang['SEARCH_INDEX'];
        ?>
</h1>

<p><?php 
        echo $_CLASS['core_user']->lang['SEARCH_INDEX_EXPLAIN'];
        ?>
</p>

<form method="post" action="<?php 
        echo adminlink('forums&amp;file=admin_search');
        ?>
"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
	<tr>
		<td class="cat" height="28" align="center">&nbsp;<input type="submit" name="start" value="<?php 
        echo $_CLASS['core_user']->lang['START'];
        ?>
" class="btnmain" /> &nbsp; <input type="submit" name="cancel" value="<?php 
        echo $_CLASS['core_user']->lang['CANCEL'];
        ?>
" class="btnmain" />&nbsp;</td>
	</tr>
</table></form>

<?php 
        adm_page_footer();
    }
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:admin_search.php

示例5: display_progress_bar

 function display_progress_bar($type)
 {
     global $template, $user;
     $l_type = $type == 'create' ? 'INDEXING_IN_PROGRESS' : 'DELETING_INDEX_IN_PROGRESS';
     adm_page_header($user->lang[$l_type]);
     $template->set_filenames(array('body' => 'progress_bar.html'));
     $template->assign_vars(array('L_PROGRESS' => $user->lang[$l_type], 'L_PROGRESS_EXPLAIN' => $user->lang[$l_type . '_EXPLAIN']));
     adm_page_footer();
 }
开发者ID:ahmatjan,项目名称:Crimson,代码行数:9,代码来源:acp_search.php

示例6: msg_handler


//.........这里部分代码省略.........
            }
            if ((defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) {
                // let's avoid loops
                $db->sql_return_on_error(true);
                add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text);
                $db->sql_return_on_error(false);
            }
            // Do not send 200 OK, but service unavailable on errors
            send_status_line(503, 'Service Unavailable');
            garbage_collection();
            // Try to not call the adm page data...
            echo '<!DOCTYPE html>';
            echo '<html dir="ltr">';
            echo '<head>';
            echo '<meta charset="utf-8">';
            echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
            echo '<title>' . $msg_title . '</title>';
            echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
            echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
            echo 'a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } ';
            echo '#wrap { padding: 0 20px 15px 20px; min-width: 615px; } #page-header { text-align: right; height: 40px; } #page-footer { clear: both; font-size: 1em; text-align: center; } ';
            echo '.panel { margin: 4px 0; background-color: #FFFFFF; border: solid 1px  #A9B8C2; } ';
            echo '#errorpage #page-header a { font-weight: bold; line-height: 6em; } #errorpage #content { padding: 10px; } #errorpage #content h1 { line-height: 1.2em; margin-bottom: 0; color: #DF075C; } ';
            echo '#errorpage #content div { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; } ';
            echo "\n" . '/* ]]> */' . "\n";
            echo '</style>';
            echo '</head>';
            echo '<body id="errorpage">';
            echo '<div id="wrap">';
            echo '	<div id="page-header">';
            echo '		' . $l_return_index;
            echo '	</div>';
            echo '	<div id="acp">';
            echo '	<div class="panel">';
            echo '		<div id="content">';
            echo '			<h1>' . $msg_title . '</h1>';
            echo '			<div>' . $msg_text . '</div>';
            echo $l_notify;
            echo '		</div>';
            echo '	</div>';
            echo '	</div>';
            echo '	<div id="page-footer">';
            echo '		Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited';
            echo '	</div>';
            echo '</div>';
            echo '</body>';
            echo '</html>';
            exit_handler();
            // On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
            exit;
            break;
        case E_USER_WARNING:
        case E_USER_NOTICE:
            define('IN_ERROR_HANDLER', true);
            if (empty($user->data)) {
                $user->session_begin();
            }
            // We re-init the auth array to get correct results on login/logout
            $auth->acl($user->data);
            if (empty($user->lang)) {
                $user->setup();
            }
            if ($msg_text == 'ERROR_NO_ATTACHMENT' || $msg_text == 'NO_FORUM' || $msg_text == 'NO_TOPIC' || $msg_text == 'NO_USER') {
                send_status_line(404, 'Not Found');
            }
            $msg_text = !empty($user->lang[$msg_text]) ? $user->lang[$msg_text] : $msg_text;
            $msg_title = !isset($msg_title) ? $user->lang['INFORMATION'] : (!empty($user->lang[$msg_title]) ? $user->lang[$msg_title] : $msg_title);
            if (!defined('HEADER_INC')) {
                if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                    adm_page_header($msg_title);
                } else {
                    page_header($msg_title);
                }
            }
            $template->set_filenames(array('body' => 'message_body.html'));
            $template->assign_vars(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text, 'S_USER_WARNING' => $errno == E_USER_WARNING ? true : false, 'S_USER_NOTICE' => $errno == E_USER_NOTICE ? true : false));
            if ($request->is_ajax()) {
                global $refresh_data;
                $json_response = new \phpbb\json_response();
                $json_response->send(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text, 'S_USER_WARNING' => $errno == E_USER_WARNING ? true : false, 'S_USER_NOTICE' => $errno == E_USER_NOTICE ? true : false, 'REFRESH_DATA' => !empty($refresh_data) ? $refresh_data : null));
            }
            // We do not want the cron script to be called on error messages
            define('IN_CRON', true);
            if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                adm_page_footer();
            } else {
                page_footer();
            }
            exit_handler();
            break;
            // PHP4 compatibility
        // PHP4 compatibility
        case E_DEPRECATED:
            return true;
            break;
    }
    // If we notice an error not handled here we pass this back to PHP by returning false
    // This may not work for all php versions
    return false;
}
开发者ID:WarriorMachines,项目名称:warriormachines-phpbb,代码行数:101,代码来源:functions.php

示例7: display_progress_bar

 /**
  * Display progress bar for syncinc forums
  */
 function display_progress_bar($start, $total)
 {
     global $template, $user;
     adm_page_header($user->lang['SYNC_IN_PROGRESS']);
     $template->set_filenames(array('body' => 'progress_bar.html'));
     $template->assign_vars(array('L_PROGRESS' => $user->lang['SYNC_IN_PROGRESS'], 'L_PROGRESS_EXPLAIN' => $start && $total ? sprintf($user->lang['SYNC_IN_PROGRESS_EXPLAIN'], $start, $total) : $user->lang['SYNC_IN_PROGRESS']));
     adm_page_footer();
 }
开发者ID:PetsFundation,项目名称:Pets,代码行数:11,代码来源:acp_forums.php

示例8: display

 /**
  * Display module
  */
 function display($page_title, $display_online_list = false)
 {
     global $template, $user;
     // Generate the page
     if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
         adm_page_header($page_title);
     } else {
         page_header($page_title, $display_online_list);
     }
     $template->set_filenames(array('body' => $this->get_tpl_name()));
     if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
         adm_page_footer();
     } else {
         page_footer();
     }
 }
开发者ID:bruninoit,项目名称:phpbb,代码行数:19,代码来源:functions_module.php

示例9: action_progress_bar

 /**
  * Display progress bar for syncinc categories
  *
  * @return null
  */
 public function action_progress_bar()
 {
     $start = $this->request->variable('start', 0);
     $total = $this->request->variable('total', 0);
     adm_page_header($this->user->lang['SYNC_IN_PROGRESS']);
     $this->template->set_filenames(array('body' => 'progress_bar.html'));
     $this->template->assign_vars(array('L_PROGRESS' => $this->user->lang['SYNC_IN_PROGRESS'], 'L_PROGRESS_EXPLAIN' => $start && $total ? $this->user->lang('SYNC_IN_PROGRESS_EXPLAIN', $start, $total) : $this->user->lang['SYNC_IN_PROGRESS']));
     adm_page_footer();
 }
开发者ID:rmcgirr83,项目名称:ext-phpbb-directory,代码行数:14,代码来源:cat.php

示例10: stk_msg_handler


//.........这里部分代码省略.........
            $backtrace = get_backtrace();
            if ($backtrace) {
                $log_text .= '<br /><br />BACKTRACE<br />' . $backtrace;
            }
            if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') || isset($auth) && $auth->acl_get('a_')) {
                $msg_text = $log_text;
            }
            if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) {
                // let's avoid loops
                $db->sql_return_on_error(true);
                add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text);
                $db->sql_return_on_error(false);
            }
            // Do not send 200 OK, but service unavailable on errors
            stk_send_status_line(503, 'Service Unavailable');
            garbage_collection();
            // Try to not call the adm page data...
            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
            echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '" xml:lang="' . $user->lang['USER_LANG'] . '">';
            echo '<head>';
            echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
            echo '<title>' . $msg_title . '</title>';
            echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
            echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
            echo 'a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } ';
            echo '#wrap { padding: 0 20px 15px 20px; min-width: 615px; } #page-header { text-align: right; height: 40px; } #page-footer { clear: both; font-size: 1em; text-align: center; } ';
            echo '.panel { margin: 4px 0; background-color: #FFFFFF; border: solid 1px  #A9B8C2; } ';
            echo '#errorpage #page-header a { font-weight: bold; line-height: 6em; } #errorpage #content { padding: 10px; } #errorpage #content h1 { line-height: 1.2em; margin-bottom: 0; color: #DF075C; } ';
            echo '#errorpage #content div { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; } ';
            echo "\n" . '/* ]]> */' . "\n";
            echo '</style>';
            echo '</head>';
            echo '<body id="errorpage">';
            echo '<div id="wrap">';
            echo '	<div id="page-header">';
            echo '		' . $l_return_index;
            echo '	</div>';
            echo '	<div id="acp">';
            echo '	<div class="panel">';
            echo '		<div id="content">';
            echo '			<h1>' . $msg_title . '</h1>';
            echo '			<div>' . $msg_text . '</div>';
            echo $l_notify;
            echo '		</div>';
            echo '	</div>';
            echo '	</div>';
            echo '	<div id="page-footer">';
            echo '		Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group';
            echo '	</div>';
            echo '</div>';
            echo '</body>';
            echo '</html>';
            exit_handler();
            // On a fatal error (and E_USER_ERROR *is* fatal) we never want other scripts to continue and force an exit here.
            exit;
            break;
        case E_USER_WARNING:
        case E_USER_NOTICE:
            define('IN_ERROR_HANDLER', true);
            if (empty($user->data)) {
                $user->session_begin();
            }
            // We re-init the auth array to get correct results on login/logout
            $auth->acl($user->data);
            if (empty($user->lang)) {
                $user->setup();
            }
            if ($msg_text == 'ERROR_NO_ATTACHMENT' || $msg_text == 'NO_FORUM' || $msg_text == 'NO_TOPIC' || $msg_text == 'NO_USER') {
                stk_send_status_line(404, 'Not Found');
            }
            $msg_text = !empty($user->lang[$msg_text]) ? $user->lang[$msg_text] : $msg_text;
            $msg_title = !isset($msg_title) ? $user->lang['INFORMATION'] : (!empty($user->lang[$msg_title]) ? $user->lang[$msg_title] : $msg_title);
            if (!defined('HEADER_INC')) {
                if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                    adm_page_header($msg_title);
                } else {
                    page_header($msg_title, false);
                }
            }
            $template->set_filenames(array('body' => 'message_body.html'));
            $template->assign_vars(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text, 'S_USER_WARNING' => $errno == E_USER_WARNING ? true : false, 'S_USER_NOTICE' => $errno == E_USER_NOTICE ? true : false));
            // We do not want the cron script to be called on error messages
            define('IN_CRON', true);
            if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                adm_page_footer();
            } else {
                page_footer();
            }
            exit_handler();
            break;
            // PHP4 compatibility
        // PHP4 compatibility
        case E_DEPRECATED:
            return true;
            break;
    }
    // If we notice an error not handled here we pass this back to PHP by returning false
    // This may not work for all php versions
    return false;
}
开发者ID:melvingb,项目名称:phpbb3.1-STK,代码行数:101,代码来源:functions.php

示例11: msg_handler

/**
* Error and message handler, call with trigger_error if reqd
*/
function msg_handler($errno, $msg_text, $errfile, $errline)
{
    global $cache, $db, $auth, $template, $config, $user;
    global $phpEx, $phpbb_root_path, $starttime, $msg_title, $msg_long_text;
    // Message handler is stripping text. In case we need it, we are possible to define long text...
    if (isset($msg_long_text) && $msg_long_text && !$msg_text) {
        $msg_text = $msg_long_text;
    }
    switch ($errno) {
        case E_NOTICE:
        case E_WARNING:
            // Check the error reporting level and return if the error level does not match
            // Additionally do not display notices if we suppress them via @
            // If DEBUG_EXTRA is defined the default level is E_ALL
            if (($errno & (defined('DEBUG_EXTRA') && error_reporting() ? E_ALL : error_reporting())) == 0) {
                return;
            }
            /**
             * @todo Think about removing the if-condition within the final product, since we no longer enable DEBUG by default and we will maybe adjust the error reporting level
             */
            if (defined('DEBUG')) {
                if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) {
                    // remove complete path to installation, with the risk of changing backslashes meant to be there
                    $errfile = str_replace(array(realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
                    $msg_text = str_replace(array(realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
                    echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
                }
            }
            break;
        case E_USER_ERROR:
            if (isset($db)) {
                $db->sql_close();
            }
            if (isset($cache)) {
                $cache->unload();
            }
            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
            echo '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">';
            echo '<head>';
            echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />';
            echo '<title>' . $msg_title . '</title>';
            echo '<link href="' . $phpbb_root_path . 'adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />';
            echo '</head>';
            echo '<body id="errorpage">';
            echo '<div id="wrap">';
            echo '	<div id="page-header">';
            echo '		<a href="' . $phpbb_root_path . '">Return to forum index</a>';
            echo '	</div>';
            echo '	<div id="page-body">';
            echo '		<div class="panel">';
            echo '			<span class="corners-top"><span></span></span>';
            echo '			<div id="content">';
            echo '				<h1>General Error</h1>';
            echo '				<h2>' . $msg_text . '</h2>';
            if (!empty($config['board_contact'])) {
                echo '				<p>Please notify the board administrator or webmaster : <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
            }
            echo '			</div>';
            echo '			<span class="corners-bottom"><span></span></span>';
            echo '		</div>';
            echo '	</div>';
            echo '	<div id="page-footer">';
            echo '		Powered by phpBB &copy; ' . date('Y') . ' <a href="http://www.phpbb.com/">phpBB Group</a>';
            echo '	</div>';
            echo '</div>';
            echo '</body>';
            echo '</html>';
            exit;
            break;
        case E_USER_WARNING:
        case E_USER_NOTICE:
            define('IN_ERROR_HANDLER', true);
            if (empty($user->data)) {
                $user->session_begin();
            }
            // We re-init the auth array to get correct results on login/logout
            $auth->acl($user->data);
            if (empty($user->lang)) {
                $user->setup();
            }
            $msg_text = !empty($user->lang[$msg_text]) ? $user->lang[$msg_text] : $msg_text;
            $msg_title = !isset($msg_title) ? $user->lang['INFORMATION'] : (!empty($user->lang[$msg_title]) ? $user->lang[$msg_title] : $msg_title);
            if (!defined('HEADER_INC')) {
                if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                    adm_page_header($msg_title);
                } else {
                    page_header($msg_title);
                }
            }
            $template->set_filenames(array('body' => 'message_body.html'));
            $template->assign_vars(array('MESSAGE_TITLE' => $msg_title, 'MESSAGE_TEXT' => $msg_text));
            // We do not want the cron script to be called on error messages
            define('IN_CRON', true);
            if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) {
                adm_page_footer();
            } else {
                page_footer();
//.........这里部分代码省略.........
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:functions.php


注:本文中的adm_page_footer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。