Фикс критичного бага с обновлением времени сообщений из r506 (спасибо PheRum); фикс ненулевого числа сообщений у гостя в пустой базе; фикс вывода блока с новостями трекера, в случае если они отключены (спасибо greencell); удаление пустых строк в конце всех .php-файлов; пара мелочей на будущие релизы. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@561 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08@gmail.com 2014-01-18 21:23:13 +00:00
commit 8bec4dc91f
83 changed files with 441 additions and 455 deletions

View file

@ -1434,7 +1434,7 @@ CREATE TABLE IF NOT EXISTS `bb_users` (
-- Дамп данных таблицы `bb_users` -- Дамп данных таблицы `bb_users`
-- --
INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 5, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 0, 0, '', 0, 0, 0, 0, '', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
INSERT INTO `bb_users` VALUES (2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, '0', 0, '0', 1, 1, 4.00, '', 0, 0, 0, 304, 1, '', 1, 0, 0, 0, 'admin@admin.com', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, '0', 0, '0', 1, 1, 4.00, '', 0, 0, 0, 304, 1, '', 1, 0, 0, 0, 'admin@admin.com', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');
INSERT INTO `bb_users` VALUES (-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, 'bot.gif', 1, 0, 0, 0, 'bot@bot.bot', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default'); INSERT INTO `bb_users` VALUES (-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, 'bot.gif', 1, 0, 0, 0, 'bot@bot.bot', '', '', '', '', '', '', '', '', '', '', 0, 0, 'default');

View file

@ -193,4 +193,5 @@ else
'S_ACTION' => "admin_topic_templates.php", 'S_ACTION' => "admin_topic_templates.php",
)); ));
} }
print_page('admin_topic_templates.tpl', 'admin'); print_page('admin_topic_templates.tpl', 'admin');

View file

@ -15,10 +15,12 @@ if (IS_GUEST)
{ {
redirect("login.php?redirect=admin/index.php"); redirect("login.php?redirect=admin/index.php");
} }
if (!IS_ADMIN) if (!IS_ADMIN)
{ {
message_die(GENERAL_MESSAGE, $lang['NOT_ADMIN']); message_die(GENERAL_MESSAGE, $lang['NOT_ADMIN']);
} }
if (!$userdata['session_admin']) if (!$userdata['session_admin'])
{ {
$redirect = url_arg($_SERVER['REQUEST_URI'], 'admin', 1); $redirect = url_arg($_SERVER['REQUEST_URI'], 'admin', 1);

View file

@ -245,4 +245,5 @@ $template->assign_vars(array(
); );
$template->pparse('body'); $template->pparse('body');
xs_exit(); xs_exit();

View file

@ -112,4 +112,5 @@ $template->assign_vars(array(
$template->set_filenames(array('body' => XS_TPL_PATH . 'config.tpl')); $template->set_filenames(array('body' => XS_TPL_PATH . 'config.tpl'));
$template->pparse('body'); $template->pparse('body');
xs_exit(); xs_exit();

View file

@ -69,4 +69,5 @@ $template->assign_vars(array(
)); ));
$template->pparse('body'); $template->pparse('body');
xs_exit(); xs_exit();

View file

@ -35,4 +35,5 @@ $template->assign_vars(array(
$template->set_filenames(array('body' => XS_TPL_PATH . 'index.tpl')); $template->set_filenames(array('body' => XS_TPL_PATH . 'index.tpl'));
$template->pparse('body'); $template->pparse('body');
xs_exit(); xs_exit();

View file

@ -23,6 +23,7 @@ $tor = DB()->fetch_row("
WHERE tor.attach_id = $attach_id WHERE tor.attach_id = $attach_id
LIMIT 1 LIMIT 1
"); ");
if (!$tor) $this->ajax_die($lang['TORRENT_FAILED']); if (!$tor) $this->ajax_die($lang['TORRENT_FAILED']);
switch($mode) switch($mode)
@ -80,10 +81,10 @@ switch($mode)
{ {
$subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']); $subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']);
$message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), $bb_cfg['tor_icons'][$new_status] .' '.$lang['TOR_STATUS_NAME'][$new_status]); $message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), $bb_cfg['tor_icons'][$new_status] .' '.$lang['TOR_STATUS_NAME'][$new_status]);
if ($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; if ($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment;
send_pm($tor['poster_id'], $subject, $message, $userdata['user_id']); send_pm($tor['poster_id'], $subject, $message, $userdata['user_id']);
cache_rm_user_sessions($tor['poster_id']); cache_rm_user_sessions($tor['poster_id']);
} }
} }
@ -93,12 +94,11 @@ switch($mode)
if (!$bb_cfg['tor_comment']) $this->ajax_die($lang['MODULE_OFF']); if (!$bb_cfg['tor_comment']) $this->ajax_die($lang['MODULE_OFF']);
$subject = sprintf($lang['TOR_AUTH_TITLE'], $tor['topic_title']); $subject = sprintf($lang['TOR_AUTH_TITLE'], $tor['topic_title']);
$message = sprintf($lang['TOR_AUTH_MSG'], get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']); $message = sprintf($lang['TOR_AUTH_MSG'], get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']);
if($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment; if($comment && $comment != $lang['COMMENT']) $message .= "\n\n[b]". $lang['COMMENT'] .'[/b]: '. $comment;
send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']); send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']);
cache_rm_user_sessions($tor['checked_user_id']); cache_rm_user_sessions($tor['checked_user_id']);
break; break;
} }

