Welcome Guest ( Log In | Register )


> IPS Related Information

This section is focused on Invision Power Services products...

IPS, widely praised for the continuous efforts aimed to a stable, fast and efficient board system has brought to us Invision Power Board, but not only that..

Invision Power Gallery & Invision Community Blog allow the forum members :

  1. Host & publish images
  2. Host and link Blogs
  3. Integrate all that to the Invision Power Board

 
Reply to this topicStart new topic
> IPS Tutorials: Developer Articles > Linking Error Codes To Your Knowledgebase
RSS Bot
post 2 Jul 2009, 04:35 AM
Post #1


yourforum Robot
Group Icon

Group: Private Members
Posts: 196639
Joined: 12-July 05
From: RSS World
Member No.: 125



During the development of one of my Applications i thought it would be a cool idea to have the error codes on error screens link to my company knowledgebase. This would provide a few benifits. Firstly you could keep error messages to a minimum and secondly, you are able to provide additional and detailed information on the error and its resolution.

The below guide is a brief example of how to add such a feature into your applications. This however may change slightly for you depending on the type of knowledgebase you use. My knowledgebase for example always has the same URL with just the article ID at the end of the URL changing for each knowledgebase entry. So... Lets get started.

First of all we need to add a VAR to the class of your app's module which will be available to all functions, so you would add something like this

var $kb = "http://www.bouncyservers.co.uk/system/knowledgebase.php?action=displayarticle&catid=19&id=";


in my Radio Center application it would now look like this at the top of my core module for the App

class public_radio_core_core extends ipsCommand
{
    var $kb = "http://www.bouncyservers.co.uk/system/knowledgebase.php?action=displayarticle&catid=19&id=";
        
    public function doExecute( ipsRegistry $registry )
    {


As you can see, the var is just the URL to a knowledgebase article, with the actual article ID excluded from the end.

so now we have your knowledgebase defined, printing our errors with an error code that links to your knowledgebase is pretty easy

// Check File Exsists
if ( !$file )
{
    $this->registry->output->showError( $this->lang->words['brc401'], "<a href='".$this->kb."78'>BRC401</a>" );
}


so in the above code, $this->lang->words['brc401'] is the lang entry for the actuall error message, in this case $this->lang->words['brc401'] = "The file doe not exsist"

this bit of code "<a href='".$this->kb."78'>BRC401</a>" simply makes the error code BRC401 linkable, prefixed with are KB var and then 78 is the actual article number in our knowledgebase.

Now when ever this error is shown, clicking the error number will link the viewer to http://www.bouncyservers.co.uk/system/know...id=19&id=78 giving them more detailed information about the error and whatever else you would include in yoru knowledgebase about the error. View the full article
Go to the top of the page
 
Bookmark this: Post to Del.icio.usPost to DiggPost to FacebookPost to GooglePost to SlashdotPost to StumbleUponPost to TechnoratiPost to YahooMyWeb
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th March 2024 - 03:45 PM
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More © 2005-2011.
InvisionGames - Your #1 Arcade Games Repository | AllSigs - Signatures for all | Rock Band + Guitar Hero = RockHero ! | The Remoters - Remote Assistance | FileMiners - You ask, We find