mirror of
https://github.com/torrentpier/torrentpier-lts.git
synced 2025-02-28 15:10:54 +03:00
Fixed issue with atom feed (#147)
* Fixed issue with atom feed * Update CHANGELOG.md
This commit is contained in:
parent
9f835a70af
commit
6f57c6f744
@ -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)
|
||||
|
@ -69,6 +69,7 @@ $bb_cfg['js_ver'] = $bb_cfg['css_ver'] = 1;
|
||||
// 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 @@ $page_cfg['show_sidebar2'] = array(
|
||||
|
||||
// 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
|
||||
|
@ -7,10 +7,10 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
|
||||
|
||||
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 .= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
|
||||
$atom .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:base=\"http://". $bb_cfg['server_name'] . $bb_cfg['script_path'] ."\">\n";
|
||||
$atom .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:base=\"" . FULL_URL . "\">\n";
|
||||
$atom .= "<title>$title</title>\n";
|
||||
$atom .= "<updated>". $date ."T$time+00:00</updated>\n";
|
||||
$atom .= "<id>tag:rto.feed,2000:/$mode/$id</id>\n";
|
||||
$atom .= "<link href=\"http://". $bb_cfg['server_name'] . $bb_cfg['script_path'] ."\" />\n";
|
||||
$atom .= "<link href=\"" . FULL_URL . "\" />\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 .= "<entry>\n";
|
||||
$atom .= " <title type=\"html\"><![CDATA[$updated$topic_title$tor_size]]></title>\n";
|
||||
$atom .= " <author>\n";
|
||||
|
@ -2738,6 +2738,8 @@ $lang['ATOM_SUBSCRIBE'] = 'Subscribe to the feed';
|
||||
$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';
|
||||
|
@ -2738,6 +2738,8 @@ $lang['ATOM_SUBSCRIBE'] = 'Подписка на ленту';
|
||||
$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 не найдена';
|
||||
|
@ -2738,6 +2738,8 @@ $lang['ATOM_SUBSCRIBE'] = 'Підписка на стрічку';
|
||||
$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 не знайдено';
|
||||
|
Loading…
Reference in New Issue
Block a user