mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 21:03:54 -07:00
r561
Фикс критичного бага с обновлением времени сообщений из r506 (спасибо PheRum); фикс ненулевого числа сообщений у гостя в пустой базе; фикс вывода блока с новостями трекера, в случае если они отключены (спасибо greencell); удаление пустых строк в конце всех .php-файлов; пара мелочей на будущие релизы. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@561 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
a48ea08a1f
commit
8bec4dc91f
83 changed files with 441 additions and 455 deletions
|
@ -1434,7 +1434,7 @@ CREATE TABLE IF NOT EXISTS `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 (-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');
|
||||
|
||||
|
|
|
@ -37,13 +37,13 @@ else if ($mode == 'add' || $mode == 'edit')
|
|||
'TPL' => true,
|
||||
));
|
||||
|
||||
if($mode == 'edit')
|
||||
if ($mode == 'edit')
|
||||
{
|
||||
$tpl_id = (int) request_var('tpl', '');
|
||||
if(!$tpl_id) bb_die('');
|
||||
if (!$tpl_id) bb_die('');
|
||||
|
||||
$row = DB()->fetch_row("SELECT * FROM ". BB_TOPIC_TPL_OLD ." WHERE tpl_id = $tpl_id");
|
||||
if(!$row) bb_die('');
|
||||
if (!$row) bb_die('');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_ACTION' => "admin_topic_templates.php?mode=edit&tpl=$tpl_id",
|
||||
|
@ -68,9 +68,9 @@ else if ($mode == 'add' || $mode == 'edit')
|
|||
'DESC' => $tpl_desc,
|
||||
));
|
||||
|
||||
if(isset($_POST['submit']))
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
if($mode == 'edit')
|
||||
if ($mode == 'edit')
|
||||
{
|
||||
DB()->query("UPDATE ". BB_TOPIC_TPL_OLD ." SET
|
||||
tpl_name = '". DB()->escape($tpl_name) ."',
|
||||
|
@ -91,7 +91,7 @@ else if ($mode == 'add' || $mode == 'edit')
|
|||
bb_die($message);
|
||||
}
|
||||
}
|
||||
else if ($mode == 'delete')
|
||||
elseif ($mode == 'delete')
|
||||
{
|
||||
$tpl_ids = isset($_POST['tpl_id']) ? $_POST['tpl_id'] : bb_die($lang['NOT_CHOOSE']);
|
||||
|
||||
|
@ -193,4 +193,5 @@ else
|
|||
'S_ACTION' => "admin_topic_templates.php",
|
||||
));
|
||||
}
|
||||
|
||||
print_page('admin_topic_templates.tpl', 'admin');
|
|
@ -15,10 +15,12 @@ if (IS_GUEST)
|
|||
{
|
||||
redirect("login.php?redirect=admin/index.php");
|
||||
}
|
||||
|
||||
if (!IS_ADMIN)
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['NOT_ADMIN']);
|
||||
}
|
||||
|
||||
if (!$userdata['session_admin'])
|
||||
{
|
||||
$redirect = url_arg($_SERVER['REQUEST_URI'], 'admin', 1);
|
||||
|
|
|
@ -245,4 +245,5 @@ $template->assign_vars(array(
|
|||
);
|
||||
|
||||
$template->pparse('body');
|
||||
|
||||
xs_exit();
|
|
@ -112,4 +112,5 @@ $template->assign_vars(array(
|
|||
|
||||
$template->set_filenames(array('body' => XS_TPL_PATH . 'config.tpl'));
|
||||
$template->pparse('body');
|
||||
|
||||
xs_exit();
|
|
@ -69,4 +69,5 @@ $template->assign_vars(array(
|
|||
));
|
||||
|
||||
$template->pparse('body');
|
||||
|
||||
xs_exit();
|
|
@ -35,4 +35,5 @@ $template->assign_vars(array(
|
|||
|
||||
$template->set_filenames(array('body' => XS_TPL_PATH . 'index.tpl'));
|
||||
$template->pparse('body');
|
||||
|
||||
xs_exit();
|
|
@ -9,7 +9,7 @@ if (!isset($this->request['attach_id'])) $this->ajax_die($lang['EMPTY_ATTACH_ID'
|
|||
$attach_id = (int) $this->request['attach_id'];
|
||||
$mode = (string) $this->request['mode'];
|
||||
|
||||
if($bb_cfg['tor_comment'])
|
||||
if ($bb_cfg['tor_comment'])
|
||||
{
|
||||
$comment = (string) $this->request['comment'];
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ $tor = DB()->fetch_row("
|
|||
WHERE tor.attach_id = $attach_id
|
||||
LIMIT 1
|
||||
");
|
||||
|
||||
if (!$tor) $this->ajax_die($lang['TORRENT_FAILED']);
|
||||
|
||||
switch($mode)
|
||||
|
@ -33,7 +34,7 @@ switch($mode)
|
|||
// Валидность статуса
|
||||
if (!isset($lang['TOR_STATUS_NAME'][$new_status])) $this->ajax_die($lang['TOR_STATUS_FAILED']);
|
||||
if (!isset($this->request['status'])) $this->ajax_die($lang['TOR_DONT_CHANGE']);
|
||||
if(!IS_AM) $this->ajax_die($lang['NOT_MODERATOR']);
|
||||
if (!IS_AM) $this->ajax_die($lang['NOT_MODERATOR']);
|
||||
|
||||
// Тот же статус
|
||||
if ($tor['tor_status'] == $new_status)
|
||||
|
@ -74,31 +75,30 @@ switch($mode)
|
|||
|
||||
$this->response['status'] = $bb_cfg['tor_icons'][$new_status] .' <b> '. $lang['TOR_STATUS_NAME'][$new_status]. '</b> · '. profile_url($userdata) .' · <i>'. delta_time(TIMENOW) . $lang['BACK']. '</i>';
|
||||
|
||||
if($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply'])))
|
||||
if ($bb_cfg['tor_comment'] && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, $bb_cfg['tor_reply'])))
|
||||
{
|
||||
if($tor['poster_id'] > 0)
|
||||
if ($tor['poster_id'] > 0)
|
||||
{
|
||||
$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]);
|
||||
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']);
|
||||
|
||||
cache_rm_user_sessions($tor['poster_id']);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'status_reply':
|
||||
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']);
|
||||
|
||||
$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;
|
||||
|
||||
send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']);
|
||||
|
||||
cache_rm_user_sessions($tor['checked_user_id']);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,6 @@ switch($mode)
|
|||
$html .= ($moderators) ? join(', ', $moderators) : $lang['NONE'];
|
||||
unset($moderators, $mod);
|
||||
$datastore->rm('moderators');
|
||||
|
||||
break;
|
||||
|
||||
case 'change_tz':
|
||||
|
|
|
@ -7,7 +7,7 @@ global $userdata, $lang, $bb_cfg;
|
|||
$mode = (string) $this->request['mode'];
|
||||
$user_id = $this->request['user_id'];
|
||||
|
||||
switch($mode)
|
||||
switch ($mode)
|
||||
{
|
||||
case 'clear_cache':
|
||||
$gc_cache = array(
|
||||
|
@ -93,14 +93,15 @@ switch($mode)
|
|||
|
||||
$this->response['info'] = $lang['USER_ACTIVATE_OFF'];
|
||||
break;
|
||||
|
||||
case "indexer":
|
||||
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"))
|
||||
{
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", "####Logger from dimka3210.####".date("H:i:s", TIMENOW)."##############################\r\n\r\n\r\n\r\n", FILE_APPEND);
|
||||
}
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", "##############################".date("H:i:s", TIMENOW)."##############################\r\n", FILE_APPEND);
|
||||
foreach($result as $row)
|
||||
foreach ($result as $row)
|
||||
{
|
||||
file_put_contents($bb_cfg['sphinx_config_path'].".log", $row."\r\n", FILE_APPEND);
|
||||
}
|
||||
|
|
|
@ -46,16 +46,16 @@ switch ($mode)
|
|||
|
||||
DB()->query("UPDATE ". BB_TOPICS ." SET topic_title = '$topic_title_sql' WHERE topic_id = $topic_id LIMIT 1");
|
||||
|
||||
//Обновление кеша новостей на главной
|
||||
// Обновление кеша новостей на главной
|
||||
$news_forums = array_flip(explode(',', $bb_cfg['latest_news_forum_id']));
|
||||
if(isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news'])
|
||||
if (isset($news_forums[$t_data['forum_id']]) && $bb_cfg['show_latest_news'])
|
||||
{
|
||||
$datastore->enqueue('latest_news');
|
||||
$datastore->update('latest_news');
|
||||
}
|
||||
|
||||
$net_forums = array_flip(explode(',', $bb_cfg['network_news_forum_id']));
|
||||
if(isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news'])
|
||||
if (isset($net_forums[$t_data['forum_id']]) && $bb_cfg['show_network_news'])
|
||||
{
|
||||
$datastore->enqueue('network_news');
|
||||
$datastore->update('network_news');
|
||||
|
@ -69,7 +69,7 @@ switch ($mode)
|
|||
$user_id = (int) $this->request['user_id'];
|
||||
$profiledata = get_userdata($user_id);
|
||||
|
||||
if(!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
if (!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
|
||||
$reg_ip = DB()->fetch_rowset("SELECT username, user_id, user_rank FROM ". BB_USERS ."
|
||||
WHERE user_reg_ip = '{$profiledata['user_reg_ip']}'
|
||||
|
@ -84,7 +84,7 @@ switch ($mode)
|
|||
|
||||
$link_reg_ip = $link_last_ip = '';
|
||||
|
||||
if(!empty($reg_ip))
|
||||
if (!empty($reg_ip))
|
||||
{
|
||||
$link_reg_ip .= $lang['OTHER_IP'] .' ';
|
||||
foreach ($reg_ip as $row)
|
||||
|
@ -93,7 +93,7 @@ switch ($mode)
|
|||
}
|
||||
}
|
||||
|
||||
if(!empty($last_ip))
|
||||
if (!empty($last_ip))
|
||||
{
|
||||
$link_last_ip .= $lang['OTHER_IP'] .' ';
|
||||
foreach ($last_ip as $row)
|
||||
|
|
|
@ -50,7 +50,7 @@ if (!defined('WORD_LIST_OBTAINED'))
|
|||
switch($this->request['type'])
|
||||
{
|
||||
case 'delete';
|
||||
if($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW)))
|
||||
if ($post['post_id'] != $post['topic_first_post_id'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $is_auth['auth_delete'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600*3 > TIMENOW)))
|
||||
{
|
||||
if (empty($this->request['confirmed']))
|
||||
{
|
||||
|
@ -89,11 +89,11 @@ switch($this->request['type'])
|
|||
$message = (!empty($message)) ? preg_replace($orig_word, $replace_word, $message) : '';
|
||||
}
|
||||
|
||||
if($post['post_id'] == $post['topic_first_post_id'])
|
||||
if ($post['post_id'] == $post['topic_first_post_id'])
|
||||
{
|
||||
$message = "[quote]". $post['topic_title'] ."[/quote]\n";
|
||||
}
|
||||
if(mb_strlen($message, 'UTF-8') > 1000)
|
||||
if (mb_strlen($message, 'UTF-8') > 1000)
|
||||
{
|
||||
$this->response['redirect'] = make_url('posting.php?mode=quote&p='. $post_id);
|
||||
}
|
||||
|
@ -117,23 +117,23 @@ switch($this->request['type'])
|
|||
{
|
||||
$this->ajax_die($lang['EDIT_OWN_POSTS']);
|
||||
}
|
||||
if((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id))
|
||||
if ((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id))
|
||||
{
|
||||
$this->response['redirect'] = make_url('posting.php?mode=editpost&p='. $post_id);
|
||||
}
|
||||
else if($this->request['type'] == 'editor')
|
||||
elseif ($this->request['type'] == 'editor')
|
||||
{
|
||||
$text = (string) $this->request['text'];
|
||||
$text = prepare_message($text);
|
||||
|
||||
if(mb_strlen($text) > 2)
|
||||
if (mb_strlen($text) > 2)
|
||||
{
|
||||
if($text != $post['post_text'])
|
||||
if ($text != $post['post_text'])
|
||||
{
|
||||
if($bb_cfg['max_smilies'])
|
||||
if ($bb_cfg['max_smilies'])
|
||||
{
|
||||
$count_smilies = substr_count(bbcode2html($text), '<img class="smile" src="'. $bb_cfg['smilies_path']);
|
||||
if($count_smilies > $bb_cfg['max_smilies'])
|
||||
if ($count_smilies > $bb_cfg['max_smilies'])
|
||||
{
|
||||
$this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies']));
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ switch($this->request['type'])
|
|||
{
|
||||
$this->ajax_die($lang['TOPIC_LOCKED']);
|
||||
}
|
||||
else if(!$is_auth['auth_edit'])
|
||||
elseif (!$is_auth['auth_edit'])
|
||||
{
|
||||
$this->ajax_die(sprintf($lang['SORRY_AUTH_EDIT'], strip_tags($is_auth['auth_edit_type'])));
|
||||
}
|
||||
|
@ -222,11 +222,11 @@ switch($this->request['type'])
|
|||
$this->ajax_die('empty topic_id');
|
||||
}
|
||||
|
||||
if(bf($userdata['user_opt'], 'user_opt', 'allow_post'))
|
||||
if (bf($userdata['user_opt'], 'user_opt', 'allow_post'))
|
||||
{
|
||||
$this->ajax_die($lang['RULES_REPLY_CANNOT']);
|
||||
}
|
||||
else if(!$is_auth['auth_reply'])
|
||||
elseif (!$is_auth['auth_reply'])
|
||||
{
|
||||
$this->ajax_die(sprintf($lang['SORRY_AUTH_REPLY'], strip_tags($is_auth['auth_reply_type'])));
|
||||
}
|
||||
|
@ -276,10 +276,10 @@ switch($this->request['type'])
|
|||
}
|
||||
}
|
||||
|
||||
if($bb_cfg['max_smilies'])
|
||||
if ($bb_cfg['max_smilies'])
|
||||
{
|
||||
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="'. $bb_cfg['smilies_path']);
|
||||
if($count_smilies > $bb_cfg['max_smilies'])
|
||||
if ($count_smilies > $bb_cfg['max_smilies'])
|
||||
{
|
||||
$this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies']));
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ switch($mode)
|
|||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'check_email':
|
||||
$email = (string) $this->request['email'];
|
||||
|
||||
|
@ -33,6 +34,7 @@ switch($mode)
|
|||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'check_pass':
|
||||
$pass = (string) $this->request['pass'];
|
||||
$pass_confirm = (string) $this->request['pass_confirm'];
|
||||
|
@ -64,6 +66,7 @@ switch($mode)
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'refresh_captcha';
|
||||
$html = CAPTCHA()->get_html();
|
||||
break;
|
||||
|
|
|
@ -10,9 +10,9 @@ switch ($mode)
|
|||
{
|
||||
case 'active_torrents':
|
||||
$user_id = (int) $this->request['user_id'];
|
||||
if(!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
if (!$user_id) $this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
$user_info = get_userdata($user_id);
|
||||
if(!bf($user_info['user_opt'], 'user_opt', 'allow_dls') && !IS_AM && $user_id != $userdata['user_id']) $this->ajax_die($lang['CUR_ACTIVE_DLS_DISALLOWED']);
|
||||
if (!bf($user_info['user_opt'], 'user_opt', 'allow_dls') && !IS_AM && $user_id != $userdata['user_id']) $this->ajax_die($lang['CUR_ACTIVE_DLS_DISALLOWED']);
|
||||
|
||||
$excluded_forums_csv = $user->get_excluded_forums(AUTH_VIEW);
|
||||
$not_auth_forums_sql = ($excluded_forums_csv) ? "
|
||||
|
|
|
@ -10,11 +10,8 @@ if (!isset($this->request['attach_id']))
|
|||
}
|
||||
$attach_id = (int) $this->request['attach_id'];
|
||||
|
||||
$torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename
|
||||
FROM ". BB_ATTACHMENTS_DESC ." at
|
||||
WHERE at.attach_id = $attach_id
|
||||
LIMIT 1");
|
||||
if(!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']);
|
||||
$torrent = DB()->fetch_row("SELECT at.attach_id, at.physical_filename FROM ". BB_ATTACHMENTS_DESC ." at WHERE at.attach_id = $attach_id LIMIT 1");
|
||||
if (!$torrent) $this->ajax_die($lang['EMPTY_ATTACH_ID']);
|
||||
$filename = get_attachments_dir() .'/'. $torrent['physical_filename'];
|
||||
|
||||
if (($file_contents = @file_get_contents($filename)) === false)
|
||||
|
@ -173,4 +170,3 @@ function clean_tor_dirname ($dirname)
|
|||
}
|
||||
|
||||
$this->response['html'] = $tor_filelist;
|
||||
|
||||
|
|
|
@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
|
|||
|
||||
// Increase number of revision after update
|
||||
$bb_cfg['tp_version'] = '2.5 (unstable)';
|
||||
$bb_cfg['tp_release_date'] = '17-01-2014';
|
||||
$bb_cfg['tp_release_state'] = 'R560';
|
||||
$bb_cfg['tp_release_date'] = '19-01-2014';
|
||||
$bb_cfg['tp_release_state'] = 'R561';
|
||||
|
||||
// Database
|
||||
$charset = 'utf8';
|
||||
|
|
|
@ -4,4 +4,3 @@
|
|||
$bb_cfg['dbg']['interpreter'] = 'cmd.exe /c START';
|
||||
$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
|
||||
|
||||
|
|
|
@ -104,4 +104,3 @@ class bb_error_handler
|
|||
|
||||
$errHandler = new bb_error_handler;
|
||||
set_error_handler(array(&$errHandler, 'bb_error_handler'));
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ class profiler_dbg extends profiler
|
|||
var $min_time = 0;
|
||||
var $total_time = 0;
|
||||
|
||||
// $min_time - минимальное время выполнения для вывода в подробной построковой информации (в секундах или %)
|
||||
// $min_time - минимальное время выполнения для вывода в подробной построковой информации (в секундах или %)
|
||||
//
|
||||
function print_profile_data ($min_time = 0)
|
||||
{
|
||||
|
@ -371,7 +371,3 @@ class profiler_dbg extends profiler
|
|||
return ($a['time'] > $b['time']) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -187,9 +187,9 @@ if ($bb_cfg['show_ads'])
|
|||
$ad_block_assignment[$block_id][] = $ad['ad_id'];
|
||||
}
|
||||
}
|
||||
|
||||
$ad_html[$ad['ad_id']] = $ad['ad_html'];
|
||||
}
|
||||
|
||||
$this->store('ads', $ad_html);
|
||||
bb_update_config(array('active_ads' => serialize($ad_block_assignment)));
|
||||
}
|
|
@ -2745,18 +2745,18 @@ function get_path_from_id ($id, $ext_id, $base_path, $first_div, $sec_div)
|
|||
return ($base_path ? "$base_path/" : '') . ($id % $sec_div) .'/'. $id . ($ext ? ".$ext" : '');
|
||||
}
|
||||
|
||||
function send_pm($user_id, $subject, $message, $poster_id = BOT_UID)
|
||||
function send_pm ($user_id, $subject, $message, $poster_id = BOT_UID)
|
||||
{
|
||||
global $userdata;
|
||||
|
||||
$subject = DB()->escape($subject);
|
||||
$message = DB()->escape($message);
|
||||
|
||||
if($poster_id == BOT_UID)
|
||||
if ($poster_id == BOT_UID)
|
||||
{
|
||||
$poster_ip = '7f000001';
|
||||
}
|
||||
else if($row = DB()->fetch_row("SELECT user_reg_ip FROM ". BB_USERS ." WHERE user_id = $poster_id"))
|
||||
elseif ($row = DB()->fetch_row("SELECT user_reg_ip FROM ". BB_USERS ." WHERE user_id = $poster_id"))
|
||||
{
|
||||
$poster_ip = $row['user_reg_ip'];
|
||||
}
|
||||
|
@ -2780,7 +2780,7 @@ function send_pm($user_id, $subject, $message, $poster_id = BOT_UID)
|
|||
WHERE user_id = $user_id");
|
||||
}
|
||||
|
||||
function profile_url($data)
|
||||
function profile_url ($data)
|
||||
{
|
||||
global $bb_cfg, $lang, $datastore;
|
||||
|
||||
|
@ -2792,22 +2792,22 @@ function profile_url($data)
|
|||
|
||||
$user_rank = !empty($data['user_rank']) ? $data['user_rank'] : 0;
|
||||
|
||||
if(isset($ranks[$user_rank]))
|
||||
if (isset($ranks[$user_rank]))
|
||||
{
|
||||
$title = $ranks[$user_rank]['rank_title'];
|
||||
$style = $ranks[$user_rank]['rank_style'];
|
||||
}
|
||||
if(empty($title)) $title = $lang['USER'];
|
||||
if(empty($style)) $style = 'colorUser';
|
||||
if (empty($title)) $title = $lang['USER'];
|
||||
if (empty($style)) $style = 'colorUser';
|
||||
|
||||
if(!$bb_cfg['color_nick']) $style = '';
|
||||
if (!$bb_cfg['color_nick']) $style = '';
|
||||
|
||||
$username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
|
||||
$user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : GUEST_UID;
|
||||
|
||||
$profile = '<span title="'. $title .'" class="'. $style .'">'. $username .'</span>';
|
||||
|
||||
if(!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username)
|
||||
if (!in_array($user_id, array('', GUEST_UID, BOT_UID)) && $username)
|
||||
{
|
||||
$profile = '<a href="'. make_url(PROFILE_URL . $user_id) .'">'. $profile .'</a>';
|
||||
}
|
||||
|
@ -2815,7 +2815,8 @@ function profile_url($data)
|
|||
return $profile;
|
||||
}
|
||||
|
||||
function seo_link_header($str){
|
||||
function seo_link_header ($str)
|
||||
{
|
||||
/**
|
||||
* Функция обработки url. Сверяет url с переданным выражением.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
||||
if (($mode == 'editpost' && $post_data['first_post']))
|
||||
{
|
||||
$sql_update = "
|
||||
UPDATE
|
||||
". BB_POSTS ." p,
|
||||
". 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
|
||||
$sql_insert = "
|
||||
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)
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$sql_update = "
|
||||
UPDATE
|
||||
" . BB_TOPICS . "
|
||||
SET
|
||||
topic_title = '$post_subject',
|
||||
topic_type = $topic_type,
|
||||
topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ",
|
||||
topic_vote = " . $topic_vote : "") . "
|
||||
topic_dl_type = $topic_dl_type
|
||||
". ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = ". $topic_vote : "") ."
|
||||
WHERE
|
||||
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))
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
|
|||
//
|
||||
// Pick a language, any language
|
||||
//
|
||||
function language_select($default, $select_name = "language", $dirname="language")
|
||||
function language_select ($default, $select_name = "language", $dirname="language")
|
||||
{
|
||||
global $bb_cfg;
|
||||
if(!$default) $default = $bb_cfg['default_lang'];
|
||||
|
@ -43,7 +43,7 @@ function language_select($default, $select_name = "language", $dirname="language
|
|||
//
|
||||
// Pick a timezone
|
||||
//
|
||||
function tz_select($default, $select_name = 'timezone')
|
||||
function tz_select ($default, $select_name = 'timezone')
|
||||
{
|
||||
global $sys_timezone, $lang;
|
||||
|
||||
|
@ -66,7 +66,7 @@ function tz_select($default, $select_name = 'timezone')
|
|||
//
|
||||
// Templates
|
||||
//
|
||||
function templates_select($default_style, $select_name = 'tpl_name')
|
||||
function templates_select ($default_style, $select_name = 'tpl_name')
|
||||
{
|
||||
global $bb_cfg;
|
||||
|
||||
|
|
|
@ -580,8 +580,7 @@ $dl_status_css = array(
|
|||
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'))
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, 'BOARD_DISABLE');
|
||||
|
|
|
@ -352,7 +352,7 @@ $template->pparse('page_header');
|
|||
|
||||
define('PAGE_HEADER_SENT', true);
|
||||
|
||||
if(!$bb_cfg['gzip_compress'])
|
||||
if (!$bb_cfg['gzip_compress'])
|
||||
{
|
||||
flush();
|
||||
}
|
|
@ -66,6 +66,7 @@ if ($edit_tpl_mode)
|
|||
'NO_TPL_ASSIGNED' => !($f_data['forum_tpl_id']),
|
||||
'TPL_SELECT' => get_select('forum_tpl', $f_data['forum_tpl_id']),
|
||||
));
|
||||
|
||||
if ($tpl_data)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
|
@ -79,4 +80,3 @@ if ($edit_tpl_mode)
|
|||
}
|
||||
|
||||
print_page('posting_tpl.tpl');
|
||||
|
||||
|
|
|
@ -18,4 +18,5 @@ $lang['TPL']['GUIDE'] = array(
|
|||
'audio' => 330984,
|
||||
'torrent' => 330985,
|
||||
);
|
||||
|
||||
$lang['TPL']['GUIDE'] = array();
|
|
@ -28,7 +28,7 @@ if (isset($_POST['bonus_id']))
|
|||
$upload = $upload_row[$id]*1024*1024*1024;
|
||||
$points = $price_row[$id];
|
||||
|
||||
if($userdata['user_points'] < $points)
|
||||
if ($userdata['user_points'] < $points)
|
||||
{
|
||||
meta_refresh('index.php', 5);
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@ if ( !$userdata['session_logged_in'] )
|
|||
redirect("login.php?redirect=profile.php&mode=email&" . POST_USERS_URL . "=$user_id");
|
||||
}
|
||||
|
||||
$sql = "SELECT username, user_email, user_lang
|
||||
FROM " . BB_USERS . "
|
||||
WHERE user_id = $user_id";
|
||||
$sql = "SELECT username, user_email, user_lang FROM " . BB_USERS . " WHERE user_id = $user_id";
|
||||
if ( $row = DB()->fetch_row($sql) )
|
||||
{
|
||||
$username = $row['username'];
|
||||
|
|
|
@ -50,4 +50,3 @@
|
|||
</fieldset>
|
||||
<p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ Закрыть ]</a></p>
|
||||
</div><!--/infobox-wrap-->
|
||||
|
||||
|
|
|
@ -21,4 +21,3 @@
|
|||
</fieldset>
|
||||
<p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ Закрыть ]</a></p>
|
||||
</div><!--/infobox-wrap-->
|
||||
|
||||
|
|
|
@ -138,4 +138,3 @@ echo '</body></html>';
|
|||
DB()->query("DROP TEMPORARY TABLE ". TMP_TRACKER_TABLE);
|
||||
|
||||
bb_exit();
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
|
||||
<!-- 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">
|
||||
window.BB = {};
|
||||
window.encURL = encodeURIComponent;
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var postImg_MaxWidth = screen.width - {POST_IMG_WIDTH_DECR_JS};
|
||||
var postImgAligned_MaxWidth = Math.round(screen.width/3);
|
||||
|
@ -577,8 +581,6 @@ important_info
|
|||
|
||||
<!--/menus-->
|
||||
|
||||
|
||||
|
||||
<!--page_content-->
|
||||
<div id="page_content">
|
||||
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
|
||||
|
@ -608,13 +610,13 @@ important_info
|
|||
<!-- ENDIF -->
|
||||
|
||||
<!--main_content-->
|
||||
<td id="main_content">
|
||||
<td id="main_content">
|
||||
<div id="main_content_wrap">
|
||||
<div id="latest_news">
|
||||
<table cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<!-- IF SHOW_LATEST_NEWS -->
|
||||
<td width="50%">
|
||||
<h3>{L_LATEST_NEWS}</h3>
|
||||
<table cellpadding="0">
|
||||
<!-- BEGIN news -->
|
||||
|
@ -626,8 +628,8 @@ important_info
|
|||
</tr>
|
||||
<!-- END news -->
|
||||
</table>
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF SHOW_NETWORK_NEWS -->
|
||||
<td width="50%">
|
||||
|
@ -648,8 +650,11 @@ important_info
|
|||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 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 -->
|
||||
<!-- 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 -->
|
||||
|
||||
<!--=======================-->
|
||||
<!-- ENDIF / COMMON_HEADER -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue