Переделка структуры папок движка.
30
README.md
|
@ -10,7 +10,7 @@ TorrentPier II - движок торрент-трекера, написанны
|
|||
1. Распаковываем на сервер содержимое папки **upload**
|
||||
|
||||
2. Создаем базу данных, в которую при помощи phpmyadmin (или любого другого удобного инструмента) импортируем дамп, расположенный в папке **install/sql/mysql.sql**
|
||||
3. Правим файл конфигурации **config.php**, загруженный на сервер:
|
||||
3. Правим файл конфигурации **library/config.php**, загруженный на сервер:
|
||||
> ***'db1' => array('localhost', 'dbase', 'user', 'pass', $charset, $pconnect)***
|
||||
В данной строке изменяем данные входа в базу данных
|
||||
***$domain_name = 'torrentpier.me';***
|
||||
|
@ -25,20 +25,20 @@ TorrentPier II - движок торрент-трекера, написанны
|
|||
## Права доступа на папки и файлы
|
||||
|
||||
Исходя из настроек вашего сервера, устанавливаем рекомендуемые права доступа (chmod) на указанные папки **777**, а на файлы внутри этих папок (кроме файлов **.htaccess** и **.keep**) **666**:
|
||||
- ajax/html
|
||||
- atom
|
||||
- cache
|
||||
- cache/filecache
|
||||
- images
|
||||
- images/avatars
|
||||
- images/captcha
|
||||
- images/ranks
|
||||
- images/smiles
|
||||
- log
|
||||
- old_files
|
||||
- old_files/thumbs
|
||||
- sitemap
|
||||
- triggers
|
||||
- data/avatars
|
||||
- data/old_files
|
||||
- data/torrent_files
|
||||
- internal_data/ajax_html
|
||||
- internal_data/atom
|
||||
- internal_data/cache
|
||||
- internal_data/cache/filecache
|
||||
- internal_data/captcha
|
||||
- internal_data/log
|
||||
- internal_data/sitemap
|
||||
- internal_data/triggers
|
||||
- styles/images
|
||||
- styles/images/ranks
|
||||
- styles/images/smiles
|
||||
|
||||
## Необходимые настройки php
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ CREATE TABLE IF NOT EXISTS `bb_attachments_config` (
|
|||
-- Дамп данных таблицы `bb_attachments_config`
|
||||
--
|
||||
|
||||
INSERT INTO `bb_attachments_config` VALUES ('upload_dir', 'old_files');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('upload_dir', 'data/old_files');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('upload_img', 'images/icon_clip.gif');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('topic_icon', 'images/icon_clip.gif');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('display_order', '0');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
define('IN_ADMIN', true);
|
||||
define('BB_ROOT', './../');
|
||||
define('BB_ROOT', './../../');
|
||||
require(BB_ROOT .'common.php');
|
||||
|
||||
$user->session_start();
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
define('IN_ADMIN', true);
|
||||
define('BB_ROOT', './../');
|
||||
define('BB_ROOT', './../../');
|
||||
require(BB_ROOT .'common.php');
|
||||
|
||||
$user->session_start();
|
|
@ -453,7 +453,7 @@ class sql_db
|
|||
{
|
||||
if ($trace['file'] !== __FILE__)
|
||||
{
|
||||
$source = str_replace(BB_PATH . DIRECTORY_SEPARATOR, '', $trace['file']) .'('. $trace['line'] .')';
|
||||
$source = str_replace(BB_PATH, '', $trace['file']) .'('. $trace['line'] .')';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ if (!defined('IN_FORUM') && !defined('IN_TRACKER')) define('IN_FORUM', true);
|
|||
header('X-Frame-Options: SAMEORIGIN');
|
||||
|
||||
// Get initial config
|
||||
require(BB_ROOT .'config.php');
|
||||
require(BB_ROOT .'library/config.php');
|
||||
|
||||
$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';
|
||||
$server_port = ($bb_cfg['server_port'] != 80) ? ':'. $bb_cfg['server_port'] : '';
|
||||
|
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
@ -12,7 +12,7 @@ switch ($mode)
|
|||
{
|
||||
case 'create':
|
||||
$map->create();
|
||||
if (@file_exists(BB_ROOT. "/sitemap/sitemap.xml"))
|
||||
if (@file_exists(SITEMAP_DIR. 'sitemap.xml'))
|
||||
{
|
||||
$html .= $lang['SITEMAP_CREATED'].': <b>'.bb_date(TIMENOW, $bb_cfg['post_date_format']).'</b> '.$lang['SITEMAP_AVAILABLE'].': <a href="'.make_url('/sitemap/sitemap.xml').'" target="_blank">'.make_url('/sitemap/sitemap.xml').'</a>';
|
||||
} else {
|
||||
|
@ -21,12 +21,9 @@ switch ($mode)
|
|||
break;
|
||||
|
||||
case 'search_update':
|
||||
if (!@file_exists(BB_ROOT. "/sitemap/sitemap.xml"))
|
||||
{
|
||||
$map->create();
|
||||
}
|
||||
if (!@file_exists(SITEMAP_DIR. 'sitemap.xml')) $map->create();
|
||||
|
||||
$map_link = make_url('/sitemap/sitemap.xml');
|
||||
$map_link = make_url(SITEMAP_DIR. 'sitemap.xml');
|
||||
|
||||
if (strpos($map->send_url("http://google.com/webmasters/sitemaps/ping?sitemap=", $map_link), "successfully added") !== false) {
|
||||
$html .= '<br />'.$lang['SITEMAP_NOTIFY_SEARCH'].' Google: <font style="color: green;">'.$lang['SITEMAP_SENT'].'</font>';
|
|
@ -30,7 +30,6 @@
|
|||
* Sessions
|
||||
* Registration
|
||||
* Email
|
||||
* AJAX
|
||||
* Debug
|
||||
* Special users (dbg_users, unlimited_users, super_admins)
|
||||
* LOG
|
||||
|
@ -105,7 +104,7 @@ $bb_cfg['db_alias'] = array(
|
|||
|
||||
// Cache
|
||||
$bb_cfg['cache']['pconnect'] = true;
|
||||
$bb_cfg['cache']['db_dir'] = realpath(BB_ROOT) .'/cache/filecache/';
|
||||
$bb_cfg['cache']['db_dir'] = realpath(BB_ROOT) .'/internal_data/cache/filecache/';
|
||||
$bb_cfg['cache']['prefix'] = 'tp_'; // Префикс кеша 'tp_2'
|
||||
$bb_cfg['cache']['memcache'] = array(
|
||||
'host' => '127.0.0.1',
|
||||
|
@ -239,18 +238,21 @@ $page_cfg['show_torhelp'] = array(
|
|||
);
|
||||
|
||||
// Path (trailing slash '/' at the end: XX_PATH - without, XX_DIR - with)
|
||||
define('DIR_SEPR', DIRECTORY_SEPARATOR);
|
||||
|
||||
define('BB_PATH', realpath(BB_ROOT) ); // absolute pathname to the forum root
|
||||
define('BB_PATH', realpath(BB_ROOT) );
|
||||
define('ADMIN_DIR', BB_PATH .'/admin/' );
|
||||
define('ATTACH_DIR', BB_PATH .'/attach_mod/');
|
||||
define('CACHE_DIR', BB_PATH .'/cache/' );
|
||||
define('CFG_DIR', BB_PATH .'/config/' );
|
||||
define('INC_DIR', BB_PATH .'/includes/' );
|
||||
define('LANG_ROOT_DIR', BB_PATH .'/language/' );
|
||||
define('LOG_DIR', BB_PATH .'/log/' );
|
||||
define('TEMPLATES_DIR', BB_PATH .'/templates/' );
|
||||
define('TRIGGERS_DIR', BB_PATH .'/triggers/' );
|
||||
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('CACHE_DIR', BB_PATH .'/internal_data/cache/' );
|
||||
define('LOG_DIR', BB_PATH .'/internal_data/log/' );
|
||||
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/' );
|
||||
define('CFG_DIR', BB_PATH .'/library/config/' );
|
||||
define('INC_DIR', BB_PATH .'/library/includes/' );
|
||||
define('LANG_ROOT_DIR', BB_PATH .'/library/language/' );
|
||||
define('TEMPLATES_DIR', BB_PATH .'/styles/templates/' );
|
||||
|
||||
// URL's
|
||||
$bb_cfg['ajax_url'] = 'ajax.php'; # "http://{$_SERVER['SERVER_NAME']}/ajax.php"
|
||||
|
@ -361,10 +363,6 @@ $bb_cfg['tech_admin_email'] = 'admin@' . $domain_name; // email for send
|
|||
$bb_cfg['abuse_email'] = 'abuse@' . $domain_name;
|
||||
$bb_cfg['adv_email'] = 'adv@' . $domain_name;
|
||||
|
||||
// AJAX
|
||||
define('AJAX_HTML_DIR', BB_ROOT .'ajax/html/');
|
||||
define('AJAX_DIR', BB_ROOT .'ajax/');
|
||||
|
||||
// Debug
|
||||
define('DBG_LOG', false); // enable forum debug (off on production)
|
||||
define('DBG_TRACKER', false); // enable tracker debug (off on production)
|
||||
|
@ -505,7 +503,7 @@ $bb_cfg['user_not_active_days_keep'] = 180; // inactive users but only wi
|
|||
$bb_cfg['group_members_per_page'] = 50;
|
||||
|
||||
// Tidy
|
||||
$bb_cfg['tidy_post'] = (!extension_loaded('tidy')) ? false : true;
|
||||
$bb_cfg['tidy_post'] = (!in_array('tidy', get_loaded_extensions())) ? false : true;
|
||||
|
||||
// Ads
|
||||
$bb_cfg['show_ads'] = false;
|
||||
|
@ -553,7 +551,7 @@ $bb_cfg['avatars'] = array(
|
|||
'max_height' => 100, // высота аватара в px
|
||||
'max_width' => 100, // ширина аватара в px
|
||||
'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара
|
||||
'upload_path' => BB_ROOT . 'images/avatars/', // путь к директории с аватарами
|
||||
'upload_path' => DATA_DIR . 'avatars/', // путь к директории с аватарами
|
||||
'up_allowed' => true, // разрешить загрузку аватар
|
||||
);
|
||||
|
||||
|
@ -564,7 +562,7 @@ $bb_cfg['group_avatars'] = array(
|
|||
'max_height' => 300, // высота аватара в px
|
||||
'max_width' => 300, // ширина аватара в px
|
||||
'no_avatar' => 'gallery/noavatar.png', // дефолтная аватара
|
||||
'upload_path' => BB_ROOT . 'images/avatars/', // путь к директории с аватарами
|
||||
'upload_path' => DATA_DIR . 'avatars/', // путь к директории с аватарами
|
||||
'up_allowed' => true, // разрешить загрузку аватар
|
||||
);
|
||||
|
||||
|
@ -608,14 +606,14 @@ $bb_cfg['advert_url'] = 'info.php?show=advert';
|
|||
$bb_cfg['captcha'] = array(
|
||||
'disabled' => false,
|
||||
'secret_key' => 'secret_key',
|
||||
'img_url' => './images/captcha/', # with '/'
|
||||
'img_path' => BB_PATH .'/images/captcha/', # with '/'
|
||||
'img_url' => './internal_data/captcha/', # with '/'
|
||||
'img_path' => INT_DATA_DIR .'captcha/', # with '/'
|
||||
);
|
||||
|
||||
// Atom feed
|
||||
$bb_cfg['atom'] = array(
|
||||
'path' => BB_PATH .'/atom', # without '/'
|
||||
'url' => './atom', # without '/'
|
||||
'path' => INT_DATA_DIR .'atom', # without '/'
|
||||
'url' => './internal_data/atom', # without '/'
|
||||
);
|
||||
|
||||
// Nofollow
|
0
upload/includes/api.sphinx.php → upload/library/includes/api.sphinx.php
Executable file → Normal file
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 7 KiB After Width: | Height: | Size: 7 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
@ -181,33 +181,33 @@ class sitemap
|
|||
$pages_count = @ceil($row['count'] / 40000);
|
||||
|
||||
$sitemap = $this->build_index($pages_count);
|
||||
$handler = fopen(BB_ROOT. "/sitemap/sitemap.xml", "wb+");
|
||||
$handler = fopen(SITEMAP_DIR. "sitemap.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
@chmod(BB_ROOT. "/sitemap/sitemap.xml", 0666);
|
||||
@chmod(SITEMAP_DIR. "sitemap.xml", 0666);
|
||||
|
||||
$sitemap = $this->build_stat();
|
||||
$handler = fopen(BB_ROOT. "/sitemap/sitemap1.xml", "wb+");
|
||||
$handler = fopen(SITEMAP_DIR. "sitemap1.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
@chmod(BB_ROOT. "/sitemap/sitemap.xml", 0666);
|
||||
@chmod(SITEMAP_DIR. "sitemap.xml", 0666);
|
||||
|
||||
for ($i = 0; $i < $pages_count; $i++) {
|
||||
$t = $i + 2;
|
||||
$n = $i + 1;
|
||||
|
||||
$sitemap = $this->build_map_topic($n);
|
||||
$handler = fopen(BB_ROOT. "/sitemap/sitemap{$t}.xml", "wb+");
|
||||
$handler = fopen(SITEMAP_DIR. "sitemap{$t}.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
@chmod(BB_ROOT. "/sitemap/sitemap{$t}.xml", 0666);
|
||||
@chmod(SITEMAP_DIR. "sitemap{$t}.xml", 0666);
|
||||
}
|
||||
} else {
|
||||
$sitemap = $this->build_map();
|
||||
$handler = fopen(BB_ROOT. "/sitemap/sitemap.xml", "wb+");
|
||||
$handler = fopen(SITEMAP_DIR. "sitemap.xml", "wb+");
|
||||
fwrite($handler, $sitemap);
|
||||
fclose($handler);
|
||||
@chmod(BB_ROOT. "/sitemap/sitemap.xml", 0666);
|
||||
@chmod(SITEMAP_DIR. "sitemap.xml", 0666);
|
||||
}
|
||||
|
||||
$params['sitemap_time'] = TIMENOW;
|