View file

@ -73,7 +73,6 @@ switch($mode)
$html .= ($moderators) ? join(', ', $moderators) : $lang['NONE']; $html .= ($moderators) ? join(', ', $moderators) : $lang['NONE'];
unset($moderators, $mod); unset($moderators, $mod);
$datastore->rm('moderators'); $datastore->rm('moderators');
break; break;
case 'change_tz': case 'change_tz':

View file

@ -93,6 +93,7 @@ switch($mode)
$this->response['info'] = $lang['USER_ACTIVATE_OFF']; $this->response['info'] = $lang['USER_ACTIVATE_OFF'];
break; break;
case "indexer": case "indexer":
exec("indexer --config {$bb_cfg['sphinx_config_path']} --all --rotate", $result); exec("indexer --config {$bb_cfg['sphinx_config_path']} --all --rotate", $result);
if (!is_file($bb_cfg['sphinx_config_path'].".log")) if (!is_file($bb_cfg['sphinx_config_path'].".log"))

View file

@ -21,6 +21,7 @@ switch($mode)
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>'; $html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
} }
break; break;
case 'check_email': case 'check_email':
$email = (string) $this->request['email']; $email = (string) $this->request['email'];
@ -33,6 +34,7 @@ switch($mode)
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>'; $html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
} }
break; break;
case 'check_pass': case 'check_pass':
$pass = (string) $this->request['pass']; $pass = (string) $this->request['pass'];
$pass_confirm = (string) $this->request['pass_confirm']; $pass_confirm = (string) $this->request['pass_confirm'];
@ -64,6 +66,7 @@ switch($mode)
} }
} }
break; break;
case 'refresh_captcha'; case 'refresh_captcha';
$html = CAPTCHA()->get_html(); $html = CAPTCHA()->get_html();
break; break;

View file

@ -10,10 +10,7 @@ if (!isset($this->request['attach_id']))
} }
$attach_id = (int) $this->request['attach_id']; $attach_id = (int) $this->request['attach_id'];
$torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename $torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename FROM ". BB_ATTACHMENTS_DESC ." at WHERE at.attach_id = $attach_id LIMIT 1");
FROM ". BB_ATTACHMENTS_DESC ." at
WHERE at.attach_id = $attach_id
LIMIT 1");
if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']); if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']);
$filename = get_attachments_dir() .'/'. $torrent['physical_filename']; $filename = get_attachments_dir() .'/'. $torrent['physical_filename'];
@ -173,4 +170,3 @@ function clean_tor_dirname ($dirname)
} }
$this->response['html'] = $tor_filelist; $this->response['html'] = $tor_filelist;

View file

@ -55,8 +55,8 @@ $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'] = '17-01-2014'; $bb_cfg['tp_release_date'] = '19-01-2014';
$bb_cfg['tp_release_state'] = 'R560'; $bb_cfg['tp_release_state'] = 'R561';
// Database // Database
$charset = 'utf8'; $charset = 'utf8';

View file

@ -4,4 +4,3 @@
$bb_cfg['dbg']['interpreter'] = 'cmd.exe /c START'; $bb_cfg['dbg']['interpreter'] = 'cmd.exe /c START';
$bb_cfg['dbg']['editor_path'] = 'D:\Programs\TextPad\TextPad.exe'; $bb_cfg['dbg']['editor_path'] = 'D:\Programs\TextPad\TextPad.exe';
$bb_cfg['dbg']['editor_args'] = '%s(%s)'; // %s - file_to_open path, %s - line number $bb_cfg['dbg']['editor_args'] = '%s(%s)'; // %s - file_to_open path, %s - line number

View file

@ -104,4 +104,3 @@ class bb_error_handler
$errHandler = new bb_error_handler; $errHandler = new bb_error_handler;
set_error_handler(array(&$errHandler, 'bb_error_handler')); set_error_handler(array(&$errHandler, 'bb_error_handler'));

View file

@ -156,7 +156,7 @@ class profiler_dbg extends profiler
var $min_time = 0; var $min_time = 0;
var $total_time = 0; var $total_time = 0;
// $min_time - минимальное время выполнения для вывода в подробной построковой информации (в секундах или %) // $min_time - минимальное время выполнения для вывода в подробной построковой информации (в секундах или %)
// //
function print_profile_data ($min_time = 0) function print_profile_data ($min_time = 0)
{ {
@ -371,7 +371,3 @@ class profiler_dbg extends profiler
return ($a['time'] > $b['time']) ? -1 : 1; return ($a['time'] > $b['time']) ? -1 : 1;
} }
} }

View file

@ -187,9 +187,9 @@ if ($bb_cfg['show_ads'])
$ad_block_assignment[$block_id][] = $ad['ad_id']; $ad_block_assignment[$block_id][] = $ad['ad_id'];
} }
} }
$ad_html[$ad['ad_id']] = $ad['ad_html']; $ad_html[$ad['ad_id']] = $ad['ad_html'];
} }
$this->store('ads', $ad_html); $this->store('ads', $ad_html);
bb_update_config(array('active_ads' => serialize($ad_block_assignment))); bb_update_config(array('active_ads' => serialize($ad_block_assignment)));
} }

View file

@ -2815,7 +2815,8 @@ function profile_url($data)
return $profile; return $profile;
} }
function seo_link_header($str){ function seo_link_header ($str)
{
/** /**
* Функция обработки url. Сверяет url с переданным выражением. * Функция обработки url. Сверяет url с переданным выражением.
*/ */

View file

@ -159,41 +159,26 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
$topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL; $topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL;
if (($mode == 'editpost' && $post_data['first_post'])) $sql_insert = "
{ INSERT INTO
$sql_update = " " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote)
UPDATE VALUES
". BB_POSTS ." p, ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote)
". BB_TOPICS ." t
SET
p.post_time = ". TIMENOW .",
t.topic_title = '$post_subject',
t.topic_type = $topic_type,
t.topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ",
t.topic_vote = " . $topic_vote : "") . ",
t.topic_last_post_time = ". TIMENOW .",
t.topic_time = ". TIMENOW ."
WHERE
t.topic_id = $topic_id
AND t.topic_first_post_id = p.post_id
"; ";
}
else
{
$sql_update = " $sql_update = "
UPDATE UPDATE
" . BB_TOPICS . " " . BB_TOPICS . "
SET SET
topic_title = '$post_subject', topic_title = '$post_subject',
topic_type = $topic_type, topic_type = $topic_type,
topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_dl_type = $topic_dl_type
topic_vote = " . $topic_vote : "") . " ". ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = ". $topic_vote : "") ."
WHERE WHERE
topic_id = $topic_id topic_id = $topic_id
"; ";
}
$sql = ($mode != "editpost") ? "INSERT INTO " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote)" : $sql_update; $sql = ($mode != "editpost") ? $sql_insert : $sql_update;
if (!DB()->sql_query($sql)) if (!DB()->sql_query($sql))
{ {

View file

@ -580,8 +580,7 @@ $dl_status_css = array(
DL_STATUS_CANCEL => 'dlCancel', DL_STATUS_CANCEL => 'dlCancel',
); );
// Show 'Board is disabled' message if needed
// Show 'Board is disabled' message if needed.
if ($bb_cfg['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN')) if ($bb_cfg['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN'))
{ {
message_die(GENERAL_MESSAGE, 'BOARD_DISABLE'); message_die(GENERAL_MESSAGE, 'BOARD_DISABLE');

View file

@ -66,6 +66,7 @@ if ($edit_tpl_mode)
'NO_TPL_ASSIGNED' => !($f_data['forum_tpl_id']), 'NO_TPL_ASSIGNED' => !($f_data['forum_tpl_id']),
'TPL_SELECT' => get_select('forum_tpl', $f_data['forum_tpl_id']), 'TPL_SELECT' => get_select('forum_tpl', $f_data['forum_tpl_id']),
)); ));
if ($tpl_data) if ($tpl_data)
{ {
$template->assign_vars(array( $template->assign_vars(array(
@ -79,4 +80,3 @@ if ($edit_tpl_mode)
} }
print_page('posting_tpl.tpl'); print_page('posting_tpl.tpl');

View file

@ -18,4 +18,5 @@ $lang['TPL']['GUIDE'] = array(
'audio' => 330984, 'audio' => 330984,
'torrent' => 330985, 'torrent' => 330985,
); );
$lang['TPL']['GUIDE'] = array(); $lang['TPL']['GUIDE'] = array();

View file

@ -22,9 +22,7 @@ if ( !$userdata['session_logged_in'] )
redirect("login.php?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id"); redirect("login.php?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id");
} }
$sql = "SELECT username, user_email, user_lang $sql = "SELECT username, user_email, user_lang FROM " . BB_USERS . " WHERE user_id = $user_id";
FROM " . BB_USERS . "
WHERE user_id = $user_id";
if ( $row = DB()->fetch_row($sql) ) if ( $row = DB()->fetch_row($sql) )
{ {
$username = $row['username']; $username = $row['username'];

View file

@ -50,4 +50,3 @@
</fieldset> </fieldset>
<p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ Закрыть ]</a></p> <p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ Закрыть ]</a></p>
</div><!--/infobox-wrap--> </div><!--/infobox-wrap-->

View file

@ -21,4 +21,3 @@
</fieldset> </fieldset>
<p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ Закрыть ]</a></p> <p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ Закрыть ]</a></p>
</div><!--/infobox-wrap--> </div><!--/infobox-wrap-->

