| 1 | <?php |
|---|
| 2 | // $Id: module.errorhandler.php,v 1.4 2005/08/03 12:39:11 onokazu Exp $ |
|---|
| 3 | // ------------------------------------------------------------------------ // |
|---|
| 4 | // XOOPS - PHP Content Management System // |
|---|
| 5 | // Copyright (c) 2000 XOOPS.org // |
|---|
| 6 | // <http://www.xoops.org/> // |
|---|
| 7 | // ------------------------------------------------------------------------ // |
|---|
| 8 | // This program is free software; you can redistribute it and/or modify // |
|---|
| 9 | // it under the terms of the GNU General Public License as published by // |
|---|
| 10 | // the Free Software Foundation; either version 2 of the License, or // |
|---|
| 11 | // (at your option) any later version. // |
|---|
| 12 | // // |
|---|
| 13 | // You may not change or alter any portion of this comment or credits // |
|---|
| 14 | // of supporting developers from this source code or any supporting // |
|---|
| 15 | // source code which is considered copyrighted (c) material of the // |
|---|
| 16 | // original comment or credit authors. // |
|---|
| 17 | // // |
|---|
| 18 | // This program is distributed in the hope that it will be useful, // |
|---|
| 19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|---|
| 20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|---|
| 21 | // GNU General Public License for more details. // |
|---|
| 22 | // // |
|---|
| 23 | // You should have received a copy of the GNU General Public License // |
|---|
| 24 | // along with this program; if not, write to the Free Software // |
|---|
| 25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|---|
| 26 | // ------------------------------------------------------------------------ // |
|---|
| 27 | // Author of File: Goghs (http://www.eqiao.com/) // |
|---|
| 28 | ################################################################################ |
|---|
| 29 | |
|---|
| 30 | if ( !defined("XOOPS_C_ERRORHANDLER_INCLUDED") ) { |
|---|
| 31 | define("XOOPS_C_ERRORHANDLER_INCLUDED",1); |
|---|
| 32 | |
|---|
| 33 | /** |
|---|
| 34 | * Error Handler class |
|---|
| 35 | * |
|---|
| 36 | * @package kernel |
|---|
| 37 | * @subpackage core |
|---|
| 38 | * |
|---|
| 39 | * @author Goghs (http://www.eqiao.com/) |
|---|
| 40 | * @copyright (c) 2000-2003 The Xoops Project - www.xoops.org |
|---|
| 41 | */ |
|---|
| 42 | class ErrorHandler |
|---|
| 43 | { |
|---|
| 44 | /** |
|---|
| 45 | * Show an error message |
|---|
| 46 | * |
|---|
| 47 | * @param string $e_code Errorcode |
|---|
| 48 | * @param integer $pages How many pages should the link take you back? |
|---|
| 49 | * |
|---|
| 50 | * @global $xoopsConfig |
|---|
| 51 | **/ |
|---|
| 52 | function show($e_code, $pages=1) |
|---|
| 53 | { |
|---|
| 54 | global $xoopsConfig, $xoopsUser, $xoopsRequestUri, $xoopsModule, $xoopsLogger; |
|---|
| 55 | $errmsg = array( |
|---|
| 56 | "0001" =>"Could not connect to the forums database.", |
|---|
| 57 | "0002" => "The forum you selected does not exist. Please go back and try again.", |
|---|
| 58 | "0003" => "Password Incorrect.", |
|---|
| 59 | "0004" => "Could not query the topics database.", |
|---|
| 60 | "0005" => "Error getting messages from the database.", |
|---|
| 61 | "0006" => "Please enter the Nickname and the Password.", |
|---|
| 62 | "0007" => "You are not the Moderator of this forum therefore you can't perform this function.", |
|---|
| 63 | "0008" => "You did not enter the correct password, please go back and try again.", |
|---|
| 64 | "0009" => "Could not remove posts from the database.", |
|---|
| 65 | "0010" => "Could not move selected topic to selected forum. Please go back and try again.", |
|---|
| 66 | "0011" => "Could not lock the selected topic. Please go back and try again.", |
|---|
| 67 | "0012" => "Could not unlock the selected topic. Please go back and try again.", |
|---|
| 68 | "0013" => "Could not query the database. <br />Error: ".mysql_error()."", |
|---|
| 69 | "0014" => "No such user or post in the database.", |
|---|
| 70 | "0015" => "Search Engine was unable to query the forums database.", |
|---|
| 71 | "0016" => "That user does not exist. Please go back and search again.", |
|---|
| 72 | "0017" => "You must type a subject to post. You can't post an empty subject. Go back and enter the subject", |
|---|
| 73 | "0018" => "You must choose message icon to post. Go back and choose message icon.", |
|---|
| 74 | "0019" => "You must type a message to post. You can't post an empty message. Go back and enter a message.", |
|---|
| 75 | "0020" => "Could not enter data into the database. Please go back and try again.", |
|---|
| 76 | "0021" => "Can't delete the selected message.", |
|---|
| 77 | "0022" => "An error ocurred while querying the database.", |
|---|
| 78 | "0023" => "Selected message was not found in the forum database.", |
|---|
| 79 | "0024" => "You can't reply to that message. It wasn't sent to you.", |
|---|
| 80 | "0025" => "You can't post a reply to this topic, it has been locked. Contact the administrator if you have any question.", |
|---|
| 81 | "0026" => "The forum or topic you are attempting to post to does not exist. Please try again.", |
|---|
| 82 | "0027" => "You must enter your username and password. Go back and do so.", |
|---|
| 83 | "0028" => "You have entered an incorrect password. Go back and try again.", |
|---|
| 84 | "0029" => "Couldn't update post count.", |
|---|
| 85 | "0030" => "The forum you are attempting to post to does not exist. Please try again.", |
|---|
| 86 | "0031" => "Unknown Error", |
|---|
| 87 | "0035" => "You can't edit a post that's not yours.", |
|---|
| 88 | "0036" => "You do not have permission to edit this post.", |
|---|
| 89 | "0037" => "You did not supply the correct password or do not have permission to edit this post. Please go back and try again.", |
|---|
| 90 | "1001" => "Please enter value for Title.", |
|---|
| 91 | "1002" => "Please enter value for Phone.", |
|---|
| 92 | "1003" => "Please enter value for Summary.", |
|---|
| 93 | "1004" => "Please enter value for Address.", |
|---|
| 94 | "1005" => "Please enter value for City.", |
|---|
| 95 | "1006" => "Please enter value for State/Province.", |
|---|
| 96 | "1007" => "Please enter value for Zipcode.", |
|---|
| 97 | "1008" => "Please enter value for Description.", |
|---|
| 98 | "1009" => "Vote for the selected resource only once.<br />All votes are logged and reviewed.", |
|---|
| 99 | "1010" => "You cannot vote on the resource you submitted.<br />All votes are logged and reviewed.", |
|---|
| 100 | "1011" => "No rating selected - no vote tallied.", |
|---|
| 101 | "1013" => "Please enter a search query.", |
|---|
| 102 | "1016" => "Please enter value for URL.", |
|---|
| 103 | "1017" => "Please enter value for Home Page.", |
|---|
| 104 | "9999" => "OOPS! God Knows" |
|---|
| 105 | ); |
|---|
| 106 | |
|---|
| 107 | $errorno = array_keys($errmsg); |
|---|
| 108 | if (!in_array($e_code, $errorno)) { |
|---|
| 109 | $e_code = '9999'; |
|---|
| 110 | } |
|---|
| 111 | include_once XOOPS_ROOT_PATH."/header.php"; |
|---|
| 112 | //OpenTable(); |
|---|
| 113 | echo "<div><b>".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)." Error</b><br /><br />"; |
|---|
| 114 | echo "Error Code: $e_code<br /><br /><br />"; |
|---|
| 115 | echo "<b>ERROR:</b> $errmsg[$e_code]<br /><br /><br />"; |
|---|
| 116 | echo "[ <a href='javascript:history.go(-".$pages.")'>Go Back</a> ]</div>"; |
|---|
| 117 | //CloseTable(); |
|---|
| 118 | include_once XOOPS_ROOT_PATH."/footer.php"; |
|---|
| 119 | exit(); |
|---|
| 120 | } |
|---|
| 121 | } |
|---|
| 122 | } |
|---|
| 123 | ?> |
|---|