Море мелких исправлений и недоработок, найденных анализатором кода. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@532 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08 2013-08-02 20:28:44 +00:00
commit 9b74caa6d0
20 changed files with 41 additions and 106 deletions

View file

@ -1,6 +1,6 @@
<?php <?php
$mysql_host = 'localhost'; $mysql_host = 'localhost';
$mysql_user = 'user'; $mysql_user = 'user';
$mysql_pass = 'user'; $mysql_pass = 'user';
$mysql_db = 'forum'; $mysql_db = 'forum';
?>

View file

@ -288,7 +288,7 @@ else
ORDER BY c.cat_order"; ORDER BY c.cat_order";
if( !($result = DB()->sql_query($sql)) ) if( !($result = DB()->sql_query($sql)) )
{ {
message_die(general_error, 'Could not query categories list', '', __line__, __file__, $sql); message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);
} }
$category_rows = DB()->sql_fetchrowset($result); $category_rows = DB()->sql_fetchrowset($result);

View file

@ -1180,7 +1180,6 @@ else
$order = 'DESC'; $order = 'DESC';
$o_order = 'ASC'; $o_order = 'ASC';
break; break;
case 'DESC':
default: default:
$o_order = 'DESC'; $o_order = 'DESC';
$order = 'ASC'; $order = 'ASC';

View file

@ -20,6 +20,7 @@ if (defined('ATTACH_INSTALL'))
/** /**
* wrapper function for determining the correct language directory * wrapper function for determining the correct language directory
*/ */
/** @noinspection PhpInconsistentReturnPointsInspection */
function attach_mod_get_lang($language_file) function attach_mod_get_lang($language_file)
{ {
global $attach_config, $bb_cfg; global $attach_config, $bb_cfg;

View file

@ -1,51 +1,5 @@
<?php <?php
/**
* Database
* Cache
- Tracker Cache
- Forum Cache
- Session Cache
- Datastore
* Tracker
* Torrents
- Ratio limits
- Seeding torrents limit
- DL-Status (days to keep)
- Tor-Stats (days to keep)
- Tor-Help
* Path
* Language
* Templates
* Cookie
* Server
- Server load
- Backup
- GZip
* Sessions
* Registration
* Email
* AJAX
* Debug
* Special users (dbg_users, unlimited_users, super_admins)
* LOG
* Error reporting
* Subforums
* Forums
* Topics
* Posts
* Search
* Actions log
* Users
* GroupCP
* Ads
* Misc
* Captcha
**/
if (!defined('BB_ROOT')) die(basename(__FILE__)); if (!defined('BB_ROOT')) die(basename(__FILE__));
$bb_cfg = $tr_cfg = $page_cfg = array(); $bb_cfg = $tr_cfg = $page_cfg = array();
@ -57,7 +11,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.5 (unstable)'; $bb_cfg['tp_version'] = '2.5 (unstable)';
$bb_cfg['tp_release_date'] = '02-08-2013'; $bb_cfg['tp_release_date'] = '02-08-2013';
$bb_cfg['tp_release_state'] = 'R531'; $bb_cfg['tp_release_state'] = 'R532';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';
@ -96,7 +50,6 @@ $bb_cfg['cache']['engines'] = array(
'bb_cache' => array('filecache', array()), 'bb_cache' => array('filecache', array()),
'tr_cache' => array('filecache', array()), 'tr_cache' => array('filecache', array()),
'session_cache' => array('filecache', array()), 'session_cache' => array('filecache', array()),
'bb_cap_sid' => array('filecache', array()), 'bb_cap_sid' => array('filecache', array()),
'bb_login_err' => array('filecache', array()), 'bb_login_err' => array('filecache', array()),
); );
@ -167,7 +120,7 @@ $tr_cfg = array(
'limit_seed_ips' => 0, 'limit_seed_ips' => 0,
'limit_leech_ips' => 0, 'limit_leech_ips' => 0,
'tor_topic_up' => true, 'tor_topic_up' => true,
'gold_silver_enabled' => true, 'gold_silver_enabled' => true,
); );
$bb_cfg['show_dl_status_in_search'] = true; $bb_cfg['show_dl_status_in_search'] = true;

View file

@ -21,15 +21,16 @@ function make_OpenInEditor_js ($file, $line)
} }
/** /**
* Show source part of the file * Show source part of the file
* @param string $file Filename * @param string $file Filename
* @param int $line Line to read * @param int $line Line to read
* @param int $prev How many lines before main line to read * @param int $prev How many lines before main line to read
* @param int $next How many lines after main line to read * @param int $next How many lines after main line to read
* @return string * @param bool $add_view_full_link
* @access public * @return string
* @package ErrorHandler * @access public
*/ * @package ErrorHandler
*/
function showSource ($file, $line, $prev = 10, $next = 10, $add_view_full_link = true) function showSource ($file, $line, $prev = 10, $next = 10, $add_view_full_link = true)
{ {
if (!(file_exists($file) && is_file($file))) if (!(file_exists($file) && is_file($file)))

View file

@ -291,14 +291,17 @@ function strip_quotes ($text)
// ############################################################################# // #############################################################################
/** /**
* Strips away bbcode from a given string, leaving plain text * Strips away bbcode from a given string, leaving plain text
* *
* @param string Text to be stripped of bbcode tags * @param string Text to be stripped of bbcode tags
* @param boolean If true, strip away quote tags AND their contents * @param bool $stripquotes
* @param boolean If true, use the fast-and-dirty method rather than the shiny and nice method * @param bool $fast_and_dirty
* * @param bool $showlinks
* @return string * @internal param \If $boolean true, strip away quote tags AND their contents
*/ * @internal param \If $boolean true, use the fast-and-dirty method rather than the shiny and nice method
*
* @return string
*/
function strip_bbcode ($message, $stripquotes = true, $fast_and_dirty = false, $showlinks = true) function strip_bbcode ($message, $stripquotes = true, $fast_and_dirty = false, $showlinks = true)
{ {
$find = array(); $find = array();

View file

@ -1073,6 +1073,7 @@ class Template {
array_splice($tokens, $is_arg_start, count($tokens), $new_tokens); array_splice($tokens, $is_arg_start, count($tokens), $new_tokens);
$i = $is_arg_start; $i = $is_arg_start;
break;
default: default:
$pattern = '@^ $pattern = '@^

View file

@ -97,8 +97,7 @@ if ($watch_count > 0)
else else
{ {
meta_refresh(BB_ROOT, '3'); meta_refresh(BB_ROOT, '3');
bb_die($lang['NO_WATCHED_TOPICS']); bb_die($lang['NO_WATCHED_TOPICS']);
} }
print_page('usercp_topic_watch.tpl'); print_page('usercp_topic_watch.tpl');
?>

View file

@ -14,6 +14,4 @@ $lang['REPORT_TYPE'] = 'General report';
$lang['WRITE_REPORT'] = 'Write report'; $lang['WRITE_REPORT'] = 'Write report';
$lang['WRITE_REPORT_EXPLAIN'] = 'Use this form to send a message to the team.'; $lang['WRITE_REPORT_EXPLAIN'] = 'Use this form to send a message to the team.';
$lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to write reports.'; $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to write reports.';
?>

View file

@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report posts.';
$lang['DUPLICATE_ERROR'] = 'The selected post has already been reported.'; $lang['DUPLICATE_ERROR'] = 'The selected post has already been reported.';
$lang['DELETED_ERROR'] = 'The reported post was deleted.'; $lang['DELETED_ERROR'] = 'The reported post was deleted.';
$lang['CLICK_RETURN'] = '%sClick here%s to return to the post.'; $lang['CLICK_RETURN'] = '%sClick here%s to return to the post.';
?>

View file

@ -24,6 +24,4 @@ $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report private me
$lang['DUPLICATE_ERROR'] = 'The private message has already been reported.'; $lang['DUPLICATE_ERROR'] = 'The private message has already been reported.';
$lang['DELETED_ERROR'] = 'The reported private message was deleted.'; $lang['DELETED_ERROR'] = 'The reported private message was deleted.';
$lang['CLICK_RETURN'] = '%sClick here%s to return to the private message.'; $lang['CLICK_RETURN'] = '%sClick here%s to return to the private message.';
?>

View file

@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report topics.';
$lang['DUPLICATE_ERROR'] = 'The selected topic has already been reported.'; $lang['DUPLICATE_ERROR'] = 'The selected topic has already been reported.';
$lang['DELETED_ERROR'] = 'The reported topic was deleted.'; $lang['DELETED_ERROR'] = 'The reported topic was deleted.';
$lang['CLICK_RETURN'] = '%sClick here%s to return to the topic.'; $lang['CLICK_RETURN'] = '%sClick here%s to return to the topic.';
?>

View file

@ -18,6 +18,4 @@ $lang['WRITE_REPORT_ERROR'] = 'The selected user doesn\'t exist.';
$lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report users.'; $lang['AUTH_WRITE_ERROR'] = 'You don\'t have the permission to report users.';
$lang['DELETED_ERROR'] = 'The selected user was deleted.'; $lang['DELETED_ERROR'] = 'The selected user was deleted.';
$lang['CLICK_RETURN'] = '%sClick here%s to return to the user\'s profile.'; $lang['CLICK_RETURN'] = '%sClick here%s to return to the user\'s profile.';
?>

View file

@ -14,6 +14,4 @@ $lang['REPORT_TYPE'] = 'Общие нарушения';
$lang['WRITE_REPORT'] = 'Сообщить о нарушении'; $lang['WRITE_REPORT'] = 'Сообщить о нарушении';
$lang['WRITE_REPORT_EXPLAIN'] = 'Используйте эту форму для отправки сообщения команде администраторов и модераторов.'; $lang['WRITE_REPORT_EXPLAIN'] = 'Используйте эту форму для отправки сообщения команде администраторов и модераторов.';
$lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщений о нарушениях.'; $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщений о нарушениях.';
?>

View file

@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки
$lang['DUPLICATE_ERROR'] = 'О нарушениях в выбранных сообщениях уже сообщено.'; $lang['DUPLICATE_ERROR'] = 'О нарушениях в выбранных сообщениях уже сообщено.';
$lang['DELETED_ERROR'] = 'Сообщение с нарушением удалено.'; $lang['DELETED_ERROR'] = 'Сообщение с нарушением удалено.';
$lang['CLICK_RETURN'] = '%sНажмите%s для возврата к сообщению в теме.'; $lang['CLICK_RETURN'] = '%sНажмите%s для возврата к сообщению в теме.';
?>

View file

@ -24,6 +24,4 @@ $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки
$lang['DUPLICATE_ERROR'] = 'О нарушении уже сообщено.'; $lang['DUPLICATE_ERROR'] = 'О нарушении уже сообщено.';
$lang['DELETED_ERROR'] = 'Личное сообщение с нарушением удалено.'; $lang['DELETED_ERROR'] = 'Личное сообщение с нарушением удалено.';
$lang['CLICK_RETURN'] = '%sНажмите%s для возврата к личному сообщению.'; $lang['CLICK_RETURN'] = '%sНажмите%s для возврата к личному сообщению.';
?>

View file

@ -20,6 +20,4 @@ $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки
$lang['DUPLICATE_ERROR'] = 'О нарушении уже сообщено.'; $lang['DUPLICATE_ERROR'] = 'О нарушении уже сообщено.';
$lang['DELETED_ERROR'] = 'Тема с нарушением удалена.'; $lang['DELETED_ERROR'] = 'Тема с нарушением удалена.';
$lang['CLICK_RETURN'] = '%sНажмите%s для возврата в тему.'; $lang['CLICK_RETURN'] = '%sНажмите%s для возврата в тему.';
?>

View file

@ -18,6 +18,4 @@ $lang['WRITE_REPORT_ERROR'] = 'Выбранный пользователь не
$lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщения.'; $lang['AUTH_WRITE_ERROR'] = 'У вас нет прав для отправки сообщения.';
$lang['DELETED_ERROR'] = 'Выбранный пользователь удален.'; $lang['DELETED_ERROR'] = 'Выбранный пользователь удален.';
$lang['CLICK_RETURN'] = '%sНажмите%s для возврата в профиль пользователя.'; $lang['CLICK_RETURN'] = '%sНажмите%s для возврата в профиль пользователя.';
?>

View file

@ -30,6 +30,4 @@ foreach($sql as $i => $query) {
$res = DB()->query($query) or die('Oh shit!'); $res = DB()->query($query) or die('Oh shit!');
$row = mysql_fetch_row($res); $row = mysql_fetch_row($res);
echo "<li>{$titles[$i]} - <b>{$row[0]}</b>"; echo "<li>{$titles[$i]} - <b>{$row[0]}</b>";
} }
?>