diff --git a/CHANGELOG.md b/CHANGELOG.md index 5120e8fa..bb47d45c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Redundant pagination, mysql 5.7+ issue [\#140](https://github.com/torrentpier/torrentpier-lts/pull/140) ([belomaxorka](https://github.com/belomaxorka)) - Added Freeleech [\#143](https://github.com/torrentpier/torrentpier-lts/pull/143) ([belomaxorka](https://github.com/belomaxorka)) - Added some new torrent clients into sidebar [\#146](https://github.com/torrentpier/torrentpier-lts/pull/146) ([belomaxorka](https://github.com/belomaxorka)) +- Fixed issue with atom feed [\#147](https://github.com/torrentpier/torrentpier-lts/pull/147) ([belomaxorka](https://github.com/belomaxorka)) - Minor fixes [\#124](https://github.com/torrentpier/torrentpier-lts/pull/124), [\#133](https://github.com/torrentpier/torrentpier-lts/pull/133), [\#135](https://github.com/torrentpier/torrentpier-lts/pull/135), [\#136](https://github.com/torrentpier/torrentpier-lts/pull/136), [\#139](https://github.com/torrentpier/torrentpier-lts/pull/139), [\#142](https://github.com/torrentpier/torrentpier-lts/pull/142), [\#144](https://github.com/torrentpier/torrentpier-lts/pull/144), [\#145](https://github.com/torrentpier/torrentpier-lts/pull/145) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.03](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.03) (2023-04-04) diff --git a/library/config.php b/library/config.php index 5a4191a0..fa714f39 100644 --- a/library/config.php +++ b/library/config.php @@ -69,6 +69,7 @@ // Primary domain name $domain_name = 'torrentpier.com'; // enter here your primary domain name of your site $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name; +$domain_ssl = false; // Version info $bb_cfg['tp_version'] = '2.1.5-2023.04'; @@ -327,7 +328,7 @@ // Cookie $bb_cfg['cookie_domain'] = in_array($domain_name, array(getenv('SERVER_ADDR'), 'localhost')) ? '' : ".$domain_name"; -$bb_cfg['cookie_secure'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || (isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] === 'https') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) ? 1 : 0; +$bb_cfg['cookie_secure'] = $domain_ssl ? 1 : (((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || (isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] === 'https') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) ? 1 : 0); $bb_cfg['cookie_prefix'] = 'bb_'; // 'bb_' // Sessions diff --git a/library/includes/functions_atom.php b/library/includes/functions_atom.php index 7583f6e1..2a33b132 100644 --- a/library/includes/functions_atom.php +++ b/library/includes/functions_atom.php @@ -7,10 +7,10 @@ function update_forum_feed ($forum_id, $forum_data) { - global $bb_cfg; + global $bb_cfg, $lang; $file_path = $bb_cfg['atom']['path'] .'/f/'. $forum_id .'.atom'; $select_tor_sql = $join_tor_sql = ''; - if ($forum_id == 0) $forum_data['forum_name'] = 'Общая по всем разделам'; + if ($forum_id == 0) $forum_data['forum_name'] = (isset($lang['ATOM_GLOBAL_FEED']) ? $lang['ATOM_GLOBAL_FEED'] : $bb_cfg['server_name']); if ($forum_id > 0 && $forum_data['allow_reg_tracker']) { $select_tor_sql = ', tor.size AS tor_size, tor.tor_status'; @@ -121,7 +121,7 @@ function update_user_feed ($user_id, $username) function create_atom ($file_path, $mode, $id, $title, $topics) { - global $bb_cfg; + global $lang; $dir = dirname($file_path); if (!file_exists($dir)) { @@ -137,11 +137,11 @@ function create_atom ($file_path, $mode, $id, $title, $topics) } $atom = ""; $atom .= "\n"; - $atom .= "\n"; + $atom .= "\n"; $atom .= "$title\n"; $atom .= "". $date ."T$time+00:00\n"; $atom .= "tag:rto.feed,2000:/$mode/$id\n"; - $atom .= "\n"; + $atom .= "\n"; foreach ($topics as $topic) { $topic_id = $topic['topic_id']; @@ -159,14 +159,14 @@ function create_atom ($file_path, $mode, $id, $title, $topics) $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); } $topic_title = wbr($topic_title); - $author_name = ($topic['first_username']) ? wbr($topic['first_username']) : 'Гость'; + $author_name = ($topic['first_username']) ? wbr($topic['first_username']) : $lang['GUEST']; $last_time = $topic['topic_last_post_time']; if ($topic['topic_last_post_edit_time']) $last_time = $topic['topic_last_post_edit_time']; $date = bb_date($last_time, 'Y-m-d', 0); $time = bb_date($last_time, 'H:i:s', 0); $updated = ''; $checktime = TIMENOW - 604800; // неделя (week) - if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) $updated = '[Обновлено] '; + if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) $updated = '[' . $lang['ATOM_UPDATED'] . '] '; $atom .= "\n"; $atom .= " <![CDATA[$updated$topic_title$tor_size]]>\n"; $atom .= " \n"; diff --git a/library/language/en/main.php b/library/language/en/main.php index f921be6c..3e261656 100644 --- a/library/language/en/main.php +++ b/library/language/en/main.php @@ -2738,6 +2738,8 @@ $lang['ATOM_NO_MODE'] = 'Do not specify a mode for the feed'; $lang['ATOM_NO_FORUM'] = 'This forum does not have a feed (no ongoing topics)'; $lang['ATOM_NO_USER'] = 'This user does not have a feed (no ongoing topics)'; +$lang['ATOM_UPDATED'] = 'Updated'; +$lang['ATOM_GLOBAL_FEED'] = 'Global feed for all forums'; $lang['HASH_INVALID'] = 'Hash %s is invalid'; $lang['HASH_NOT_FOUND'] = 'Release with hash %s not found'; diff --git a/library/language/ru/main.php b/library/language/ru/main.php index bfa3e06d..845086d3 100644 --- a/library/language/ru/main.php +++ b/library/language/ru/main.php @@ -2738,6 +2738,8 @@ $lang['ATOM_NO_MODE'] = 'Не указан режим для ленты'; $lang['ATOM_NO_FORUM'] = 'Для этого форума нет ленты (нет начатых тем)'; $lang['ATOM_NO_USER'] = 'Для этого пользователя нет ленты (нет начатых тем)'; +$lang['ATOM_UPDATED'] = 'Обновлено'; +$lang['ATOM_GLOBAL_FEED'] = 'Глобальная лента для всех форумов'; $lang['HASH_INVALID'] = 'Хэш %s некорректен'; $lang['HASH_NOT_FOUND'] = 'Раздача с хэшем %s не найдена'; diff --git a/library/language/uk/main.php b/library/language/uk/main.php index 82e2bee1..bbdec587 100644 --- a/library/language/uk/main.php +++ b/library/language/uk/main.php @@ -2738,6 +2738,8 @@ $lang['ATOM_NO_MODE'] = 'Не вказано режим для стрічки'; $lang['ATOM_NO_FORUM'] = 'Для цього форуму немає стрічки (немає початих тем)'; $lang['ATOM_NO_USER'] = 'Для цього користувача немає стрічки (немає початих тем)'; +$lang['ATOM_UPDATED'] = 'Оновлено'; +$lang['ATOM_GLOBAL_FEED'] = 'Глобальна стрічка для всіх форумів'; $lang['HASH_INVALID'] = 'Хеш %s некоректний'; $lang['HASH_NOT_FOUND'] = 'Роздача з хешем %s не знайдено';