Чистка TODO, удаление устаревшего кода согласно #52, спасибо @VasyOk за помощь

This commit is contained in:
Exile 2016-02-04 06:17:21 +03:00
commit cb28304866
12 changed files with 23 additions and 38 deletions

View file

@ -256,7 +256,7 @@ else if ( $mode != '' )
'TPL_SMILE_EDIT' => true,
'SMILEY_CODE' => $smile_data['code'],
'SMILEY_EMOTICON' => $smile_data['emoticon'],
'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_edit_img, // TODO
'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_edit_img,
'S_SMILEY_ACTION' => "admin_smilies.php",
'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_FILENAME_OPTIONS' => $filename_list,

8
dl.php
View file

@ -7,7 +7,7 @@ require(BB_ROOT .'common.php');
if (!$topic_id = (int) request_var('t', 0))
{
bb_simple_die('Ошибочный запрос: не указан topic_id'); // TODO
bb_simple_die('Ошибочный запрос: не указан topic_id'); // TODO: перевести
}
$user->session_start();
@ -24,11 +24,11 @@ $sql = "
";
if (!$t_data = DB()->fetch_row($sql))
{
bb_simple_die('Файл не найден [DB]'); // TODO
bb_simple_die('Файл не найден [DB]'); // TODO: перевести
}
if (!$t_data['attach_ext_id'])
{
bb_simple_die('Файл не найден [EXT_ID]'); // TODO
bb_simple_die('Файл не найден [EXT_ID]'); // TODO: перевести
}
// Auth check
@ -88,7 +88,7 @@ $file_path = get_attach_path($topic_id, $t_data['attach_ext_id']);
if (($file_contents = @file_get_contents($file_path)) === false)
{
bb_simple_die("Файл не найден [HDD]"); // TODO
bb_simple_die("Файл не найден [HDD]"); // TODO: перевести
}
$send_filename = "t-$topic_id.". $bb_cfg['file_id_ext'][$t_data['attach_ext_id']];

View file

@ -498,7 +498,7 @@ else
switch ($view_mode)
{
case 'releases':
// TODO Correct SQL to posts with attach and limit them, optimization
// TODO: проверить на работу с новыми вложениями
if (!$group_info['release_group'])
{

View file

@ -31,8 +31,6 @@ if ($group_id)
if ($is_moderator)
{
// TODO Admin panel, some tasty features
// Avatar
if ($submit)
{

View file

@ -906,7 +906,6 @@ class sql_db
{
case 'start':
$this->explain_hold = '';
// TODO: добавить поддержку многотабличных запросов
if (preg_match('#UPDATE ([a-z0-9_]+).*?WHERE(.*)/#', $query, $m))
{
$query = "SELECT * FROM $m[1] WHERE $m[2]";

View file

@ -339,7 +339,7 @@ function topic_delete ($mode_or_topic_id, $forum_id = null, $prune_time = 0, $pr
// Log action
if ($prune)
{
// TODO
// TODO: логирование для массового удаления
}
else
{

View file

@ -318,7 +318,7 @@ function send_torrent_with_passkey ($t_data)
}
else if (isset($bb_cfg['tor_frozen'][$row['tor_status']]))
{
if (!$t_data['is_am']) bb_die("Раздача имеет статус: <b>{$lang['tor_status'][$row['tor_status']]}</b><br /><br />Скачивание запрещено"); //todo перевести
if (!$t_data['is_am']) bb_die("Раздача имеет статус: <b>{$lang['tor_status'][$row['tor_status']]}</b><br /><br />Скачивание запрещено"); //TODO: перевести
}
$passkey_val = '';
@ -359,7 +359,7 @@ function send_torrent_with_passkey ($t_data)
}
}
/* todo активировать несколько позднее
/* TODO: восстановить
// лимит количества скачиваний торрент-файлов в день
if ($user_id != $poster_id && !$t_data['is_am'])
{

View file

@ -411,7 +411,7 @@ if (DBG_USER) require(INC_DIR .'functions_dev.php');
$html = new html_common();
$log_action = new log_action();
// TODO temporarily 'cat_forums' always enqueued
// TODO: удаление датастор
$datastore->enqueue(array('cat_forums'));
// Дата старта вашего проекта

View file

@ -28,13 +28,14 @@ $page_cfg['show_tor_status_select'] = ($is_auth['auth_mod'] || IS_CP_HOLDER);
// Define show peers mode (count only || full details)
$s_mode = (isset($_GET['spmode']) && $_GET['spmode'] == 'full') ? 'full' : 'count';
$tor_file_size = humn_size($t_data['filesize']);
$tor_reged = (bool) $t_data['tracker_status'];
$bt_user_id = $userdata['user_id'];
$tor_file_size = humn_size($t_data['filesize']);
$tor_reged = (bool) $t_data['tracker_status'];
$locked = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED);
$tor_auth = ($bt_user_id != GUEST_UID && (($bt_user_id == $poster_id && !$locked) || $is_auth['auth_mod']));
$tor_auth = ($bt_user_id != GUEST_UID && (($bt_user_id == $poster_id && !$locked) || $is_auth['auth_mod'] || IS_CP_HOLDER));
if ($tor_auth && $t_data['allow_reg_tracker'] && !$tor_reged && !IS_CP_HOLDER /* && $post_id == $t_data['topic_first_post_id']*/)
if ($tor_auth && $t_data['allow_reg_tracker'] && !$tor_reged && !IS_CP_HOLDER && $post_id == $t_data['topic_first_post_id'])
{
$tr_reg_link = '<a class="txtb" href="#" onclick="ajax.exec({ action: \'change_torrent\', t : '. $topic_id .', type: \'reg\'}); return false;">'. $lang['BT_REG_ON_TRACKER'] .'</a>';
}
@ -75,7 +76,7 @@ else
if ($tor_reged && !$tor_info)
{
//DB()->query("UPDATE ". BB_TOPICS ." SET tracker_status = 0 WHERE topic_id = $topic_id LIMIT 1");
//bb_die('Torrent status fixed');
//bb_die('Torrent status fixed'); //TODO: восстановить
}
if ($tor_reged)
@ -96,7 +97,7 @@ if ($tor_reged)
{
$sql = "SELECT u.*, dl.user_status
FROM ". BB_BT_USERS ." u
LEFT JOIN ". BB_BT_DLSTATUS ." dl ON dl.user_id = $bt_user_id AND dl.topic_id = $bt_topic_id
LEFT JOIN ". BB_BT_DLSTATUS ." dl ON dl.user_id = $bt_user_id AND dl.topic_id = $topic_id
WHERE u.user_id = $bt_user_id
LIMIT 1";
}
@ -113,7 +114,7 @@ if ($tor_reged)
$user_status = isset($bt_userdata['user_status']) ? $bt_userdata['user_status'] : null;
if (($min_ratio_dl || $min_ratio_warn) && $user_status != DL_STATUS_COMPLETE && $bt_user_id != $poster_id && $tor_type != TOR_TYPE_GOLD)
if (($min_ratio_dl || $min_ratio_warn) && $user_status != DL_STATUS_COMPLETE && $bt_user_id != $poster_id && $tor_info['tor_type'] != TOR_TYPE_GOLD)
{
if (($user_ratio = get_bt_ratio($bt_userdata)) !== null)
{
@ -123,8 +124,8 @@ if ($tor_reged)
if ((isset($user_ratio) && isset($min_ratio_warn) && $user_ratio < $min_ratio_warn && TR_RATING_LIMITS) || ($bt_userdata['u_down_total'] < MIN_DL_FOR_RATIO))
{
$template->assign_vars(array(
'SHOW_RATIO_WARN' => true,
'RATIO_WARN_MSG' => sprintf($lang['BT_RATIO_WARNING_MSG'], $min_ratio_dl, $bb_cfg['ratio_url_help']),
'SHOW_RATIO_WARN' => true,
'RATIO_WARN_MSG' => sprintf($lang['BT_RATIO_WARNING_MSG'], $min_ratio_dl, $bb_cfg['ratio_url_help']),
));
}
}
@ -172,8 +173,6 @@ if ($tor_reged)
// Show peers
if ($tor_info['tor_status'] == TOR_CLOSED_CPHOLD)
{
$closed_by_cphold = true;
$template->assign_vars(array(
'TOR_CLOSED_BY_CPHOLD' => true,
'TOR_CONTROLS' => false,

View file

@ -108,7 +108,7 @@ if (isset($_POST['login']))
if ($login_err > $bb_cfg['invalid_logins']) $need_captcha = true;
if ($login_err > 50)
{
// TODO temp ban ip
// TODO: блокировка IP
}
CACHE('bb_login_err')->set('l_err_'. USER_IP, ($login_err + 1), 3600);
}

View file

@ -692,9 +692,9 @@ if ($mode == 'newtopic' || $post_data['first_post'])
'S_FORM_ENCTYPE' => 'enctype="multipart/form-data"',
'FILE_ATTACHED' => $file_attached,
'ATTACH_MAX_SIZE' => humn_size($bb_cfg['attach']['max_size']),
'ALLOWED_EXT' => ($allowed_ext) ? '*.' . join(', *.', $allowed_ext) : 'прикреплять запрещено',
'ALLOWED_EXT' => ($allowed_ext) ? '*.' . join(', *.', $allowed_ext) : 'прикреплять запрещено', // TODO: перевести
'TOR_REQUIRED' => !empty($_POST['tor_required']),
'POLL_TIP' => ($mode == 'newtopic') ? 'Вы сможете добавить опрос после создания темы' : 'Вы можете добавить опрос со страницы просмотра темы', // TODO
'POLL_TIP' => ($mode == 'newtopic') ? 'Вы сможете добавить опрос после создания темы' : 'Вы можете добавить опрос со страницы просмотра темы', // TODO: перевести
));
}

View file

@ -527,12 +527,6 @@ $template->assign_vars(array(
));
require(INC_DIR .'torrent_show_dl_list.php');
if ($t_data['topic_attachment'])
{
require(INC_DIR .'old_attachment.php');
init_display_post_attachments($t_data['topic_attachment']);
}
//
// Update the topic view counter
//
@ -743,11 +737,6 @@ for($i = 0; $i < $total_posts; $i++)
'RG_SIG_ATTACH' => $postrow[$i]['attach_rg_sig'],
));
if ($postrow[$i]['post_attachment'] && $is_auth['auth_download'] && function_exists('display_post_attachments'))
{
display_post_attachments($post_id, $postrow[$i]['post_attachment']);
}
if ($is_first_post && $t_data['attach_ext_id'])
{
if (IS_GUEST)