Change paths to absolute pathname

This commit is contained in:
Vasily Komrakov 2017-02-05 22:28:55 +03:00
commit 064175c67d
No known key found for this signature in database
GPG key ID: 558236680C20A69A
81 changed files with 297 additions and 303 deletions

View file

@ -27,7 +27,7 @@ if (!empty($setmodules)) {
$module['ATTACHMENTS']['CONTROL_PANEL'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
$total_attachments = 0;
@ -37,7 +37,7 @@ if (($attach_config['upload_dir'][0] == '/') || (($attach_config['upload_dir'][0
$upload_dir = '../' . $attach_config['upload_dir'];
}
include(ATTACH_DIR . 'includes/functions_selects.php');
include ATTACH_DIR . '/includes/functions_selects.php';
// Check if the language got included
if (!isset($lang['TEST_SETTINGS_SUCCESSFUL'])) {

View file

@ -40,7 +40,7 @@ if (($attach_config['upload_dir'][0] == '/') || (($attach_config['upload_dir'][0
$upload_dir = '../' . $attach_config['upload_dir'];
}
include(ATTACH_DIR . 'includes/functions_selects.php');
include ATTACH_DIR . '/includes/functions_selects.php';
// Check if the language got included
if (!isset($lang['TEST_SETTINGS_SUCCESSFUL'])) {

View file

@ -28,9 +28,8 @@ if (!empty($setmodules)) {
$module['MODS']['CONFIGURATION'] = basename(__FILE__) . '?mode=config_mods';
return;
}
require('./pagestart.php');
require(INC_DIR . 'functions_selects.php');
require __DIR__ . '/pagestart.php';
require INC_DIR . '/functions_selects.php';
$mode = isset($_GET['mode']) ? $_GET['mode'] : '';

View file

@ -27,12 +27,12 @@ if (!empty($setmodules)) {
$module['TP']['FORUM_CONFIG'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
$max_forum_name_len = 30;
$max_forum_rows = 25;
require(INC_DIR . 'functions_admin_torrent.php');
require INC_DIR . '/functions_admin_torrent.php';
$submit = isset($_POST['submit']);
$confirm = isset($_POST['confirm']);

View file

@ -29,13 +29,13 @@ if (!empty($setmodules)) {
}
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
if (!IS_SUPER_ADMIN) {
bb_die($lang['NOT_ADMIN']);
}
require(INC_DIR . 'functions_admin_torrent.php');
require INC_DIR . '/functions_admin_torrent.php';
$submit = isset($_POST['submit']);
$confirmed = isset($_POST['confirm']);

View file

@ -42,15 +42,15 @@ if ($mode == 'run' && !$job_id) {
$user->session_start();
redirect('admin/' . basename(__FILE__) . '?mode=list');
} else {
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
}
if (!IS_SUPER_ADMIN) {
bb_die($lang['NOT_ADMIN']);
}
require(INC_DIR . 'functions_admin_torrent.php');
require(INC_DIR . 'functions_admin_cron.php');
require INC_DIR . '/functions_admin_torrent.php';
require INC_DIR . '/functions_admin_cron.php';
$sql = DB()->fetch_rowset("SELECT * FROM " . BB_CONFIG . " WHERE config_name = 'cron_enabled' OR config_name = 'cron_check_interval'");

View file

@ -27,12 +27,12 @@ if (!empty($setmodules)) {
$module['USERS']['DISALLOW'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
$message = '';
if (isset($_POST['add_name'])) {
include(INC_DIR . 'functions_validate.php');
include INC_DIR . '/functions_validate.php';
$disallowed_user = (isset($_POST['disallowed_user'])) ? trim($_POST['disallowed_user']) : trim($_GET['disallowed_user']);

View file

@ -44,7 +44,7 @@ if (($attach_config['upload_dir'][0] == '/') || (($attach_config['upload_dir'][0
$upload_dir = BB_ROOT . $attach_config['upload_dir'];
}
include(ATTACH_DIR . 'includes/functions_selects.php');
include ATTACH_DIR . '/includes/functions_selects.php';
// Check if the language got included
if (!isset($lang['TEST_SETTINGS_SUCCESSFUL'])) {

View file

@ -27,9 +27,8 @@ if (!empty($setmodules)) {
$module['FORUMS']['MANAGE'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require(INC_DIR . 'functions_group.php');
require __DIR__ . '/pagestart.php';
require INC_DIR . '/functions_group.php';
array_deep($_POST, 'trim');

View file

@ -27,9 +27,8 @@ if (!empty($setmodules)) {
$module['GROUPS']['MANAGE'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require(INC_DIR . 'functions_group.php');
require __DIR__ . '/pagestart.php';
require INC_DIR . '/functions_group.php';
$group_id = isset($_REQUEST[POST_GROUPS_URL]) ? intval($_REQUEST[POST_GROUPS_URL]) : 0;
$mode = isset($_REQUEST['mode']) ? strval($_REQUEST['mode']) : '';

View file

@ -75,7 +75,7 @@ if (isset($_POST['submit'])) {
");
}
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
foreach ($user_list as $i => $row) {
$emailer = new emailer($bb_cfg['smtp_delivery']);

View file

@ -29,13 +29,13 @@ if (!empty($setmodules)) {
}
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
if (!IS_SUPER_ADMIN) {
bb_die($lang['NOT_ADMIN']);
}
require(INC_DIR . 'bbcode.php');
require INC_DIR . '/bbcode.php';
define('REBUILD_SEARCH_ABORTED', 0); // when the user aborted the processing
define('REBUILD_SEARCH_PROCESSED', 1); // when a batch of posts has been processed

View file

@ -27,9 +27,8 @@ if (!empty($setmodules)) {
$module['MODS']['SITEMAP'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require(INC_DIR . 'functions_selects.php');
require __DIR__ . '/pagestart.php';
require INC_DIR . '/functions_selects.php';
$sql = "SELECT * FROM " . BB_CONFIG;

View file

@ -27,9 +27,8 @@ if (!empty($setmodules)) {
$module['GENERAL']['TERMS'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require(INC_DIR . 'bbcode.php');
require __DIR__ . '/pagestart.php';
require INC_DIR . '/bbcode.php';
if (isset($_POST['post']) && $bb_cfg['terms'] != $_POST['message']) {
bb_update_config(array('terms' => $_POST['message']));

View file

@ -28,11 +28,11 @@ if (!empty($setmodules)) {
$module['GROUPS']['PERMISSIONS'] = basename(__FILE__) . '?mode=group';
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
$max_forum_name_length = 50;
require(INC_DIR . 'functions_group.php');
require INC_DIR . '/functions_group.php';
$yes_sign = '√';
$no_sign = 'x';

View file

@ -27,11 +27,11 @@ if (!empty($setmodules)) {
$module['USERS']['SEARCH'] = basename(__FILE__);
return;
}
require('./pagestart.php');
require __DIR__ . '/pagestart.php';
array_deep($_POST, 'trim');
require(INC_DIR . 'functions_selects.php');
require INC_DIR . '/functions_selects.php';
$total_sql = '';

View file

@ -27,10 +27,10 @@ define('BB_ROOT', './../');
define('IN_FORUM', true);
define('IN_ADMIN', true);
require(BB_ROOT . 'common.php');
require(ATTACH_DIR . 'attachment_mod.php');
require(ATTACH_DIR . 'includes/functions_admin.php');
require_once(INC_DIR . 'functions_admin.php');
require dirname(__DIR__) . '/common.php';
require ATTACH_DIR . '/attachment_mod.php';
require ATTACH_DIR . '/includes/functions_admin.php';
require_once INC_DIR . '/functions_admin.php';
$user->session_start();

View file

@ -28,7 +28,7 @@ define('IN_AJAX', true);
$ajax = new ajax_common();
require('./common.php');
require __DIR__ . '/common.php';
$ajax->init();
@ -47,45 +47,45 @@ if ($ajax->action != 'manage_admin') {
// Load actions required modules
switch ($ajax->action) {
case 'view_post':
require(INC_DIR . 'bbcode.php');
require INC_DIR . '/bbcode.php';
break;
case 'posts':
case 'post_mod_comment':
require(INC_DIR . 'bbcode.php');
require(INC_DIR . 'functions_post.php');
require(INC_DIR . 'functions_admin.php');
require INC_DIR . '/bbcode.php';
require INC_DIR . '/functions_post.php';
require INC_DIR . '/functions_admin.php';
break;
case 'view_torrent':
case 'mod_action':
case 'change_tor_status':
case 'gen_passkey':
require(ATTACH_DIR . 'attachment_mod.php');
require(INC_DIR . 'functions_torrent.php');
require ATTACH_DIR . '/attachment_mod.php';
require INC_DIR . '/functions_torrent.php';
break;
case 'change_torrent':
require(ATTACH_DIR . 'attachment_mod.php');
require(INC_DIR . 'functions_torrent.php');
require ATTACH_DIR . '/attachment_mod.php';
require INC_DIR . '/functions_torrent.php';
break;
case 'user_register':
require(INC_DIR . 'functions_validate.php');
require INC_DIR . '/functions_validate.php';
break;
case 'manage_user':
case 'manage_admin':
require(INC_DIR . 'functions_admin.php');
require INC_DIR . '/functions_admin.php';
break;
case 'group_membership':
case 'manage_group':
require(INC_DIR . 'functions_group.php');
require INC_DIR . '/functions_group.php';
break;
case 'sitemap':
require(CLASS_DIR . 'sitemap.php');
require CLASS_DIR . '/sitemap.php';
break;
}
@ -134,7 +134,7 @@ class ajax_common
/**
* Constructor
*/
public function ajax_common()
public function __construct()
{
ob_start(array(&$this, 'ob_handler'));
header('Content-Type: text/plain');
@ -328,101 +328,101 @@ class ajax_common
public function edit_user_profile()
{
require(AJAX_DIR . 'edit_user_profile.php');
require AJAX_DIR . '/edit_user_profile.php';
}
public function change_user_rank()
{
require(AJAX_DIR . 'change_user_rank.php');
require AJAX_DIR . '/change_user_rank.php';
}
public function change_user_opt()
{
require(AJAX_DIR . 'change_user_opt.php');
require AJAX_DIR . '/change_user_opt.php';
}
public function gen_passkey()
{
require(AJAX_DIR . 'gen_passkey.php');
require AJAX_DIR . '/gen_passkey.php';
}
public function group_membership()
{
require(AJAX_DIR . 'group_membership.php');
require AJAX_DIR . '/group_membership.php';
}
public function manage_group()
{
require(AJAX_DIR . 'edit_group_profile.php');
require AJAX_DIR . '/edit_group_profile.php';
}
public function post_mod_comment()
{
require(AJAX_DIR . 'post_mod_comment.php');
require AJAX_DIR . '/post_mod_comment.php';
}
public function view_post()
{
require(AJAX_DIR . 'view_post.php');
require AJAX_DIR . '/view_post.php';
}
public function change_tor_status()
{
require(AJAX_DIR . 'change_tor_status.php');
require AJAX_DIR . '/change_tor_status.php';
}
public function change_torrent()
{
require(AJAX_DIR . 'change_torrent.php');
require AJAX_DIR . '/change_torrent.php';
}
public function view_torrent()
{
require(AJAX_DIR . 'view_torrent.php');
require AJAX_DIR . '/view_torrent.php';
}
public function user_register()
{
require(AJAX_DIR . 'user_register.php');
require AJAX_DIR . '/user_register.php';
}
public function mod_action()
{
require(AJAX_DIR . 'mod_action.php');
require AJAX_DIR . '/mod_action.php';
}
public function posts()
{
require(AJAX_DIR . 'posts.php');
require AJAX_DIR . '/posts.php';
}
public function manage_user()
{
require(AJAX_DIR . 'manage_user.php');
require AJAX_DIR . '/manage_user.php';
}
public function manage_admin()
{
require(AJAX_DIR . 'manage_admin.php');
require AJAX_DIR . '/manage_admin.php';
}
public function topic_tpl()
{
require(AJAX_DIR . 'topic_tpl.php');
require AJAX_DIR . '/topic_tpl.php';
}
public function index_data()
{
require(AJAX_DIR . 'index_data.php');
require AJAX_DIR . '/index_data.php';
}
public function avatar()
{
require(AJAX_DIR . 'avatar.php');
require AJAX_DIR . '/avatar.php';
}
public function sitemap()
{
require(AJAX_DIR . 'sitemap.php');
require AJAX_DIR . '/sitemap.php';
}
}

View file

@ -25,7 +25,7 @@
define('IN_TRACKER', true);
define('BB_ROOT', './../');
require(BB_ROOT . 'common.php');
require dirname(__DIR__) . '/common.php';
global $bb_cfg, $tr_cfg;

View file

@ -23,4 +23,4 @@
* SOFTWARE.
*/
require('./announce.php');
require __DIR__ . '/announce.php';

View file

@ -25,7 +25,7 @@
define('IN_TRACKER', true);
define('BB_ROOT', './../');
require(BB_ROOT . 'common.php');
require dirname(__DIR__) . '/common.php';
global $tr_cfg;

View file

@ -26,7 +26,7 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'callseed');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
// Init userdata
$user->session_start(array('req_login' => true));

View file

@ -57,7 +57,7 @@ header('X-Frame-Options: SAMEORIGIN');
require_once(BB_ROOT . 'vendor/autoload.php');
// Get initial config
require(BB_ROOT . 'library/config.php');
require __DIR__ . '/library/config.php';
$server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://';
$server_port = (in_array($bb_cfg['server_port'], array(80, 443))) ? '' : ':' . $bb_cfg['server_port'];
@ -97,9 +97,14 @@ define('BOT_UID', -746);
* Database
*/
// Core DB class
require(CORE_DIR . 'dbs.php');
require CORE_DIR . '/dbs.php';
$DBS = new DBS($bb_cfg);
/**
* @param string $db_alias
* @return \sql_db
* @deprecated
*/
function DB($db_alias = 'db1')
{
global $DBS;
@ -110,12 +115,12 @@ function DB($db_alias = 'db1')
* Cache
*/
// Main cache class
require(INC_DIR . 'cache/common.php');
require INC_DIR . '/cache/common.php';
// Main datastore class
require(INC_DIR . 'datastore/common.php');
require INC_DIR . '/datastore/common.php';
// Core CACHE class
require(CORE_DIR . 'caches.php');
require CORE_DIR . '/caches.php';
$CACHES = new CACHES($bb_cfg);
function CACHE($cache_name)
@ -125,23 +130,23 @@ function CACHE($cache_name)
}
// Common cache classes
require(INC_DIR . 'cache/memcache.php');
require(INC_DIR . 'cache/sqlite.php');
require(INC_DIR . 'cache/redis.php');
require(INC_DIR . 'cache/apc.php');
require(INC_DIR . 'cache/xcache.php');
require(INC_DIR . 'cache/file.php');
require INC_DIR . '/cache/memcache.php';
require INC_DIR . '/cache/sqlite.php';
require INC_DIR . '/cache/redis.php';
require INC_DIR . '/cache/apc.php';
require INC_DIR . '/cache/xcache.php';
require INC_DIR . '/cache/file.php';
/**
* Datastore
*/
// Common datastore classes
require(INC_DIR . 'datastore/memcache.php');
require(INC_DIR . 'datastore/sqlite.php');
require(INC_DIR . 'datastore/redis.php');
require(INC_DIR . 'datastore/apc.php');
require(INC_DIR . 'datastore/xcache.php');
require(INC_DIR . 'datastore/file.php');
require INC_DIR . '/datastore/memcache.php';
require INC_DIR . '/datastore/sqlite.php';
require INC_DIR . '/datastore/redis.php';
require INC_DIR . '/datastore/apc.php';
require INC_DIR . '/datastore/xcache.php';
require INC_DIR . '/datastore/file.php';
// Initialize datastore
switch ($bb_cfg['datastore_type']) {
@ -206,7 +211,7 @@ function bb_log($msg, $file_name)
$msg = join(LOG_LF, $msg);
}
$file_name .= (LOG_EXT) ? '.' . LOG_EXT : '';
return file_write($msg, LOG_DIR . $file_name);
return file_write($msg, LOG_DIR . '/' . $file_name);
}
function file_write($str, $file, $max_size = LOG_MAX_SIZE, $lock = true, $replace_content = false)
@ -421,7 +426,7 @@ function ver_compare($version1, $operator, $version2)
function dbg_log($str, $file)
{
$dir = LOG_DIR . (defined('IN_TRACKER') ? 'dbg_tr/' : 'dbg_bb/') . date('m-d_H') . '/';
$dir = LOG_DIR . (defined('IN_TRACKER') ? '/dbg_tr/' : '/dbg_bb/') . date('m-d_H') . '/';
return file_write($str, $dir . $file, false, false);
}
@ -469,7 +474,7 @@ function log_request($file = '', $prepend_str = false, $add_post = true)
// Board init
if (defined('IN_FORUM')) {
require(INC_DIR . 'init_bb.php');
require INC_DIR . '/init_bb.php';
} // Tracker init
elseif (defined('IN_TRACKER')) {
define('DUMMY_PEER', pack('Nn', ip2long($_SERVER['REMOTE_ADDR']), !empty($_GET['port']) ? intval($_GET['port']) : mt_rand(1000, 65000)));

View file

@ -26,4 +26,4 @@
define('START_CRON', true);
define('BB_ROOT', dirname(__FILE__) . '/');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';

6
dl.php
View file

@ -27,8 +27,8 @@ define('IN_FORUM', true);
define('BB_SCRIPT', 'dl');
define('NO_GZIP', true);
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(ATTACH_DIR . 'attachment_mod.php');
require __DIR__ . '/common.php';
require ATTACH_DIR . '/attachment_mod.php';
$datastore->enqueue(array(
'attach_extensions',
@ -60,7 +60,7 @@ function send_file_to_browser($attachment, $upload_dir)
//bt
if (!(isset($_GET['original']) && !IS_USER)) {
include(INC_DIR . 'functions_torrent.php');
include INC_DIR . '/functions_torrent.php';
send_torrent_with_passkey($filename);
}

View file

@ -26,7 +26,7 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'dl_list');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
$forum_id = isset($_REQUEST[POST_FORUM_URL]) ? (int)$_REQUEST[POST_FORUM_URL] : 0;
$topic_id = isset($_REQUEST[POST_TOPIC_URL]) ? (int)$_REQUEST[POST_TOPIC_URL] : 0;

View file

@ -26,7 +26,7 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'feed');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
$user->session_start(array('req_login' => true));
@ -53,7 +53,7 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
if (file_exists($bb_cfg['atom']['path'] . '/f/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/f/' . $id . '.atom') > $timecheck) {
redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom');
} else {
require_once(INC_DIR . 'functions_atom.php');
require_once INC_DIR . '/functions_atom.php';
if (update_forum_feed($id, $forum_data)) {
redirect($bb_cfg['atom']['url'] . '/f/' . $id . '.atom');
} else {
@ -72,7 +72,7 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
if (file_exists($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') && filemtime($bb_cfg['atom']['path'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') > $timecheck) {
redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
} else {
require_once(INC_DIR . 'functions_atom.php');
require_once INC_DIR . '/functions_atom.php';
if (update_user_feed($id, $username)) {
redirect($bb_cfg['atom']['url'] . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
} else {

View file

@ -26,9 +26,9 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'group');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(INC_DIR . 'bbcode.php');
require(INC_DIR . 'functions_group.php');
require __DIR__ . '/common.php';
require INC_DIR . '/bbcode.php';
require INC_DIR . '/functions_group.php';
$page_cfg['use_tablesorter'] = true;
@ -213,7 +213,7 @@ if (!$group_id) {
add_user_into_group($group_id, $userdata['user_id'], 1, TIMENOW);
if ($bb_cfg['group_send_email']) {
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");
@ -256,7 +256,7 @@ if (!$group_id) {
add_user_into_group($group_id, $row['user_id']);
if ($bb_cfg['group_send_email']) {
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");
@ -315,7 +315,7 @@ if (!$group_id) {
bb_die('Could not get user email information');
}
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");

View file

@ -26,8 +26,8 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'group_edit');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(INC_DIR . 'functions_group.php');
require __DIR__ . '/common.php';
require INC_DIR . '/functions_group.php';
$page_cfg['include_bbcode_js'] = true;
@ -56,7 +56,7 @@ if ($is_moderator) {
// Avatar
if ($submit) {
if (!empty($_FILES['avatar']['name']) && $bb_cfg['group_avatars']['up_allowed']) {
require(INC_DIR . 'functions_upload.php');
require INC_DIR . '/functions_upload.php';
$upload = new upload_common();
if ($upload->init($bb_cfg['group_avatars'], $_FILES['avatar']) and $upload->store('avatar', array("user_id" => GROUP_AVATAR_MASK . $group_id, "avatar_ext_id" => $group_info['avatar_ext_id']))) {

View file

@ -26,7 +26,7 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'index');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
$page_cfg['load_tpl_vars'] = array(
'post_icons',

View file

@ -25,7 +25,7 @@
define('BB_SCRIPT', 'info');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
// Start session management
$user->session_start();
@ -102,4 +102,4 @@ $require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : $h
</p>
</div><!--/infobox-wrap-->
</body>
</html>
</html>

View file

@ -41,7 +41,7 @@ $value = $this->request['value'] = (string)(isset($this->request['value'])) ? $t
switch ($field) {
case 'username':
require_once(INC_DIR . 'functions_validate.php');
require_once INC_DIR . '/functions_validate.php';
$value = clean_username($value);
if ($err = validate_username($value)) {
$this->ajax_die(strip_tags($err));
@ -50,7 +50,7 @@ switch ($field) {
break;
case 'user_email':
require_once(INC_DIR . 'functions_validate.php');
require_once INC_DIR . '/functions_validate.php';
$value = htmlCHR($value);
if ($err = validate_email($value)) {
$this->ajax_die($err);
@ -154,7 +154,7 @@ switch ($field) {
$this->response['new_value'] = humn_size($value, null, null, ' ');
if (!$btu = get_bt_userdata($user_id)) {
require(INC_DIR . 'functions_torrent.php');
require INC_DIR . '/functions_torrent.php';
generate_passkey($user_id, true);
$btu = get_bt_userdata($user_id);
}

View file

@ -96,7 +96,7 @@ switch ($mode) {
case 'update_user_level':
require(INC_DIR . 'functions_group.php');
require INC_DIR . '/functions_group.php';
update_user_level('all');

View file

@ -36,7 +36,7 @@ $html = '';
switch ($mode) {
case 'create':
$map->create();
if (@file_exists(SITEMAP_DIR . '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.xml') . '" target="_blank">' . make_url('sitemap.xml') . '</a>';
} else {
$html .= $lang['SITEMAP_NOT_CREATED'];
@ -44,11 +44,11 @@ switch ($mode) {
break;
case 'search_update':
if (!@file_exists(SITEMAP_DIR . 'sitemap.xml')) {
if (!file_exists(SITEMAP_DIR . '/sitemap.xml')) {
$map->create();
}
$map_link = make_url(SITEMAP_DIR . '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>';

View file

@ -27,11 +27,11 @@ if (!defined('IN_FORUM')) {
die("Hacking attempt");
}
require(ATTACH_DIR . 'includes/functions_includes.php');
require(ATTACH_DIR . 'includes/functions_attach.php');
require(ATTACH_DIR . 'includes/functions_delete.php');
require(ATTACH_DIR . 'includes/functions_thumbs.php');
require(ATTACH_DIR . 'includes/functions_filetypes.php');
require ATTACH_DIR . '/includes/functions_includes.php';
require ATTACH_DIR . '/includes/functions_attach.php';
require ATTACH_DIR . '/includes/functions_delete.php';
require ATTACH_DIR . '/includes/functions_thumbs.php';
require ATTACH_DIR . '/includes/functions_filetypes.php';
if (defined('ATTACH_INSTALL')) {
return;
@ -44,18 +44,17 @@ function attach_mod_get_lang($language_file)
{
global $attach_config, $bb_cfg;
$language = $bb_cfg['default_lang'];
if (!file_exists(LANG_ROOT_DIR . "$language/$language_file.php")) {
$language = $attach_config['board_lang'];
if (!file_exists(LANG_ROOT_DIR . "$language/$language_file.php")) {
bb_die('Attachment mod language file does not exist: language/' . $language . '/' . $language_file . '.php');
} else {
return $language;
}
$file = LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/' . $language_file . '.php';
if (file_exists($file)) {
return $bb_cfg['default_lang'];
} else {
return $language;
$file = LANG_ROOT_DIR . '/' . $attach_config['board_lang'] . '/' . $language_file . '.php';
if (file_exists($file)) {
return $attach_config['board_lang'];
}
}
bb_die('Attachment mod language file does not exist: language/' . $attach_config['board_lang'] . '/' . $language_file . '.php');
}
/**
@ -91,7 +90,7 @@ if (!$attach_config = CACHE('bb_cache')->get('attach_config')) {
CACHE('bb_cache')->set('attach_config', $attach_config, 86400);
}
include(ATTACH_DIR . 'displaying.php');
include(ATTACH_DIR . 'posting_attachments.php');
include ATTACH_DIR . '/displaying.php';
include ATTACH_DIR . '/posting_attachments.php';
$upload_dir = $attach_config['upload_dir'];

View file

@ -302,7 +302,7 @@ function display_attachments($post_id)
// bt
if ($link && ($attachments['_' . $post_id][$i]['extension'] === TORRENT_EXT)) {
include(ATTACH_DIR . 'displaying_torrent.php');
include ATTACH_DIR . '/displaying_torrent.php';
} elseif ($link) {
$target_blank = ((@intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT)) ? 'target="_blank"' : '';

View file

@ -32,8 +32,6 @@
*/
function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0, $user_id = 0)
{
global $bb_cfg;
// Generate Array, if it's not an array
if ($post_id_array === 0 && $attach_id_array === 0 && $page === 0) {
return;

View file

@ -52,9 +52,9 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode)
$upload_dir = BB_ROOT . $attach_config['upload_dir'];
}
include(ATTACH_DIR . 'includes/functions_selects.php');
include ATTACH_DIR . '/includes/functions_selects.php';
if (!function_exists("process_quota_settings")) {
include(ATTACH_DIR . 'includes/functions_admin.php');
include ATTACH_DIR . '/includes/functions_admin.php';
}
$user_id = 0;

View file

@ -482,7 +482,7 @@ class attach_parent
//bt
if ($this->attachment_extension_list[$actual_element] === TORRENT_EXT && $attachments[$actual_element]['tracker_status']) {
include(INC_DIR . 'functions_torrent.php');
include INC_DIR . '/functions_torrent.php';
tracker_unregister($attachment_id);
}
//bt end

View file

@ -271,25 +271,25 @@ $page_cfg['show_torhelp'] = array(
);
// Path (trailing slash '/' at the end: XX_PATH - without, XX_DIR - with)
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('CORE_DIR', BB_PATH . '/library/includes/core/');
define('UCP_DIR', BB_PATH . '/library/includes/ucp/');
define('LANG_ROOT_DIR', BB_PATH . '/library/language/');
define('IMAGES_DIR', BB_PATH . '/styles/images/');
define('TEMPLATES_DIR', BB_PATH . '/styles/templates/');
define('BB_PATH', dirname(__DIR__));
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('CORE_DIR', BB_PATH . '/library/includes/core');
define('UCP_DIR', BB_PATH . '/library/includes/ucp');
define('LANG_ROOT_DIR', BB_PATH . '/library/language');
define('IMAGES_DIR', BB_PATH . '/styles/images');
define('TEMPLATES_DIR', BB_PATH . '/styles/templates');
// URL's
$bb_cfg['ajax_url'] = 'ajax.php'; # "http://{$_SERVER['SERVER_NAME']}/ajax.php"
@ -303,18 +303,18 @@ $bb_cfg['auto_language'] = true; // select user-preferred language automatical
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $bb_cfg['auto_language']) {
$user_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if (file_exists(LANG_ROOT_DIR . $user_lang . '/')) {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . $user_lang . '/';
if (file_exists(LANG_ROOT_DIR . '/' . $user_lang)) {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . '/' . $user_lang . '/';
$bb_cfg['default_lang'] = $user_lang;
} else {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . 'en/';
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . '/en/';
$bb_cfg['default_lang'] = 'en';
}
} else {
if (isset($bb_cfg['default_lang']) && file_exists(LANG_ROOT_DIR . $bb_cfg['default_lang'] . '/')) {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . $bb_cfg['default_lang'] . '/';
if (isset($bb_cfg['default_lang']) && file_exists(LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'])) {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/';
} else {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . 'en/';
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . '/en/';
}
}
@ -441,7 +441,7 @@ define('LOG_MAX_SIZE', 1048576); // bytes
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 0);
ini_set('log_errors', 1);
ini_set('error_log', LOG_DIR . 'php_err.log');
ini_set('error_log', LOG_DIR . '/php_err.log');
// Check some variable
// Magic quotes
@ -454,10 +454,10 @@ if (!function_exists('json_encode')) {
}
// Triggers
define('BB_ENABLED', TRIGGERS_DIR . '$on');
define('BB_DISABLED', TRIGGERS_DIR . '$off');
define('CRON_ALLOWED', TRIGGERS_DIR . 'cron_allowed');
define('CRON_RUNNING', TRIGGERS_DIR . 'cron_running');
define('BB_ENABLED', TRIGGERS_DIR . '/$on');
define('BB_DISABLED', TRIGGERS_DIR . '/$off');
define('CRON_ALLOWED', TRIGGERS_DIR . '/cron_allowed');
define('CRON_RUNNING', TRIGGERS_DIR . '/cron_running');
// Date format
$bb_cfg['date_format'] = 'Y-m-d';
@ -602,7 +602,7 @@ $bb_cfg['file_id_ext'] = array(
// Attachments
$bb_cfg['attach'] = array(
'upload_path' => DATA_DIR . 'torrent_files', // путь к директории с torrent файлами
'upload_path' => DATA_DIR . '/torrent_files', // путь к директории с torrent файлами
'max_size' => 250 * 1024, // размер аватары в байтах
);
@ -643,7 +643,7 @@ $bb_cfg['captcha'] = array(
// Atom feed
$bb_cfg['atom'] = array(
'path' => INT_DATA_DIR . 'atom', // without ending slash
'path' => INT_DATA_DIR . '/atom', // without ending slash
'url' => './internal_data/atom', // without ending slash
);

View file

@ -115,21 +115,17 @@ class emailer
{
global $bb_cfg;
if (trim($template_file) == '') {
bb_die('No template file set');
}
if (trim($template_lang) == '') {
if (!$template_lang) {
$template_lang = $bb_cfg['default_lang'];
}
if (empty($this->tpl_msg[$template_lang . $template_file])) {
$tpl_file = LANG_ROOT_DIR . "$template_lang/email/$template_file.html";
$tpl_file = LANG_ROOT_DIR . '/' . $template_lang . '/email/' . $template_file . '.html';
if (!@file_exists(@bb_realpath($tpl_file))) {
$tpl_file = LANG_ROOT_DIR . "{$bb_cfg['default_lang']}/email/$template_file.html";
if (!file_exists($tpl_file)) {
$tpl_file = LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/email/' . $template_file . '.html';
if (!@file_exists(@bb_realpath($tpl_file))) {
if (!file_exists($tpl_file)) {
bb_die('Could not find email template file :: ' . $template_file);
}
}
@ -207,7 +203,7 @@ class emailer
// Send message
if ($this->use_smtp) {
if (!defined('SMTP_INCLUDED')) {
include(INC_DIR . 'smtp.php');
include INC_DIR . '/smtp.php';
}
$result = smtpmail($to, $this->subject, $this->msg, $this->extra_headers);

View file

@ -228,33 +228,33 @@ class sitemap
$pages_count = @ceil($row['count'] / 40000);
$sitemap = $this->build_index($pages_count);
$handler = fopen(SITEMAP_DIR . "sitemap.xml", "wb+");
$handler = fopen(SITEMAP_DIR . '/sitemap.xml', 'wb+');
fwrite($handler, $sitemap);
fclose($handler);
@chmod(SITEMAP_DIR . "sitemap.xml", 0666);
chmod(SITEMAP_DIR . '/sitemap.xml', 0666);
$sitemap = $this->build_stat();
$handler = fopen(SITEMAP_DIR . "sitemap1.xml", "wb+");
$handler = fopen(SITEMAP_DIR . '/sitemap1.xml', 'wb+');
fwrite($handler, $sitemap);
fclose($handler);
@chmod(SITEMAP_DIR . "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(SITEMAP_DIR . "sitemap{$t}.xml", "wb+");
$handler = fopen(SITEMAP_DIR . '/sitemap' . $t . '.xml', 'wb+');
fwrite($handler, $sitemap);
fclose($handler);
@chmod(SITEMAP_DIR . "sitemap{$t}.xml", 0666);
chmod(SITEMAP_DIR . '/sitemap' . $t . '.xml', 0666);
}
} else {
$sitemap = $this->build_map();
$handler = fopen(SITEMAP_DIR . "sitemap.xml", "wb+");
$handler = fopen(SITEMAP_DIR . '/sitemap.xml', 'wb+');
fwrite($handler, $sitemap);
fclose($handler);
@chmod(SITEMAP_DIR . "sitemap.xml", 0666);
@chmod(SITEMAP_DIR . 'sitemap.xml', 0666);
}
$params['sitemap_time'] = TIMENOW;

View file

@ -27,7 +27,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
bb_log(date('H:i:s - ') . getmypid() . ' --x- SELECT jobs' . LOG_LF, CRON_LOG_DIR . 'cron_check');
bb_log(date('H:i:s - ') . getmypid() . ' --x- SELECT jobs' . LOG_LF, CRON_LOG_DIR . '/cron_check');
// Get cron jobs
$cron_jobs = DB()->fetch_rowset("
@ -39,7 +39,7 @@ $cron_jobs = DB()->fetch_rowset("
// Run cron jobs
if ($cron_jobs) {
bb_log(date('H:i:s - ') . getmypid() . ' --x- RUN jobs' . LOG_LF, CRON_LOG_DIR . 'cron_check');
bb_log(date('H:i:s - ') . getmypid() . ' --x- RUN jobs' . LOG_LF, CRON_LOG_DIR . '/cron_check');
foreach ($cron_jobs as $job) {
if ($job['disable_board']) {
@ -54,5 +54,5 @@ if ($cron_jobs) {
// Update cron_last_check
bb_update_config(array('cron_last_check' => (TIMENOW + 10)));
} else {
bb_log(date('H:i:s - ') . getmypid() . ' --x- no active jobs found ----------------------------------------------' . LOG_LF, CRON_LOG_DIR . 'cron_check');
bb_log(date('H:i:s - ') . getmypid() . ' --x- no active jobs found ----------------------------------------------' . LOG_LF, CRON_LOG_DIR . '/cron_check');
}

View file

@ -35,7 +35,7 @@ function cron_get_file_lock()
$lock_obtained = false;
if (file_exists(CRON_ALLOWED)) {
# bb_log(date('H:i:s - ') . getmypid() .' -x-- FILE-LOCK try'. LOG_LF, CRON_LOG_DIR .'cron_check');
# bb_log(date('H:i:s - ') . getmypid() .' -x-- FILE-LOCK try'. LOG_LF, CRON_LOG_DIR .'/cron_check');
$lock_obtained = @rename(CRON_ALLOWED, CRON_RUNNING);
} elseif (file_exists(CRON_RUNNING)) {
@ -50,7 +50,7 @@ function cron_get_file_lock()
function cron_track_running($mode)
{
@define('CRON_STARTMARK', TRIGGERS_DIR . 'cron_started_at_' . date('Y-m-d_H-i-s') . '_by_pid_' . getmypid());
@define('CRON_STARTMARK', TRIGGERS_DIR . '/cron_started_at_' . date('Y-m-d_H-i-s') . '_by_pid_' . getmypid());
if ($mode == 'start') {
cron_touch_lock_file(CRON_RUNNING);
@ -68,7 +68,7 @@ if (cron_get_file_lock()) {
register_shutdown_function('cron_release_file_lock');
register_shutdown_function('cron_enable_board');
# bb_log(date('H:i:s - ') . getmypid() .' --x- FILE-LOCK OBTAINED ###############'. LOG_LF, CRON_LOG_DIR .'cron_check');
# bb_log(date('H:i:s - ') . getmypid() .' --x- FILE-LOCK OBTAINED ###############'. LOG_LF, CRON_LOG_DIR .'/cron_check');
cron_track_running('start');
@ -78,5 +78,5 @@ if (cron_get_file_lock()) {
}
if (defined('IN_CRON')) {
bb_log(date('H:i:s - ') . getmypid() . ' --x- ALL jobs FINISHED *************************************************' . LOG_LF, CRON_LOG_DIR . 'cron_check');
bb_log(date('H:i:s - ') . getmypid() . ' --x- ALL jobs FINISHED *************************************************' . LOG_LF, CRON_LOG_DIR . '/cron_check');
}

View file

@ -63,7 +63,7 @@ foreach ($cron_jobs as $job) {
$cron_start_time = utime();
$cron_runtime_log = '';
$cron_write_log = (CRON_LOG_ENABLED && (CRON_FORCE_LOG || $job['log_enabled'] >= 1));
$cron_sql_log_file = CRON_LOG_DIR . 'SQL-' . basename($job['cron_script']);
$cron_sql_log_file = CRON_LOG_DIR . '/SQL-' . basename($job['cron_script']);
if ($cron_write_log) {
$msg = array();
@ -74,7 +74,7 @@ foreach ($cron_jobs as $job) {
$msg[] = sprintf('%05d', getmypid());
$msg[] = $job['cron_title'];
$msg = join(LOG_SEPR, $msg);
bb_log($msg . LOG_LF, CRON_LOG_DIR . CRON_LOG_FILE);
bb_log($msg . LOG_LF, CRON_LOG_DIR . '/' . CRON_LOG_FILE);
}
if ($job['log_sql_queries']) {
@ -99,11 +99,11 @@ foreach ($cron_jobs as $job) {
$msg[] = round(utime() - $cron_start_time) . '/' . round(utime() - TIMESTART) . ' sec';
$msg = join(LOG_SEPR, $msg);
$msg .= LOG_LF . '------=-------=----------=------=-------=----------';
bb_log($msg . LOG_LF, CRON_LOG_DIR . CRON_LOG_FILE);
bb_log($msg . LOG_LF, CRON_LOG_DIR . '/' . CRON_LOG_FILE);
if ($cron_runtime_log) {
$runtime_log_file = ($job['log_file']) ? $job['log_file'] : $job['cron_script'];
bb_log($cron_runtime_log . LOG_LF, CRON_LOG_DIR . basename($runtime_log_file));
bb_log($cron_runtime_log . LOG_LF, CRON_LOG_DIR . '/' . basename($runtime_log_file));
}
}

View file

@ -27,7 +27,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
require_once(INC_DIR . 'functions_admin.php');
require_once INC_DIR . '/functions_admin.php';
// Синхронизация
sync('topic', 'all');

View file

@ -27,7 +27,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
require_once(INC_DIR . 'functions_admin.php');
require_once INC_DIR . '/functions_admin.php';
if ($bb_cfg['prune_enable']) {
$sql = "SELECT forum_id, prune_days FROM " . BB_FORUMS . " WHERE prune_days != 0";

View file

@ -27,7 +27,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
require_once(INC_DIR . 'functions_admin.php');
require_once INC_DIR . '/functions_admin.php';
$users_per_cycle = 1000;

View file

@ -27,7 +27,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
require(CLASS_DIR . 'sitemap.php');
require CLASS_DIR . '/sitemap.php';
$map = new sitemap();
$map->create();

View file

@ -29,7 +29,7 @@ if (!defined('BB_ROOT')) {
global $bb_cfg;
require_once(INC_DIR . 'functions_atom.php');
require_once INC_DIR . '/functions_atom.php';
$timecheck = TIMENOW - 600;
$forums_data = DB()->fetch_rowset("SELECT forum_id, allow_reg_tracker, forum_name FROM " . BB_FORUMS);

View file

@ -129,8 +129,8 @@ $data = array(
$this->store('jumpbox', $data);
file_write($data['guest'], AJAX_HTML_DIR . 'jumpbox_guest.html', false, true, true);
file_write($data['user'], AJAX_HTML_DIR . 'jumpbox_user.html', false, true, true);
file_write($data['guest'], AJAX_HTML_DIR . '/jumpbox_guest.html', false, true, true);
file_write($data['user'], AJAX_HTML_DIR . '/jumpbox_user.html', false, true, true);
//
// viewtopic_forum_select

View file

@ -32,7 +32,7 @@ class datastore_common
/**
* Директория с builder-скриптами (внутри INC_DIR)
*/
public $ds_dir = 'datastore/';
public $ds_dir = 'datastore';
/**
* Готовая к употреблению data
* array('title' => data)
@ -132,8 +132,9 @@ class datastore_common
public function _build_item($title)
{
if (!empty($this->known_items[$title])) {
require(INC_DIR . $this->ds_dir . $this->known_items[$title]);
$file = INC_DIR . '/' . $this->ds_dir . '/' . $this->known_items[$title];
if (isset($this->known_items[$title]) && file_exists($file)) {
require $file;
} else {
trigger_error("Unknown datastore item: $title", E_USER_ERROR);
}

View file

@ -1428,7 +1428,7 @@ function setup_style()
}
}
$template = new Template(TEMPLATES_DIR . $tpl_dir_name);
$template = new Template(TEMPLATES_DIR . '/' . $tpl_dir_name);
$css_dir = 'styles/' . basename(TEMPLATES_DIR) . '/' . $tpl_dir_name . '/css/';
$template->assign_vars(array(
@ -1440,7 +1440,7 @@ function setup_style()
'SITE_URL' => make_url('/'),
));
require(TEMPLATES_DIR . $tpl_dir_name . '/tpl_config.php');
require TEMPLATES_DIR . '/' . $tpl_dir_name . '/tpl_config.php';
$theme = array('template_name' => $tpl_dir_name);
@ -1720,7 +1720,7 @@ function bb_simple_die($txt)
function bb_realpath($path)
{
return (!@function_exists('realpath') || !@realpath(INC_DIR . 'functions.php')) ? $path : @realpath($path);
return realpath($path);
}
function login_redirect($url = '')
@ -2453,8 +2453,8 @@ function get_avatar($user_id, $ext_id, $allow_avatar = true, $size = true, $heig
// TODO размеры: s, m, l + кеширование
}
$height = ($height != '') ? 'height="' . $height . '"' : '';
$width = ($width != '') ? 'width="' . $width . '"' : '';
$height = !$height ? 'height="' . $height . '"' : '';
$width = !$width ? 'width="' . $width . '"' : '';
$user_avatar = '<img src="' . make_url($bb_cfg['avatars']['upload_path'] . $bb_cfg['avatars']['no_avatar']) . '" alt="' . $user_id . '" ' . $height . ' ' . $width . ' />';
@ -2519,7 +2519,7 @@ function is_gold($type)
function update_atom($type, $id)
{
require_once(INC_DIR . 'functions_atom.php');
require_once INC_DIR . '/functions_atom.php';
switch ($type) {
case 'user':

View file

@ -36,7 +36,7 @@ function run_jobs($jobs)
while ($row = DB()->sql_fetchrow($result)) {
$job = $row['cron_script'];
$job_script = INC_DIR . 'cron/jobs/' . $job;
$job_script = INC_DIR . '/cron/jobs/' . $job;
require($job_script);
}
DB()->query("

View file

@ -39,7 +39,7 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
$username = clean_username($username);
if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $user->name)) {
require(INC_DIR . 'functions_validate.php');
require INC_DIR . '/functions_validate.php';
if ($err = validate_username($username)) {
$error_msg .= $err;
@ -331,7 +331,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
");
if ($watch_list) {
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$orig_word = $replacement_word = array();

View file

@ -292,7 +292,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
}
if ($bb_cfg['bt_check_announce_url']) {
include(INC_DIR . 'torrent_announce_urls.php');
include INC_DIR . '/torrent_announce_urls.php';
$ann = (@$tor['announce']) ? $tor['announce'] : '';
$announce_urls['main_url'] = $bb_cfg['bt_announce_url'];

View file

@ -336,8 +336,8 @@ define('LOGIN_KEY_LENGTH', 12);
define('USERNAME_MAX_LENGTH', 25);
define('USEREMAIL_MAX_LENGTH', 40);
define('PAGE_HEADER', INC_DIR . 'page_header.php');
define('PAGE_FOOTER', INC_DIR . 'page_footer.php');
define('PAGE_HEADER', INC_DIR . '/page_header.php');
define('PAGE_FOOTER', INC_DIR . '/page_footer.php');
define('CAT_URL', 'index.php?c=');
define('DOWNLOAD_URL', 'dl.php?id=');
@ -452,10 +452,10 @@ function make_url($path = '')
return FULL_URL . preg_replace('#^\/?(.*?)\/?$#', '\1', $path);
}
require(INC_DIR . 'functions.php');
require(INC_DIR . 'sessions.php');
require(INC_DIR . 'template.php');
require(CORE_DIR . 'mysql.php');
require INC_DIR . '/functions.php';
require INC_DIR . '/sessions.php';
require INC_DIR . '/template.php';
require CORE_DIR . '/mysql.php';
define('SQL_LAYER', 'mysql');
@ -465,7 +465,7 @@ $user = new user_common();
$userdata =& $user->data;
if (DBG_USER) {
require(INC_DIR . 'functions_dev.php');
require INC_DIR . '/functions_dev.php';
}
$html = new html_common();
@ -490,15 +490,15 @@ if ((empty($_POST) && !defined('IN_ADMIN') && !defined('IN_AJAX') && !file_exist
define('CRON_LOG_ENABLED', true); // global ON/OFF
define('CRON_FORCE_LOG', false); // always log regardless of job settings
define('CRON_DIR', INC_DIR . 'cron/');
define('CRON_DIR', INC_DIR . '/cron/');
define('CRON_JOB_DIR', CRON_DIR . 'jobs/');
define('CRON_LOG_DIR', 'cron/'); // inside LOG_DIR
define('CRON_LOG_DIR', 'cron'); // inside LOG_DIR
define('CRON_LOG_FILE', 'cron'); // without ext
bb_log(date('H:i:s - ') . getmypid() . ' -x-- DB-LOCK try' . LOG_LF, CRON_LOG_DIR . 'cron_check');
bb_log(date('H:i:s - ') . getmypid() . ' -x-- DB-LOCK try' . LOG_LF, CRON_LOG_DIR . '/cron_check');
if (DB()->get_lock('cron', 1)) {
bb_log(date('H:i:s - ') . getmypid() . ' --x- DB-LOCK OBTAINED !!!!!!!!!!!!!!!!!' . LOG_LF, CRON_LOG_DIR . 'cron_check');
bb_log(date('H:i:s - ') . getmypid() . ' --x- DB-LOCK OBTAINED !!!!!!!!!!!!!!!!!' . LOG_LF, CRON_LOG_DIR . '/cron_check');
sleep(2);
require(CRON_DIR . 'cron_init.php');

View file

@ -93,7 +93,7 @@ echo '
';
if (DBG_USER && SQL_DEBUG && !(isset($_GET['pane']) && $_GET['pane'] == 'left')) {
require(INC_DIR . 'page_footer_dev.php');
require INC_DIR . '/page_footer_dev.php';
}
echo '

View file

@ -58,7 +58,7 @@ if (defined('SHOW_ONLINE') && SHOW_ONLINE) {
$template->assign_var('SHOW_ONLINE_LIST');
if (!${$online_list} = CACHE('bb_cache')->get($online_list)) {
require(INC_DIR . 'online_userlist.php');
require INC_DIR . '/online_userlist.php';
}
}

View file

@ -96,4 +96,4 @@ if ($edit_tpl_mode) {
}
}
print_page(TEMPLATES_DIR . 'posting_tpl.tpl');
print_page(TEMPLATES_DIR . '/posting_tpl.tpl');

View file

@ -540,13 +540,13 @@ class user_common
return;
} // prevent multiple calling
define('DEFAULT_LANG_DIR', LANG_ROOT_DIR . $bb_cfg['default_lang'] . '/');
define('ENGLISH_LANG_DIR', LANG_ROOT_DIR . 'en/');
define('DEFAULT_LANG_DIR', LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/');
define('ENGLISH_LANG_DIR', LANG_ROOT_DIR . '/en/');
if ($this->data['user_id'] != GUEST_UID) {
if ($this->data['user_lang'] && $this->data['user_lang'] != $bb_cfg['default_lang']) {
$bb_cfg['default_lang'] = basename($this->data['user_lang']);
define('LANG_DIR', LANG_ROOT_DIR . $bb_cfg['default_lang'] . '/');
define('LANG_DIR', LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/');
}
if (isset($this->data['user_timezone'])) {

View file

@ -79,7 +79,7 @@ class template
public $root = '';
// Cache directory
public $cachedir = CACHE_DIR;
public $cachedir = CACHE_DIR . '/';
// Template root directory
public $tpldir = '';

View file

@ -43,7 +43,7 @@ if (isset($_POST['bonus_id'])) {
$btu = get_bt_userdata($user_id);
if (empty($btu)) {
require(INC_DIR . 'functions_torrent.php');
require INC_DIR . '/functions_torrent.php';
generate_passkey($user_id, true);
$btu = get_bt_userdata($user_id);
}

View file

@ -71,7 +71,7 @@ if ($row = DB()->fetch_row($sql)) {
}
if (!$errors) {
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($userdata['username'] . " <{$userdata['user_email']}>");

View file

@ -50,9 +50,9 @@ $submit = !empty($_POST['submit']);
$errors = array();
$adm_edit = false; // редактирование админом чужого профиля
require(INC_DIR . 'bbcode.php');
require(INC_DIR . 'functions_validate.php');
require(INC_DIR . 'functions_selects.php');
require INC_DIR . '/bbcode.php';
require INC_DIR . '/functions_validate.php';
require INC_DIR . '/functions_selects.php';
$pr_data = array(); // данные редактируемого либо регистрационного профиля
$db_data = array(); // данные для базы: регистрационные либо измененные данные юзера
@ -384,7 +384,7 @@ foreach ($profile_fields as $field => $can_edit) {
$pr_data['avatar_ext_id'] = 0;
$db_data['avatar_ext_id'] = 0;
} elseif (!empty($_FILES['avatar']['name']) && $bb_cfg['avatars']['up_allowed']) {
require(INC_DIR . 'functions_upload.php');
require INC_DIR . '/functions_upload.php';
$upload = new upload_common();
if ($upload->init($bb_cfg['avatars'], $_FILES['avatar']) and $upload->store('avatar', $pr_data)) {
@ -590,7 +590,7 @@ if ($submit && !$errors) {
$email_template = 'user_welcome';
}
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");
@ -625,7 +625,7 @@ if ($submit && !$errors) {
$pr_data['user_actkey'] = $user_actkey;
$db_data['user_actkey'] = $user_actkey;
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");

View file

@ -63,7 +63,7 @@ if (isset($_POST['submit'])) {
bb_die('Could not update new password information');
}
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");

View file

@ -27,7 +27,7 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
require(INC_DIR . 'bbcode.php');
require INC_DIR . '/bbcode.php';
$datastore->enqueue(array(
'ranks',

View file

@ -27,7 +27,7 @@ define('IN_FORUM', true);
define('BB_SCRIPT', 'login');
define('IN_LOGIN', true);
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
array_deep($_POST, 'trim');

View file

@ -26,7 +26,7 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'memberlist');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
$page_cfg['use_tablesorter'] = true;

View file

@ -26,10 +26,10 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'modcp');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(INC_DIR . 'bbcode.php');
require(INC_DIR . 'functions_post.php');
require_once(INC_DIR . 'functions_admin.php');
require __DIR__ . '/common.php';
require INC_DIR . '/bbcode.php';
require INC_DIR . '/functions_post.php';
require_once INC_DIR . '/functions_admin.php';
//
// Functions

View file

@ -24,7 +24,7 @@
*/
define('BB_SCRIPT', 'vote');
require('./common.php');
require __DIR__ . '/common.php';
$user->session_start(array('req_login' => true));

View file

@ -26,10 +26,10 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'posting');
define('BB_ROOT', './');
require(BB_ROOT . "common.php");
require(INC_DIR . 'bbcode.php');
require(INC_DIR . 'functions_post.php');
require(ATTACH_DIR . 'attachment_mod.php');
require __DIR__ . '/common.php';
require INC_DIR . '/bbcode.php';
require INC_DIR . '/functions_post.php';
require ATTACH_DIR . '/attachment_mod.php';
$page_cfg['load_tpl_vars'] = array('post_icons');
@ -258,7 +258,7 @@ if ($mode == 'new_rel') {
bb_die($topics . $lang['UNEXECUTED_RELEASE']);
}
}
require(INC_DIR . 'posting_tpl.php');
require INC_DIR . '/posting_tpl.php';
exit;
}
@ -367,7 +367,7 @@ if (($delete || $mode == 'delete') && !$confirm) {
break;
case 'delete':
require_once(INC_DIR . 'functions_admin.php');
require_once INC_DIR . '/functions_admin.php';
delete_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id);
break;
}
@ -388,7 +388,7 @@ if (($delete || $mode == 'delete') && !$confirm) {
}
if (defined('TORRENT_ATTACH_ID') && $bb_cfg['bt_newtopic_auto_reg'] && !$error_msg) {
include(INC_DIR . 'functions_torrent.php');
include INC_DIR . '/functions_torrent.php';
if (!DB()->fetch_row("SELECT attach_id FROM " . BB_BT_TORRENTS . " WHERE attach_id = " . TORRENT_ATTACH_ID)) {
if ($bb_cfg['premod']) {
// Получение списка id форумов начиная с parent

View file

@ -27,9 +27,9 @@ define('IN_FORUM', true);
define('BB_SCRIPT', 'pm');
define('IN_PM', true);
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(INC_DIR . 'bbcode.php');
require(INC_DIR . 'functions_post.php');
require __DIR__ . '/common.php';
require INC_DIR . '/bbcode.php';
require INC_DIR . '/functions_post.php';
$privmsg_sent_id = $l_box_name = $to_username = $privmsg_subject = $privmsg_message = $error_msg = '';
@ -929,7 +929,7 @@ if ($mode == 'read') {
cache_rm_user_sessions($to_userdata['user_id']);
if (bf($to_userdata['user_opt'], 'user_opt', 'user_notify_pm') && $to_userdata['user_active'] && $bb_cfg['pm_notify_enabled']) {
require(CLASS_DIR . 'emailer.php');
require CLASS_DIR . '/emailer.php';
$emailer = new emailer($bb_cfg['smtp_delivery']);
$emailer->from($bb_cfg['sitename'] . " <{$bb_cfg['board_email']}>");

View file

@ -26,7 +26,7 @@
define('IN_PROFILE', true);
define('BB_SCRIPT', 'profile');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
// Start session management
$user->session_start();
@ -36,7 +36,7 @@ $mode = request_var('mode', '');
switch ($mode) {
case 'viewprofile':
require(UCP_DIR . 'viewprofile.php');
require UCP_DIR . '/viewprofile.php';
break;
case 'register':
@ -44,33 +44,33 @@ switch ($mode) {
if (IS_GUEST && $mode == 'editprofile') {
login_redirect();
}
require(UCP_DIR . 'register.php');
require UCP_DIR . '/register.php';
break;
case 'sendpassword':
require(UCP_DIR . 'sendpasswd.php');
require UCP_DIR . '/sendpasswd.php';
break;
case 'activate':
require(UCP_DIR . 'activate.php');
require UCP_DIR . '/activate.php';
break;
case 'email':
require(UCP_DIR . 'email.php');
require UCP_DIR . '/email.php';
break;
case 'bonus':
if (IS_GUEST) {
login_redirect();
}
require(UCP_DIR . 'bonus.php');
require UCP_DIR . '/bonus.php';
break;
case 'watch':
if (IS_GUEST) {
login_redirect();
}
require(UCP_DIR . 'topic_watch.php');
require UCP_DIR . '/topic_watch.php';
break;
default:

View file

@ -25,12 +25,12 @@
define('BB_SCRIPT', 'search');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
require(INC_DIR . 'bbcode.php');
require(CLASS_DIR . 'utf8.php');
require(CLASS_DIR . 'correct.php');
require(CLASS_DIR . 'reflection.php');
require INC_DIR . '/bbcode.php';
require CLASS_DIR . '/utf8.php';
require CLASS_DIR . '/correct.php';
require CLASS_DIR . '/reflection.php';
$page_cfg['load_tpl_vars'] = array(
'post_buttons',

View file

@ -1499,4 +1499,4 @@ div#autocomplete_popup span.regenerate {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
background-repeat: repeat-x;
border-color: #dca7a7;
}
}

View file

@ -67,7 +67,7 @@ $(document).ready(function(){
');
$('#jumpbox-container').one('click', function(){
$('#jumpbox-title').html('&nbsp;&nbsp; {L_LOADING} ... &nbsp;');
var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? 'jumpbox_user.html' : 'jumpbox_guest.html');
var jumpbox_src = '{AJAX_HTML_DIR}' + ({LOGGED_IN} ? '/jumpbox_user.html' : '/jumpbox_guest.html');
$(this).load(jumpbox_src);
$('#jumpbox-submit').click(function(){ window.location.href='{FORUM_URL}'+$('#jumpbox').val(); });
});
@ -512,4 +512,4 @@ $(document).ready(function() {
<!-- ENDIF / ERROR_MESSAGE -->
<!-- page_header.tpl END -->
<!-- module_xx.tpl START -->
<!-- module_xx.tpl START -->

View file

@ -25,8 +25,8 @@
define('BB_SCRIPT', 'terms');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(INC_DIR . 'bbcode.php');
require __DIR__ . '/common.php';
require INC_DIR . '/bbcode.php';
// Start session management
$user->session_start();

View file

@ -25,12 +25,12 @@
define('BB_SCRIPT', 'tracker');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
require(CLASS_DIR . 'utf8.php');
require(CLASS_DIR . 'correct.php');
require(CLASS_DIR . 'reflection.php');
require(INC_DIR . 'functions_group.php');
require CLASS_DIR . '/utf8.php';
require CLASS_DIR . '/correct.php';
require CLASS_DIR . '/reflection.php';
require INC_DIR . '/functions_group.php';
// Page config
$page_cfg['include_bbcode_js'] = true;

View file

@ -26,7 +26,7 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'forum');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require __DIR__ . '/common.php';
$page_cfg['include_bbcode_js'] = true;

View file

@ -26,8 +26,8 @@
define('IN_FORUM', true);
define('BB_SCRIPT', 'topic');
define('BB_ROOT', './');
require(BB_ROOT . 'common.php');
require(INC_DIR . 'bbcode.php');
require __DIR__ . '/common.php';
require INC_DIR . '/bbcode.php';
$datastore->enqueue(array(
'ranks',
@ -298,7 +298,7 @@ $limit_posts_time = '';
$total_replies = $t_data['topic_replies'] + 1;
if (!empty($_REQUEST['postdays'])) {
if ($post_days = abs(intval($_REQUEST['postdays']))) {
if ($post_days = (int) $_REQUEST['postdays']) {
if (!empty($_POST['postdays'])) {
$start = 0;
}
@ -554,10 +554,10 @@ $template->assign_vars(array(
'PEERS_FULL_LINK' => false,
'DL_LIST_HREF' => TOPIC_URL . "$topic_id&amp;dl=names&amp;spmode=full",
));
require(INC_DIR . 'torrent_show_dl_list.php');
require INC_DIR . '/torrent_show_dl_list.php';
if (isset($t_data['topic_attachment'])) {
require(ATTACH_DIR . 'attachment_mod.php');
require ATTACH_DIR . '/attachment_mod.php';
init_display_post_attachments($t_data['topic_attachment']);
}