<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: module.errorhandler.php,v 1.4.2.2 2004/04/18 12:45:43 ajvwaay Exp $




class ErrorHandler {
    function show($e_code, $pages=1) {
        global $sitename, $header, $footer,$phpEx;
        $errmsg = array(
            "0001" =>"".translate("Could not connect to the forums database.")."",
            "0002" => "".translate("The forum you selected does not exist. Please go back and try again.")."",
            "0003" => "".translate("Password Incorrect.")."",
            "0004" => "".translate("Could not query the topics database.")."",
            "0005" => "".translate("Error getting messages from the database.")."",
            "0006" => "".translate("Please enter the Nickname and the Password.")."",
            "0007" => "".translate("You are not the Moderator of this forum therefore you can't perform this function.")."",
            "0008" => "".translate("You did not enter the correct password, please go back and try again.")."",
            "0009" => "".translate("Could not remove posts from the database.")."",
            "0010" => "".translate("Could not move selected topic to selected forum. Please go back and try again.")."",
            "0011" => "".translate("Could not lock the selected topic. Please go back and try again.")."",
            "0012" => "".translate("Could not unlock the selected topic. Please go back and try again.")."",
            "0013" => "".translate("Could not query the database. <BR>Error: ").mysql_error()."",
            "0014" => "".translate("No such user or post in the database.")."",
            "0015" => "".translate("Search Engine was unable to query the forums database.")."",
            "0016" => "".translate("That user does not exist. Please go back and search again.")."",
            "0017" => "".translate("You must type a subject to post. You can't post an empty subject. Go back and enter the subject")."",
            "0018" => "".translate("You must choose message icon to post. Go back and choose message icon.")."",
            "0019" => "".translate("You must type a message to post. You can't post an empty message. Go back and enter a message.")."",
            "0020" => "".translate("Could not enter data into the database. Please go back and try again.")."",
            "0021" => "".translate("Can't delete the selected message.")."",
            "0022" => "".translate("An error ocurred while querying the database.")."",
            "0023" => "".translate("Selected message was not found in the forum database.")."",
            "0024" => "".translate("You can't reply to that message. It wasn't sent to you.")."",
            "0025" => "".translate("You can't post a reply to this topic, it has been locked. Contact the administrator if you have any question.")."",
            "0026" => "".translate("The forum or topic you are attempting to post to does not exist. Please try again.")."",
            "0027" => "".translate("You must enter your username and password. Go back and do so.")."",
            "0028" => "".translate("You have entered an incorrect password. Go back and try again.")."",
            "0029" => "".translate("Couldn't update post count.")."",
            "0030" => "".translate("The forum you are attempting to post to does not exist. Please try again.")."",
            "0031" => "".translate("Unknown Error")."",
            "0032" => "".translate("Error doing DB query in check_user_pw()")."",
            "0033" => "".translate("Error doing DB query in get_pmsg_count")."",
            "0034" => "".translate("Error doing DB query in check_username()")."",
            "0035" => "".translate("You can't edit a post that's not yours.")."",
            "0036" => "".translate("You do not have permission to edit this post.")."",
            "0037" => "".translate("You did not supply the correct password or do not have permission to edit this post. Please go back and try again.")."",
            "1001" => "".translate("Please enter value for Title.")."",
            "1002" => "".translate("Please enter value for Phone.")."",
            "1003" => "".translate("Please enter value for Summary.")."",
            "1004" => "".translate("Please enter value for Address.")."",
            "1005" => "".translate("Please enter value for City.")."",
            "1006" => "".translate("Please enter value for State/Province.")."",
            "1007" => "".translate("Please enter value for Zipcode.")."",
            "1008" => "".translate("Please enter value for Desctiprion.")."",
            "1009" => "".translate("Vote for the selected resource only once.<br>All votes are logged and reviewed.")."",
            "1010" => "".translate("You cannot vote on the resource you submitted.<br>All votes are logged and reviewed.")."",
            "1011" => "".translate("No rating selected - no vote tallied.")."",
            "1012" => "".translate("You have already submitted a broken report for this business.")."",
            "1013" => "".translate("Please enter a search query.")."",
            "1014" => "".translate("You need to be a registered user or logged in to submit a new business.<br>Please <a href='user.php?op=register'>register</a> or <a href='user.php'>login</a> first!")."",
            "1015" => "".translate("You need to be a registered user or logged in to send a modify request.<br>Please <a href='user.php?op=register'>register</a> or <a href='user.php'>login</a> first!")."",
            "1016" => "".translate("Please enter value for URL.")."",
            "1017" => "".translate("You have already submitted a broken report for this link.")."",
            "9999" => "".translate("OOPS! God Knows").""
        );

        $errorno = array_keys($errmsg);
        if (!in_array($e_code, $errorno)) {
            $e_code = '9999';
        }
        if (!isset($header)) {
            include_once("header.$phpEx");
        }
        OpenTable2();
        echo "<center><font size='2'><b>$sitename ".translate("Error")."</b></font><br><br>";
        echo "".translate("Error Code: ")."$e_code<br><br><br>";
        echo "<b>".translate("ERROR:")."</b> $errmsg[$e_code]<br><br><br>";
        echo "[ <a href='javascript:history.go(-".$pages.")'>".translate("Go Back")."</a> ]<br><br>";
        CloseTable();
        include("footer.$phpEx");
        die("");
    }

}
?>
