mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -07:00
Merge pull request #465 from Exileum/feature/new-dl-url
Configurable download torrent url
This commit is contained in:
commit
b80ef5d0e5
10 changed files with 13 additions and 12 deletions
|
@ -452,7 +452,7 @@ if ($view === 'attachments') {
|
||||||
|
|
||||||
'S_DELETE_BOX' => $delete_box,
|
'S_DELETE_BOX' => $delete_box,
|
||||||
'S_HIDDEN' => $hidden_field,
|
'S_HIDDEN' => $hidden_field,
|
||||||
'U_VIEW_ATTACHMENT' => BB_ROOT . DOWNLOAD_URL . $attachments[$i]['attach_id'],
|
'U_VIEW_ATTACHMENT' => BB_ROOT . DL_URL . $attachments[$i]['attach_id'],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ $user_list = DB()->fetch_rowset("
|
||||||
");
|
");
|
||||||
|
|
||||||
$subject = sprintf($lang['CALLSEED_SUBJECT'], $t_data['topic_title']);
|
$subject = sprintf($lang['CALLSEED_SUBJECT'], $t_data['topic_title']);
|
||||||
$message = sprintf($lang['CALLSEED_TEXT'], make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DOWNLOAD_URL . $t_data['attach_id']));
|
$message = sprintf($lang['CALLSEED_TEXT'], make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DL_URL . $t_data['attach_id']));
|
||||||
|
|
||||||
if ($user_list) {
|
if ($user_list) {
|
||||||
foreach ($user_list as $row) {
|
foreach ($user_list as $row) {
|
||||||
|
|
2
dl.php
2
dl.php
|
@ -186,7 +186,7 @@ if (IS_GUEST && !bb_captcha('check')) {
|
||||||
global $template;
|
global $template;
|
||||||
|
|
||||||
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';
|
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';
|
||||||
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
|
$message = '<form action="' . DL_URL . $attachment['attach_id'] . '" method="post">';
|
||||||
$message .= $lang['CAPTCHA'] . ':';
|
$message .= $lang['CAPTCHA'] . ':';
|
||||||
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
|
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
|
||||||
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
|
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
|
||||||
|
|
|
@ -239,7 +239,7 @@ function display_attachments($post_id)
|
||||||
if ($image) {
|
if ($image) {
|
||||||
// Images
|
// Images
|
||||||
if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) {
|
if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) {
|
||||||
$img_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'];
|
$img_source = BB_ROOT . DL_URL . $attachments['_' . $post_id][$i]['attach_id'];
|
||||||
$download_link = true;
|
$download_link = true;
|
||||||
} else {
|
} else {
|
||||||
$img_source = $filename;
|
$img_source = $filename;
|
||||||
|
@ -269,7 +269,7 @@ function display_attachments($post_id)
|
||||||
if ($thumbnail) {
|
if ($thumbnail) {
|
||||||
// Images, but display Thumbnail
|
// Images, but display Thumbnail
|
||||||
if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) {
|
if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) {
|
||||||
$thumb_source = BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1';
|
$thumb_source = BB_ROOT . DL_URL . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1';
|
||||||
} else {
|
} else {
|
||||||
$thumb_source = $thumbnail_filename;
|
$thumb_source = $thumbnail_filename;
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ function display_attachments($post_id)
|
||||||
$template->assign_block_vars('postrow.attach.cat_thumb_images', array(
|
$template->assign_block_vars('postrow.attach.cat_thumb_images', array(
|
||||||
'DOWNLOAD_NAME' => $display_name,
|
'DOWNLOAD_NAME' => $display_name,
|
||||||
'S_UPLOAD_IMAGE' => $upload_image,
|
'S_UPLOAD_IMAGE' => $upload_image,
|
||||||
'IMG_SRC' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'],
|
'IMG_SRC' => BB_ROOT . DL_URL . $attachments['_' . $post_id][$i]['attach_id'],
|
||||||
'IMG_THUMB_SRC' => $thumb_source,
|
'IMG_THUMB_SRC' => $thumb_source,
|
||||||
'FILESIZE' => $filesize,
|
'FILESIZE' => $filesize,
|
||||||
'COMMENT' => $comment,
|
'COMMENT' => $comment,
|
||||||
|
@ -292,7 +292,7 @@ function display_attachments($post_id)
|
||||||
|
|
||||||
// display attachment
|
// display attachment
|
||||||
$template->assign_block_vars('postrow.attach.attachrow', array(
|
$template->assign_block_vars('postrow.attach.attachrow', array(
|
||||||
'U_DOWNLOAD_LINK' => BB_ROOT . DOWNLOAD_URL . $attachments['_' . $post_id][$i]['attach_id'],
|
'U_DOWNLOAD_LINK' => BB_ROOT . DL_URL . $attachments['_' . $post_id][$i]['attach_id'],
|
||||||
'S_UPLOAD_IMAGE' => $upload_image,
|
'S_UPLOAD_IMAGE' => $upload_image,
|
||||||
'DOWNLOAD_NAME' => $display_name,
|
'DOWNLOAD_NAME' => $display_name,
|
||||||
'FILESIZE' => $filesize,
|
'FILESIZE' => $filesize,
|
||||||
|
|
|
@ -77,7 +77,7 @@ $tor_auth_del = ($tor_auth && $tor_reged);
|
||||||
|
|
||||||
$tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO'];
|
$tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO'];
|
||||||
|
|
||||||
$download_link = DOWNLOAD_URL . $attach_id;
|
$download_link = DL_URL . $attach_id;
|
||||||
$description = ($comment) ?: preg_replace("#.torrent$#i", '', $display_name);
|
$description = ($comment) ?: preg_replace("#.torrent$#i", '', $display_name);
|
||||||
|
|
||||||
if ($tor_auth_reg || $tor_auth_del) {
|
if ($tor_auth_reg || $tor_auth_del) {
|
||||||
|
|
|
@ -141,6 +141,7 @@ $bb_cfg['torhelp_enabled'] = false; // find dead torrents (without seeder) that
|
||||||
|
|
||||||
// URL's
|
// URL's
|
||||||
$bb_cfg['ajax_url'] = 'ajax.php'; # "http://{$_SERVER['SERVER_NAME']}/ajax.php"
|
$bb_cfg['ajax_url'] = 'ajax.php'; # "http://{$_SERVER['SERVER_NAME']}/ajax.php"
|
||||||
|
$bb_cfg['dl_url'] = 'dl.php?id='; # "http://{$domain_name}/dl.php?id="
|
||||||
$bb_cfg['login_url'] = 'login.php'; # "http://{$domain_name}/login.php"
|
$bb_cfg['login_url'] = 'login.php'; # "http://{$domain_name}/login.php"
|
||||||
$bb_cfg['posting_url'] = 'posting.php'; # "http://{$domain_name}/posting.php"
|
$bb_cfg['posting_url'] = 'posting.php'; # "http://{$domain_name}/posting.php"
|
||||||
$bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php"
|
$bb_cfg['pm_url'] = 'privmsg.php'; # "http://{$domain_name}/privmsg.php"
|
||||||
|
|
|
@ -282,7 +282,7 @@ define('PAGE_HEADER', INC_DIR . '/page_header.php');
|
||||||
define('PAGE_FOOTER', INC_DIR . '/page_footer.php');
|
define('PAGE_FOOTER', INC_DIR . '/page_footer.php');
|
||||||
|
|
||||||
define('CAT_URL', 'index.php?c=');
|
define('CAT_URL', 'index.php?c=');
|
||||||
define('DOWNLOAD_URL', 'dl.php?id=');
|
define('DL_URL', $bb_cfg['dl_url']);
|
||||||
define('FORUM_URL', 'viewforum.php?f=');
|
define('FORUM_URL', 'viewforum.php?f=');
|
||||||
define('GROUP_URL', 'group.php?g=');
|
define('GROUP_URL', 'group.php?g=');
|
||||||
define('LOGIN_URL', $bb_cfg['login_url']);
|
define('LOGIN_URL', $bb_cfg['login_url']);
|
||||||
|
|
|
@ -178,7 +178,7 @@ $template->assign_vars(array(
|
||||||
// Common urls
|
// Common urls
|
||||||
'AVATARS_URL' => 'data/avatars',
|
'AVATARS_URL' => 'data/avatars',
|
||||||
'CAT_URL' => BB_ROOT . CAT_URL,
|
'CAT_URL' => BB_ROOT . CAT_URL,
|
||||||
'DOWNLOAD_URL' => BB_ROOT . DOWNLOAD_URL,
|
'DOWNLOAD_URL' => BB_ROOT . DL_URL,
|
||||||
'FORUM_URL' => BB_ROOT . FORUM_URL,
|
'FORUM_URL' => BB_ROOT . FORUM_URL,
|
||||||
'GROUP_URL' => BB_ROOT . GROUP_URL,
|
'GROUP_URL' => BB_ROOT . GROUP_URL,
|
||||||
'LOGIN_URL' => $bb_cfg['login_url'],
|
'LOGIN_URL' => $bb_cfg['login_url'],
|
||||||
|
|
|
@ -695,7 +695,7 @@ class Attach
|
||||||
if (@$this->attachment_id_list[$i] == 0) {
|
if (@$this->attachment_id_list[$i] == 0) {
|
||||||
$download_link = $upload_dir . '/' . basename($this->attachment_list[$i]);
|
$download_link = $upload_dir . '/' . basename($this->attachment_list[$i]);
|
||||||
} else {
|
} else {
|
||||||
$download_link = BB_ROOT . DOWNLOAD_URL . $this->attachment_id_list[$i];
|
$download_link = BB_ROOT . DL_URL . $this->attachment_id_list[$i];
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('attach_row', [
|
$template->assign_block_vars('attach_row', [
|
||||||
|
|
|
@ -411,7 +411,7 @@ class Torrent
|
||||||
|
|
||||||
if ($reg_mode == 'request' || $reg_mode == 'newtopic') {
|
if ($reg_mode == 'request' || $reg_mode == 'newtopic') {
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
$mess = sprintf($lang['BT_REGISTERED'], DOWNLOAD_URL . $attach_id);
|
$mess = sprintf($lang['BT_REGISTERED'], DL_URL . $attach_id);
|
||||||
bb_die($mess);
|
bb_die($mess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue