diff --git a/.gitignore b/.gitignore index 244880992..5ebd83e36 100644 --- a/.gitignore +++ b/.gitignore @@ -32,5 +32,4 @@ $RECYCLE.BIN/ .Spotlight-V100 .Trashes *.orig -*.rej - +*.rej \ No newline at end of file diff --git a/dl.php b/dl.php index 064421396..17ef4466d 100644 --- a/dl.php +++ b/dl.php @@ -39,7 +39,6 @@ if (IS_GUEST && $bb_cfg['guest_tracker']) $guest_allow = true; if ($t_data['attach_ext_id'] != 8 && !$is_auth['auth_download']) login_redirect($bb_cfg['dl_url'] . $topic_id); if ($t_data['attach_ext_id'] == 8 && (!$is_auth['auth_download'] || !$guest_allow)) login_redirect($bb_cfg['dl_url'] . $topic_id); - // Проверка рефёрера (не качать с других сайтов) $referer = (!empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : ''; if (!preg_match("/". $bb_cfg['server_name']."/", $referer)) exit; @@ -84,7 +83,7 @@ if ($t_data['attach_ext_id'] == 8) } // All other -$file_path = get_attach_path($topic_id); +$file_path = get_attach_path($topic_id, $t_data['attach_ext_id']); if (($file_contents = @file_get_contents($file_path)) === false) { diff --git a/library/TorrentPier/Html/Common.php b/library/TorrentPier/Html/Common.php index 948566f86..97e85e262 100644 --- a/library/TorrentPier/Html/Common.php +++ b/library/TorrentPier/Html/Common.php @@ -9,18 +9,22 @@ class Html_Common * @type string */ var $options = ''; + /** * @type array */ var $attr = []; + /** * @type null */ var $cur_attr = null; + /** * @type int */ var $max_length = HTML_SELECT_MAX_LENGTH; + /** * @type array */ @@ -153,8 +157,7 @@ class Html_Common * * @return string */ - public function build_checkbox ($name, $title, $checked = false, $disabled = false, $class = null, $id = null, -$value = 1) + public function build_checkbox ($name, $title, $checked = false, $disabled = false, $class = null, $id = null, $value = 1) { $name = ' name="' . $name . '" '; $value = ' value="' . $value . '" '; diff --git a/library/TorrentPier/Log/Action.php b/library/TorrentPier/Log/Action.php index 75cb62966..59ad4209c 100644 --- a/library/TorrentPier/Log/Action.php +++ b/library/TorrentPier/Log/Action.php @@ -19,10 +19,12 @@ class Log_Action 'adm_user_ban' => 8, 'adm_user_unban' => 9, ]; + /** * @type array */ public $log_type_select = []; + /** * @type bool */ diff --git a/library/TorrentPier/Sessions.php b/library/TorrentPier/Sessions.php index c1528c6c1..7057eb9b5 100644 --- a/library/TorrentPier/Sessions.php +++ b/library/TorrentPier/Sessions.php @@ -76,7 +76,6 @@ class Sessions public $level; public $opt; - function __construct () { $this->get_sessiondata(); @@ -568,7 +567,6 @@ class Sessions return $autologin_id; } - public function set_shortcuts () { $this->id =& $this->data['user_id']; @@ -582,7 +580,6 @@ class Sessions $this->ip = CLIENT_IP; } - public function init_userprefs () { global $bb_cfg, $theme, $lang; diff --git a/library/includes/api/sphinx.php b/library/includes/api/sphinx.php index 68b29869e..aa2bc1aa4 100644 --- a/library/includes/api/sphinx.php +++ b/library/includes/api/sphinx.php @@ -359,7 +359,6 @@ function sphUnpackI64 ( $v ) return $neg . $h . $l; } - function sphFixUint ( $value ) { if ( PHP_INT_SIZE>=8 ) @@ -375,7 +374,6 @@ function sphFixUint ( $value ) } } - /// sphinx searchd client class class SphinxClient extends cache_common { @@ -522,7 +520,6 @@ class SphinxClient extends cache_common $this->_timeout = $timeout; } - function _Send ( $handle, $data, $length ) { if ( feof($handle) || fwrite ( $handle, $data, $length ) !== $length ) @@ -1406,7 +1403,6 @@ class SphinxClient extends cache_common return $res; } - ///////////////////////////////////////////////////////////////////////////// // keyword generation ///////////////////////////////////////////////////////////////////////////// diff --git a/library/includes/functions.php b/library/includes/functions.php index c15697f6b..01fcfb67b 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -241,9 +241,7 @@ function auth ($type, $forum_id, $ug_data, $f_access = [], $group_perm = UG_PERM $auth = $auth_fields = $u_access = []; $add_auth_type_desc = ($forum_id != AUTH_LIST_ALL); - // // Get $auth_fields - // if ($type == AUTH_ALL) { $auth_fields = array_keys($bf['forum_perm']); @@ -258,9 +256,7 @@ function auth ($type, $forum_id, $ug_data, $f_access = [], $group_perm = UG_PERM trigger_error(__FUNCTION__ .'(): empty $auth_fields', E_USER_ERROR); } - // // Get $f_access - // // If f_access has been passed, or auth is needed to return an array of forums // then we need to pull the auth information on the given forum (or all forums) if (empty($f_access)) @@ -291,9 +287,7 @@ function auth ($type, $forum_id, $ug_data, $f_access = [], $group_perm = UG_PERM trigger_error(__FUNCTION__ .'(): empty $f_access', E_USER_ERROR); } - // // Get user or group permissions - // $forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "AND aa.forum_id = ". (int) $forum_id : ''; // GROUP mode @@ -449,8 +443,6 @@ function get_select ($select, $selected = null, $return_as = 'html', $first_opt return ($return_as == 'html') ? build_select($select_name, $select_ary, $selected) : $select_ary; } - - function build_select ($name, $params, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '') { global $html; @@ -1223,7 +1215,6 @@ function setup_style () return $theme; } - function bb_date ($gmepoch, $format = false, $friendly_date = true) { global $bb_cfg, $lang, $userdata; @@ -1320,9 +1311,7 @@ function generate_pagination ($base_url, $num_items, $per_page, $start_item, $ad if ($on_page > 1 && $on_page < $total_pages) { $page_string .= ( $on_page > ($begin_end + $from_middle + 1) ) ? ' ... ' : ', '; - $init_page_min = ( $on_page > ($begin_end + $from_middle) ) ? $on_page : ($begin_end + $from_middle + 1); - $init_page_max = ( $on_page < $total_pages - ($begin_end + $from_middle) ) ? $on_page : $total_pages - ($begin_end + $from_middle); for ($i = $init_page_min - $from_middle; $i < $init_page_max + ($from_middle + 1); $i++) @@ -1372,7 +1361,6 @@ function generate_pagination ($base_url, $num_items, $per_page, $start_item, $ad { $page_string .= '  ' . $lang['NEXT_PAGE'] . ''; } - } $pagination = ($page_string) ? ''. $lang['GOTO_PAGE'] .' :  '. $page_string : ''; @@ -1388,7 +1376,6 @@ function generate_pagination ($base_url, $num_items, $per_page, $start_item, $ad return $pagination; } - function obtain_word_list (&$orig_word, &$replacement_word) { global $bb_cfg; @@ -1537,7 +1524,6 @@ function redirect ($url) exit; } - function get_forum_display_sort_option ($selected_row = 0, $action = 'list', $list = 'sort') { global $lang; @@ -1554,7 +1540,6 @@ function get_forum_display_sort_option ($selected_row = 0, $action = 'list', $li $list_name = 'forum_display_' . $list; $listrow = $$list_name; - $res = ''; if ( $selected_row > count($listrow['lang_key']) ) { @@ -1574,6 +1559,7 @@ function get_forum_display_sort_option ($selected_row = 0, $action = 'list', $li { $res = $listrow['fields'][$selected_row]; } + return $res; } @@ -1583,7 +1569,6 @@ function clear_dl_list ($topics_csv) DB()->query("DELETE FROM ". BB_BT_DLSTATUS_SNAP ." WHERE topic_id IN($topics_csv)"); } - function get_id_csv ($ids) { $ids = array_values((array) $ids); @@ -1591,7 +1576,6 @@ function get_id_csv ($ids) return (string) join(',', $ids); } - function get_id_ary ($ids) { $ids = is_string($ids) ? explode(',', $ids) : array_values((array) $ids); @@ -1689,7 +1673,6 @@ function build_topic_pagination ($url, $replies, $per_page) return $pg; } - function get_poll_data_items_js ($topic_id) { if (!$topic_id_csv = get_id_csv($topic_id)) @@ -1954,7 +1937,6 @@ function get_title_match_topics($search) } // для более корректного поиска по словам содержащим одиночную кавычку - function encode_text_match ($txt) { return str_replace("'", ''', $txt); diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 9b6e5adf7..137c045e7 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -430,8 +430,6 @@ $userdata =& $user->data; if (DBG_USER) require(INC_DIR .'functions_dev.php'); - - $html = new Html_Common(); $log_action = new Log_Action(); diff --git a/library/includes/old_attachment.php b/library/includes/old_attachment.php index 7ec141c49..c983224a6 100644 --- a/library/includes/old_attachment.php +++ b/library/includes/old_attachment.php @@ -51,7 +51,6 @@ function get_attachments_from_post($post_id_array) return $attachments; } - /** * Get attachment mod configuration */ diff --git a/poll.php b/poll.php index 0fbaf4aec..01a435d7d 100644 --- a/poll.php +++ b/poll.php @@ -156,4 +156,4 @@ switch ($mode) default: bb_die('Invalid mode: '. htmlCHR($mode)); -} +} \ No newline at end of file diff --git a/posting.php b/posting.php index fb693f640..6700d3dbe 100644 --- a/posting.php +++ b/posting.php @@ -42,8 +42,6 @@ if ($mode == 'smilies') $tracking_topics = get_tracks('topic'); $tracking_forums = get_tracks('forum'); - - set_die_append_msg($forum_id, $topic_id); // What auth type do we need to check? diff --git a/viewtopic.php b/viewtopic.php index c160811b4..fcd3c8ce7 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -22,7 +22,6 @@ $post_id = (!$topic_id && isset($_GET[POST_POST_URL])) ? (int) $_GET[POST_POST_ $start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0; $newest = 0; - // Posts per page $posts_per_page = $bb_cfg['posts_per_page']; $select_ppp = '';