mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-16 10:03:11 -07:00
Fixed broken torrent stats displaying (Part 2) (#1673)
* Fixed broken torrent stats displaying (Part 2) * Update CHANGELOG.md * Updated * Revert "Updated" This reverts commite816be32df
. * Updated * Update mysql.sql * Update mysql.sql * Revert "Fixed broken torrent stats displaying (Part 2)" This reverts commitce071d9fcf
. * Update Torrent.php * Reapply "Fixed broken torrent stats displaying (Part 2)" This reverts commit3f713b8a45
. * Update register.php * Updated
This commit is contained in:
parent
64409e607d
commit
a50c6601b4
9 changed files with 22 additions and 19 deletions
|
@ -19,7 +19,7 @@
|
||||||
- Invites: Permanent invites feature [\#1670](https://github.com/torrentpier/torrentpier/pull/1670) ([belomaxorka](https://github.com/belomaxorka))
|
- Invites: Permanent invites feature [\#1670](https://github.com/torrentpier/torrentpier/pull/1670) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka))
|
- Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- BBCode: Fixed relative links working [\#1613](https://github.com/torrentpier/torrentpier/pull/1613) ([belomaxorka](https://github.com/belomaxorka))
|
- BBCode: Fixed relative links working [\#1613](https://github.com/torrentpier/torrentpier/pull/1613) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Fixed broken torrent stats displaying [\#1672](https://github.com/torrentpier/torrentpier/pull/1672) ([belomaxorka](https://github.com/belomaxorka))
|
- Fixed broken torrent stats displaying [\#1672](https://github.com/torrentpier/torrentpier/pull/1672), [\#1673](https://github.com/torrentpier/torrentpier/pull/1673) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Fixed incorrect page width on mobile devices [\#1653](https://github.com/torrentpier/torrentpier/pull/1653) ([belomaxorka](https://github.com/belomaxorka))
|
- Fixed incorrect page width on mobile devices [\#1653](https://github.com/torrentpier/torrentpier/pull/1653) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Fixed template caching issue [\#1622](https://github.com/torrentpier/torrentpier/pull/1622) ([belomaxorka](https://github.com/belomaxorka))
|
- Fixed template caching issue [\#1622](https://github.com/torrentpier/torrentpier/pull/1622) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Fixed `md5()` deprecated in PHP 8.4 [\#1561](https://github.com/torrentpier/torrentpier/pull/1561) ([belomaxorka](https://github.com/belomaxorka))
|
- Fixed `md5()` deprecated in PHP 8.4 [\#1561](https://github.com/torrentpier/torrentpier/pull/1561) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
|
|
|
@ -434,6 +434,10 @@ CREATE TABLE IF NOT EXISTS `bb_bt_users`
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of bb_bt_users
|
-- Records of bb_bt_users
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
INSERT INTO `bb_bt_users` (user_id, auth_key)
|
||||||
|
VALUES ('-1', SUBSTRING(MD5(RAND()), 1, 20)),
|
||||||
|
('-746', SUBSTRING(MD5(RAND()), 1, 20)),
|
||||||
|
('2', SUBSTRING(MD5(RAND()), 1, 20));
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for `bb_bt_user_settings`
|
-- Table structure for `bb_bt_user_settings`
|
||||||
|
|
|
@ -268,6 +268,7 @@ define('BB_WORDS', 'bb_words');
|
||||||
define('BB_THX', 'bb_thx');
|
define('BB_THX', 'bb_thx');
|
||||||
|
|
||||||
define('TORRENT_EXT', 'torrent');
|
define('TORRENT_EXT', 'torrent');
|
||||||
|
define('TORRENT_MIMETYPE', 'application/x-bittorrent');
|
||||||
|
|
||||||
define('TOPIC_DL_TYPE_NORMAL', 0);
|
define('TOPIC_DL_TYPE_NORMAL', 0);
|
||||||
define('TOPIC_DL_TYPE_DL', 1);
|
define('TOPIC_DL_TYPE_DL', 1);
|
||||||
|
|
|
@ -605,6 +605,16 @@ if ($submit && !$errors) {
|
||||||
DB()->query("INSERT INTO " . BB_USERS . $sql_args);
|
DB()->query("INSERT INTO " . BB_USERS . $sql_args);
|
||||||
$new_user_id = DB()->sql_nextid();
|
$new_user_id = DB()->sql_nextid();
|
||||||
|
|
||||||
|
// Generate passkey
|
||||||
|
for ($i = 0, $max_try = 3; $i <= $max_try; $i++) {
|
||||||
|
if (\TorrentPier\Legacy\Torrent::generate_passkey($new_user_id, true)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ($i == $max_try) {
|
||||||
|
bb_simple_die('Could not generate passkey');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
set_pr_die_append_msg($new_user_id);
|
set_pr_die_append_msg($new_user_id);
|
||||||
$message = $lang['ACCOUNT_ADDED'];
|
$message = $lang['ACCOUNT_ADDED'];
|
||||||
|
|
|
@ -569,7 +569,7 @@ class Attach
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (empty($this->attachment_mimetype_list[$i]) && $this->attachment_extension_list[$i] === TORRENT_EXT) {
|
if (empty($this->attachment_mimetype_list[$i]) && $this->attachment_extension_list[$i] === TORRENT_EXT) {
|
||||||
$this->attachment_mimetype_list[$i] = 'application/x-bittorrent';
|
$this->attachment_mimetype_list[$i] = TORRENT_MIMETYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert attachment into db
|
// insert attachment into db
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
namespace TorrentPier\Legacy\Common;
|
namespace TorrentPier\Legacy\Common;
|
||||||
|
|
||||||
use TorrentPier\Legacy\DateDelta;
|
use TorrentPier\Legacy\DateDelta;
|
||||||
use TorrentPier\Legacy\Torrent;
|
|
||||||
use TorrentPier\Sessions;
|
use TorrentPier\Sessions;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
@ -253,13 +252,6 @@ class User
|
||||||
$user_id = (int)$this->data['user_id'];
|
$user_id = (int)$this->data['user_id'];
|
||||||
$mod_admin_session = ((int)$this->data['user_level'] === ADMIN || (int)$this->data['user_level'] === MOD);
|
$mod_admin_session = ((int)$this->data['user_level'] === ADMIN || (int)$this->data['user_level'] === MOD);
|
||||||
|
|
||||||
// Generate passkey
|
|
||||||
if (!Torrent::getPasskey($this->data['user_id'])) {
|
|
||||||
if (!Torrent::generate_passkey($this->data['user_id'], true)) {
|
|
||||||
bb_simple_die('Could not generate passkey');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create new session
|
// Create new session
|
||||||
for ($i = 0, $max_try = 5; $i <= $max_try; $i++) {
|
for ($i = 0, $max_try = 5; $i <= $max_try; $i++) {
|
||||||
$session_id = make_rand_str(SID_LENGTH);
|
$session_id = make_rand_str(SID_LENGTH);
|
||||||
|
|
|
@ -671,7 +671,7 @@ class Torrent
|
||||||
bb_die("<pre>$out</pre>");
|
bb_die("<pre>$out</pre>");
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Content-Type: application/x-bittorrent; name=\"$dl_fname\"");
|
header("Content-Type: " . TORRENT_MIMETYPE . "; name=\"$dl_fname\"");
|
||||||
header("Content-Disposition: attachment; filename=\"$dl_fname\"");
|
header("Content-Disposition: attachment; filename=\"$dl_fname\"");
|
||||||
|
|
||||||
exit($output);
|
exit($output);
|
||||||
|
@ -866,10 +866,6 @@ class Torrent
|
||||||
*/
|
*/
|
||||||
public static function getPasskey(int|string $user_id): bool|string
|
public static function getPasskey(int|string $user_id): bool|string
|
||||||
{
|
{
|
||||||
if ($passkey = DB()->fetch_row("SELECT auth_key FROM " . BB_BT_USERS . " WHERE user_id = " . (int)$user_id . " LIMIT 1")) {
|
return get_bt_userdata($user_id)['auth_key'];
|
||||||
return $passkey['auth_key'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ class TorrServerAPI
|
||||||
global $bb_cfg;
|
global $bb_cfg;
|
||||||
|
|
||||||
// Check mimetype
|
// Check mimetype
|
||||||
if ($mimetype !== 'application/x-bittorrent') {
|
if ($mimetype !== TORRENT_MIMETYPE) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -391,7 +391,7 @@ function go_to_page ()
|
||||||
<!--sidebar1-->
|
<!--sidebar1-->
|
||||||
<td id="sidebar1">
|
<td id="sidebar1">
|
||||||
<div id="sidebar1-wrap">
|
<div id="sidebar1-wrap">
|
||||||
<div id="user_ratio">
|
<!-- IF SHOW_BT_USERDATA --><div id="user_ratio">
|
||||||
<h3>{L_USER_RATIO}</h3>
|
<h3>{L_USER_RATIO}</h3>
|
||||||
<table cellpadding="0">
|
<table cellpadding="0">
|
||||||
<div align="center">{THIS_AVATAR}</div>
|
<div align="center">{THIS_AVATAR}</div>
|
||||||
|
@ -402,7 +402,7 @@ function go_to_page ()
|
||||||
<tr><td>{L_BONUS}</td><td class="seedmed">{UP_BONUS}</td></tr>
|
<tr><td>{L_BONUS}</td><td class="seedmed">{UP_BONUS}</td></tr>
|
||||||
<!-- IF $bb_cfg['seed_bonus_enabled'] --><tr><td>{L_SEED_BONUS}</td><td><a href="{BONUS_URL}"><span class="points bold">{POINTS}</span></a></td></tr><!-- ENDIF -->
|
<!-- IF $bb_cfg['seed_bonus_enabled'] --><tr><td>{L_SEED_BONUS}</td><td><a href="{BONUS_URL}"><span class="points bold">{POINTS}</span></a></td></tr><!-- ENDIF -->
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div><!-- ENDIF -->
|
||||||
<!-- IF HTML_SIDEBAR_1 -->
|
<!-- IF HTML_SIDEBAR_1 -->
|
||||||
<?php include($V['HTML_SIDEBAR_1']); ?>
|
<?php include($V['HTML_SIDEBAR_1']); ?>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue