mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
[Configurable] Show magnet-links for guests (#1712)
* [Configurable] Show magnet links for guests * Update mysql.sql * Update legacy-changes.txt * Updated * Update main.php * Update functions.php * Updated * Update viewforum.tpl * Update viewtopic_attach.tpl * Update viewforum.tpl * Update CHANGELOG.md
This commit is contained in:
parent
ea1e533a5a
commit
60899a0184
11 changed files with 18 additions and 5 deletions
|
@ -6,6 +6,7 @@
|
|||
**Merged pull requests:**
|
||||
|
||||
- Release 2.4.5 🍧️ ([belomaxorka](https://github.com/belomaxorka))
|
||||
- [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Set `cursor: pointer;` for buttons, inputs (buttons) [\#1710](https://github.com/torrentpier/torrentpier/pull/1710), [\#1711](https://github.com/torrentpier/torrentpier/pull/1711) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- New Crowdin updates [\#1704](https://github.com/torrentpier/torrentpier/pull/1704), [\#1706](https://github.com/torrentpier/torrentpier/pull/1706) ([Exileum](https://github.com/Exileum))
|
||||
|
|
|
@ -61,6 +61,7 @@ switch ($mode) {
|
|||
'CONFIG_MODS' => true,
|
||||
|
||||
'MAGNET_LINKS_ENABLED' => $new['magnet_links_enabled'],
|
||||
'MAGNET_LINKS_FOR_GUESTS' => $new['magnet_links_for_guests'],
|
||||
'GENDER' => $new['gender'],
|
||||
'CALLSEED' => $new['callseed'],
|
||||
'TOR_STATS' => $new['tor_stats'],
|
||||
|
|
|
@ -583,6 +583,7 @@ VALUES ('allow_autologin', '1'),
|
|||
('xs_use_cache', '1'),
|
||||
('cron_check_interval', '180'),
|
||||
('magnet_links_enabled', '1'),
|
||||
('magnet_links_for_guests', '0'),
|
||||
('gender', '1'),
|
||||
('callseed', '0'),
|
||||
('tor_stats', '1'),
|
||||
|
|
|
@ -148,3 +148,6 @@ UPDATE `bb_cron` SET `run_interval` = '00:10:00' WHERE `cron_script` = 'tr_seed_
|
|||
// 2.4.5-rc.1
|
||||
INSERT INTO `bb_extensions` (`group_id`, `extension`, `comment`) VALUES ('1', 'avif', ''), ('3', 'm3u', '');
|
||||
ALTER TABLE `bb_topics` ADD COLUMN `topic_allow_robots` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0';
|
||||
|
||||
// 2.4.5
|
||||
INSERT INTO bb_config VALUES ('magnet_links_for_guests', '0');
|
||||
|
|
|
@ -1812,7 +1812,7 @@ function create_magnet(string $infohash, string $infohash_v2, string $auth_key,
|
|||
}
|
||||
|
||||
// Only for registered users
|
||||
if (IS_GUEST && $bb_cfg['bt_tor_browse_only_reg']) {
|
||||
if (!$bb_cfg['magnet_links_for_guests'] && IS_GUEST) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1400,6 +1400,7 @@ $lang['SEEDING'] = 'Seed';
|
|||
$lang['LEECHING'] = 'Leech';
|
||||
$lang['IS_REGISTERED'] = 'Registered';
|
||||
$lang['MAGNET'] = 'Magnet-link';
|
||||
$lang['MAGNET_FOR_GUESTS'] = 'Show magnet-link for guests';
|
||||
$lang['MAGNET_v2'] = 'Magnet-link (BitTorrent v2 supported)';
|
||||
|
||||
//torrent status mod
|
||||
|
|
|
@ -171,6 +171,13 @@
|
|||
<label><input type="radio" name="magnet_links_enabled" value="0" <!-- IF not MAGNET_LINKS_ENABLED -->checked<!-- ENDIF --> />{L_DISABLED}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>{L_MAGNET_FOR_GUESTS}</h4></td>
|
||||
<td>
|
||||
<label><input type="radio" name="magnet_links_for_guests" value="1" <!-- IF MAGNET_LINKS_FOR_GUESTS -->checked<!-- ENDIF --> />{L_ENABLED}</label>
|
||||
<label><input type="radio" name="magnet_links_for_guests" value="0" <!-- IF not MAGNET_LINKS_FOR_GUESTS -->checked<!-- ENDIF --> />{L_DISABLED}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>{L_GENDER}</h4></td>
|
||||
<td>
|
||||
|
|
|
@ -124,7 +124,6 @@ $template->assign_vars([
|
|||
'TOPIC_LEFT_COL_SPACER_WITDH' => $bb_cfg['topic_left_column_witdh'] - 8, // 8px padding
|
||||
'POST_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['post_img_width_decr'],
|
||||
'ATTACH_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['attach_img_width_decr'],
|
||||
'MAGNET_LINKS' => $bb_cfg['magnet_links_enabled'],
|
||||
'FEED_IMG' => '<img src="' . $_main . 'feed.png" class="feed-small" alt="' . $lang['ATOM_FEED'] . '" />',
|
||||
]);
|
||||
|
||||
|
|
|
@ -404,7 +404,7 @@ ajax.callback.view_post = function(data) {
|
|||
<!-- ENDIF -->
|
||||
<td class="row4 small nowrap">
|
||||
<u>{tor.TOR_SIZE_RAW}</u>
|
||||
<!-- IF not tor.TOR_FROZEN --><a class="small tr-dl" title="{L_DOWNLOAD}" href="{DOWNLOAD_URL}{tor.ATTACH_ID}">{tor.TOR_SIZE}</a> <!-- IF MAGNET_LINKS -->{tor.MAGNET}<!-- ENDIF --><!-- ELSE -->
|
||||
<!-- IF not tor.TOR_FROZEN --><a class="small tr-dl" title="{L_DOWNLOAD}" href="{DOWNLOAD_URL}{tor.ATTACH_ID}">{tor.TOR_SIZE}</a> <!-- IF tor.MAGNET -->{tor.MAGNET}<!-- ENDIF --><!-- ELSE -->
|
||||
{tor.TOR_SIZE}<!-- ENDIF -->
|
||||
</td>
|
||||
<td class="row4 seedmed" title="{tor.SEEDS_TITLE}"><b>{tor.SEEDS}</b></td>
|
||||
|
|
|
@ -466,7 +466,7 @@ td.topic_id { cursor: pointer; }
|
|||
<!-- BEGIN tor -->
|
||||
<div>
|
||||
<div><span class="seedmed" title="{L_SEEDERS}"><b>{t.tor.SEEDERS}</b></span><span class="med"> | </span><span class="leechmed" title="{L_LEECHERS}"><b>{t.tor.LEECHERS}</b></span></div>
|
||||
<div style="padding-top: 2px" class="small"><!-- IF t.TOR_FROZEN -->{t.tor.TOR_SIZE}<!-- ELSE --><a href="{DOWNLOAD_URL}{t.tor.ATTACH_ID}" title="{L_DL_TORRENT}" class="small" style="text-decoration: none">{t.tor.TOR_SIZE}</a> <!-- IF MAGNET_LINKS -->{t.tor.MAGNET}<!-- ENDIF --><!-- ENDIF --></div>
|
||||
<div style="padding-top: 2px" class="small"><!-- IF t.TOR_FROZEN -->{t.tor.TOR_SIZE}<!-- ELSE --><a href="{DOWNLOAD_URL}{t.tor.ATTACH_ID}" title="{L_DL_TORRENT}" class="small">{t.tor.TOR_SIZE}</a> <!-- IF t.tor.MAGNET -->{t.tor.MAGNET}<!-- ENDIF --><!-- ENDIF --></div>
|
||||
</div>
|
||||
<!-- END tor -->
|
||||
</td>
|
||||
|
|
|
@ -147,7 +147,7 @@
|
|||
<tr class="row3">
|
||||
<th colspan="3" class="{postrow.attach.tor_reged.DL_LINK_CLASS}">{postrow.attach.tor_reged.DOWNLOAD_NAME}
|
||||
<a href="{postrow.attach.tor_reged.FILELIST_LINK}" title="{L_BT_FLIST_LINK_TITLE}" target="_blank"><img alt="{L_BT_FLIST_LINK_TITLE}" src="{postrow.attach.tor_reged.FILELIST_ICON}" width="12" height="12" border="0"></a>
|
||||
<!-- IF MAGNET_LINKS and not postrow.attach.tor_reged.TOR_FROZEN --> {postrow.attach.tor_reged.MAGNET}<!-- ENDIF --></th>
|
||||
<!-- IF postrow.attach.tor_reged.MAGNET and not postrow.attach.tor_reged.TOR_FROZEN --> {postrow.attach.tor_reged.MAGNET}<!-- ENDIF --></th>
|
||||
</tr>
|
||||
<!-- IF postrow.attach.tor_reged.TOR_TYPE -->
|
||||
<tr class="row4">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue