Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

[resources.invisionpower.com - pliki] Developer Articles > Linking Error Codes To Your Knowledgebase


Rekomendowane odpowiedzi

  • Manager

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. Wyświetl pełny artykuł

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.