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


PHP display_error_page函数代码示例

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


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

示例1: display_error_page

             Logging::close_log();
             display_error_page($smarty, new UploadNoTmpDirError());
             exit(1);
             break;
         case UPLOAD_ERR_CANT_WRITE:
             // Cleanup
             DataExchange::releaseResources();
             Logging::close_log();
             display_error_page($smarty, new UploadCantWriteError());
             exit(1);
             break;
         case UPLOAD_ERR_EXTENSION:
             // Cleanup
             DataExchange::releaseResources();
             Logging::close_log();
             display_error_page($smarty, new UploadExtensionError());
             exit(1);
             break;
     }
     $list = split("\n", file_get_contents($_FILES['file']['tmp_name']));
     foreach ($list as $range) {
         if ($range) {
             list($range_beg, $range_end) = split(' ', $range);
             // Ban for a month.
             $reason = 'Mass ban utility';
             $until = date(Config::DATETIME_FORMAT, time() + 60 * 60 * 24 * 30);
             bans_add(ip2long($range_beg), ip2long($range_end), $reason, $until);
             call_user_func(Logging::$f['MASS_BAN_ADD'], $range_beg, $range_end, $reason, $until);
         }
     }
 }
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:mass_ban.php

示例2: SmartyKotobaSetup

 $smarty = new SmartyKotobaSetup();
 // Check if client banned.
 if (($ban = bans_check(get_remote_addr())) !== FALSE) {
     // Cleanup.
     DataExchange::releaseResources();
     $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
     $smarty->assign('reason', $ban['reason']);
     $smarty->display('banned.tpl');
     session_destroy();
     exit(1);
 }
 // Check permission and write message to log file.
 if (!is_admin()) {
     // Cleanup.
     DataExchange::releaseResources();
     display_error_page($smarty, new NotAdminError());
     exit(1);
 }
 call_user_func(Logging::$f['EDIT_USER_GROUPS_USE']);
 $groups = groups_get_all();
 $users = users_get_all();
 $user_groups = user_groups_get_all();
 $reload_user_groups = false;
 // Add new relation.
 if (isset($_POST['new_bind_user']) && isset($_POST['new_bind_group']) && $_POST['new_bind_user'] != '' && $_POST['new_bind_group'] != '') {
     $new_bind_user = users_check_id($_POST['new_bind_user']);
     $new_bind_group = groups_check_id($_POST['new_bind_group']);
     user_groups_add($new_bind_user, $new_bind_group);
     $reload_user_groups = true;
 }
 // Change relation.
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:edit_user_groups.php

示例3: session_start

<?php

session_start();
require_once "config.php";
$smarty = new Smarty();
$smarty->compile_check = true;
require_once "dvd-db.php";
require_once "dvd-util.php";
try {
    $all_dvds = get_all("dvd");
    $dvd_list = array();
    foreach ($all_dvds as $dvd) {
        array_push($dvd_list, $dvd['title']);
    }
    $smarty->assign("dvd_list", $dvd_list);
    $smarty->assign("heading", "All DVDs in the Library");
} catch (DbException $dbe) {
    display_error_page($smarty, "An error ocurred while feching the list of DVDs: {$dbe->getMessage()}");
}
$smarty->display("list_dvds.tpl");
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:20,代码来源:list_all.php

示例4: search_dvd

    } else {
        $part_title = $_GET['part_title'];
        $logger->debug("part title came from GET");
    }
    $logger->debug("Part title is {$part_title}");
    $dvds = search_dvd($part_title);
    if (sizeof($dvds) > 0) {
        if (sizeof($dvds) == 1) {
            $dvd = $dvds[0];
            $smarty->assign("title", $dvd['title']);
            $smarty->assign("release", $dvd['release_year']);
            $smarty->assign("director", $dvd['director']);
            $smarty->assign("rating", $dvd['rating']);
            $smarty->assign("genre", $dvd['genre']);
            $smarty->display("view_dvd_single.tpl");
            exit;
        } else {
            $dvd_list = array();
            foreach ($dvds as $dvd) {
                array_push($dvd_list, $dvd['title']);
            }
            $smarty->assign("dvd_list", $dvd_list);
            $smarty->assign("heading", "Possible Matches");
            $smarty->display("list_dvds.tpl");
        }
    } else {
        display_error_page($smarty, "No matches were found for {$part_title}");
    }
} catch (DbException $dbe) {
    display_error_page($smarty, "An error ocurred while fetching matching DVDs: {$dbe->getMessage()}");
}
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:31,代码来源:view_dvd.php

