mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 21:03:54 -07:00
Исправления SSL, sitemap и т.д.
Множественные исправления предыдущих коммитов, правки форматирования.
This commit is contained in:
parent
0804706fd7
commit
1c5fb857f2
13 changed files with 71 additions and 77 deletions
|
@ -36,6 +36,7 @@ nord51
|
|||
Вася
|
||||
Alexander.S (http://torrent.dchub.ws/)
|
||||
sasha20072007
|
||||
gerhanovn
|
||||
|
||||
*****************************
|
||||
** Прочая информация **
|
||||
|
|
|
@ -19,9 +19,10 @@ header('X-Frame-Options: SAMEORIGIN');
|
|||
// Get initial config
|
||||
require(BB_ROOT . 'library/config.php');
|
||||
|
||||
$server_protocol = '//';
|
||||
$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';
|
||||
$server_port = (in_array($bb_cfg['server_port'], array(80, 443))) ? '' : ':' . $bb_cfg['server_port'];
|
||||
define('FORUM_PATH', $bb_cfg['script_path']);
|
||||
define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $bb_cfg['script_path']);
|
||||
define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']);
|
||||
unset($server_protocol, $server_port);
|
||||
|
||||
// Debug options
|
||||
|
|
|
@ -78,6 +78,7 @@ if ($is_moderator)
|
|||
'GROUP_DESCRIPTION' => htmlCHR($group_info['group_description']),
|
||||
'GROUP_SIGNATURE' => htmlCHR($group_info['group_signature']),
|
||||
'U_GROUP_URL' => GROUP_URL . $group_id,
|
||||
'RELEASE_GROUP' => ($group_info['release_group']) ? true : false,
|
||||
'GROUP_TYPE' => $group_type,
|
||||
'S_GROUP_OPEN_TYPE' => GROUP_OPEN,
|
||||
'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED,
|
||||
|
@ -90,7 +91,6 @@ if ($is_moderator)
|
|||
|
||||
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['group_avatars']['max_width'], $bb_cfg['group_avatars']['max_height'], (round($bb_cfg['group_avatars']['max_size'] / 1024))),
|
||||
'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']),
|
||||
'RELEASE_GROUP' => ($group_info['release_group']) ? true : false,
|
||||
));
|
||||
|
||||
$template->set_filenames(array('body' => 'group_edit.tpl'));
|
||||
|
|
|
@ -380,7 +380,6 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
|
|||
$week_all = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$week_list[] = profile_url($week) .' <span class="small">('. birthday_age($week['user_birthday']-1) .')</span>';
|
||||
}
|
||||
$week_all = ($week_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_week\'}); return false;" title="'. $lang['ALL'] .'">...</a>' : '';
|
||||
|
@ -398,7 +397,6 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled'])
|
|||
$today_all = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$today_list[] = profile_url($today) .' <span class="small">('. birthday_age($today['user_birthday']) .')</span>';
|
||||
}
|
||||
$today_all = ($today_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_today\'}); return false;" title="'. $lang['ALL'] .'">...</a>' : '';
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
* Error reporting
|
||||
* Triggers
|
||||
* Date format
|
||||
|
||||
* Subforums
|
||||
* Forums
|
||||
* Topics
|
||||
|
@ -48,13 +47,12 @@
|
|||
* Actions log
|
||||
* Users
|
||||
* Groups
|
||||
|
||||
* Tidy
|
||||
* Ads
|
||||
* Misc
|
||||
* Attachments
|
||||
* Avatars
|
||||
* Group avatars
|
||||
* Misc
|
||||
* Captcha
|
||||
* Atom feed
|
||||
* Nofollow
|
||||
|
@ -253,10 +251,10 @@ define('BB_PATH', realpath(BB_ROOT) );
|
|||
define('ADMIN_DIR', BB_PATH .'/admin/' );
|
||||
define('DATA_DIR', BB_PATH .'/data/' );
|
||||
define('INT_DATA_DIR', BB_PATH .'/internal_data/' );
|
||||
define('AJAX_HTML_DIR', BB_ROOT .'internal_data/ajax_html/' );
|
||||
define('AJAX_HTML_DIR', BB_ROOT .'/internal_data/ajax_html/' );
|
||||
define('CACHE_DIR', BB_PATH .'/internal_data/cache/' );
|
||||
define('LOG_DIR', BB_PATH .'/internal_data/log/' );
|
||||
define('SITEMAP_DIR', BB_PATH .'internal_data/sitemap/' );
|
||||
define('SITEMAP_DIR', BB_PATH .'/internal_data/sitemap/' );
|
||||
define('TRIGGERS_DIR', BB_PATH .'/internal_data/triggers/' );
|
||||
define('AJAX_DIR', BB_ROOT .'/library/ajax/' );
|
||||
define('ATTACH_DIR', BB_PATH .'/library/attach_mod/' );
|
||||
|
@ -574,6 +572,12 @@ $bb_cfg['user_agreement_url'] = 'info.php?show=user_agreement';
|
|||
$bb_cfg['copyright_holders_url'] = 'info.php?show=copyright_holders';
|
||||
$bb_cfg['advert_url'] = 'info.php?show=advert';
|
||||
|
||||
// Attachments
|
||||
$bb_cfg['attach'] = array(
|
||||
'upload_path' => DATA_DIR . 'torrent_files', // путь к директории с torrent файлами
|
||||
'max_size' => 250*1024, // размер аватары в байтах
|
||||
);
|
||||
|
||||
$bb_cfg['file_id_ext'] = array(
|
||||
1 => 'gif',
|
||||
2 => 'gz',
|
||||
|
@ -589,12 +593,6 @@ $bb_cfg['file_id_ext'] = array(
|
|||
$bb_cfg['tor_forums_allowed_ext'] = array('torrent', 'zip', 'rar'); // для разделов с раздачами
|
||||
$bb_cfg['gen_forums_allowed_ext'] = array('zip', 'rar'); // для обычных разделов
|
||||
|
||||
// Attachments
|
||||
$bb_cfg['attach'] = array(
|
||||
'upload_path' => DATA_DIR . 'torrent_files', // путь к директории с torrent файлами
|
||||
'max_size' => 250*1024, // размер аватары в байтах
|
||||
);
|
||||
|
||||
// Avatars
|
||||
$bb_cfg['avatars'] = array(
|
||||
'allowed_ext' => array('gif','jpg','jpeg','png'), // разрешенные форматы файлов
|
||||
|
@ -622,14 +620,14 @@ $bb_cfg['group_avatars'] = array(
|
|||
$bb_cfg['captcha'] = array(
|
||||
'disabled' => false,
|
||||
'secret_key' => 'secret_key',
|
||||
'img_path' => INT_DATA_DIR .'captcha/', // with '/'
|
||||
'img_url' => './internal_data/captcha/', // with '/'
|
||||
'img_path' => INT_DATA_DIR .'captcha/', // with ending slash
|
||||
'img_url' => './internal_data/captcha/', // with ending slash
|
||||
);
|
||||
|
||||
// Atom feed
|
||||
$bb_cfg['atom'] = array(
|
||||
'path' => INT_DATA_DIR .'atom', // without '/'
|
||||
'url' => './internal_data/atom', // without '/'
|
||||
'path' => INT_DATA_DIR .'atom', // without ending slash
|
||||
'url' => './internal_data/atom', // without ending slash
|
||||
);
|
||||
|
||||
// Nofollow
|
||||
|
|
|
@ -12,8 +12,7 @@ class sitemap
|
|||
var $cat_priority = '0.7';
|
||||
|
||||
function sitemap () {
|
||||
global $bb_cfg;
|
||||
$this->home = make_url('');
|
||||
$this->home = make_url();
|
||||
}
|
||||
|
||||
function build_map () {
|
||||
|
@ -29,10 +28,10 @@ class sitemap
|
|||
function build_index ($count) {
|
||||
$lm = date('c');
|
||||
$map = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n";
|
||||
$map .= "<sitemap>\n<loc>".make_url(substr(SITEMAP_DIR, 2))."/sitemap1.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
|
||||
$map .= "<sitemap>\n<loc>".make_url(substr(SITEMAP_DIR, 3))."/sitemap1.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$t = $i + 2;
|
||||
$map .= "<sitemap>\n<loc>".make_url(substr(SITEMAP_DIR, 2))."/sitemap{$t}.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
|
||||
$map .= "<sitemap>\n<loc>".make_url(substr(SITEMAP_DIR, 3))."/sitemap{$t}.xml</loc>\n<lastmod>{$lm}</lastmod>\n</sitemap>\n";
|
||||
}
|
||||
$map .= "</sitemapindex>";
|
||||
|
||||
|
|
|
@ -9,13 +9,6 @@ function get_path_from_id ($id, $ext_id, $base_path, $first_div, $sec_div)
|
|||
return ($base_path ? "$base_path/" : '') . floor($id/$first_div) .'/'. ($id % $sec_div) .'/'. $id . ($ext ? ".$ext" : '');
|
||||
}
|
||||
|
||||
function delete_avatar ($user_id, $avatar_ext_id)
|
||||
{
|
||||
global $bb_cfg;
|
||||
$avatar_file = ($avatar_ext_id) ? get_avatar_path($user_id, $avatar_ext_id) : '';
|
||||
return ($avatar_file && file_exists($avatar_file)) ? @unlink($avatar_file) : false;
|
||||
}
|
||||
|
||||
function get_avatar_path ($id, $ext_id, $base_path = null, $first_div = 10000, $sec_div = 100)
|
||||
{
|
||||
global $bb_cfg;
|
||||
|
@ -30,6 +23,12 @@ function get_attach_path ($id, $ext_id = '', $base_path = null, $first_div = 100
|
|||
return get_path_from_id($id, $ext_id, $base_path, $first_div, $sec_div);
|
||||
}
|
||||
|
||||
function delete_avatar ($user_id, $avatar_ext_id)
|
||||
{
|
||||
$avatar_file = ($avatar_ext_id) ? get_avatar_path($user_id, $avatar_ext_id) : '';
|
||||
return ($avatar_file && file_exists($avatar_file)) ? @unlink($avatar_file) : false;
|
||||
}
|
||||
|
||||
function get_tracks ($type)
|
||||
{
|
||||
static $pattern = '#^a:\d+:{[i:;\d]+}$#';
|
||||
|
|
|
@ -118,8 +118,6 @@ class upload_common
|
|||
|
||||
function store ($mode = '', $params = array())
|
||||
{
|
||||
global $bb_cfg;
|
||||
|
||||
if ($mode == 'avatar')
|
||||
{
|
||||
delete_avatar($params['user_id'], $params['avatar_ext_id']);
|
||||
|
|
|
@ -421,7 +421,7 @@ function html_ent_decode ($txt, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
|
|||
return (string) html_entity_decode($txt, $quote_style, $charset);
|
||||
}
|
||||
|
||||
function make_url ($path)
|
||||
function make_url ($path = '')
|
||||
{
|
||||
return FULL_URL . preg_replace('#^\/?(.*?)\/?$#', '\1', $path);
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<h3>FAQ</h3>
|
||||
<ul class="med">
|
||||
<li><a href="info.php?show=user_agreement" class="med" onclick="window.open(this.href, '', IWP); return false;"><b>Terms of use resource</b></a></li>
|
||||
<li><a href="http://torrentpier.me/threads/faq-для-новичков.260" class="med">FAQ for beginners</a></li>
|
||||
<li><a href="http://torrentpier.me/forums/Основные-вопросы-по-torrentpier-ii.10" class="med">Where is ask a question?</a></li>
|
||||
<li><a href="https://torrentpier.me/threads/faq-dlja-novichkov.260" class="med">FAQ for beginners</a></li>
|
||||
<li><a href="https://torrentpier.me/forums/osnovnye-voprosy-po-torrentpier-ii.10" class="med">Where is ask a question?</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<h3>FAQ</h3>
|
||||
<ul class="med">
|
||||
<li><a href="info.php?show=user_agreement" class="med" onclick="window.open(this.href, '', IWP); return false;"><b>Правила пользования данным ресурсом</b></a></li>
|
||||
<li><a href="http://torrentpier.me/threads/faq-для-новичков.260" class="med">FAQ для новичков</a></li>
|
||||
<li><a href="http://torrentpier.me/forums/Основные-вопросы-по-torrentpier-ii.10" class="med">Где задать вопрос?</a></li>
|
||||
<li><a href="https://torrentpier.me/threads/faq-dlja-novichkov.260" class="med">FAQ для новичков</a></li>
|
||||
<li><a href="https://torrentpier.me/forums/osnovnye-voprosy-po-torrentpier-ii.10" class="med">Где задать вопрос?</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<h3>FAQ</h3>
|
||||
<ul class="med">
|
||||
<li><a href="info.php?show=user_agreement" class="med" onclick="window.open(this.href, '', IWP); return false;"><b>Правила користування цим ресурсом</b></a></li>
|
||||
<li><a href="http://torrentpier.me/threads/faq-для-новичков.260" class="med">FAQ для новачків</a></li>
|
||||
<li><a href="http://torrentpier.me/forums/Основные-вопросы-по-torrentpier-ii.10" class="med">Де поставити питання?</a></li>
|
||||
<li><a href="https://torrentpier.me/threads/faq-dlja-novichkov.260" class="med">FAQ для новачків</a></li>
|
||||
<li><a href="https://torrentpier.me/forums/osnovnye-voprosy-po-torrentpier-ii.10" class="med">Де поставити питання?</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue