1
intel352
errorhandler hack
  • 2004/5/14 13:24

  • intel352

  • Module Developer

  • Posts: 824

  • Since: 2003/11/23


just adds a new function so i can specify my own error messages:

function error_text($error, $pages=1){
            global 
$xoopsConfig, $xoopsUser, $xoopsRequestUri, $xoopsModule, $xoopsLogger, $HTTP_SERVER_VARS;

            echo 
"<div><b>".$xoopsConfig['sitename']." Error</b><br /><br />";
            echo 
"<b>ERROR:</b> $error<br /><br /><br />";
            echo 
"[ <a href='javascript:history.go(-".$pages.")'>Go Back</a> ]</div>";
            exit();
        }

after initializing the errorhandler to $eh, you would call the function like so:

$eh->error_text("Please enter value for WHATEVER");

small feature, doesn't hurt XOOPS core at all, just adds to it

if this or something similar could be implemented in the future (if not already and i just don't know about it...), that'd be great