Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
0.1.2.2
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

sgb_error_documents

Announcing error document support for TxP. This plugin provides a configurable hook for common (and custom) HTTP errors. Errors can be configured to display a specific article on your site, redirect to a URL, include a file or simply output text.

Currently the plugin supports two error codes, 403 Forbidden and 404 Not Found, more can easily be add. (Although this plugin was designed as a companion to sgb_url_handler it can be used by any plugin/hack.)

The plugin responds to each error code in one of four possible ways; by displaying an article on your site (ID), redirecting to an error page (URL), including an error document (file) or by simply outputting error text (text). The plugin responds to an error in the order specified above (ID, URL, file and text). If the ID is not set or is not found, the plugin will try the URL. If the URL is not set the plugin will try the file. If the file is not found, the plugin will output the text, defaulting to standard message if custom text is not set.

If an error code is passed to the plugin that is not under stood, the plugin will not do anything.

id
The id should be of an article available in your article database. You may wish set up a dedicated “Errors” section to prevent the errors articles from being listed with your normal posts.

url
The URL should be an absolute URL to a page explaining the specified error code. If this error is triggered users will be redirected to this page.

file
The file element should be a relative path (to index.php) to a file explaining a particular error code. The function will exit() immediately following the inclusion of the file (terminating any further TxP actions).

text
This text will be echoed to the browser, if it is not specified a default message will be displayed. This text can contained HTML code. The plugin will issue an exit() call immediately after echoing the text (terminating any further TxP actions).

After installing sgb_error_documents, click edit to change the configuration, all configuration options are listed in the first function.

Article Request Count:
Initially released:
2004-03-13
Posted here:
14 Mar 2005

You know you want to visit the Archives.
Published with Textpattern