'
+ . '
'
. ''. $time .' '
. ''. $perc .''
. ' '
diff --git a/upload/includes/functions_post.php b/upload/includes/functions_post.php
index 4260d11eb..8a208bd94 100644
--- a/upload/includes/functions_post.php
+++ b/upload/includes/functions_post.php
@@ -89,7 +89,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
{
if (TIMENOW - $row['last_post_time'] < $bb_cfg['flood_interval'])
{
- message_die(GENERAL_MESSAGE, $lang['FLOOD_ERROR']);
+ bb_die($lang['FLOOD_ERROR']);
}
}
}
@@ -114,7 +114,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
if ($last_msg == $post_message)
{
- message_die(GENERAL_MESSAGE, $lang['DOUBLE_POST_ERROR']);
+ bb_die($lang['DOUBLE_POST_ERROR']);
}
}
}
@@ -145,7 +145,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in posting #1');
}
if ($mode == 'newtopic')
@@ -166,7 +166,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
$sql = ($mode != "editpost") ? "INSERT INTO " . BB_POSTS . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '". USER_IP ."')" : "UPDATE " . BB_POSTS . " SET post_username = '$post_username'" . $edited_sql . " WHERE post_id = $post_id";
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in posting #2');
}
if ($mode != 'editpost')
@@ -177,7 +177,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
$sql = ($mode != 'editpost') ? "INSERT INTO " . BB_POSTS_TEXT . " (post_id, post_text) VALUES ($post_id, '$post_message')" : "UPDATE " . BB_POSTS_TEXT . " SET post_text = '$post_message' WHERE post_id = $post_id";
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in posting #3');
}
if ($userdata['user_id'] != BOT_UID)
@@ -245,7 +245,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u
WHERE topic_id = $topic_id";
if (!($result = DB()->sql_query($sql)))
{
- message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in deleting post #1');
}
if ($row = DB()->sql_fetchrow($result))
@@ -261,7 +261,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u
WHERE forum_id = $forum_id";
if (!($result = DB()->sql_query($sql)))
{
- message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in deleting post #2');
}
if ($row = DB()->sql_fetchrow($result))
@@ -275,7 +275,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u
$sql = "SELECT MIN(post_id) AS first_post_id FROM " . BB_POSTS . " WHERE topic_id = $topic_id";
if (!($result = DB()->sql_query($sql)))
{
- message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in deleting post #3');
}
if ($row = DB()->sql_fetchrow($result))
@@ -297,7 +297,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u
$sql = "UPDATE " . BB_FORUMS . " SET $forum_update_sql WHERE forum_id = $forum_id";
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in posting #4');
}
if ($topic_update_sql != '')
@@ -305,14 +305,14 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u
$sql = "UPDATE " . BB_TOPICS . " SET $topic_update_sql WHERE topic_id = $topic_id";
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in posting #5');
}
}
$sql = "UPDATE " . BB_USERS . " SET user_posts = user_posts $sign WHERE user_id = $user_id";
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
+ bb_die('Error in posting #6');
}
}
diff --git a/upload/includes/functions_report.php b/upload/includes/functions_report.php
index bb9846016..6fb0ec122 100644
--- a/upload/includes/functions_report.php
+++ b/upload/includes/functions_report.php
@@ -73,7 +73,7 @@ function report_modules_obtain()
FROM ' . BB_REPORTS_MODULES . '
ORDER BY report_module_order';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report modules', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report modules');
}
$modules = DB()->sql_fetchrowset($result);
@@ -284,7 +284,7 @@ function report_notify($mode)
if ($report['report_reason_id']) {
$sql = 'SELECT report_reason_desc FROM ' . BB_REPORTS_REASONS . ' WHERE report_reason_id = ' . $report['report_reason_id'];
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report reason desc', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report reason desc');
}
$row = DB()->sql_fetchrow($result);
@@ -303,7 +303,7 @@ function report_notify($mode)
AND user_level ' . $user_level_sql . '
AND user_id <> ' . $userdata['user_id'];
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain administrators and moderators', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain administrators and moderators #1');
}
$notify_users[$report['report_id']] = array();
@@ -349,7 +349,7 @@ function report_notify($mode)
ON u.user_id = rc.user_id
WHERE r.report_id IN(' . implode(', ', $report_ids) . ')';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report information', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report information');
}
$auth_check_array = array();
@@ -376,7 +376,7 @@ function report_notify($mode)
AND user_level ' . $user_level_sql . '
AND user_id <> ' . $userdata['user_id'];
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain administrators and moderators', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain administrators and moderators #2');
}
$auth_options = array('auth_view', 'auth_notify');
@@ -530,7 +530,7 @@ function report_count_obtain()
if (!CACHE('bb_cache')->get('report_count_obtain_exp') || (CACHE('bb_cache')->get('report_count_obtain_exp') + 300) < TIMENOW) {
$sql = 'SELECT COUNT(report_id) AS report_count FROM ' . BB_REPORTS . ' WHERE report_status IN(' . REPORT_NEW . ', ' . REPORT_OPEN . ')';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report count', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report count #1');
}
$report_count = DB()->sql_fetchfield('report_count', 0, $result);
DB()->sql_freeresult($result);
@@ -548,7 +548,7 @@ function report_count_obtain()
WHERE report_status IN(' . REPORT_NEW . ', ' . REPORT_OPEN . ')
AND rm.auth_view <= ' . REPORT_AUTH_MOD;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report count', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report count #2');
}
$report_count = DB()->sql_fetchfield('report_count', 0, $result);
@@ -558,7 +558,7 @@ function report_count_obtain()
FROM ' . BB_REPORTS . '
WHERE report_status IN(' . REPORT_NEW . ', ' . REPORT_OPEN . ')';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not check report auth', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not check report auth');
}
$reports = DB()->sql_fetchrowset($result);
@@ -598,7 +598,7 @@ function reports_obtain($module_id = null, $auth_check = true)
$where_sql
ORDER BY r.report_status ASC, r.report_time DESC";
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain reports #1');
}
$rows = DB()->sql_fetchrowset($result);
@@ -648,7 +648,7 @@ function reports_open_obtain($module_id, $report_subject, $auth_check = true)
AND r.report_subject = ' . (int)$report_subject . '
ORDER BY r.report_status ASC, r.report_time DESC';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain open reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain open reports');
}
$reports = DB()->sql_fetchrowset($result);
@@ -686,7 +686,7 @@ function reports_deleted_obtain($auth_check = true)
WHERE r.report_status = ' . REPORT_DELETE . '
ORDER BY r.report_time DESC';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain deleted reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain deleted reports');
}
$reports = DB()->sql_fetchrowset($result);
@@ -727,7 +727,7 @@ function report_obtain($report_id, $auth_check = true)
ON u.user_id = r.user_id
WHERE r.report_id = ' . (int)$report_id;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain reports #2');
}
$report = DB()->sql_fetchrow($result);
@@ -771,7 +771,7 @@ function report_changes_obtain($report_id)
WHERE rc.report_id = ' . (int)$report_id . '
ORDER BY rc.report_change_time';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report changes', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report changes');
}
$report_changes = DB()->sql_fetchrowset($result);
@@ -795,7 +795,7 @@ function report_duplicate_check($module_id, $report_subject)
AND report_subject = ' . (int)$report_subject . '
AND report_status NOT IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ')';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not check for duplicate reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not check for duplicate reports');
}
$count = DB()->sql_fetchfield('count', 0, $result);
@@ -820,7 +820,7 @@ function report_prune($module_id, $prune_time)
AND r.report_status IN(' . REPORT_CLEARED . ', ' . REPORT_DELETE . ')
AND rc.report_change_time < ' . (TIMENOW - (int)$prune_time);
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain old reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain old reports #1');
}
$reports = $report_ids = array();
@@ -839,7 +839,7 @@ function report_prune($module_id, $prune_time)
// Set last prune date
$sql = 'UPDATE ' . BB_REPORTS_MODULES . ' SET report_module_last_prune = ' . TIMENOW . ' WHERE report_module_id = ' . (int)$module_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not delete old reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete old reports #2');
}
}
@@ -880,7 +880,7 @@ function report_insert($module_id, $report_subject, $report_reason, $report_titl
' . (int)$report_subject . ", $report_subject_data_sql, '" . DB()->escape($report_title) . "',
'" . DB()->escape($report_desc) . "')";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not insert report', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not insert report');
}
$report_id = DB()->sql_nextid();
@@ -913,7 +913,7 @@ function report_insert($module_id, $report_subject, $report_reason, $report_titl
if (isset($bb_cfg['report_hack_count'])) {
$sql = 'UPDATE ' . BB_CONFIG . " SET config_value = config_value + 1 WHERE config_name = 'report_hack_count'";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update report hack count', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update report hack count');
}
}
@@ -943,7 +943,7 @@ function reports_update_status($report_ids, $report_status, $comment = '', $auth
FROM ' . BB_REPORTS . '
WHERE report_id IN(' . implode(', ', $report_ids) . ')';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain reports #3');
}
$reports = DB()->sql_fetchrowset($result);
@@ -969,7 +969,7 @@ function reports_update_status($report_ids, $report_status, $comment = '', $auth
$sql = 'INSERT INTO ' . BB_REPORTS_CHANGES . " (report_id, user_id, report_change_time, report_status, report_change_comment)
VALUES($report_id, " . $userdata['user_id'] . ', ' . TIMENOW . ", $report_status, '$comment')";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not insert report change', __LINE__, __FILE__, $sql);
+ bb_die('Could not insert report change');
}
$change_id = DB()->sql_nextid();
@@ -981,7 +981,7 @@ function reports_update_status($report_ids, $report_status, $comment = '', $auth
report_last_change = " . (int)$change_id . "
WHERE report_id = $report_id";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update reports status', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update reports status');
}
}
@@ -1016,7 +1016,7 @@ function reports_delete($report_ids, $auth_check = true, $module_action = true)
FROM ' . BB_REPORTS . '
WHERE report_id IN(' . implode(', ', $report_ids) . ')';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain reports #4');
}
$reports = DB()->sql_fetchrowset($result);
@@ -1055,13 +1055,13 @@ function reports_delete($report_ids, $auth_check = true, $module_action = true)
// Delete reports
$sql = 'DELETE FROM ' . BB_REPORTS . " WHERE report_id IN($reports_sql)";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not delete reports', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete reports');
}
// Delete report status changes
$sql = 'DELETE FROM ' . BB_REPORTS_CHANGES . " WHERE report_id IN($reports_sql)";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not delete reports changes', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete reports changes');
}
// Execute module action
@@ -1089,7 +1089,7 @@ function report_statistics($mode)
$sql = 'SELECT COUNT(report_id) AS report_count
FROM ' . BB_REPORTS;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report statistics', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report statistics');
}
$report_count = DB()->sql_fetchfield('report_count', 0, $result);
@@ -1130,7 +1130,7 @@ function user_moderated_forums($user_id)
AND aa.forum_perm = 8
GROUP BY aa.forum_id';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain moderated forums', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain moderated forums');
}
$moderators[$user_id] = array();
diff --git a/upload/includes/functions_report_admin.php b/upload/includes/functions_report_admin.php
index f9d24bbe2..10e646397 100644
--- a/upload/includes/functions_report_admin.php
+++ b/upload/includes/functions_report_admin.php
@@ -15,7 +15,7 @@ function report_counts_obtain()
ON r.report_module_id = rm.report_module_id
GROUP BY rm.report_module_id';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report counts', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report counts');
}
$report_counts = array();
@@ -38,7 +38,7 @@ function report_reason_counts_obtain()
ON rr.report_module_id = rm.report_module_id
GROUP BY rm.report_module_id';
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report reason counts', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report reason counts');
}
$report_reason_counts = array();
@@ -166,7 +166,7 @@ function report_module_install($module_notify, $module_prune, $module_name, $aut
$sql = 'SELECT MAX(report_module_order) AS max_order
FROM ' . BB_REPORTS_MODULES;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain max order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain max order #1');
}
$max_order = DB()->sql_fetchfield('max_order', 0, $result);
@@ -181,7 +181,7 @@ function report_module_install($module_notify, $module_prune, $module_name, $aut
'" . DB()->escape($module_name) . "', " . (int)$auth_write . ', ' . (int)$auth_view . ',
' . (int)$auth_notify . ', ' . (int)$auth_delete . ')';
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not install report module', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not install report module');
}
$module_id = DB()->sql_nextid();
@@ -213,7 +213,7 @@ function report_module_edit($module_id, $module_notify, $module_prune, $auth_wri
auth_delete = ' . (int)$auth_delete . '
WHERE report_module_id = ' . (int)$module_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not edit report module', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not edit report module');
}
//
@@ -256,7 +256,7 @@ function report_module_move($mode, $module_id, $steps = 1)
}
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update module order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update module order #1');
}
if (DB()->affected_rows()) {
@@ -265,7 +265,7 @@ function report_module_move($mode, $module_id, $steps = 1)
SET report_module_order = report_module_order $op 1
WHERE report_module_id = " . (int)$module_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update module order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update module order #2');
}
}
@@ -295,7 +295,7 @@ function report_module_uninstall($module_id)
FROM ' . BB_REPORTS . '
WHERE report_module_id = ' . (int)$module_id;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report ids', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report ids');
}
$report_ids = array();
@@ -322,7 +322,7 @@ function report_module_uninstall($module_id)
SET report_module_order = report_module_order - 1
WHERE report_module_order > ' . $report_module->data['report_module_order'];
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update module order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update module order #3');
}
//
@@ -331,7 +331,7 @@ function report_module_uninstall($module_id)
$sql = 'DELETE FROM ' . BB_REPORTS_REASONS . '
WHERE report_module_id = ' . (int)$module_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not delete report reasons', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete report reason #1');
}
//
@@ -340,7 +340,7 @@ function report_module_uninstall($module_id)
$sql = 'DELETE FROM ' . BB_REPORTS_MODULES . '
WHERE report_module_id = ' . (int)$module_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not delete report module', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete report module');
}
//
@@ -360,7 +360,7 @@ function report_reason_obtain($reason_id)
FROM ' . BB_REPORTS_REASONS . '
WHERE report_reason_id = ' . (int)$reason_id;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report reason', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report reason #1');
}
$row = DB()->sql_fetchrow($result);
@@ -380,7 +380,7 @@ function report_reason_insert($module_id, $reason_desc)
$sql = 'SELECT MAX(report_reason_order) AS max_order
FROM ' . BB_REPORTS_REASONS;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain max order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain max order #2');
}
$max_order = DB()->sql_fetchfield('max_order', 0, $result);
@@ -392,7 +392,7 @@ function report_reason_insert($module_id, $reason_desc)
$sql = 'INSERT INTO ' . BB_REPORTS_REASONS . ' (report_module_id, report_reason_order, report_reason_desc)
VALUES(' . (int)$module_id . ', ' . ($max_order + 1) . ", '" . DB()->escape($reason_desc) . "')";
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not insert report reason', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not insert report reason');
}
return DB()->sql_nextid();
@@ -409,7 +409,7 @@ function report_reason_edit($reason_id, $module_id, $reason_desc)
report_reason_desc = '" . DB()->escape($reason_desc) . "'
WHERE report_reason_id = " . (int)$reason_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update report reason', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update report reason');
}
}
@@ -425,7 +425,7 @@ function report_reason_move($mode, $reason_id, $steps = 1)
FROM ' . BB_REPORTS_REASONS . '
WHERE report_reason_id = ' . (int)$reason_id;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report reason order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report reason #3');
}
$row = DB()->sql_fetchrow($result);
@@ -458,7 +458,7 @@ function report_reason_move($mode, $reason_id, $steps = 1)
}
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update report reason order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update report reason order #1');
}
if (DB()->affected_rows()) {
@@ -467,7 +467,7 @@ function report_reason_move($mode, $reason_id, $steps = 1)
SET report_reason_order = report_reason_order $op 1
WHERE report_reason_id = " . (int)$reason_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update report reason order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update report reason order #2');
}
}
@@ -488,7 +488,7 @@ function report_reason_delete($reason_id)
FROM ' . BB_REPORTS_REASONS . '
WHERE report_reason_id = ' . (int)$reason_id;
if (!$result = DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not obtain report reason', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not obtain report reason #3');
}
$row = DB()->sql_fetchrow($result);
@@ -506,7 +506,7 @@ function report_reason_delete($reason_id)
WHERE report_module_id = ' . $row['report_module_id'] . '
AND report_reason_order > ' . $row['report_reason_order'];
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not update report reason order', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update report reason order #3');
}
//
@@ -515,6 +515,6 @@ function report_reason_delete($reason_id)
$sql = 'DELETE FROM ' . BB_REPORTS_REASONS . '
WHERE report_reason_id = ' . (int)$reason_id;
if (!DB()->sql_query($sql)) {
- message_die(GENERAL_ERROR, 'Could not delete report reason', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete report reason #2');
}
}
\ No newline at end of file
diff --git a/upload/includes/functions_torrent.php b/upload/includes/functions_torrent.php
index 93171fdd8..cf3c516ab 100644
--- a/upload/includes/functions_torrent.php
+++ b/upload/includes/functions_torrent.php
@@ -31,7 +31,7 @@ function get_torrent_info ($attach_id)
if (!$torrent = DB()->fetch_row($sql))
{
- message_die(GENERAL_ERROR, $lang['INVALID_ATTACH_ID']);
+ bb_die($lang['INVALID_ATTACH_ID']);
}
return $torrent;
@@ -47,12 +47,11 @@ function torrent_auth_check ($forum_id, $poster_id)
if ($poster_id != $userdata['user_id'] && !$is_auth['auth_mod'])
{
- message_die(GENERAL_MESSAGE, $lang['NOT_MODERATOR'], $lang['NOT_AUTHORISED']);
+ bb_die($lang['NOT_MODERATOR']);
}
else if (!$is_auth['auth_view'] || !$is_auth['auth_attachments'] || $attach_config['disable_mod'])
{
- $message = sprintf($lang['SORRY_AUTH_READ'], $is_auth['auth_read_type']);
- message_die(GENERAL_MESSAGE, $message);
+ bb_die(sprintf($lang['SORRY_AUTH_READ'], $is_auth['auth_read_type']));
}
return $is_auth;
}
@@ -76,11 +75,11 @@ function tracker_unregister ($attach_id, $mode = '')
{
if (!$torrent)
{
- message_die(GENERAL_ERROR, $lang['TOR_NOT_FOUND']);
+ bb_die($lang['TOR_NOT_FOUND']);
}
if (!$torrent['tracker_status'])
{
- message_die(GENERAL_ERROR, 'Torrent already unregistered');
+ bb_die('Torrent already unregistered');
}
torrent_auth_check($forum_id, $torrent['poster_id']);
}
@@ -91,7 +90,7 @@ function tracker_unregister ($attach_id, $mode = '')
if (!$result = DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not query torrent information', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not query torrent information');
}
if ($row = DB()->sql_fetchrow($result))
{
@@ -106,7 +105,7 @@ function tracker_unregister ($attach_id, $mode = '')
if (!$result = DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update topics table #1');
}
}
@@ -115,7 +114,7 @@ function tracker_unregister ($attach_id, $mode = '')
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not delete peers', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete peers');
}
// Delete torrent
@@ -123,7 +122,7 @@ function tracker_unregister ($attach_id, $mode = '')
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not delete torrent from torrents table', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not delete torrent from torrents table');
}
// Update tracker_status
@@ -131,7 +130,7 @@ function tracker_unregister ($attach_id, $mode = '')
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not update torrent status', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update torrent status #1');
}
if ($mode == 'request')
@@ -150,7 +149,7 @@ function delete_torrent ($attach_id, $mode = '')
if (!$torrent = get_torrent_info($attach_id))
{
- message_die(GENERAL_ERROR, $lang['TOR_NOT_FOUND']);
+ bb_die($lang['TOR_NOT_FOUND']);
}
$topic_id = $torrent['topic_id'];
@@ -159,7 +158,7 @@ function delete_torrent ($attach_id, $mode = '')
if ($torrent['extension'] !== TORRENT_EXT)
{
- message_die(GENERAL_ERROR, $lang['NOT_TORRENT']);
+ bb_die($lang['NOT_TORRENT']);
}
torrent_auth_check($forum_id, $poster_id);
@@ -316,7 +315,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
{
return torrent_error_exit($lang['BT_REG_FAIL_SAME_HASH']);
}
- message_die(GENERAL_ERROR, 'Could not register torrent on tracker', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not register torrent on tracker');
}
// update tracker status for this attachment
@@ -324,7 +323,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
if (!DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not update torrent status', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update torrent status #2');
}
// set DL-Type for topic
@@ -334,7 +333,7 @@ function tracker_register ($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVE
if (!$result = DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not update topics table #2');
}
}
@@ -368,7 +367,7 @@ function send_torrent_with_passkey ($filename)
if (!$passkey_key = $bb_cfg['passkey_key'])
{
- message_die(GENERAL_ERROR, 'Could not add passkey (wrong config $bb_cfg[\'passkey_key\'])');
+ bb_die('Could not add passkey (wrong config $bb_cfg[\'passkey_key\'])');
}
// Get $post_id & $poster_id
@@ -386,19 +385,19 @@ function send_torrent_with_passkey ($filename)
$topic_id_sql = 'SELECT topic_id FROM ' . BB_POSTS . ' WHERE post_id = ' . (int) $post_id;
if (!($topic_id_result = DB()->sql_query($topic_id_sql)))
{
- message_die(GENERAL_ERROR, 'Could not query post information', '', __LINE__, __FILE__, $topic_id_sql);
+ bb_die('Could not query post information');
}
$topic_id_row = DB()->sql_fetchrow($topic_id_result);
$topic_id = $topic_id_row['topic_id'];
if (!$attachment['tracker_status'])
{
- message_die(GENERAL_ERROR, $lang['PASSKEY_ERR_TOR_NOT_REG']);
+ bb_die($lang['PASSKEY_ERR_TOR_NOT_REG']);
}
if (bf($userdata['user_opt'], 'user_opt', 'dis_passkey') && !IS_GUEST)
{
- message_die(GENERAL_ERROR, 'Could not add passkey');
+ bb_die('Could not add passkey');
}
if ($bt_userdata = get_bt_userdata($user_id))
@@ -431,8 +430,7 @@ function send_torrent_with_passkey ($filename)
if (!isset($dl['user_status']) || $dl['user_status'] != DL_STATUS_COMPLETE)
{
- $mess = sprintf($lang['BT_LOW_RATIO_FOR_DL'], round($user_ratio, 2), "search.php?dlu=$user_id&dlc=1");
- message_die(GENERAL_ERROR, $mess);
+ bb_die(sprintf($lang['BT_LOW_RATIO_FOR_DL'], round($user_ratio, 2), "search.php?dlu=$user_id&dlc=1"));
}
}
}
@@ -442,7 +440,7 @@ function send_torrent_with_passkey ($filename)
if (!$tor = bdecode_file($filename))
{
- message_die(GENERAL_ERROR, 'This is not a bencoded file');
+ bb_die('This is not a bencoded file');
}
$announce = strval($ann_url . "?$passkey_key=$passkey_val");
@@ -507,13 +505,13 @@ function generate_passkey ($user_id, $force_generate = false)
if (!$result = DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not query userdata for passkey', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not query userdata for passkey');
}
if ($row = DB()->sql_fetchrow($result))
{
if (bf($row['user_opt'], 'user_opt', 'dis_passkey'))
{
- message_die(GENERAL_MESSAGE, $lang['NOT_AUTHORISED']);
+ bb_die($lang['NOT_AUTHORISED']);
}
}
}
@@ -558,7 +556,7 @@ function get_registered_torrents ($id, $mode)
if (!$result = DB()->sql_query($sql))
{
- message_die(GENERAL_ERROR, 'Could not query torrent id', '', __LINE__, __FILE__, $sql);
+ bb_die('Could not query torrent id');
}
if ($rowset = @DB()->sql_fetchrowset($result))
@@ -589,7 +587,7 @@ function torrent_error_exit ($message)
bb_die($msg . $message);
}
-// bdecode: based on OpenTracker [http://whitsoftdev.com/opentracker]
+// bdecode: based on OpenTracker
function bdecode_file ($filename)
{
$file_contents = file_get_contents($filename);
diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php
index 43b9b978d..c2b061db1 100644
--- a/upload/includes/init_bb.php
+++ b/upload/includes/init_bb.php
@@ -119,19 +119,14 @@ function bb_setcookie ($name, $val, $lifetime = COOKIE_PERSIST, $httponly = fals
// Debug options
if (DBG_USER)
{
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
+ ini_set('error_reporting', E_ALL);
+ ini_set('display_errors', 1);
}
else
{
unset($_COOKIE['explain']);
}
-if (DEBUG === true)
-{
- require(DEV_DIR .'init_debug.php');
-}
-
define('DELETED', -1);
// User Levels
@@ -177,11 +172,7 @@ define('POST_ANNOUNCE', 2);
define('SEARCH_TYPE_POST', 0);
define('SEARCH_TYPE_TRACKER', 1);
-// Error codes
-define('GENERAL_MESSAGE', 200);
-define('GENERAL_ERROR', 202);
-define('CRITICAL_ERROR', 204);
-
+// Ajax error codes
define('E_AJAX_GENERAL_ERROR', 1000);
define('E_AJAX_NEED_LOGIN', 1001);
@@ -212,18 +203,12 @@ define('PHYSICAL_LINK', 2);
// Categories
define('NONE_CAT', 0);
define('IMAGE_CAT', 1);
-define('STREAM_CAT', 2);
-define('SWF_CAT', 3);
// Misc
-define('MEGABYTE', 1024);
define('ADMIN_MAX_ATTACHMENTS', 50);
define('THUMB_DIR', 'thumbs');
define('MODE_THUMBNAIL', 1);
-// Forum Extension Group Permissions
-define('GPERM_ALL', 0); // ALL FORUMS
-
// Quota Types
define('QUOTA_UPLOAD_LIMIT', 1);
define('QUOTA_PM_LIMIT', 2);
@@ -314,6 +299,7 @@ $bb_cfg['tor_cannot_edit'] = array(
TOR_CONSUMED => true,
TOR_DUP => true,
);
+
// Запрет на создание новых раздач если стоит статус недооформлено/неоформлено/сомнительно
$bb_cfg['tor_cannot_new'] = array(TOR_NEED_EDIT, TOR_NO_DESC, TOR_DOUBTFUL);
@@ -322,10 +308,10 @@ $bb_cfg['tor_reply'] = array(TOR_NEED_EDIT, TOR_NO_DESC, TOR_DOUBTFUL);
// Если такой статус у релиза, то статистика раздачи будет скрыта
$bb_cfg['tor_no_tor_act'] = array(
- TOR_CLOSED => true,
- TOR_DUP => true,
- TOR_CLOSED_CPHOLD => true,
- TOR_CONSUMED => true,
+ TOR_CLOSED => true,
+ TOR_DUP => true,
+ TOR_CLOSED_CPHOLD => true,
+ TOR_CONSUMED => true,
);
// Table names
@@ -346,6 +332,7 @@ define('BB_BT_TORHELP', 'bb_bt_torhelp');
define('BB_BT_TORSTAT', 'bb_bt_torstat');
define('BB_CATEGORIES', 'bb_categories');
define('BB_CAPTCHA', 'bb_captcha');
+define('BB_CHAT', 'bb_chat');
define('BB_CONFIG', 'bb_config');
define('BB_CRON', 'bb_cron');
define('BB_DISALLOW', 'bb_disallow');
@@ -412,8 +399,6 @@ define('BONUS_URL', 'profile.php?mode=bonus');
define('TOPIC_URL', 'viewtopic.php?t=');
define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT']));
-define('UA_OPERA', strpos(USER_AGENT, 'pera'));
-define('UA_IE', strpos(USER_AGENT, 'msie'));
define('HTML_SELECT_MAX_LENGTH', 60);
define('HTML_WBR_LENGTH', 12);
@@ -590,5 +575,5 @@ $dl_status_css = array(
// Show 'Board is disabled' message if needed
if ($bb_cfg['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') && !defined('IN_AJAX'))
{
- message_die(GENERAL_MESSAGE, 'BOARD_DISABLE');
+ bb_die($lang['BOARD_DISABLE']);
}
\ No newline at end of file
diff --git a/upload/includes/page_footer.php b/upload/includes/page_footer.php
index 3f6a73ad0..238a61c61 100644
--- a/upload/includes/page_footer.php
+++ b/upload/includes/page_footer.php
@@ -11,7 +11,6 @@ if (!empty($template))
'POWERED' => base64_decode($lang['POWERED']),
'SHOW_ADMIN_LINK' => (IS_ADMIN && !defined('IN_ADMIN')),
'ADMIN_LINK_HREF' => "admin/index.php",
-
));
$template->set_filenames(array('page_footer' => 'page_footer.tpl'));
@@ -31,7 +30,6 @@ if ($show_dbg_info)
$gen_time_txt = sprintf('%.3f', $gen_time);
$gzip_text = (UA_GZIP_SUPPORTED) ? 'GZIP ' : 'GZIP ';
$gzip_text .= ($bb_cfg['gzip_compress']) ? $lang['ON'] : $lang['OFF'];
- $debug_text = (DEBUG) ? 'Debug ON' : 'Debug OFF';
$stat = '[ '. $lang['EXECUTION_TIME'] ." $gen_time_txt ". $lang['SEC'];
@@ -75,7 +73,7 @@ echo '
';
-if (DBG_USER && (SQL_DEBUG || PROFILER) && !(isset($_GET['pane']) && $_GET['pane'] == 'left'))
+if (DBG_USER && SQL_DEBUG && !(isset($_GET['pane']) && $_GET['pane'] == 'left'))
{
require(INC_DIR . 'page_footer_dev.php');
}
@@ -91,12 +89,6 @@ if (isset($log_ip_resp[USER_IP]) || isset($log_ip_resp[CLIENT_IP]))
}
### LOG END ###
-if (DBG_USER && !empty($GLOBALS['timer_markers']))
-{
- $GLOBALS['timer']->stop();
- $GLOBALS['timer']->display();
-}
-
echo '