Merge pull request #37 from torrentpier/develop
Версия 2.1.2 ALPHA-2 Второй ALPHA-билд. Основные изменения: - новая структура папок движка, подготовка к частичному ООП, системе модулей, упрощение бекапа форума; - новые пути к карте сайта, файлам классов, api, драйверу для работы в базой данных, файлу config.php; - исправлена проверка на наличие и корректность работы tidy; - исправлена поддерка скобок в ссылках; - частично исправлена поддержка относительных путей. Для обновления на версию, необходимо выполнить следующие запросы к базе данных: UPDATE `bb_cron` SET `cron_script` = 'board_maintenance.php' WHERE `cron_script` = 'bb_maintenance.php'; TRUNCATE TABLE `bb_posts_html`;
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/captcha
|
||||
- internal_data/log
|
||||
- internal_data/sitemap
|
||||
- internal_data/triggers
|
||||
|
||||
## Необходимая версия php
|
||||
|
||||
Минимально поддерживаемой версией в настоящий момент является 5.3. Существует поддержка вплоть до версии 5.5 (в данной версии в логах будет уведомление об использовании устаревших функций). Версия php 5.6 в настоящее время движком не поддерживается и его работа на ней не гарантируется. Мы делаем все возможное чтобы в самое ближайшее время добавить его поддержку.
|
||||
|
||||
## Необходимые настройки php
|
||||
|
||||
|
|
|
@ -125,13 +125,16 @@ http {
|
|||
|
||||
location ~ \/admin|backup\/ {
|
||||
deny all;
|
||||
# allow YOUR_IP;
|
||||
#allow YOUR_IP;
|
||||
}
|
||||
# Deny folder (Sec. lvl1)
|
||||
location ~ \/(cache|log|attach_mod|config|includes|language|triggers)\/ {
|
||||
location ~ \/(internal_data|library)\/ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# sitemap rewrite
|
||||
rewrite ^/sitemap.xml$ /internal_data/sitemap/sitemap.xml;
|
||||
|
||||
# deny access to .htaccess files, if Apache's document root
|
||||
# concurs with nginx's one
|
||||
# deny sql,tpl,db,inc,log
|
||||
|
|
|
@ -101,9 +101,9 @@ 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_img', 'images/icon_clip.gif');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('topic_icon', 'images/icon_clip.gif');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('upload_dir', 'data/old_files');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('upload_img', 'styles/images/icon_clip.gif');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('topic_icon', 'styles/images/icon_clip.gif');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('display_order', '0');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('max_filesize', '262144');
|
||||
INSERT INTO `bb_attachments_config` VALUES ('attachment_quota', '52428800');
|
||||
|
@ -546,7 +546,7 @@ INSERT INTO `bb_config` VALUES ('seed_bonus_user_regdate', '0');
|
|||
INSERT INTO `bb_config` VALUES ('site_desc', 'A little text to describe your forum');
|
||||
INSERT INTO `bb_config` VALUES ('sitemap_time', '');
|
||||
INSERT INTO `bb_config` VALUES ('sitename', 'TorrentPier II - Torrent Tracker');
|
||||
INSERT INTO `bb_config` VALUES ('smilies_path', 'images/smiles');
|
||||
INSERT INTO `bb_config` VALUES ('smilies_path', 'styles/images/smiles');
|
||||
INSERT INTO `bb_config` VALUES ('static_sitemap', '');
|
||||
INSERT INTO `bb_config` VALUES ('topics_per_page', '50');
|
||||
INSERT INTO `bb_config` VALUES ('xs_use_cache', '1');
|
||||
|
@ -605,7 +605,7 @@ CREATE TABLE IF NOT EXISTS `bb_cron` (
|
|||
--
|
||||
|
||||
INSERT INTO `bb_cron` VALUES (1, 1, 'Attach maintenance', 'attach_maintenance.php', 'daily', NULL, '05:00:00', 40, '', '', NULL, 1, '', 0, 1, 0);
|
||||
INSERT INTO `bb_cron` VALUES (2, 1, 'Board maintenance', 'bb_maintenance.php', 'daily', NULL, '05:00:00', 40, '', '', NULL, 1, '', 0, 1, 0);
|
||||
INSERT INTO `bb_cron` VALUES (2, 1, 'Board maintenance', 'board_maintenance.php', 'daily', NULL, '05:00:00', 40, '', '', NULL, 1, '', 0, 1, 0);
|
||||
INSERT INTO `bb_cron` VALUES (3, 1, 'Prune forums', 'prune_forums.php', 'daily', NULL, '05:00:00', 50, '', '', NULL, 1, '', 0, 1, 0);
|
||||
INSERT INTO `bb_cron` VALUES (4, 1, 'Prune topic moved stubs', 'prune_topic_moved.php', 'daily', NULL, '05:00:00', 60, '', '', NULL, 1, '', 0, 1, 0);
|
||||
INSERT INTO `bb_cron` VALUES (5, 1, 'Logs cleanup', 'clean_log.php', 'daily', NULL, '05:00:00', 70, '', '', NULL, 1, '', 0, 1, 0);
|
||||
|
@ -988,7 +988,7 @@ CREATE TABLE IF NOT EXISTS `bb_ranks` (
|
|||
-- Дамп данных таблицы `bb_ranks`
|
||||
--
|
||||
|
||||
INSERT INTO `bb_ranks` VALUES (1, 'Администратор', -1, 1, 'images/ranks/admin.png', 'colorAdmin');
|
||||
INSERT INTO `bb_ranks` VALUES (1, 'Администратор', -1, 1, 'styles/images/ranks/admin.png', 'colorAdmin');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
|
|
@ -18,3 +18,4 @@ ALTER TABLE `bb_privmsgs` DROP COLUMN `privmsgs_reported`;
|
|||
ALTER TABLE `bb_topics` DROP COLUMN `topic_reported`;
|
||||
DELETE FROM `bb_cron` WHERE `cron_script` = 'site_backup.php';
|
||||
DELETE FROM `bb_cron` WHERE `cron_script` = 'db_backup.php';
|
||||
UPDATE `bb_cron` SET `cron_script` = 'board_maintenance.php' WHERE `cron_script` = 'bb_maintenance.php';
|
|
@ -7,3 +7,7 @@ Options All -Indexes
|
|||
<FilesMatch "\.(.*sql|tpl|inc|db|log)|(config|common).php$">
|
||||
deny from all
|
||||
</FilesMatch>
|
||||
|
||||
RewriteEngine On
|
||||
RewriteRule ^sitemap.xml$ internal_data/sitemap/sitemap.xml [L]
|
||||
RewriteRule ^/internal_data/atom/(.*) /atom$1 [L]
|
|
@ -53,7 +53,7 @@ if (isset($_POST['submit']))
|
|||
");
|
||||
}
|
||||
|
||||
require(INC_DIR .'emailer.class.php');
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
|
||||
foreach ($user_list as $i => $row)
|
||||
{
|
||||
|
|
|
@ -41,8 +41,8 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
$s_mess = $lang['SITEMAP_CREATED'].': <b>'.bb_date($new['sitemap_time'], $bb_cfg['post_date_format']).'</b> '.$lang['SITEMAP_AVAILABLE'].': <a href="'.make_url('/sitemap/sitemap.xml').'" target="_blank">'.make_url('/sitemap/sitemap.xml').'</a>';
|
||||
$message = (@file_exists(BB_ROOT. "/sitemap/sitemap.xml")) ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
|
||||
$s_mess = $lang['SITEMAP_CREATED'].': <b>'.bb_date($new['sitemap_time'], $bb_cfg['post_date_format']).'</b> '.$lang['SITEMAP_AVAILABLE'].': <a href="'.make_url('sitemap.xml').'" target="_blank">'.make_url('sitemap.xml').'</a>';
|
||||
$message = (@file_exists(BB_ROOT. "/internal_data/sitemap/sitemap.xml")) ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
|
||||
|
||||
$template->assign_vars(array(
|
||||
'STATIC_SITEMAP' => $new['static_sitemap'],
|
||||
|
|
|
@ -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();
|
|
@ -67,7 +67,7 @@ switch ($ajax->action)
|
|||
break;
|
||||
|
||||
case 'sitemap';
|
||||
require(INC_DIR .'class.sitemap.php');
|
||||
require(CLASS_DIR .'sitemap.php');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 |
|
@ -220,7 +220,7 @@ else if (@$_POST['joingroup'])
|
|||
|
||||
if ($bb_cfg['group_send_email'])
|
||||
{
|
||||
require(INC_DIR .'emailer.class.php');
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>");
|
||||
|
@ -272,7 +272,7 @@ else
|
|||
|
||||
if ($bb_cfg['group_send_email'])
|
||||
{
|
||||
require(INC_DIR .'emailer.class.php');
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>");
|
||||
|
@ -342,7 +342,7 @@ else
|
|||
bb_die('Could not get user email information');
|
||||
}
|
||||
|
||||
require(INC_DIR .'emailer.class.php');
|
||||
require(CLASS_DIR .'emailer.php');
|
||||
$emailer = new emailer($bb_cfg['smtp_delivery']);
|
||||
|
||||
$emailer->from($bb_cfg['sitename'] ." <{$bb_cfg['board_email']}>");
|
||||
|
|
|
@ -46,7 +46,7 @@ $require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : $h
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
<link rel="stylesheet" href="./templates/default/css/main.css" type="text/css">
|
||||
<link rel="stylesheet" href="./styles/templates/default/css/main.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<style type="text/css">
|
||||
|
|
|
@ -12,21 +12,18 @@ 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>';
|
||||
$html .= $lang['SITEMAP_CREATED'].': <b>'.bb_date(TIMENOW, $bb_cfg['post_date_format']).'</b> '.$lang['SITEMAP_AVAILABLE'].': <a href="'.make_url('sitemap.xml').'" target="_blank">'.make_url('sitemap.xml').'</a>';
|
||||
} else {
|
||||
$html .= $lang['SITEMAP_NOT_CREATED'];
|
||||
}
|
||||
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>';
|
|
@ -6,7 +6,7 @@ global $bb_cfg, $lang, $userdata;
|
|||
|
||||
$mode = (string) $this->request['mode'];
|
||||
|
||||
$html = '<img src="./images/good.gif">';
|
||||
$html = '<img src="./styles/images/good.gif">';
|
||||
switch($mode)
|
||||
{
|
||||
case 'check_name':
|
||||
|
@ -14,11 +14,11 @@ switch($mode)
|
|||
|
||||
if (empty($username))
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_A_NAME'] .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_A_NAME'] .'</span>';
|
||||
}
|
||||
elseif($err = validate_username($username))
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -27,11 +27,11 @@ switch($mode)
|
|||
|
||||
if (empty($email))
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_E_MAIL'] .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_E_MAIL'] .'</span>';
|
||||
}
|
||||
elseif($err = validate_email($email))
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. $err .'</span>';
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -40,28 +40,28 @@ switch($mode)
|
|||
$pass_confirm = (string) $this->request['pass_confirm'];
|
||||
if (empty($pass) || empty($pass_confirm))
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_PASS'] .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_PASS'] .'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($pass != $pass_confirm)
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_PASS_ERR'] .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. $lang['CHOOSE_PASS_ERR'] .'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mb_strlen($pass, 'UTF-8') > 20)
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. sprintf($lang['CHOOSE_PASS_ERR_MAX'], 20) .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. sprintf($lang['CHOOSE_PASS_ERR_MAX'], 20) .'</span>';
|
||||
}
|
||||
elseif (mb_strlen($pass, 'UTF-8') < 5)
|
||||
{
|
||||
$html = '<img src="./images/bad.gif"> <span class="leechmed bold">'. sprintf($lang['CHOOSE_PASS_ERR_MIN'], 5) .'</span>';
|
||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">'. sprintf($lang['CHOOSE_PASS_ERR_MIN'], 5) .'</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = (IS_GUEST) ? $lang['CHOOSE_PASS_REG_OK'] : $lang['CHOOSE_PASS_OK'];
|
||||
$html = '<img src="./images/good.gif"> <span class="seedmed bold">'. $text .'</span>';
|
||||
$html = '<img src="./styles/images/good.gif"> <span class="seedmed bold">'. $text .'</span>';
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,7 +30,6 @@
|
|||
* Sessions
|
||||
* Registration
|
||||
* Email
|
||||
* AJAX
|
||||
* Debug
|
||||
* Special users (dbg_users, unlimited_users, super_admins)
|
||||
* LOG
|
||||
|
@ -66,12 +65,12 @@ if (!defined('BB_ROOT')) die(basename(__FILE__));
|
|||
$bb_cfg = $tr_cfg = $page_cfg = array();
|
||||
|
||||
// Primary domain name
|
||||
$domain_name = 'torrentpier.me'; // enter here your primary domain name of your site
|
||||
$domain_name = 'torrentpier.me'; // enter here your primary domain name of your site
|
||||
$domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $domain_name;
|
||||
|
||||
// Version info
|
||||
$bb_cfg['tp_version'] = '2.1.1';
|
||||
$bb_cfg['tp_release_date'] = '11-09-2014';
|
||||
$bb_cfg['tp_version'] = '2.1.2';
|
||||
$bb_cfg['tp_release_date'] = '20-10-2014';
|
||||
$bb_cfg['tp_release_state'] = 'ALPHA';
|
||||
|
||||
// Database
|
||||
|
@ -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',
|
||||
|
@ -199,15 +198,15 @@ $bb_cfg['show_tor_info_in_dl_list'] = true;
|
|||
$bb_cfg['allow_dl_list_names_mode'] = true;
|
||||
|
||||
$bb_cfg['torrent_name_style'] = true; // use torrent name style [yoursite.com].txxx.torrent
|
||||
$bb_cfg['tor_help_links'] = '';
|
||||
$bb_cfg['tor_help_links'] = 'terms.php';
|
||||
|
||||
// Сколько дней сохранять торрент зарегистрированным / Days to keep torrent registered, if:
|
||||
$bb_cfg['seeder_last_seen_days_keep'] = 0; // сколько дней назад был сид последний раз
|
||||
$bb_cfg['seeder_never_seen_days_keep'] = 0; // сколько дней имеется статус "Сида не было никогда"
|
||||
|
||||
// Ratio limits
|
||||
define('TR_RATING_LIMITS', true); // ON/OFF
|
||||
define('MIN_DL_FOR_RATIO', 10737418240); // 10 GB in bytes, 0 - disable
|
||||
define('TR_RATING_LIMITS', true); // ON/OFF
|
||||
define('MIN_DL_FOR_RATIO', 10737418240); // 10 GB in bytes, 0 - disable
|
||||
|
||||
// Don't change the order of ratios (from 0 to 1)
|
||||
// rating < 0.4 -- allow only 1 torrent for leeching
|
||||
|
@ -227,10 +226,10 @@ $bb_cfg['dl_complete_days_keep'] = 180;
|
|||
$bb_cfg['dl_cancel_days_keep'] = 30;
|
||||
|
||||
// Tor-Stats
|
||||
$bb_cfg['torstat_days_keep'] = 60; // days to keep user's per-torrent stats
|
||||
$bb_cfg['torstat_days_keep'] = 60; // days to keep user's per-torrent stats
|
||||
|
||||
// Tor-Help
|
||||
$bb_cfg['torhelp_enabled'] = false; // find dead torrents (without seeder) that user might help seeding
|
||||
$bb_cfg['torhelp_enabled'] = false; // find dead torrents (without seeder) that user might help seeding
|
||||
|
||||
$page_cfg['show_torhelp'] = array(
|
||||
# BB_SCRIPT => true
|
||||
|
@ -239,18 +238,23 @@ $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('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('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('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('CLASS_DIR', BB_PATH .'/library/includes/classes/');
|
||||
define('UCP_DIR', BB_PATH .'/library/includes/ucp/' );
|
||||
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 +365,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 +505,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;
|
||||
|
@ -526,8 +526,8 @@ $bb_cfg['ad_blocks'] = array(
|
|||
|
||||
// Attachments
|
||||
$bb_cfg['attach'] = array(
|
||||
'upload_path' => BB_ROOT . 'torrents', // without '/'
|
||||
'max_size' => 250*1024, // bytes
|
||||
'upload_path' => DATA_DIR . 'torrent_files', // without '/'
|
||||
'max_size' => 250*1024, // bytes
|
||||
);
|
||||
|
||||
$bb_cfg['file_id_ext'] = array(
|
||||
|
@ -553,7 +553,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' => BB_ROOT . 'data/avatars/', // путь к директории с аватарами
|
||||
'up_allowed' => true, // разрешить загрузку аватар
|
||||
);
|
||||
|
||||
|
@ -564,7 +564,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' => BB_ROOT . 'data/avatars/', // путь к директории с аватарами
|
||||
'up_allowed' => true, // разрешить загрузку аватар
|
||||
);
|
||||
|
||||
|
@ -608,14 +608,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_path' => INT_DATA_DIR .'captcha/', # with '/'
|
||||
'img_url' => './internal_data/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
|
||||
|
@ -625,9 +625,9 @@ $bb_cfg['nofollow'] = array(
|
|||
);
|
||||
|
||||
// Local config
|
||||
if (file_exists('config.local.php'))
|
||||
if (file_exists(BB_ROOT. '/library/config.local.php'))
|
||||
{
|
||||
include_once('config.local.php');
|
||||
include_once(BB_ROOT. '/library/config.local.php');
|
||||
}
|
||||
|
||||
define('BB_CFG_LOADED', true);
|
0
upload/includes/api.sphinx.php → upload/library/includes/api/sphinx.php
Executable file → Normal file
|
@ -422,7 +422,6 @@ function add_search_words ($post_id, $post_message, $topic_title = '', $only_ret
|
|||
global $bb_cfg;
|
||||
|
||||
$text = $topic_title .' '. $post_message;
|
||||
$text = strip_bbcode_uid($text);
|
||||
$words = ($text) ? extract_search_words($text) : array();
|
||||
|
||||
if ($only_return_words || $bb_cfg['search_engine_type'] == 'sphinx')
|
||||
|
@ -575,7 +574,7 @@ class bbcode
|
|||
$text = preg_replace_callback('#(\[(quote|spoiler)=")(.+?)("\])#', array(&$this, 'escape_tiltes_callback'), $text);
|
||||
|
||||
// [url]
|
||||
$url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+?';
|
||||
$url_exp = '[\w\#!$%&~/.\-;:=,?@а-яА-Я()\[\]+]+?';
|
||||
$text = preg_replace_callback("#\[url\]((?:https?://)?$url_exp)\[/url\]#isu", array(&$this, 'url_callback'), $text);
|
||||
$text = preg_replace_callback("#\[url\](www\.$url_exp)\[/url\]#isu", array(&$this, 'url_callback'), $text);
|
||||
$text = preg_replace_callback("#\[url=((?:https?://)?$url_exp)\]([^?\n\t].*?)\[/url\]#isu", array(&$this, 'url_callback'), $text);
|
||||
|
@ -739,7 +738,7 @@ class bbcode
|
|||
(?<![\"'=])
|
||||
\b
|
||||
(
|
||||
https?://[\w\#!$%&~/.\-;:=?@а-яА-Я\[\]+]+
|
||||
https?://[\w\#!$%&~/.\-;:=?@а-яА-Я()\[\]+]+
|
||||
)
|
||||
(?![\"']|\[/url|\[/img|</a)
|
||||
(?=[,!]?\s|[\)<!])
|
||||
|
@ -841,16 +840,6 @@ function bbcode2html ($text)
|
|||
return $bbcode->bbcode2html($text);
|
||||
}
|
||||
|
||||
function strip_bbcode_uid ($text)
|
||||
{
|
||||
$text = str_replace('[tab]', ' ', $text);
|
||||
$text = str_replace('"', '"', $text);
|
||||
$text = str_replace('code:1:', 'code:', $text);
|
||||
$text = str_replace('list:u:', 'list:', $text);
|
||||
$text = str_replace('list:o:', 'list:', $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
class words_rate
|
||||
{
|
||||
var $dbg_mode = false;
|
||||
|
@ -863,7 +852,7 @@ class words_rate
|
|||
function words_rate ()
|
||||
{
|
||||
// слова начинающиеся на..
|
||||
$del_list = file_get_contents(BB_ROOT .'/misc/words_rate_del_list.txt');
|
||||
$del_list = file_get_contents(BB_ROOT .'/library/words_rate_del_list.txt');
|
||||
$del_list = str_compact($del_list);
|
||||
$del_list = str_replace(' ', '|', preg_quote($del_list, '/'));
|
||||
$del_exp = '/\b('.$del_list.')[\w\-]*/i';
|
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;
|