View file

@ -138,4 +138,3 @@ echo '</body></html>';
DB()->query("DROP TEMPORARY TABLE ". TMP_TRACKER_TABLE); DB()->query("DROP TEMPORARY TABLE ". TMP_TRACKER_TABLE);
bb_exit(); bb_exit();

View file

@ -17,6 +17,10 @@
<!-- IF INCLUDE_BBCODE_JS --> <!-- IF INCLUDE_BBCODE_JS -->
<script type="text/javascript" src="{SITE_URL}misc/js/bbcode.js?v={$bb_cfg['js_ver']}"></script> <script type="text/javascript" src="{SITE_URL}misc/js/bbcode.js?v={$bb_cfg['js_ver']}"></script>
<script type="text/javascript">
window.BB = {};
window.encURL = encodeURIComponent;
</script>
<script type="text/javascript"> <script type="text/javascript">
var postImg_MaxWidth = screen.width - {POST_IMG_WIDTH_DECR_JS}; var postImg_MaxWidth = screen.width - {POST_IMG_WIDTH_DECR_JS};
var postImgAligned_MaxWidth = Math.round(screen.width/3); var postImgAligned_MaxWidth = Math.round(screen.width/3);
@ -577,8 +581,6 @@ important_info
<!--/menus--> <!--/menus-->
<!--page_content--> <!--page_content-->
<div id="page_content"> <div id="page_content">
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"> <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
@ -613,8 +615,8 @@ important_info
<div id="latest_news"> <div id="latest_news">
<table cellspacing="0" cellpadding="0" width="100%"> <table cellspacing="0" cellpadding="0" width="100%">
<tr> <tr>
<td width="50%">
<!-- IF SHOW_LATEST_NEWS --> <!-- IF SHOW_LATEST_NEWS -->
<td width="50%">
<h3>{L_LATEST_NEWS}</h3> <h3>{L_LATEST_NEWS}</h3>
<table cellpadding="0"> <table cellpadding="0">
<!-- BEGIN news --> <!-- BEGIN news -->
@ -626,8 +628,8 @@ important_info
</tr> </tr>
<!-- END news --> <!-- END news -->
</table> </table>
<!-- ENDIF -->
</td> </td>
<!-- ENDIF -->
<!-- IF SHOW_NETWORK_NEWS --> <!-- IF SHOW_NETWORK_NEWS -->
<td width="50%"> <td width="50%">
@ -648,8 +650,11 @@ important_info
</table> </table>
</div> </div>
<!-- IF AD_BLOCK_200 -->
<!-- IF AD_BLOCK_200 --><div id="ad-200">{AD_BLOCK_200}</div><!--/ad-200--><!-- ELSEIF AD_BLOCK_100 --><div id="ad-100">{AD_BLOCK_100}</div><!--/ad-100--><!-- ENDIF / AD_BLOCK_100 --> <div id="ad-200">{AD_BLOCK_200}</div><!--/ad-200-->
<!-- ELSEIF AD_BLOCK_100 -->
<div id="ad-100">{AD_BLOCK_100}</div><!--/ad-100-->
<!-- ENDIF / AD_BLOCK_100 -->
<!--=======================--> <!--=======================-->
<!-- ENDIF / COMMON_HEADER --> <!-- ENDIF / COMMON_HEADER -->