Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > BT.Manager (phpMyBitTorrent)
Reply
Thread Tools
  #1  
Old 14th October 2009, 16:47
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default Error function explained
To generate a basic error report you can use 1 of 3 PMBT error functions
first is the btsqlerror which is the Mysql error
PHP Code:
btsqlerror($sql ''
where $sql is the query
example
PHP Code:
        $sql "SELECT id FROM ".$db_prefix."_users WHERE id = '".$user->id."' AND username = '".$user->name."' AND act_key = '".addslashes($userdata[3])."' AND password = '".addslashes($userdata[2])."';"
this well return a fatal error causing the script to come to a complete stop
and display a error block reporting the query the error code and Mysql message for this error
to use this
PHP Code:
                        $sql "SELECT avatar FROM ".$db_prefix."_users WHERE id = '".$uid."';";
                        
$res $db->sql_query($sql)or btsqlerror($sql); 
the Second is the display error bterror
PHP Code:
bterror($error$title _btgenerror$fatal true
$error is the body of the error block and is a required field
$tittle is the header of the error block this field is not required
$fatal tells the script if it should come to a complete stop or just carry on after display By default it is fatal and well stop the script.
example Fatal Error
PHP Code:
bterror("Error","you have a fatal error"); 
Example Non Fatal error
PHP Code:
bterror("Error","you have a nonfatal error",false); 
the last is error log
PHP Code:
logerror($message$error _btgenerror
this well write a log error in the data base of the error for site admin to view
in the admin logs
$message is the main error and is required
$error is the title of the error and is not required
this well add to the data base a row for error type error body user IP the created the error and a time stamp
Example
PHP Code:
logerror('User login failed for '.$username'Failed Login'); 
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
Reply

Tags
error , explained , function


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
file get contents function Help AJ Free Torrent Source 1 16th January 2010 16:08
FTS 1.1 getallheaders function in announce.php Ashur Free Torrent Source 2 5th September 2009 16:50
Why need this function in YSE PRE 6!?? kp380lv Yuna Scatari Edition (YSE) 6 3rd December 2008 21:01
External mail function daeron Template Shares 0 21st June 2008 18:08
ipcheck.php - add pager function, how? Jack Yuna Scatari Edition (YSE) 0 27th May 2008 21:50



All times are GMT +2. The time now is 14:57. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.