mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
Исправления SSL, sitemap и т.д.
Множественные исправления предыдущих коммитов, правки форматирования.
This commit is contained in:
parent
0804706fd7
commit
1c5fb857f2
13 changed files with 71 additions and 77 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue