mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Merge pull request #431 from Exile37/bugfix/various-bugfixes
Various bug fixes described on the forum
This commit is contained in:
commit
670a46d9b0
11 changed files with 25 additions and 22 deletions
|
@ -40,6 +40,7 @@ For installation you need to follow a few simple steps:
|
||||||
1. Create database and import dump located at **install/sql/mysql.sql**
|
1. Create database and import dump located at **install/sql/mysql.sql**
|
||||||
1. Edit database configuration settings in the configuration file or a local copy (see below)
|
1. Edit database configuration settings in the configuration file or a local copy (see below)
|
||||||
1. Edit domain name in the configuration file or a local copy (see below)
|
1. Edit domain name in the configuration file or a local copy (see below)
|
||||||
|
1. Edit domain ssl setting in the configuration file or a local copy (see below)
|
||||||
1. Edit this files:
|
1. Edit this files:
|
||||||
1. **favicon.png** (change on your own)
|
1. **favicon.png** (change on your own)
|
||||||
1. **robots.txt** (change the addresses in lines **Host** and **Sitemap** on your own)
|
1. **robots.txt** (change the addresses in lines **Host** and **Sitemap** on your own)
|
||||||
|
|
|
@ -39,7 +39,7 @@ if (isset($_POST['add_name'])) {
|
||||||
if ($disallowed_user == '') {
|
if ($disallowed_user == '') {
|
||||||
bb_die($lang['FIELDS_EMPTY']);
|
bb_die($lang['FIELDS_EMPTY']);
|
||||||
}
|
}
|
||||||
if (!validate_username($disallowed_user)) {
|
if (validate_username($disallowed_user)) {
|
||||||
$message = $lang['DISALLOWED_ALREADY'];
|
$message = $lang['DISALLOWED_ALREADY'];
|
||||||
} else {
|
} else {
|
||||||
$sql = 'INSERT INTO ' . BB_DISALLOW . " (disallow_username) VALUES('" . DB()->escape($disallowed_user) . "')";
|
$sql = 'INSERT INTO ' . BB_DISALLOW . " (disallow_username) VALUES('" . DB()->escape($disallowed_user) . "')";
|
||||||
|
|
|
@ -14,17 +14,17 @@
|
||||||
{
|
{
|
||||||
"name": "Exile",
|
"name": "Exile",
|
||||||
"email": "admin@torrentpier.com",
|
"email": "admin@torrentpier.com",
|
||||||
"homepage": "https://torrentpier.com/forum/members/exile.1/",
|
"homepage": "https://github.com/Exile37",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Diolektor",
|
"name": "Diolektor",
|
||||||
"homepage": "https://torrentpier.com/forum/members/diolektor.5765/",
|
"homepage": "https://github.com/VasyOk",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "PheRum",
|
"name": "PheRum",
|
||||||
"homepage": "https://torrentpier.com/forum/members/pherum.23/",
|
"homepage": "https://github.com/PheRum",
|
||||||
"role": "Developer"
|
"role": "Developer"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -41,7 +41,6 @@
|
||||||
"gigablah/sphinxphp": "^2.0",
|
"gigablah/sphinxphp": "^2.0",
|
||||||
"google/recaptcha": "^1.1",
|
"google/recaptcha": "^1.1",
|
||||||
"longman/ip-tools": "^1.2",
|
"longman/ip-tools": "^1.2",
|
||||||
"roave/security-advisories": "dev-master",
|
|
||||||
"rych/bencode": "^1.0",
|
"rych/bencode": "^1.0",
|
||||||
"samdark/sitemap": "^2.0",
|
"samdark/sitemap": "^2.0",
|
||||||
"swiftmailer/swiftmailer": "^5.4",
|
"swiftmailer/swiftmailer": "^5.4",
|
||||||
|
|
|
@ -29,6 +29,7 @@ if (!defined('BB_ROOT')) {
|
||||||
|
|
||||||
$domain_name = 'torrentpier.com'; // enter here your primary domain name of your site
|
$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_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name;
|
||||||
|
$domain_ssl = true;
|
||||||
|
|
||||||
$bb_cfg = [];
|
$bb_cfg = [];
|
||||||
|
|
||||||
|
@ -366,7 +367,7 @@ $bb_cfg['show_sidebar2_on_every_page'] = false;
|
||||||
|
|
||||||
// Cookie
|
// Cookie
|
||||||
$bb_cfg['cookie_domain'] = in_array($domain_name, [getenv('SERVER_ADDR'), 'localhost'], true) ? '' : ".$domain_name";
|
$bb_cfg['cookie_domain'] = in_array($domain_name, [getenv('SERVER_ADDR'), 'localhost'], true) ? '' : ".$domain_name";
|
||||||
$bb_cfg['cookie_secure'] = !empty($_SERVER['HTTPS']) ? 1 : 0;
|
$bb_cfg['cookie_secure'] = $domain_ssl ? true : (!empty($_SERVER['HTTPS']) ? true : false);
|
||||||
$bb_cfg['cookie_prefix'] = 'bb_'; // 'bb_'
|
$bb_cfg['cookie_prefix'] = 'bb_'; // 'bb_'
|
||||||
|
|
||||||
// Sessions
|
// Sessions
|
||||||
|
|
|
@ -1851,7 +1851,7 @@ function log_sphinx_error($err_type, $err_msg, $query = '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_title_match_topics($title_match_sql, array $forum_ids = array())
|
function get_title_match_topics($title_match_sql, $forum_ids = [])
|
||||||
{
|
{
|
||||||
global $bb_cfg, $sphinx, $userdata, $title_match, $lang;
|
global $bb_cfg, $sphinx, $userdata, $title_match, $lang;
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,11 @@ if (!defined('BB_ROOT')) {
|
||||||
|
|
||||||
function update_forum_feed($forum_id, $forum_data)
|
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';
|
$file_path = $bb_cfg['atom']['path'] . '/f/' . $forum_id . '.atom';
|
||||||
$select_tor_sql = $join_tor_sql = '';
|
$select_tor_sql = $join_tor_sql = '';
|
||||||
if ($forum_id == 0) {
|
if ($forum_id == 0) {
|
||||||
$forum_data['forum_name'] = 'Общая по всем разделам';
|
$forum_data['forum_name'] = $lang['ATOM_GLOBAL_FEED'];
|
||||||
}
|
}
|
||||||
if ($forum_id > 0 && $forum_data['allow_reg_tracker']) {
|
if ($forum_id > 0 && $forum_data['allow_reg_tracker']) {
|
||||||
$select_tor_sql = ', tor.size AS tor_size, tor.tor_status';
|
$select_tor_sql = ', tor.size AS tor_size, tor.tor_status';
|
||||||
|
@ -97,9 +97,9 @@ function update_forum_feed($forum_id, $forum_data)
|
||||||
}
|
}
|
||||||
if (create_atom($file_path, 'f', $forum_id, htmlCHR($forum_data['forum_name']), $topics)) {
|
if (create_atom($file_path, 'f', $forum_id, htmlCHR($forum_data['forum_name']), $topics)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_user_feed($user_id, $username)
|
function update_user_feed($user_id, $username)
|
||||||
|
@ -143,14 +143,14 @@ function update_user_feed($user_id, $username)
|
||||||
}
|
}
|
||||||
if (create_atom($file_path, 'u', $user_id, wbr($username), $topics)) {
|
if (create_atom($file_path, 'u', $user_id, wbr($username), $topics)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function create_atom($file_path, $mode, $id, $title, $topics)
|
function create_atom($file_path, $mode, $id, $title, $topics)
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
global $lang;
|
||||||
$dir = dirname($file_path);
|
$dir = dirname($file_path);
|
||||||
if (!file_exists($dir)) {
|
if (!file_exists($dir)) {
|
||||||
if (!bb_mkdir($dir)) {
|
if (!bb_mkdir($dir)) {
|
||||||
|
@ -168,11 +168,11 @@ function create_atom($file_path, $mode, $id, $title, $topics)
|
||||||
}
|
}
|
||||||
$atom = "";
|
$atom = "";
|
||||||
$atom .= "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
|
$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 .= "<title>$title</title>\n";
|
||||||
$atom .= "<updated>" . $date . "T$time+00:00</updated>\n";
|
$atom .= "<updated>" . $date . "T$time+00:00</updated>\n";
|
||||||
$atom .= "<id>tag:rto.feed,2000:/$mode/$id</id>\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) {
|
foreach ($topics as $topic) {
|
||||||
$topic_id = $topic['topic_id'];
|
$topic_id = $topic['topic_id'];
|
||||||
$tor_size = '';
|
$tor_size = '';
|
||||||
|
@ -187,7 +187,7 @@ function create_atom($file_path, $mode, $id, $title, $topics)
|
||||||
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
|
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
|
||||||
}
|
}
|
||||||
$topic_title = wbr($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'];
|
$last_time = $topic['topic_last_post_time'];
|
||||||
if ($topic['topic_last_post_edit_time']) {
|
if ($topic['topic_last_post_edit_time']) {
|
||||||
$last_time = $topic['topic_last_post_edit_time'];
|
$last_time = $topic['topic_last_post_edit_time'];
|
||||||
|
@ -197,7 +197,7 @@ function create_atom($file_path, $mode, $id, $title, $topics)
|
||||||
$updated = '';
|
$updated = '';
|
||||||
$checktime = TIMENOW - 604800; // неделя (week)
|
$checktime = TIMENOW - 604800; // неделя (week)
|
||||||
if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) {
|
if ($topic['topic_first_post_edit_time'] && $topic['topic_first_post_edit_time'] > $checktime) {
|
||||||
$updated = '[Обновлено] ';
|
$updated = '[' . $lang['ATOM_UPDATED'] . '] ';
|
||||||
}
|
}
|
||||||
$atom .= "<entry>\n";
|
$atom .= "<entry>\n";
|
||||||
$atom .= " <title type=\"html\"><![CDATA[$updated$topic_title$tor_size]]></title>\n";
|
$atom .= " <title type=\"html\"><![CDATA[$updated$topic_title$tor_size]]></title>\n";
|
||||||
|
|
|
@ -57,7 +57,7 @@ function tz_select($default, $select_name = 'timezone')
|
||||||
global $sys_timezone, $lang;
|
global $sys_timezone, $lang;
|
||||||
|
|
||||||
if (!isset($default)) {
|
if (!isset($default)) {
|
||||||
$default == $sys_timezone;
|
$default = $sys_timezone;
|
||||||
}
|
}
|
||||||
$tz_select = '<select name="' . $select_name . '">';
|
$tz_select = '<select name="' . $select_name . '">';
|
||||||
|
|
||||||
|
|
|
@ -2757,6 +2757,8 @@ $lang['ATOM_SUBSCRIBE'] = 'Subscribe to the feed';
|
||||||
$lang['ATOM_NO_MODE'] = 'Do not specify a mode for 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_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_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_INVALID'] = 'Hash %s is invalid';
|
||||||
$lang['HASH_NOT_FOUND'] = 'Release with hash %s not found';
|
$lang['HASH_NOT_FOUND'] = 'Release with hash %s not found';
|
||||||
|
|
|
@ -68,7 +68,7 @@ class CronHelper
|
||||||
*/
|
*/
|
||||||
public static function touchLockFile($lock_file)
|
public static function touchLockFile($lock_file)
|
||||||
{
|
{
|
||||||
file_write(make_rand_str(20), $lock_file, 0, true, true);
|
file_write('', $lock_file, 0, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -67,7 +67,7 @@ $(document).ready(function(){
|
||||||
');
|
');
|
||||||
$('#jumpbox-container').one('click', function(){
|
$('#jumpbox-container').one('click', function(){
|
||||||
$('#jumpbox-title').html(' {L_LOADING} ... ');
|
$('#jumpbox-title').html(' {L_LOADING} ... ');
|
||||||
var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? '/jumpbox_user.html' : '/jumpbox_guest.html');
|
var jumpbox_src = '/internal_data/ajax_html' + ({LOGGED_IN} ? '/jumpbox_user.html' : '/jumpbox_guest.html');
|
||||||
$(this).load(jumpbox_src);
|
$(this).load(jumpbox_src);
|
||||||
$('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); });
|
$('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); });
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,7 +67,7 @@ document.write('<input type="hidden" name="user_timezone" value="'+tz+'" />');
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="prof-title">{L_EMAIL}: * <!-- IF EDIT_PROFILE --><!-- ELSE IF $bb_cfg['reg_email_activation'] --><br /><h6>{L_EMAIL_EXPLAIN}</h6><!-- ENDIF --></td>
|
<td class="prof-title">{L_EMAIL}: * <!-- IF EDIT_PROFILE --><!-- ELSE IF $bb_cfg['reg_email_activation'] --><br /><h6>{L_EMAIL_EXPLAIN}</h6><!-- ENDIF --></td>
|
||||||
<td><input id="email" onBlur="ajax.exec({ action: 'user_register', mode: 'check_email', email: $('#email').val()}); return false;" type="text" name="user_email" size="35" maxlength="40" value="{USER_EMAIL}" <!-- IF EDIT_PROFILE --><!-- IF $bb_cfg['emailer_disabled'] -->readonly="readonly" style="color: gray;"<!-- ENDIF --><!-- ENDIF --> />
|
<td><input id="email" onBlur="ajax.exec({ action: 'user_register', mode: 'check_email', email: $('#email').val()}); return false;" type="text" name="user_email" size="35" maxlength="40" value="{USER_EMAIL}" <!-- IF EDIT_PROFILE --><!-- IF !$bb_cfg['emailer']['enabled'] -->readonly="readonly" style="color: gray;"<!-- ENDIF --><!-- ENDIF --> />
|
||||||
<span id="check_email"></span></td>
|
<span id="check_email"></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF EDIT_PROFILE and not ADM_EDIT -->
|
<!-- IF EDIT_PROFILE and not ADM_EDIT -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue