diff --git a/.gitignore b/.gitignore index 7ce02a88a..c9080af50 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,4 @@ $RECYCLE.BIN/ .LSOverride ._* .Spotlight-V100 -.Trashes +.Trashes \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index c88224b24..7c8c5d101 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -36,6 +36,7 @@ nord51 Вася Alexander.S (http://torrent.dchub.ws/) sasha20072007 +gerhanovn ***************************** ** Прочая информация ** diff --git a/common.php b/common.php index 86254493f..9b904ccaa 100644 --- a/common.php +++ b/common.php @@ -19,9 +19,10 @@ header('X-Frame-Options: SAMEORIGIN'); // Get initial config require(BB_ROOT . 'library/config.php'); -$server_protocol = '//'; +$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://'; +$server_port = (in_array($bb_cfg['server_port'], array(80, 443))) ? '' : ':' . $bb_cfg['server_port']; define('FORUM_PATH', $bb_cfg['script_path']); -define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $bb_cfg['script_path']); +define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']); unset($server_protocol, $server_port); // Debug options diff --git a/group_edit.php b/group_edit.php index f4f1129b5..801e62f69 100644 --- a/group_edit.php +++ b/group_edit.php @@ -78,6 +78,7 @@ if ($is_moderator) 'GROUP_DESCRIPTION' => htmlCHR($group_info['group_description']), 'GROUP_SIGNATURE' => htmlCHR($group_info['group_signature']), 'U_GROUP_URL' => GROUP_URL . $group_id, + 'RELEASE_GROUP' => ($group_info['release_group']) ? true : false, 'GROUP_TYPE' => $group_type, 'S_GROUP_OPEN_TYPE' => GROUP_OPEN, 'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED, @@ -88,9 +89,8 @@ if ($is_moderator) 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_GROUP_CONFIG_ACTION' => "group_edit.php?" . POST_GROUPS_URL . "=$group_id", - 'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['group_avatars']['max_width'], $bb_cfg['group_avatars']['max_height'], (round($bb_cfg['group_avatars']['max_size'] / 1024))), - 'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']), - 'RELEASE_GROUP' => ($group_info['release_group']) ? true : false, + 'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['group_avatars']['max_width'], $bb_cfg['group_avatars']['max_height'], (round($bb_cfg['group_avatars']['max_size'] / 1024))), + 'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']), )); $template->set_filenames(array('body' => 'group_edit.tpl')); diff --git a/index.php b/index.php index 6f4b9d20b..7dc7b44a9 100644 --- a/index.php +++ b/index.php @@ -373,14 +373,13 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) if ($stats['birthday_week_list']) { shuffle($stats['birthday_week_list']); - foreach($stats['birthday_week_list'] as $i => $week) + foreach ($stats['birthday_week_list'] as $i => $week) { - if($i >= 5) + if ($i >= 5) { $week_all = true; continue; } - $week_list[] = profile_url($week) .' ('. birthday_age($week['user_birthday']-1) .')'; } $week_all = ($week_all) ? ' ...' : ''; @@ -391,14 +390,13 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) if ($stats['birthday_today_list']) { shuffle($stats['birthday_today_list']); - foreach($stats['birthday_today_list'] as $i => $today) + foreach ($stats['birthday_today_list'] as $i => $today) { - if($i >= 5) + if ($i >= 5) { $today_all = true; continue; } - $today_list[] = profile_url($today) .' ('. birthday_age($today['user_birthday']) .')'; } $today_all = ($today_all) ? ' ...' : ''; diff --git a/library/config.php b/library/config.php index dd01ae848..c48d7c4fc 100644 --- a/library/config.php +++ b/library/config.php @@ -37,7 +37,6 @@ * Error reporting * Triggers * Date format - * Subforums * Forums * Topics @@ -48,13 +47,12 @@ * Actions log * Users * Groups - * Tidy * Ads + * Misc * Attachments * Avatars * Group avatars - * Misc * Captcha * Atom feed * Nofollow @@ -253,10 +251,10 @@ define('BB_PATH', realpath(BB_ROOT) ); define('ADMIN_DIR', BB_PATH .'/admin/' ); define('DATA_DIR', BB_PATH .'/data/' ); define('INT_DATA_DIR', BB_PATH .'/internal_data/' ); -define('AJAX_HTML_DIR', BB_ROOT .'internal_data/ajax_html/' ); +define('AJAX_HTML_DIR', BB_ROOT .'/internal_data/ajax_html/' ); define('CACHE_DIR', BB_PATH .'/internal_data/cache/' ); define('LOG_DIR', BB_PATH .'/internal_data/log/' ); -define('SITEMAP_DIR', BB_PATH .'internal_data/sitemap/' ); +define('SITEMAP_DIR', BB_PATH .'/internal_data/sitemap/' ); define('TRIGGERS_DIR', BB_PATH .'/internal_data/triggers/' ); define('AJAX_DIR', BB_ROOT .'/library/ajax/' ); define('ATTACH_DIR', BB_PATH .'/library/attach_mod/' ); @@ -463,16 +461,16 @@ $bb_cfg['show_poster_joined'] = true; $bb_cfg['show_poster_posts'] = true; $bb_cfg['show_poster_from'] = true; $bb_cfg['show_bot_nick'] = false; -$bb_cfg['text_buttons'] = false; // replace EDIT, QUOTE... images with text links -$bb_cfg['parse_ed2k_links'] = true; // make ed2k links clickable +$bb_cfg['text_buttons'] = false; // replace EDIT, QUOTE... images with text links +$bb_cfg['parse_ed2k_links'] = true; // make ed2k links clickable $bb_cfg['post_date_format'] = 'd-M-Y H:i'; -$bb_cfg['ext_link_new_win'] = true; // open external links in new window +$bb_cfg['ext_link_new_win'] = true; // open external links in new window -$bb_cfg['topic_moved_days_keep'] = 7; // remove topic moved links after xx days (or FALSE to disable) +$bb_cfg['topic_moved_days_keep'] = 7; // remove topic moved links after xx days (or FALSE to disable) $bb_cfg['allowed_posts_per_page'] = array(15, 30, 50, 100); $bb_cfg['user_signature_start'] = '

_________________
'; -$bb_cfg['user_signature_end'] = '
'; // Это позволит использовать html теги, которые требуют закрытия. Например или +$bb_cfg['user_signature_end'] = ''; // Это позволит использовать html теги, которые требуют закрытия. Например
или // Posts $bb_cfg['use_posts_cache'] = true; // if you switch from ON to OFF, you need to TRUNCATE `bb_posts_html` table @@ -574,68 +572,68 @@ $bb_cfg['user_agreement_url'] = 'info.php?show=user_agreement'; $bb_cfg['copyright_holders_url'] = 'info.php?show=copyright_holders'; $bb_cfg['advert_url'] = 'info.php?show=advert'; +// Attachments +$bb_cfg['attach'] = array( + 'upload_path' => DATA_DIR . 'torrent_files', // путь к директории с torrent файлами + 'max_size' => 250*1024, // размер аватары в байтах +); + $bb_cfg['file_id_ext'] = array( - 1 => 'gif', - 2 => 'gz', - 3 => 'jpg', - 4 => 'png', - 5 => 'rar', - 6 => 'tar', - 7 => 'tiff', - 8 => 'torrent', - 9 => 'zip', + 1 => 'gif', + 2 => 'gz', + 3 => 'jpg', + 4 => 'png', + 5 => 'rar', + 6 => 'tar', + 7 => 'tiff', + 8 => 'torrent', + 9 => 'zip', ); $bb_cfg['tor_forums_allowed_ext'] = array('torrent', 'zip', 'rar'); // для разделов с раздачами $bb_cfg['gen_forums_allowed_ext'] = array('zip', 'rar'); // для обычных разделов -// Attachments -$bb_cfg['attach'] = array( - 'upload_path' => DATA_DIR . 'torrent_files', // путь к директории с torrent файлами - 'max_size' => 250*1024, // размер аватары в байтах -); - // Avatars $bb_cfg['avatars'] = array( - 'allowed_ext' => array('gif','jpg','jpeg','png'), // разрешенные форматы файлов - 'bot_avatar' => 'gallery/bot.gif', // аватара бота - 'max_size' => 100*1024, // размер аватары в байтах - 'max_height' => 100, // высота аватара в px - 'max_width' => 100, // ширина аватара в px - 'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара - 'upload_path' => BB_ROOT . 'data/avatars/', // путь к директории с аватарами - 'up_allowed' => true, // разрешить загрузку аватар + 'allowed_ext' => array('gif','jpg','jpeg','png'), // разрешенные форматы файлов + 'bot_avatar' => 'gallery/bot.gif', // аватара бота + 'max_size' => 100*1024, // размер аватары в байтах + 'max_height' => 100, // высота аватара в px + 'max_width' => 100, // ширина аватара в px + 'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара + 'upload_path' => BB_ROOT . 'data/avatars/', // путь к директории с аватарами + 'up_allowed' => true, // разрешить загрузку аватар ); // Group avatars $bb_cfg['group_avatars'] = array( - 'allowed_ext' => array('gif','jpg','jpeg','png'), // разрешенные форматы файлов - 'max_size' => 300*1024, // размер аватары в байтах - 'max_height' => 300, // высота аватара в px - 'max_width' => 300, // ширина аватара в px - 'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара - 'upload_path' => BB_ROOT . 'data/avatars/', // путь к директории с аватарами - 'up_allowed' => true, // разрешить загрузку аватар + 'allowed_ext' => array('gif','jpg','jpeg','png'), // разрешенные форматы файлов + 'max_size' => 300*1024, // размер аватары в байтах + 'max_height' => 300, // высота аватара в px + 'max_width' => 300, // ширина аватара в px + 'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара + 'upload_path' => BB_ROOT . 'data/avatars/', // путь к директории с аватарами + 'up_allowed' => true, // разрешить загрузку аватар ); // Captcha $bb_cfg['captcha'] = array( 'disabled' => false, 'secret_key' => 'secret_key', - 'img_path' => INT_DATA_DIR .'captcha/', // with '/' - 'img_url' => './internal_data/captcha/', // with '/' + 'img_path' => INT_DATA_DIR .'captcha/', // with ending slash + 'img_url' => './internal_data/captcha/', // with ending slash ); // Atom feed $bb_cfg['atom'] = array( - 'path' => INT_DATA_DIR .'atom', // without '/' - 'url' => './internal_data/atom', // without '/' + 'path' => INT_DATA_DIR .'atom', // without ending slash + 'url' => './internal_data/atom', // without ending slash ); // Nofollow $bb_cfg['nofollow'] = array( 'disabled' => false, - 'allowed_url' => array($domain_name), // 'allowed.site', 'www.allowed.site' + 'allowed_url' => array($domain_name), // 'allowed.site', 'www.allowed.site' ); // Local config diff --git a/library/includes/classes/sitemap.php b/library/includes/classes/sitemap.php index 4ab1a537d..7a42ceb6c 100644 --- a/library/includes/classes/sitemap.php +++ b/library/includes/classes/sitemap.php @@ -12,8 +12,7 @@ class sitemap var $cat_priority = '0.7'; function sitemap () { - global $bb_cfg; - $this->home = make_url(''); + $this->home = make_url(); } function build_map () { @@ -29,10 +28,10 @@ class sitemap function build_index ($count) { $lm = date('c'); $map = "\n\n"; - $map .= "\n".make_url(substr(SITEMAP_DIR, 2))."/sitemap1.xml\n{$lm}\n\n"; + $map .= "\n".make_url(substr(SITEMAP_DIR, 3))."/sitemap1.xml\n{$lm}\n\n"; for ($i = 0; $i < $count; $i++) { $t = $i + 2; - $map .= "\n".make_url(substr(SITEMAP_DIR, 2))."/sitemap{$t}.xml\n{$lm}\n\n"; + $map .= "\n".make_url(substr(SITEMAP_DIR, 3))."/sitemap{$t}.xml\n{$lm}\n\n"; } $map .= ""; diff --git a/library/includes/functions.php b/library/includes/functions.php index 8a1ba0187..96dc8bb83 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -9,13 +9,6 @@ function get_path_from_id ($id, $ext_id, $base_path, $first_div, $sec_div) return ($base_path ? "$base_path/" : '') . floor($id/$first_div) .'/'. ($id % $sec_div) .'/'. $id . ($ext ? ".$ext" : ''); } -function delete_avatar ($user_id, $avatar_ext_id) -{ - global $bb_cfg; - $avatar_file = ($avatar_ext_id) ? get_avatar_path($user_id, $avatar_ext_id) : ''; - return ($avatar_file && file_exists($avatar_file)) ? @unlink($avatar_file) : false; -} - function get_avatar_path ($id, $ext_id, $base_path = null, $first_div = 10000, $sec_div = 100) { global $bb_cfg; @@ -30,6 +23,12 @@ function get_attach_path ($id, $ext_id = '', $base_path = null, $first_div = 100 return get_path_from_id($id, $ext_id, $base_path, $first_div, $sec_div); } +function delete_avatar ($user_id, $avatar_ext_id) +{ + $avatar_file = ($avatar_ext_id) ? get_avatar_path($user_id, $avatar_ext_id) : ''; + return ($avatar_file && file_exists($avatar_file)) ? @unlink($avatar_file) : false; +} + function get_tracks ($type) { static $pattern = '#^a:\d+:{[i:;\d]+}$#'; diff --git a/library/includes/functions_upload.php b/library/includes/functions_upload.php index 14244c730..9c2762217 100644 --- a/library/includes/functions_upload.php +++ b/library/includes/functions_upload.php @@ -118,8 +118,6 @@ class upload_common function store ($mode = '', $params = array()) { - global $bb_cfg; - if ($mode == 'avatar') { delete_avatar($params['user_id'], $params['avatar_ext_id']); diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 47d10263e..3994af630 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -421,7 +421,7 @@ function html_ent_decode ($txt, $quote_style = ENT_QUOTES, $charset = 'UTF-8') return (string) html_entity_decode($txt, $quote_style, $charset); } -function make_url ($path) +function make_url ($path = '') { return FULL_URL . preg_replace('#^\/?(.*?)\/?$#', '\1', $path); } diff --git a/library/language/en/html/sidebar1.html b/library/language/en/html/sidebar1.html index 08fe86eea..421d37134 100644 --- a/library/language/en/html/sidebar1.html +++ b/library/language/en/html/sidebar1.html @@ -13,8 +13,8 @@

FAQ

diff --git a/library/language/ru/html/sidebar1.html b/library/language/ru/html/sidebar1.html index 49cb07edd..0810f75f1 100644 --- a/library/language/ru/html/sidebar1.html +++ b/library/language/ru/html/sidebar1.html @@ -13,8 +13,8 @@

FAQ

diff --git a/library/language/uk/html/sidebar1.html b/library/language/uk/html/sidebar1.html index d18ab59d1..c123a61e2 100644 --- a/library/language/uk/html/sidebar1.html +++ b/library/language/uk/html/sidebar1.html @@ -13,8 +13,8 @@

FAQ