示例5: display_error_page

 if ($board == NULL) {
     // Cleanup.
     DataExchange::releaseResources();
     display_error_page($smarty, new BoardNotFoundError($board_name));
     exit(1);
 }
 $threads_count = threads_get_visible_count($_SESSION['user'], $board['id']);
 $page_max = ceil($threads_count / $_SESSION['threads_per_page']);
 if ($page_max == 0) {
     $page_max = 1;
     // Important for empty boards.
 }
 if ($page > $page_max) {
     // Cleanup.
     DataExchange::releaseResources();
     display_error_page($smarty, new MaxPageError($page));
     exit(1);
 }
 $threads = threads_get_visible_by_page($_SESSION['user'], $board['id'], $page, $_SESSION['threads_per_page']);
 $posts = posts_get_visible_by_threads_preview($board['id'], $threads, $_SESSION['user'], $_SESSION['posts_per_thread']);
 $posts_attachments = array();
 $attachments = array();
 if (is_attachments_enabled($board)) {
     $posts_attachments = posts_attachments_get_by_posts($posts);
     $attachments = attachments_get_by_posts($posts);
 }
 $htfilter = function ($hidden_thread, $user) {
     if ($hidden_thread['user'] == $user) {
         return true;
     }
     return false;
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:boards.php

示例6: boards_check_name

    if (isset($_GET['thread']) && $_GET['thread'] != '' && isset($_GET['board']) && $_GET['board'] != '') {
        $board_name = boards_check_name($_GET['board']);
        if ($board_name === FALSE) {
            // Cleanup.
            DataExchange::releaseResources();
            display_error_page($smarty, kotoba_last_error());
            exit(1);
        }
        $thread_original_post = threads_check_original_post($_GET['thread']);
        header('Location: ' . Config::DIR_PATH . "/{$board_name}/{$thread_original_post}/");
    } else {
        if (isset($_GET['board']) && $_GET['board'] != '') {
            $board_name = boards_check_name($_GET['board']);
            if ($board_name === FALSE) {
                // Cleanup.
                DataExchange::releaseResources();
                display_error_page($smarty, kotoba_last_error());
                exit(1);
            }
            header('Location: ' . Config::DIR_PATH . "/{$board_name}/");
        }
    }
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.
    DataExchange::releaseResources();
    display_exception_page($smarty, $e, is_admin() || is_mod());
    exit(1);
}
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:shi_exit.php

示例7: preg_replace_callback

            $replace = $m[1] . "=" . $m[2] . "./" . $actualDepth . $m[3];
            return $replace;
        }
    }
    return preg_replace_callback("{$findHTMLTags}", "replaceHTMLTags", $output);
}
add_handler("replaceDir");
$locale = fusion_get_locale("", LOCALE . LOCALESET . "error.php");
$data = array("title" => $locale['errunk'], "image" => IMAGES . "unknown.png");
if (isset($_GET['code'])) {
    switch ($_GET['code']) {
        case 401:
            header("HTTP/1.1 401 Unauthorized");
            $data = array("title" => $locale['err401'], "image" => IMAGES . "error/401.png");
            break;
        case 403:
            header("HTTP/1.1 403 Forbidden");
            $data = array("title" => $locale['err403'], "image" => IMAGES . "error/403.png");
            break;
        case 404:
            header("HTTP/1.1 404 Not Found");
            $data = array("title" => $locale['err404'], "image" => IMAGES . "error/404.png");
            break;
        case 500:
            header("HTTP/1.1 500 Internal Server Error");
            $data = array("title" => $locale['err500'], "image" => IMAGES . "error/500.png");
            break;
    }
}
display_error_page($data);
require_once THEMES . "templates/footer.php";
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:error.php

示例8: get_dvds_for_genre

    try {
        $genre_found = $_GET['genre'];
        $dvds = get_dvds_for_genre($genre_found);
        if (sizeof($dvds) > 0) {
            if (sizeof($dvds) == 1) {
                $dvd = $dvds[0];
                $smarty->assign("title", $dvd['title']);
                $smarty->assign("release", $dvd['release_year']);
                $smarty->assign("director", $dvd['director']);
                $smarty->assign("rating", $dvd['rating']);
                $smarty->assign("genre", $dvd['genre']);
                $smarty->display("view_dvd_single.tpl");
                exit;
            } else {
                $dvd_list = array();
                foreach ($dvds as $dvd) {
                    array_push($dvd_list, $dvd['title']);
                }
                $smarty->assign("dvd_list", $dvd_list);
                $smarty->assign("heading", "Possible Matches");
                $smarty->display("list_dvds.tpl");
                exit;
            }
        } else {
            display_error_page($smarty, "No matches were found for {$genre_found}");
        }
    } catch (DbException $dbe) {
        display_error_page($smarty, "An error ocurred while feching the dvds for {$genre_found}: {$dbe->getMessage()}");
        exit(0);
    }
}
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:31,代码来源:genres.php

示例9: SmartyKotobaSetup

 $smarty = new SmartyKotobaSetup();
 // Check if client banned.
 if (($ban = bans_check(get_remote_addr())) !== FALSE) {
     // Cleanup.
     DataExchange::releaseResources();
     $smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
     $smarty->assign('reason', $ban['reason']);
     $smarty->display('banned.tpl');
     session_destroy();
     exit(1);
 }
 // Check permission and write message to log file.
 if (!is_admin() && !is_mod()) {
     // Cleanup.
     DataExchange::releaseResources();
     display_error_page($smarty, new NotModError());
     exit(1);
 }
 call_user_func(Logging::$f['MANAGE_USE']);
 // Get boards and categories and make tree for navbar.
 $categories = categories_get_all();
 $boards = boards_get_visible($_SESSION['user']);
 make_category_boards_tree($categories, $boards);
 // Create html-code of manage page and display it.
 $smarty->assign('show_control', is_admin() || is_mod());
 $smarty->assign('categories', $categories);
 $smarty->assign('boards', $boards);
 if (is_mod()) {
     $smarty->assign('mod_panel', true);
 } elseif (is_admin()) {
     $smarty->assign('adm_panel', true);
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:manage.php

示例10: switch

     switch (Config::CAPTCHA) {
         case 'captcha':
             if (is_captcha_valid()) {
                 $captcha_request = FALSE;
             }
             break;
         case 'animaptcha':
             if (is_animaptcha_valid()) {
                 $captcha_request = FALSE;
             }
             break;
         default:
             // Cleanup.
             DataExchange::releaseResources();
             $_ = 'Unknown captcha type';
             display_error_page($smarty, new CaptchaError($_));
             exit(1);
             break;
     }
 }
 if ($captcha_request) {
     // Show captcha request.
     $smarty->assign('show_control', is_admin() || is_mod());
     $smarty->assign('boards', boards_get_visible($_SESSION['user']));
     $smarty->assign('id', $post['id']);
     $smarty->assign('enable_captcha', TRUE);
     $smarty->assign('captcha', Config::CAPTCHA);
     $smarty->display('report.tpl');
 } else {
     reports_add($post['id']);
     // Redirection.
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:report.php

示例11: session_destroy

        $smarty->display('banned.tpl');
        session_destroy();
        exit(1);
    }
    // Guests cannot hide threads.
    if (is_guest()) {
        // Cleanup.
        DataExchange::releaseResources();
        display_error_page($smarty, new GuestError());
        exit(1);
    }
    // Check thread id and get thread.
    $thread_id = threads_check_id($_REQUEST['thread']);
    if (($thread = threads_get_by_id($thread_id)) === NULL) {
        // Cleanup.
        DataExchange::releaseResources();
        display_error_page($smarty, new ThreadNotFoundIdError($thread_id));
        exit(0);
    }
    hidden_threads_delete($thread['id'], $_SESSION['user']);
    // Redirect back to board.
    header('Location: ' . Config::DIR_PATH . "/{$thread['board']['name']}/");
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.
    DataExchange::releaseResources();
    display_exception_page($smarty, $e, is_admin() || is_mod());
    exit(1);
}
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:unhide_thread.php

示例12: display_error_page

 if (count(array_filter($_, 'is_null')) != 2) {
     // Cleanup.
     DataExchange::releaseResources();
     Logging::close_log();
     display_error_page($smarty, new ACLRuleExcessError());
     exit(1);
 }
 /*
  * If view denied then change and moderate has no sense. If change
  * denyed then moderate has no sense.
  */
 if ($new_view == 0 && ($new_change != 0 || $new_moderate != 0) || $new_change == 0 && $new_moderate != 0) {
     // Cleanup.
     DataExchange::releaseResources();
     Logging::close_log();
     display_error_page($smarty, new ACLRuleConflictError());
     exit(1);
 }
 // Take a look if we already have that rule.
 $found = false;
 foreach ($acl as $record) {
     if (($record['group'] === null && $new_group === null || $record['group'] == $new_group) && ($record['board'] === null && $new_board === null || $record['board'] == $new_board) && ($record['thread'] === null && $new_thread === null || $record['thread'] == $new_thread) && ($record['post'] === null && $new_post === null || $record['post'] == $new_post)) {
         acl_edit($new_group, $new_board, $new_thread, $new_post, $new_view, $new_change, $new_moderate);
         $reload_acl = true;
         $found = true;
     }
 }
 if (!$found) {
     acl_add($new_group, $new_board, $new_thread, $new_post, $new_view, $new_change, $new_moderate);
     $reload_acl = true;
 }
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:edit_acl.php

示例13: exit

     exit(1);
 }
 // Check for requied parameters.
 foreach (array('action') as $param) {
     if (!isset($_REQUEST[$param])) {
         // Cleanup.
         DataExchange::releaseResources();
         display_error_page($smarty, new RequiedParamError($param));
         exit(1);
     }
 }
 // Guests cannot have favorites.
 if (is_guest()) {
     // Cleanup.
     DataExchange::releaseResources();
     display_error_page($smarty, new GuestError());
     exit(1);
 }
 // Perform action.
 $action = $_REQUEST['action'];
 $thread = isset($_REQUEST['thread']) ? $_REQUEST['thread'] : NULL;
 switch ($action) {
     case 'add':
         favorites_add($_SESSION['user'], threads_check_id($thread));
         break;
     case 'delete':
         favorites_delete($_SESSION['user'], threads_check_id($thread));
         break;
     case 'mark_readed':
         favorites_mark_readed($_SESSION['user'], threads_check_id($thread));
         break;
开发者ID:jellycucmber,项目名称:kotoba-ib,代码行数:31,代码来源:favorites.php


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