mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Merge pull request #424 from Exile37/feature/new-lang
Transfer to the new localization subsystem
This commit is contained in:
commit
a1286a716b
189 changed files with 6357 additions and 7388 deletions
|
@ -33,7 +33,7 @@ $view = (isset($_POST['search']) && $_POST['search']) ? 'attachments' : $view;
|
||||||
|
|
||||||
// process modes based on view
|
// process modes based on view
|
||||||
if ($view === 'username') {
|
if ($view === 'username') {
|
||||||
$mode_types_text = array($lang['SORT_USERNAME'], $lang['SORT_ATTACHMENTS'], $lang['SORT_SIZE']);
|
$mode_types_text = array(trans('messages.SORT_USERNAME'), trans('messages.SORT_ATTACHMENTS'), trans('messages.SORT_SIZE'));
|
||||||
$mode_types = array('username', 'attachments', 'filesize');
|
$mode_types = array('username', 'attachments', 'filesize');
|
||||||
|
|
||||||
if (!$mode) {
|
if (!$mode) {
|
||||||
|
@ -41,7 +41,7 @@ if ($view === 'username') {
|
||||||
$sort_order = 'DESC';
|
$sort_order = 'DESC';
|
||||||
}
|
}
|
||||||
} elseif ($view === 'attachments') {
|
} elseif ($view === 'attachments') {
|
||||||
$mode_types_text = array($lang['SORT_FILENAME'], $lang['SORT_COMMENT'], $lang['SORT_EXTENSION'], $lang['SORT_SIZE'], $lang['SORT_DOWNLOADS'], $lang['SORT_POSTTIME']);
|
$mode_types_text = array(trans('messages.SORT_FILENAME'), trans('messages.SORT_COMMENT'), trans('messages.SORT_EXTENSION'), trans('messages.SORT_SIZE'), trans('messages.SORT_DOWNLOADS'), trans('messages.SORT_POSTTIME'));
|
||||||
$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time');
|
$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time');
|
||||||
|
|
||||||
if (!$mode) {
|
if (!$mode) {
|
||||||
|
@ -49,7 +49,7 @@ if ($view === 'username') {
|
||||||
$sort_order = 'ASC';
|
$sort_order = 'ASC';
|
||||||
}
|
}
|
||||||
} elseif ($view === 'search') {
|
} elseif ($view === 'search') {
|
||||||
$mode_types_text = array($lang['SORT_FILENAME'], $lang['SORT_COMMENT'], $lang['SORT_EXTENSION'], $lang['SORT_SIZE'], $lang['SORT_DOWNLOADS'], $lang['SORT_POSTTIME']);
|
$mode_types_text = array(trans('messages.SORT_FILENAME'), trans('messages.SORT_COMMENT'), trans('messages.SORT_EXTENSION'), trans('messages.SORT_SIZE'), trans('messages.SORT_DOWNLOADS'), trans('messages.SORT_POSTTIME'));
|
||||||
$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time');
|
$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time');
|
||||||
|
|
||||||
$sort_order = 'DESC';
|
$sort_order = 'DESC';
|
||||||
|
@ -111,7 +111,7 @@ if ($view === 'username') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set select fields
|
// Set select fields
|
||||||
$view_types_text = array($lang['VIEW_STATISTIC'], $lang['VIEW_SEARCH']);
|
$view_types_text = array(trans('messages.VIEW_STATISTIC'), trans('messages.VIEW_SEARCH'));
|
||||||
$view_types = array('stats', 'search');
|
$view_types = array('stats', 'search');
|
||||||
|
|
||||||
$select_view = '<select name="view">';
|
$select_view = '<select name="view">';
|
||||||
|
@ -134,9 +134,9 @@ if (count($mode_types_text) > 0) {
|
||||||
|
|
||||||
$select_sort_order = '<select name="order">';
|
$select_sort_order = '<select name="order">';
|
||||||
if ($sort_order === 'ASC') {
|
if ($sort_order === 'ASC') {
|
||||||
$select_sort_order .= '<option value="ASC" selected="selected">' . $lang['ASC'] . '</option><option value="DESC">' . $lang['DESC'] . '</option>';
|
$select_sort_order .= '<option value="ASC" selected="selected">' . trans('messages.ASC') . '</option><option value="DESC">' . trans('messages.DESC') . '</option>';
|
||||||
} else {
|
} else {
|
||||||
$select_sort_order .= '<option value="ASC">' . $lang['ASC'] . '</option><option value="DESC" selected="selected">' . $lang['DESC'] . '</option>';
|
$select_sort_order .= '<option value="ASC">' . trans('messages.ASC') . '</option><option value="DESC" selected="selected">' . trans('messages.DESC') . '</option>';
|
||||||
}
|
}
|
||||||
$select_sort_order .= '</select>';
|
$select_sort_order .= '</select>';
|
||||||
|
|
||||||
|
@ -268,16 +268,16 @@ if ($view === 'search') {
|
||||||
|
|
||||||
$s_categories = '';
|
$s_categories = '';
|
||||||
if ($s_forums) {
|
if ($s_forums) {
|
||||||
$s_forums = '<option value="0">' . $lang['ALL_AVAILABLE'] . '</option>' . $s_forums;
|
$s_forums = '<option value="0">' . trans('messages.ALL_AVAILABLE') . '</option>' . $s_forums;
|
||||||
|
|
||||||
// Category to search
|
// Category to search
|
||||||
$s_categories = '<option value="0">' . $lang['ALL_AVAILABLE'] . '</option>';
|
$s_categories = '<option value="0">' . trans('messages.ALL_AVAILABLE') . '</option>';
|
||||||
|
|
||||||
foreach ($list_cat as $cat_id => $cat_title) {
|
foreach ($list_cat as $cat_id => $cat_title) {
|
||||||
$s_categories .= '<option value="' . $cat_id . '">' . htmlCHR($cat_title) . '</option>';
|
$s_categories .= '<option value="' . $cat_id . '">' . htmlCHR($cat_title) . '</option>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_SEARCHABLE_FORUMS']);
|
bb_die(trans('messages.NO_SEARCHABLE_FORUMS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -333,7 +333,7 @@ if ($view === 'attachments') {
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_USER_HIDDEN' => $s_hidden,
|
'S_USER_HIDDEN' => $s_hidden,
|
||||||
'L_STATISTICS_FOR_USER' => sprintf($lang['STATISTICS_FOR_USER'], $username),
|
'L_STATISTICS_FOR_USER' => sprintf(trans('messages.STATISTICS_FOR_USER'), $username),
|
||||||
));
|
));
|
||||||
|
|
||||||
$sql = 'SELECT attach_id
|
$sql = 'SELECT attach_id
|
||||||
|
@ -430,7 +430,7 @@ if ($view === 'attachments') {
|
||||||
|
|
||||||
$post_titles[] = '<a href="' . $view_topic . '" class="gen" target="_blank">' . $post_title . '</a>';
|
$post_titles[] = '<a href="' . $view_topic . '" class="gen" target="_blank">' . $post_title . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$post_titles[] = $lang['PRIVATE_MESSAGE'];
|
$post_titles[] = trans('messages.PRIVATE_MESSAGE');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,18 +197,18 @@ if ($check_upload) {
|
||||||
// Does the target directory exist, is it a directory and writeable
|
// Does the target directory exist, is it a directory and writeable
|
||||||
if (!@file_exists(amod_realpath($upload_dir))) {
|
if (!@file_exists(amod_realpath($upload_dir))) {
|
||||||
$error = true;
|
$error = true;
|
||||||
$error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $attach_config['upload_dir']) . '<br />';
|
$error_msg = sprintf(trans('messages.DIRECTORY_DOES_NOT_EXIST'), $attach_config['upload_dir']) . '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !is_dir($upload_dir)) {
|
if (!$error && !is_dir($upload_dir)) {
|
||||||
$error = true;
|
$error = true;
|
||||||
$error_msg = sprintf($lang['DIRECTORY_IS_NOT_A_DIR'], $attach_config['upload_dir']) . '<br />';
|
$error_msg = sprintf(trans('messages.DIRECTORY_IS_NOT_A_DIR'), $attach_config['upload_dir']) . '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (!($fp = @fopen($upload_dir . '/0_000000.000', 'wb'))) {
|
if (!($fp = @fopen($upload_dir . '/0_000000.000', 'wb'))) {
|
||||||
$error = true;
|
$error = true;
|
||||||
$error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $attach_config['upload_dir']) . '<br />';
|
$error_msg = sprintf(trans('messages.DIRECTORY_NOT_WRITEABLE'), $attach_config['upload_dir']) . '<br />';
|
||||||
} else {
|
} else {
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
unlink_attach($upload_dir . '/0_000000.000');
|
unlink_attach($upload_dir . '/0_000000.000');
|
||||||
|
@ -216,14 +216,14 @@ if ($check_upload) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['TEST_SETTINGS_SUCCESSFUL'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_attachments.php?mode=manage">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.TEST_SETTINGS_SUCCESSFUL') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_attachments.php?mode=manage">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Management
|
// Management
|
||||||
if ($submit && $mode == 'manage') {
|
if ($submit && $mode == 'manage') {
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['ATTACH_CONFIG_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_attachments.php?mode=manage">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.ATTACH_CONFIG_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_attachments.php?mode=manage">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,12 +256,12 @@ if ($mode == 'manage') {
|
||||||
|
|
||||||
if ($submit && $mode == 'cats') {
|
if ($submit && $mode == 'cats') {
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['ATTACH_CONFIG_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_attachments.php?mode=cats">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.ATTACH_CONFIG_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_attachments.php?mode=cats">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'cats') {
|
if ($mode == 'cats') {
|
||||||
$s_assigned_group_images = $lang['NONE'];
|
$s_assigned_group_images = trans('messages.NONE');
|
||||||
|
|
||||||
$sql = 'SELECT group_name, cat_id FROM ' . BB_EXTENSION_GROUPS . ' WHERE cat_id > 0 ORDER BY cat_id';
|
$sql = 'SELECT group_name, cat_id FROM ' . BB_EXTENSION_GROUPS . ' WHERE cat_id > 0 ORDER BY cat_id';
|
||||||
|
|
||||||
|
@ -351,19 +351,19 @@ if ($check_image_cat) {
|
||||||
|
|
||||||
if (!@file_exists(amod_realpath($upload_dir))) {
|
if (!@file_exists(amod_realpath($upload_dir))) {
|
||||||
$error = true;
|
$error = true;
|
||||||
$error_msg = sprintf($lang['DIRECTORY_DOES_NOT_EXIST'], $upload_dir) . '<br />';
|
$error_msg = sprintf(trans('messages.DIRECTORY_DOES_NOT_EXIST'), $upload_dir) . '<br />';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error && !is_dir($upload_dir)) {
|
if (!$error && !is_dir($upload_dir)) {
|
||||||
$error = true;
|
$error = true;
|
||||||
$error_msg = sprintf($lang['DIRECTORY_IS_NOT_A_DIR'], $upload_dir) . '<br />';
|
$error_msg = sprintf(trans('messages.DIRECTORY_IS_NOT_A_DIR'), $upload_dir) . '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if (!($fp = @fopen($upload_dir . '/0_000000.000', 'wb'))) {
|
if (!($fp = @fopen($upload_dir . '/0_000000.000', 'wb'))) {
|
||||||
$error = true;
|
$error = true;
|
||||||
$error_msg = sprintf($lang['DIRECTORY_NOT_WRITEABLE'], $upload_dir) . '<br />';
|
$error_msg = sprintf(trans('messages.DIRECTORY_NOT_WRITEABLE'), $upload_dir) . '<br />';
|
||||||
} else {
|
} else {
|
||||||
@fclose($fp);
|
@fclose($fp);
|
||||||
@unlink($upload_dir . '/0_000000.000');
|
@unlink($upload_dir . '/0_000000.000');
|
||||||
|
@ -371,7 +371,7 @@ if ($check_image_cat) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['TEST_SETTINGS_SUCCESSFUL'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_attachments.php?mode=cats">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.TEST_SETTINGS_SUCCESSFUL') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_attachments.php?mode=cats">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ if ($submit && $mode == 'quota') {
|
||||||
if (isset($error_msg)) {
|
if (isset($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['QUOTA_LIMIT_EXIST'], $extension_group);
|
$error_msg .= sprintf(trans('messages.QUOTA_LIMIT_EXIST'), $extension_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,7 +460,7 @@ if ($submit && $mode == 'quota') {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['ATTACH_CONFIG_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_attachments.php?mode=quota">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.ATTACH_CONFIG_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_attachments.php?mode=quota">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ require INC_DIR . '/functions_selects.php';
|
||||||
$mode = $_GET['mode'] ?? '';
|
$mode = $_GET['mode'] ?? '';
|
||||||
|
|
||||||
$return_links = array(
|
$return_links = array(
|
||||||
'index' => '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'),
|
'index' => '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'),
|
||||||
'config' => '<br /><br />' . sprintf($lang['CLICK_RETURN_CONFIG'], '<a href="admin_board.php?mode=config">', '</a>'),
|
'config' => '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_CONFIG'), '<a href="admin_board.php?mode=config">', '</a>'),
|
||||||
'config_mods' => '<br /><br />' . sprintf($lang['CLICK_RETURN_CONFIG_MODS'], '<a href="admin_board.php?mode=config_mods">', '</a>')
|
'config_mods' => '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_CONFIG_MODS'), '<a href="admin_board.php?mode=config_mods">', '</a>')
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +50,7 @@ if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
bb_die($lang['CONFIG_UPDATED'] . $return_links[$mode] . $return_links['index']);
|
bb_die(trans('messages.CONFIG_UPDATED') . $return_links[$mode] . $return_links['index']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,6 @@ switch ($mode) {
|
||||||
'POSTS_PER_PAGE' => $new['posts_per_page'],
|
'POSTS_PER_PAGE' => $new['posts_per_page'],
|
||||||
'HOT_TOPIC' => $new['hot_threshold'],
|
'HOT_TOPIC' => $new['hot_threshold'],
|
||||||
'DEFAULT_DATEFORMAT' => $new['default_dateformat'],
|
'DEFAULT_DATEFORMAT' => $new['default_dateformat'],
|
||||||
'LANG_SELECT' => language_select($new['default_lang'], 'default_lang'),
|
|
||||||
'TIMEZONE_SELECT' => tz_select($new['board_timezone'], 'board_timezone'),
|
'TIMEZONE_SELECT' => tz_select($new['board_timezone'], 'board_timezone'),
|
||||||
'MAX_LOGIN_ATTEMPTS' => $new['max_login_attempts'],
|
'MAX_LOGIN_ATTEMPTS' => $new['max_login_attempts'],
|
||||||
'LOGIN_RESET_TIME' => $new['login_reset_time'],
|
'LOGIN_RESET_TIME' => $new['login_reset_time'],
|
||||||
|
|
|
@ -87,7 +87,7 @@ if ($submit && $confirm) {
|
||||||
|
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
|
|
||||||
bb_die($lang['CONFIG_UPD'] . '<br /><br />' . sprintf($lang['RETURN_CONFIG'], '<a href="admin_bt_forum_cfg.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.CONFIG_UPD') . '<br /><br />' . sprintf(trans('messages.RETURN_CONFIG'), '<a href="admin_bt_forum_cfg.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set template vars
|
// Set template vars
|
||||||
|
@ -136,9 +136,9 @@ foreach ($db_fields_bool as $field_name => $field_def_val) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_BT_SHOW_PEERS_MODE_COUNT' => ($cfg['bt_show_peers_mode'] == SHOW_PEERS_COUNT) ? '<u>' . $lang['BT_SHOW_PEERS_MODE_COUNT'] . '</u>' : $lang['BT_SHOW_PEERS_MODE_COUNT'],
|
'L_BT_SHOW_PEERS_MODE_COUNT' => ($cfg['bt_show_peers_mode'] == SHOW_PEERS_COUNT) ? '<u>' . trans('messages.BT_SHOW_PEERS_MODE_COUNT') . '</u>' : trans('messages.BT_SHOW_PEERS_MODE_COUNT'),
|
||||||
'L_BT_SHOW_PEERS_MODE_NAMES' => ($cfg['bt_show_peers_mode'] == SHOW_PEERS_NAMES) ? '<u>' . $lang['BT_SHOW_PEERS_MODE_NAMES'] . '</u>' : $lang['BT_SHOW_PEERS_MODE_NAMES'],
|
'L_BT_SHOW_PEERS_MODE_NAMES' => ($cfg['bt_show_peers_mode'] == SHOW_PEERS_NAMES) ? '<u>' . trans('messages.BT_SHOW_PEERS_MODE_NAMES') . '</u>' : trans('messages.BT_SHOW_PEERS_MODE_NAMES'),
|
||||||
'L_BT_SHOW_PEERS_MODE_FULL' => ($cfg['bt_show_peers_mode'] == SHOW_PEERS_FULL) ? '<u>' . $lang['BT_SHOW_PEERS_MODE_FULL'] . '</u>' : $lang['BT_SHOW_PEERS_MODE_FULL'],
|
'L_BT_SHOW_PEERS_MODE_FULL' => ($cfg['bt_show_peers_mode'] == SHOW_PEERS_FULL) ? '<u>' . trans('messages.BT_SHOW_PEERS_MODE_FULL') . '</u>' : trans('messages.BT_SHOW_PEERS_MODE_FULL'),
|
||||||
|
|
||||||
'BT_SHOW_PEERS_MODE_COUNT_VAL' => SHOW_PEERS_COUNT,
|
'BT_SHOW_PEERS_MODE_COUNT_VAL' => SHOW_PEERS_COUNT,
|
||||||
'BT_SHOW_PEERS_MODE_NAMES_VAL' => SHOW_PEERS_NAMES,
|
'BT_SHOW_PEERS_MODE_NAMES_VAL' => SHOW_PEERS_NAMES,
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!empty($setmodules)) {
|
||||||
require __DIR__ . '/pagestart.php';
|
require __DIR__ . '/pagestart.php';
|
||||||
|
|
||||||
if (!IS_SUPER_ADMIN) {
|
if (!IS_SUPER_ADMIN) {
|
||||||
bb_die($lang['NOT_ADMIN']);
|
bb_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
require INC_DIR . '/functions_admin_torrent.php';
|
require INC_DIR . '/functions_admin_torrent.php';
|
||||||
|
|
|
@ -30,7 +30,7 @@ if ($mode == 'run' && !$job_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_SUPER_ADMIN) {
|
if (!IS_SUPER_ADMIN) {
|
||||||
bb_die($lang['NOT_ADMIN']);
|
bb_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
require INC_DIR . '/functions_admin_torrent.php';
|
require INC_DIR . '/functions_admin_torrent.php';
|
||||||
|
@ -64,10 +64,10 @@ switch ($mode) {
|
||||||
'ROW_CLASS' => !($i % 2) ? 'row2' : 'row1',
|
'ROW_CLASS' => !($i % 2) ? 'row2' : 'row1',
|
||||||
'JOB_ID' => $i + 1,
|
'JOB_ID' => $i + 1,
|
||||||
'CRON_ID' => $row['cron_id'],
|
'CRON_ID' => $row['cron_id'],
|
||||||
'CRON_ACTIVE' => $row['cron_active'] ? '<img src="../styles/images/icon_run.gif" alt="' . $lang['YES'] . '" />' : '<img src="../styles/images/icon_delete.gif" alt="' . $lang['NO'] . '" />',
|
'CRON_ACTIVE' => $row['cron_active'] ? '<img src="../styles/images/icon_run.gif" alt="' . trans('messages.YES') . '" />' : '<img src="../styles/images/icon_delete.gif" alt="' . trans('messages.NO') . '" />',
|
||||||
'CRON_TITLE' => $row['cron_title'],
|
'CRON_TITLE' => $row['cron_title'],
|
||||||
'CRON_SCRIPT' => $row['cron_script'],
|
'CRON_SCRIPT' => $row['cron_script'],
|
||||||
'SCHEDULE' => $row['schedule'] ? $lang['SCHEDULE'][$row['schedule']] : '<b class="leech">' . $lang['NOSELECT'] . '</b>',
|
'SCHEDULE' => $row['schedule'] ? trans('messages.SCHEDULE.' . $row['schedule']) : '<b class="leech">' . trans('messages.NOSELECT') . '</b>',
|
||||||
'RUN_DAY' => $row['run_day'],
|
'RUN_DAY' => $row['run_day'],
|
||||||
'LAST_RUN' => $row['last_run'],
|
'LAST_RUN' => $row['last_run'],
|
||||||
'NEXT_RUN' => $row['next_run'],
|
'NEXT_RUN' => $row['next_run'],
|
||||||
|
@ -110,7 +110,7 @@ switch ($mode) {
|
||||||
'CRON_ACTIVE' => $row['cron_active'],
|
'CRON_ACTIVE' => $row['cron_active'],
|
||||||
'CRON_TITLE' => $row['cron_title'],
|
'CRON_TITLE' => $row['cron_title'],
|
||||||
'CRON_SCRIPT' => $row['cron_script'],
|
'CRON_SCRIPT' => $row['cron_script'],
|
||||||
'SCHEDULE' => $row['schedule'] ? $lang['SCHEDULE'][$row['schedule']] : '',
|
'SCHEDULE' => $row['schedule'] ? trans('messages.SCHEDULE.' . $row['schedule']) : '',
|
||||||
'RUN_DAY' => $row['run_day'],
|
'RUN_DAY' => $row['run_day'],
|
||||||
'RUN_TIME' => $row['run_time'],
|
'RUN_TIME' => $row['run_time'],
|
||||||
'RUN_ORDER' => $row['run_order'],
|
'RUN_ORDER' => $row['run_order'],
|
||||||
|
@ -125,13 +125,13 @@ switch ($mode) {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$run_day = array($lang['DELTA_TIME']['INTERVALS']['mday'][0] => 0);
|
$run_day = [trans('messages.DELTA_TIME.INTERVALS.mday.0') => 0];
|
||||||
for ($i = 1; $i <= 28; $i++) {
|
for ($i = 1; $i <= 28; $i++) {
|
||||||
$run_day[$i] = $i;
|
$run_day[$i] = $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
$schedule = array($lang['SCHEDULE']['select'] => 0);
|
$schedule = [trans('messages.SCHEDULE.select') => 0];
|
||||||
foreach ($lang['SCHEDULE'] as $type => $key) {
|
foreach (trans('messages.SCHEDULE') as $type => $key) {
|
||||||
$schedule[$key] = $type;
|
$schedule[$key] = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,18 +141,18 @@ switch ($mode) {
|
||||||
'S_MODE' => 'edit',
|
'S_MODE' => 'edit',
|
||||||
'SCHEDULE' => build_select('schedule', $schedule, $row['schedule']),
|
'SCHEDULE' => build_select('schedule', $schedule, $row['schedule']),
|
||||||
'RUN_DAY' => build_select('run_day', $run_day, $row['run_day']),
|
'RUN_DAY' => build_select('run_day', $run_day, $row['run_day']),
|
||||||
'L_CRON_EDIT_HEAD' => $lang['CRON_EDIT_HEAD_EDIT'],
|
'L_CRON_EDIT_HEAD' => trans('messages.CRON_EDIT_HEAD_EDIT'),
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'add':
|
case 'add':
|
||||||
$run_day = array($lang['DELTA_TIME']['INTERVALS']['mday'][0] => 0);
|
$run_day = [trans('messages.DELTA_TIME.INTERVALS.mday.0') => 0];
|
||||||
for ($i = 1; $i <= 28; $i++) {
|
for ($i = 1; $i <= 28; $i++) {
|
||||||
$run_day[$i] = $i;
|
$run_day[$i] = $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
$schedule = array();
|
$schedule = array();
|
||||||
foreach ($lang['SCHEDULE'] as $type => $key) {
|
foreach (trans('messages.SCHEDULE') as $type => $key) {
|
||||||
$schedule[$key] = $type;
|
$schedule[$key] = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ switch ($mode) {
|
||||||
|
|
||||||
case 'delete':
|
case 'delete':
|
||||||
delete_jobs($job_id);
|
delete_jobs($job_id);
|
||||||
bb_die($lang['JOB_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_JOBS'], '<a href="admin_cron.php?mode=list">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.JOB_REMOVED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_JOBS'), '<a href="admin_cron.php?mode=list">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,20 +21,20 @@ if (isset($_POST['add_name'])) {
|
||||||
$disallowed_user = isset($_POST['disallowed_user']) ? trim($_POST['disallowed_user']) : trim($_GET['disallowed_user']);
|
$disallowed_user = isset($_POST['disallowed_user']) ? trim($_POST['disallowed_user']) : trim($_GET['disallowed_user']);
|
||||||
|
|
||||||
if ($disallowed_user == '') {
|
if ($disallowed_user == '') {
|
||||||
bb_die($lang['FIELDS_EMPTY']);
|
bb_die(trans('messages.FIELDS_EMPTY'));
|
||||||
}
|
}
|
||||||
if (!validate_username($disallowed_user)) {
|
if (!validate_username($disallowed_user)) {
|
||||||
$message = $lang['DISALLOWED_ALREADY'];
|
$message = trans('messages.DISALLOWED_ALREADY');
|
||||||
} else {
|
} else {
|
||||||
$sql = 'INSERT INTO ' . BB_DISALLOW . " (disallow_username) VALUES('" . OLD_DB()->escape($disallowed_user) . "')";
|
$sql = 'INSERT INTO ' . BB_DISALLOW . " (disallow_username) VALUES('" . OLD_DB()->escape($disallowed_user) . "')";
|
||||||
$result = OLD_DB()->sql_query($sql);
|
$result = OLD_DB()->sql_query($sql);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
bb_die('Could not add disallowed user');
|
bb_die('Could not add disallowed user');
|
||||||
}
|
}
|
||||||
$message = $lang['DISALLOW_SUCCESSFUL'];
|
$message = trans('messages.DISALLOW_SUCCESSFUL');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message .= '<br /><br />' . sprintf($lang['CLICK_RETURN_DISALLOWADMIN'], '<a href="admin_disallow.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_DISALLOWADMIN'), '<a href="admin_disallow.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} elseif (isset($_POST['delete_name'])) {
|
} elseif (isset($_POST['delete_name'])) {
|
||||||
|
@ -46,7 +46,7 @@ if (isset($_POST['add_name'])) {
|
||||||
bb_die('Could not removed disallowed user');
|
bb_die('Could not removed disallowed user');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message .= $lang['DISALLOWED_DELETED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_DISALLOWADMIN'], '<a href="admin_disallow.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= trans('messages.DISALLOWED_DELETED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_DISALLOWADMIN'), '<a href="admin_disallow.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ $disallowed = OLD_DB()->sql_fetchrowset($result);
|
||||||
$disallow_select = '<select name="disallowed_id">';
|
$disallow_select = '<select name="disallowed_id">';
|
||||||
|
|
||||||
if (count($disallowed) <= 0) {
|
if (count($disallowed) <= 0) {
|
||||||
$disallow_select .= '<option value="">' . $lang['NO_DISALLOWED'] . '</option>';
|
$disallow_select .= '<option value="">' . trans('messages.NO_DISALLOWED') . '</option>';
|
||||||
} else {
|
} else {
|
||||||
for ($i = 0, $iMax = count($disallowed); $i < $iMax; $i++) {
|
for ($i = 0, $iMax = count($disallowed); $i < $iMax; $i++) {
|
||||||
$disallow_select .= '<option value="' . $disallowed[$i]['disallow_id'] . '">' . $disallowed[$i]['disallow_username'] . '</option>';
|
$disallow_select .= '<option value="' . $disallowed[$i]['disallow_id'] . '">' . $disallowed[$i]['disallow_username'] . '</option>';
|
||||||
|
|
|
@ -36,7 +36,7 @@ $types_download = array(INLINE_LINK, PHYSICAL_LINK);
|
||||||
$modes_download = array('inline', 'physical');
|
$modes_download = array('inline', 'physical');
|
||||||
|
|
||||||
$types_category = array(IMAGE_CAT);
|
$types_category = array(IMAGE_CAT);
|
||||||
$modes_category = array($lang['CATEGORY_IMAGES']);
|
$modes_category = array(trans('messages.CATEGORY_IMAGES'));
|
||||||
|
|
||||||
$size = get_var('size', '');
|
$size = get_var('size', '');
|
||||||
$mode = get_var('mode', '');
|
$mode = get_var('mode', '');
|
||||||
|
@ -147,7 +147,7 @@ if ($submit && $mode == 'extensions') {
|
||||||
if (isset($error_msg)) {
|
if (isset($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['EXTENSION_EXIST'], strtolower(trim($extension)));
|
$error_msg .= sprintf(trans('messages.EXTENSION_EXIST'), strtolower(trim($extension)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ if ($submit && $mode == 'extensions') {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['ATTACH_CONFIG_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_extensions.php?mode=extensions">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.ATTACH_CONFIG_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_extensions.php?mode=extensions">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ if ($submit && $mode == 'groups') {
|
||||||
if (isset($error_msg)) {
|
if (isset($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['EXTENSION_GROUP_EXIST'], $extension_group);
|
$error_msg .= sprintf(trans('messages.EXTENSION_GROUP_EXIST'), $extension_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,7 @@ if ($submit && $mode == 'groups') {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
bb_die($lang['ATTACH_CONFIG_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_ATTACH_CONFIG'], '<a href="admin_extensions.php?mode=groups">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.ATTACH_CONFIG_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ATTACH_CONFIG'), '<a href="admin_extensions.php?mode=groups">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -564,7 +564,7 @@ if ($e_mode == 'perm' && $group) {
|
||||||
|
|
||||||
if ($allowed_forums == '') {
|
if ($allowed_forums == '') {
|
||||||
$forum_perm[0]['forum_id'] = 0;
|
$forum_perm[0]['forum_id'] = 0;
|
||||||
$forum_perm[0]['forum_name'] = $lang['PERM_ALL_FORUMS'];
|
$forum_perm[0]['forum_name'] = trans('messages.PERM_ALL_FORUMS');
|
||||||
} else {
|
} else {
|
||||||
$forum_p = array();
|
$forum_p = array();
|
||||||
$act_id = 0;
|
$act_id = 0;
|
||||||
|
@ -590,11 +590,11 @@ if ($e_mode == 'perm' && $group) {
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'TPL_ATTACH_EXTENSION_GROUPS_PERMISSIONS' => true,
|
'TPL_ATTACH_EXTENSION_GROUPS_PERMISSIONS' => true,
|
||||||
'L_GROUP_PERMISSIONS_TITLE' => sprintf($lang['GROUP_PERMISSIONS_TITLE_ADMIN'], trim($group_name)),
|
'L_GROUP_PERMISSIONS_TITLE' => sprintf(trans('messages.GROUP_PERMISSIONS_TITLE_ADMIN'), trim($group_name)),
|
||||||
'A_PERM_ACTION' => "admin_extensions.php?mode=groups&e_mode=perm&e_group=$group",
|
'A_PERM_ACTION' => "admin_extensions.php?mode=groups&e_mode=perm&e_group=$group",
|
||||||
));
|
));
|
||||||
|
|
||||||
$forum_option_values = array(0 => $lang['PERM_ALL_FORUMS']);
|
$forum_option_values = array(0 => trans('messages.PERM_ALL_FORUMS'));
|
||||||
|
|
||||||
$sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS;
|
$sql = 'SELECT forum_id, forum_name FROM ' . BB_FORUMS;
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ if ($e_mode == 'perm' && $group) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($empty_perm_forums) > 0) {
|
if (count($empty_perm_forums) > 0) {
|
||||||
$template->assign_vars(array('ERROR_MESSAGE' => $lang['NOTE_ADMIN_EMPTY_GROUP_PERMISSIONS'] . $message));
|
$template->assign_vars(array('ERROR_MESSAGE' => trans('messages.NOTE_ADMIN_EMPTY_GROUP_PERMISSIONS') . $message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ if (isset($_REQUEST['submit'])) {
|
||||||
bb_die('Forum not selected');
|
bb_die('Forum not selected');
|
||||||
}
|
}
|
||||||
if (!$var =& $_REQUEST['prunedays'] or !$prunedays = abs((int)$var)) {
|
if (!$var =& $_REQUEST['prunedays'] or !$prunedays = abs((int)$var)) {
|
||||||
bb_die($lang['NOT_DAYS']);
|
bb_die(trans('messages.NOT_DAYS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$prunetime = TIMENOW - 86400 * $prunedays;
|
$prunetime = TIMENOW - 86400 * $prunedays;
|
||||||
|
@ -45,10 +45,10 @@ if (isset($_REQUEST['submit'])) {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
if (!$prune_performed) {
|
if (!$prune_performed) {
|
||||||
bb_die($lang['NONE_SELECTED']);
|
bb_die(trans('messages.NONE_SELECTED'));
|
||||||
}
|
}
|
||||||
if (!$pruned_total) {
|
if (!$pruned_total) {
|
||||||
bb_die($lang['NO_SEARCH_MATCH']);
|
bb_die(trans('messages.NO_SEARCH_MATCH'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,18 +41,18 @@ $simple_auth_ary = [
|
||||||
];
|
];
|
||||||
|
|
||||||
$simple_auth_types = [
|
$simple_auth_types = [
|
||||||
$lang['PUBLIC'],
|
trans('messages.PUBLIC'),
|
||||||
$lang['REGISTERED'],
|
trans('messages.REGISTERED'),
|
||||||
$lang['REGISTERED'] . ' [' . $lang['HIDDEN'] . ']',
|
trans('messages.REGISTERED') . ' [' . trans('messages.HIDDEN') . ']',
|
||||||
$lang['PRIVATE'],
|
trans('messages.PRIVATE'),
|
||||||
$lang['PRIVATE'] . ' [' . $lang['HIDDEN'] . ']',
|
trans('messages.PRIVATE') . ' [' . trans('messages.HIDDEN') . ']',
|
||||||
$lang['MODERATORS'],
|
trans('messages.MODERATORS'),
|
||||||
$lang['MODERATORS'] . ' [' . $lang['HIDDEN'] . ']',
|
trans('messages.MODERATORS') . ' [' . trans('messages.HIDDEN') . ']',
|
||||||
];
|
];
|
||||||
|
|
||||||
$field_names = [];
|
$field_names = [];
|
||||||
foreach ($forum_auth_fields as $auth_type) {
|
foreach ($forum_auth_fields as $auth_type) {
|
||||||
$field_names[$auth_type] = $lang[strtoupper($auth_type)];
|
$field_names[$auth_type] = trans('messages.' . strtoupper($auth_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
$forum_auth_levels = ['ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN'];
|
$forum_auth_levels = ['ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN'];
|
||||||
|
@ -116,7 +116,7 @@ if (isset($_POST['submit'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="' . 'admin_forumauth.php' . '">', '</a>'));
|
bb_die(trans('messages.FORUM_AUTH_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_FORUMAUTH'), '<a href="' . 'admin_forumauth.php' . '">', '</a>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,7 +172,7 @@ if (empty($forum_id)) {
|
||||||
$simple_auth .= '</select>';
|
$simple_auth .= '</select>';
|
||||||
|
|
||||||
$template->assign_block_vars('forum_auth', array(
|
$template->assign_block_vars('forum_auth', array(
|
||||||
'CELL_TITLE' => $lang['SIMPLE_MODE'],
|
'CELL_TITLE' => trans('messages.SIMPLE_MODE'),
|
||||||
'S_AUTH_LEVELS_SELECT' => $simple_auth,
|
'S_AUTH_LEVELS_SELECT' => $simple_auth,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ if (empty($forum_id)) {
|
||||||
|
|
||||||
for ($k = 0, $kMax = count($forum_auth_levels); $k < $kMax; $k++) {
|
for ($k = 0, $kMax = count($forum_auth_levels); $k < $kMax; $k++) {
|
||||||
$selected = ($forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k]) ? ' selected="selected"' : '';
|
$selected = ($forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k]) ? ' selected="selected"' : '';
|
||||||
$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . $lang['FORUM_' . strtoupper($forum_auth_levels[$k])] . '</OPTION>';
|
$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . trans('messages.FORUM_' . strtoupper($forum_auth_levels[$k])) . '</option>';
|
||||||
}
|
}
|
||||||
$custom_auth[$j] .= '</select> ';
|
$custom_auth[$j] .= '</select> ';
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ if (empty($forum_id)) {
|
||||||
|
|
||||||
$adv_mode = empty($adv) ? '1' : '0';
|
$adv_mode = empty($adv) ? '1' : '0';
|
||||||
$switch_mode = "admin_forumauth.php?f=$forum_id&adv=$adv_mode";
|
$switch_mode = "admin_forumauth.php?f=$forum_id&adv=$adv_mode";
|
||||||
$switch_mode_text = empty($adv) ? $lang['ADVANCED_MODE'] : $lang['SIMPLE_MODE'];
|
$switch_mode_text = empty($adv) ? trans('messages.ADVANCED_MODE') : trans('messages.SIMPLE_MODE');
|
||||||
$u_switch_mode = '<a href="' . $switch_mode . '">' . $switch_mode_text . '</a>';
|
$u_switch_mode = '<a href="' . $switch_mode . '">' . $switch_mode_text . '</a>';
|
||||||
|
|
||||||
$s_hidden_fields = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';
|
$s_hidden_fields = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';
|
||||||
|
|
|
@ -26,13 +26,13 @@ $simple_auth_ary = [
|
||||||
];
|
];
|
||||||
|
|
||||||
$simple_auth_types = [
|
$simple_auth_types = [
|
||||||
$lang['PUBLIC'],
|
trans('messages.PUBLIC'),
|
||||||
$lang['REGISTERED'],
|
trans('messages.REGISTERED'),
|
||||||
$lang['REGISTERED'] . ' [' . $lang['HIDDEN'] . ']',
|
trans('messages.REGISTERED') . ' [' . trans('messages.HIDDEN') . ']',
|
||||||
$lang['PRIVATE'],
|
trans('messages.PRIVATE'),
|
||||||
$lang['PRIVATE'] . ' [' . $lang['HIDDEN'] . ']',
|
trans('messages.PRIVATE') . ' [' . trans('messages.HIDDEN') . ']',
|
||||||
$lang['MODERATORS'],
|
trans('messages.MODERATORS'),
|
||||||
$lang['MODERATORS'] . ' [' . $lang['HIDDEN'] . ']',
|
trans('messages.MODERATORS') . ' [' . trans('messages.HIDDEN') . ']',
|
||||||
];
|
];
|
||||||
|
|
||||||
$forum_auth_fields = [
|
$forum_auth_fields = [
|
||||||
|
@ -52,7 +52,7 @@ $forum_auth_fields = [
|
||||||
|
|
||||||
$field_names = [];
|
$field_names = [];
|
||||||
foreach ($forum_auth_fields as $auth_type) {
|
foreach ($forum_auth_fields as $auth_type) {
|
||||||
$field_names[$auth_type] = $lang[strtoupper($auth_type)];
|
$field_names[$auth_type] = trans('messages.' . strtoupper($auth_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
$forum_auth_levels = ['ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN'];
|
$forum_auth_levels = ['ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN'];
|
||||||
|
@ -146,7 +146,7 @@ if (isset($_POST['submit'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
bb_die($lang['FORUM_AUTH_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMAUTH'], '<a href="admin_forumauth_list.php">', '</a>'));
|
bb_die(trans('messages.FORUM_AUTH_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_FORUMAUTH'), '<a href="admin_forumauth_list.php">', '</a>'));
|
||||||
} // End of submit
|
} // End of submit
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -218,8 +218,8 @@ if (empty($forum_id) && empty($cat_id)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$template->assign_block_vars('cat_row.forum_row.forum_auth_data', array(
|
$template->assign_block_vars('cat_row.forum_row.forum_auth_data', array(
|
||||||
'CELL_VALUE' => $lang['FORUM_' . $item_auth_level],
|
'CELL_VALUE' => trans('messages.FORUM_' . $item_auth_level),
|
||||||
'AUTH_EXPLAIN' => sprintf($lang[strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $forum_auth_fields[$k])], $lang[strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $item_auth_level)]))
|
'AUTH_EXPLAIN' => sprintf(trans('messages.' . strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $forum_auth_fields[$k])), trans('messages.' . strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $item_auth_level))))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,8 +277,8 @@ if (empty($forum_id) && empty($cat_id)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$template->assign_block_vars('cat_row.forum_row.forum_auth_data', array(
|
$template->assign_block_vars('cat_row.forum_row.forum_auth_data', array(
|
||||||
'CELL_VALUE' => $lang['FORUM_' . $item_auth_level],
|
'CELL_VALUE' => trans('messages.FORUM_' . $item_auth_level),
|
||||||
'AUTH_EXPLAIN' => sprintf($lang[strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $forum_auth_fields[$k])], $lang[strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $item_auth_level)]))
|
'AUTH_EXPLAIN' => sprintf(trans('messages.' . strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $forum_auth_fields[$k])), trans('messages.' . strtoupper('FORUM_AUTH_LIST_EXPLAIN_' . $item_auth_level))))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,7 @@ if (empty($forum_id) && empty($cat_id)) {
|
||||||
|
|
||||||
for ($k = 0, $kMax = count($forum_auth_levels); $k < $kMax; $k++) {
|
for ($k = 0, $kMax = count($forum_auth_levels); $k < $kMax; $k++) {
|
||||||
$selected = (!empty($forum_rows) && $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k]) ? ' selected="selected"' : '';
|
$selected = (!empty($forum_rows) && $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k]) ? ' selected="selected"' : '';
|
||||||
$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . $lang['FORUM_' . $forum_auth_levels[$k]] . '</option>';
|
$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . trans('messages.FORUM_' . $forum_auth_levels[$k]) . '</option>';
|
||||||
}
|
}
|
||||||
$custom_auth[$j] .= '</select>';
|
$custom_auth[$j] .= '</select>';
|
||||||
|
|
||||||
|
|
|
@ -65,9 +65,9 @@ if ($mode) {
|
||||||
if ($mode == 'editforum') {
|
if ($mode == 'editforum') {
|
||||||
// $newmode determines if we are going to INSERT or UPDATE after posting?
|
// $newmode determines if we are going to INSERT or UPDATE after posting?
|
||||||
|
|
||||||
$l_title = $lang['EDIT_FORUM'];
|
$l_title = trans('messages.EDIT_FORUM');
|
||||||
$newmode = 'modforum';
|
$newmode = 'modforum';
|
||||||
$buttonvalue = $lang['UPDATE'];
|
$buttonvalue = trans('messages.UPDATE');
|
||||||
|
|
||||||
$forum_id = (int)$_GET[POST_FORUM_URL];
|
$forum_id = (int)$_GET[POST_FORUM_URL];
|
||||||
|
|
||||||
|
@ -87,9 +87,9 @@ if ($mode) {
|
||||||
$allow_porno_topic = $row['allow_porno_topic'];
|
$allow_porno_topic = $row['allow_porno_topic'];
|
||||||
$self_moderated = $row['self_moderated'];
|
$self_moderated = $row['self_moderated'];
|
||||||
} else {
|
} else {
|
||||||
$l_title = $lang['CREATE_FORUM'];
|
$l_title = trans('messages.CREATE_FORUM');
|
||||||
$newmode = 'createforum';
|
$newmode = 'createforum';
|
||||||
$buttonvalue = $lang['CREATE_FORUM'];
|
$buttonvalue = trans('messages.CREATE_FORUM');
|
||||||
|
|
||||||
$forumdesc = '';
|
$forumdesc = '';
|
||||||
$forumstatus = FORUM_UNLOCKED;
|
$forumstatus = FORUM_UNLOCKED;
|
||||||
|
@ -119,15 +119,15 @@ if ($mode) {
|
||||||
|
|
||||||
$forumstatus == FORUM_LOCKED ? $forumlocked = 'selected="selected"' : $forumunlocked = 'selected="selected"';
|
$forumstatus == FORUM_LOCKED ? $forumlocked = 'selected="selected"' : $forumunlocked = 'selected="selected"';
|
||||||
|
|
||||||
$statuslist = '<option value="' . FORUM_UNLOCKED . '" ' . $forumunlocked . '>' . $lang['STATUS_UNLOCKED'] . '</option>\n';
|
$statuslist = '<option value="' . FORUM_UNLOCKED . '" ' . $forumunlocked . '>' . trans('messages.STATUS_UNLOCKED') . '</option>\n';
|
||||||
$statuslist .= '<option value="' . FORUM_LOCKED . '" ' . $forumlocked . '>' . $lang['STATUS_LOCKED'] . '</option>\n';
|
$statuslist .= '<option value="' . FORUM_LOCKED . '" ' . $forumlocked . '>' . trans('messages.STATUS_LOCKED') . '</option>\n';
|
||||||
|
|
||||||
$forum_display_sort_list = get_forum_display_sort_option($forum_display_sort, 'list', 'sort');
|
$forum_display_sort_list = get_forum_display_sort_option($forum_display_sort, 'list', 'sort');
|
||||||
$forum_display_order_list = get_forum_display_sort_option($forum_display_order, 'list', 'order');
|
$forum_display_order_list = get_forum_display_sort_option($forum_display_order, 'list', 'order');
|
||||||
|
|
||||||
$s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
|
$s_hidden_fields = '<input type="hidden" name="mode" value="' . $newmode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
|
||||||
|
|
||||||
$s_parent = '<option value="-1"> ' . $lang['SF_NO_PARENT'] . '</option>\n';
|
$s_parent = '<option value="-1"> ' . trans('messages.SF_NO_PARENT') . '</option>\n';
|
||||||
$sel_forum = ($forum_parent && !isset($_REQUEST['forum_parent'])) ? $forum_id : $forum_parent;
|
$sel_forum = ($forum_parent && !isset($_REQUEST['forum_parent'])) ? $forum_id : $forum_parent;
|
||||||
$s_parent .= sf_get_list('forum', $forum_id, $sel_forum);
|
$s_parent .= sf_get_list('forum', $forum_id, $sel_forum);
|
||||||
|
|
||||||
|
@ -146,10 +146,10 @@ if ($mode) {
|
||||||
'S_PARENT_FORUM' => $s_parent,
|
'S_PARENT_FORUM' => $s_parent,
|
||||||
'CAT_LIST_CLASS' => $forum_parent ? 'hidden' : '',
|
'CAT_LIST_CLASS' => $forum_parent ? 'hidden' : '',
|
||||||
'SHOW_ON_INDEX_CLASS' => (!$forum_parent) ? 'hidden' : '',
|
'SHOW_ON_INDEX_CLASS' => (!$forum_parent) ? 'hidden' : '',
|
||||||
'TPL_SELECT' => get_select('forum_tpl', $forum_tpl_id, 'html', $lang['TEMPLATE_DISABLE']),
|
'TPL_SELECT' => get_select('forum_tpl', $forum_tpl_id, 'html', trans('messages.TEMPLATE_DISABLE')),
|
||||||
'ALLOW_REG_TRACKER' => build_select('allow_reg_tracker', array($lang['DISALLOWED'] => 0, $lang['ALLOWED'] => 1), $allow_reg_tracker),
|
'ALLOW_REG_TRACKER' => build_select('allow_reg_tracker', array(trans('messages.DISALLOWED') => 0, trans('messages.ALLOWED') => 1), $allow_reg_tracker),
|
||||||
'ALLOW_PORNO_TOPIC' => build_select('allow_porno_topic', array($lang['NONE'] => 0, $lang['YES'] => 1), $allow_porno_topic),
|
'ALLOW_PORNO_TOPIC' => build_select('allow_porno_topic', array(trans('messages.NONE') => 0, trans('messages.YES') => 1), $allow_porno_topic),
|
||||||
'SELF_MODERATED' => build_select('self_moderated', array($lang['NONE'] => 0, $lang['YES'] => 1), $self_moderated),
|
'SELF_MODERATED' => build_select('self_moderated', array(trans('messages.NONE') => 0, trans('messages.YES') => 1), $self_moderated),
|
||||||
|
|
||||||
'L_FORUM_TITLE' => $l_title,
|
'L_FORUM_TITLE' => $l_title,
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ if ($mode) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
OLD_CACHE('bb_cache')->rm();
|
OLD_CACHE('bb_cache')->rm();
|
||||||
|
|
||||||
bb_die($lang['FORUMS_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php?c=' . $cat_id . '">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.FORUMS_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php?c=' . $cat_id . '">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -305,9 +305,9 @@ if ($mode) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
OLD_CACHE('bb_cache')->rm();
|
OLD_CACHE('bb_cache')->rm();
|
||||||
|
|
||||||
$message = $lang['FORUMS_UPDATED'] . '<br /><br />';
|
$message = trans('messages.FORUMS_UPDATED') . '<br /><br />';
|
||||||
$message .= $fix ? "$fix<br /><br />" : '';
|
$message .= $fix ? "$fix<br /><br />" : '';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php?c=' . $cat_id . '">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php?c=' . $cat_id . '">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -334,7 +334,7 @@ if ($mode) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
OLD_CACHE('bb_cache')->rm();
|
OLD_CACHE('bb_cache')->rm();
|
||||||
|
|
||||||
bb_die($lang['FORUMS_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.FORUMS_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ if ($mode) {
|
||||||
'TPL_EDIT_CATEGORY' => true,
|
'TPL_EDIT_CATEGORY' => true,
|
||||||
'CAT_TITLE' => htmlCHR($cat_info['cat_title']),
|
'CAT_TITLE' => htmlCHR($cat_info['cat_title']),
|
||||||
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
||||||
'S_SUBMIT_VALUE' => $lang['UPDATE'],
|
'S_SUBMIT_VALUE' => trans('messages.UPDATE'),
|
||||||
'S_FORUM_ACTION' => 'admin_forums.php',
|
'S_FORUM_ACTION' => 'admin_forums.php',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ if ($mode) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
OLD_CACHE('bb_cache')->rm();
|
OLD_CACHE('bb_cache')->rm();
|
||||||
|
|
||||||
bb_die($lang['FORUMS_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.FORUMS_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ if ($mode) {
|
||||||
//
|
//
|
||||||
$forum_id = (int)$_GET['f'];
|
$forum_id = (int)$_GET['f'];
|
||||||
|
|
||||||
$move_to_options = '<option value="-1">' . $lang['DELETE_ALL_POSTS'] . '</option>';
|
$move_to_options = '<option value="-1">' . trans('messages.DELETE_ALL_POSTS') . '</option>';
|
||||||
$move_to_options .= sf_get_list('forum', $forum_id, 0);
|
$move_to_options .= sf_get_list('forum', $forum_id, 0);
|
||||||
|
|
||||||
$foruminfo = get_info('forum', $forum_id);
|
$foruminfo = get_info('forum', $forum_id);
|
||||||
|
@ -412,13 +412,13 @@ if ($mode) {
|
||||||
'TPL_DELETE_FORUM' => true,
|
'TPL_DELETE_FORUM' => true,
|
||||||
|
|
||||||
'WHAT_TO_DELETE' => htmlCHR($foruminfo['forum_name']),
|
'WHAT_TO_DELETE' => htmlCHR($foruminfo['forum_name']),
|
||||||
'DELETE_TITLE' => $lang['FORUM_DELETE'],
|
'DELETE_TITLE' => trans('messages.FORUM_DELETE'),
|
||||||
'CAT_FORUM_NAME' => $lang['FORUM_NAME'],
|
'CAT_FORUM_NAME' => trans('messages.FORUM_NAME'),
|
||||||
|
|
||||||
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
||||||
'S_FORUM_ACTION' => 'admin_forums.php',
|
'S_FORUM_ACTION' => 'admin_forums.php',
|
||||||
'MOVE_TO_OPTIONS' => $move_to_options,
|
'MOVE_TO_OPTIONS' => $move_to_options,
|
||||||
'S_SUBMIT_VALUE' => $lang['MOVE_AND_DELETE'],
|
'S_SUBMIT_VALUE' => trans('messages.MOVE_AND_DELETE'),
|
||||||
));
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -474,7 +474,7 @@ if ($mode) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
OLD_CACHE('bb_cache')->rm();
|
OLD_CACHE('bb_cache')->rm();
|
||||||
|
|
||||||
bb_die($lang['FORUMS_UPDATED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.FORUMS_UPDATED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -488,9 +488,9 @@ if ($mode) {
|
||||||
$row = OLD_DB()->fetch_row('SELECT COUNT(*) AS forums_count FROM ' . BB_FORUMS);
|
$row = OLD_DB()->fetch_row('SELECT COUNT(*) AS forums_count FROM ' . BB_FORUMS);
|
||||||
|
|
||||||
if ($row['forums_count'] > 0) {
|
if ($row['forums_count'] > 0) {
|
||||||
bb_die($lang['MUST_DELETE_FORUMS']);
|
bb_die(trans('messages.MUST_DELETE_FORUMS'));
|
||||||
} else {
|
} else {
|
||||||
$template->assign_var('NOWHERE_TO_MOVE', $lang['NOWHERE_TO_MOVE']);
|
$template->assign_var('NOWHERE_TO_MOVE', trans('messages.NOWHERE_TO_MOVE'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,13 +503,13 @@ if ($mode) {
|
||||||
'TPL_DELETE_FORUM' => true,
|
'TPL_DELETE_FORUM' => true,
|
||||||
|
|
||||||
'WHAT_TO_DELETE' => htmlCHR($catinfo['cat_title']),
|
'WHAT_TO_DELETE' => htmlCHR($catinfo['cat_title']),
|
||||||
'DELETE_TITLE' => $lang['CATEGORY_DELETE'],
|
'DELETE_TITLE' => trans('messages.CATEGORY_DELETE'),
|
||||||
'CAT_FORUM_NAME' => $lang['CATEGORY'],
|
'CAT_FORUM_NAME' => trans('messages.CATEGORY'),
|
||||||
|
|
||||||
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
||||||
'S_FORUM_ACTION' => 'admin_forums.php',
|
'S_FORUM_ACTION' => 'admin_forums.php',
|
||||||
'MOVE_TO_OPTIONS' => get_list('category', $cat_id, 0),
|
'MOVE_TO_OPTIONS' => get_list('category', $cat_id, 0),
|
||||||
'S_SUBMIT_VALUE' => $lang['MOVE_AND_DELETE'],
|
'S_SUBMIT_VALUE' => trans('messages.MOVE_AND_DELETE'),
|
||||||
));
|
));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -540,9 +540,9 @@ if ($mode) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
OLD_CACHE('bb_cache')->rm();
|
OLD_CACHE('bb_cache')->rm();
|
||||||
|
|
||||||
$message = $lang['FORUMS_UPDATED'] . '<br /><br />';
|
$message = trans('messages.FORUMS_UPDATED') . '<br /><br />';
|
||||||
$message .= $fix ? "$fix<br /><br />" : '';
|
$message .= $fix ? "$fix<br /><br />" : '';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -648,7 +648,7 @@ if ($mode) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bb_die($lang['NO_MODE']);
|
bb_die(trans('messages.NO_MODE'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -659,7 +659,7 @@ if (!$mode || $show_main_page) {
|
||||||
'TPL_FORUMS_LIST' => true,
|
'TPL_FORUMS_LIST' => true,
|
||||||
|
|
||||||
'S_FORUM_ACTION' => 'admin_forums.php',
|
'S_FORUM_ACTION' => 'admin_forums.php',
|
||||||
'L_FORUM_TITLE' => $lang['FORUM_ADMIN_MAIN'],
|
'L_FORUM_TITLE' => trans('messages.FORUM_ADMIN_MAIN'),
|
||||||
));
|
));
|
||||||
|
|
||||||
$sql = 'SELECT cat_id, cat_title, cat_order FROM ' . BB_CATEGORIES . ' ORDER BY cat_order';
|
$sql = 'SELECT cat_id, cat_title, cat_order FROM ' . BB_CATEGORIES . ' ORDER BY cat_order';
|
||||||
|
@ -1033,8 +1033,6 @@ function get_orphan_sf()
|
||||||
*/
|
*/
|
||||||
function fix_orphan_sf($orphan_sf_sql = '', $show_mess = false)
|
function fix_orphan_sf($orphan_sf_sql = '', $show_mess = false)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$done_mess = '';
|
$done_mess = '';
|
||||||
|
|
||||||
if (!$orphan_sf_sql) {
|
if (!$orphan_sf_sql) {
|
||||||
|
@ -1054,8 +1052,8 @@ function fix_orphan_sf($orphan_sf_sql = '', $show_mess = false)
|
||||||
|
|
||||||
if ($show_mess) {
|
if ($show_mess) {
|
||||||
$message = $done_mess . '<br /><br />';
|
$message = $done_mess . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_FORUMADMIN'], '<a href="admin_forums.php">', '</a>') . '<br /><br />';
|
$message .= sprintf(trans('messages.CLICK_RETURN_FORUMADMIN'), '<a href="admin_forums.php">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ attachment_quota_settings('group', isset($_POST['group_update']), $mode);
|
||||||
if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
if (!empty($_POST['edit'])) {
|
if (!empty($_POST['edit'])) {
|
||||||
if (!$row = get_group_data($group_id)) {
|
if (!$row = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
$group_info = array(
|
$group_info = array(
|
||||||
'group_name' => $row['group_name'],
|
'group_name' => $row['group_name'],
|
||||||
|
@ -58,7 +58,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
'GROUP_NAME' => stripslashes(htmlspecialchars($group_info['group_name'])),
|
'GROUP_NAME' => stripslashes(htmlspecialchars($group_info['group_name'])),
|
||||||
'GROUP_DESCRIPTION' => stripslashes(htmlspecialchars($group_info['group_description'])),
|
'GROUP_DESCRIPTION' => stripslashes(htmlspecialchars($group_info['group_description'])),
|
||||||
'GROUP_MODERATOR' => replace_quote($group_info['group_mod_name']),
|
'GROUP_MODERATOR' => replace_quote($group_info['group_mod_name']),
|
||||||
'T_GROUP_EDIT_DELETE' => ($mode == 'newgroup') ? $lang['CREATE_NEW_GROUP'] : $lang['EDIT_GROUP'],
|
'T_GROUP_EDIT_DELETE' => ($mode == 'newgroup') ? trans('messages.CREATE_NEW_GROUP') : trans('messages.EDIT_GROUP'),
|
||||||
'U_SEARCH_USER' => BB_ROOT . 'search.php?mode=searchuser',
|
'U_SEARCH_USER' => BB_ROOT . 'search.php?mode=searchuser',
|
||||||
'S_GROUP_OPEN_TYPE' => GROUP_OPEN,
|
'S_GROUP_OPEN_TYPE' => GROUP_OPEN,
|
||||||
'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED,
|
'S_GROUP_CLOSED_TYPE' => GROUP_CLOSED,
|
||||||
|
@ -73,14 +73,14 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
} elseif (!empty($_POST['group_update'])) {
|
} elseif (!empty($_POST['group_update'])) {
|
||||||
if (!empty($_POST['group_delete'])) {
|
if (!empty($_POST['group_delete'])) {
|
||||||
if (!$group_info = get_group_data($group_id)) {
|
if (!$group_info = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
// Delete Group
|
// Delete Group
|
||||||
delete_group($group_id);
|
delete_group($group_id);
|
||||||
|
|
||||||
$message = $lang['DELETED_GROUP'] . '<br /><br />';
|
$message = trans('messages.DELETED_GROUP') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_GROUPSADMIN'], '<a href="admin_groups.php">', '</a>') . '<br /><br />';
|
$message .= sprintf(trans('messages.CLICK_RETURN_GROUPSADMIN'), '<a href="admin_groups.php">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} else {
|
} else {
|
||||||
|
@ -91,14 +91,14 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
$group_moderator = $_POST['username'] ?? '';
|
$group_moderator = $_POST['username'] ?? '';
|
||||||
|
|
||||||
if ($group_name === '') {
|
if ($group_name === '') {
|
||||||
bb_die($lang['NO_GROUP_NAME']);
|
bb_die(trans('messages.NO_GROUP_NAME'));
|
||||||
} elseif ($group_moderator === '') {
|
} elseif ($group_moderator === '') {
|
||||||
bb_die($lang['NO_GROUP_MODERATOR']);
|
bb_die(trans('messages.NO_GROUP_MODERATOR'));
|
||||||
}
|
}
|
||||||
$this_userdata = get_userdata($group_moderator, true);
|
$this_userdata = get_userdata($group_moderator, true);
|
||||||
|
|
||||||
if (!$group_moderator = $this_userdata['user_id']) {
|
if (!$group_moderator = $this_userdata['user_id']) {
|
||||||
bb_die($lang['NO_GROUP_MODERATOR']);
|
bb_die(trans('messages.NO_GROUP_MODERATOR'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
|
@ -112,7 +112,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
|
|
||||||
if ($mode == 'editgroup') {
|
if ($mode == 'editgroup') {
|
||||||
if (!$group_info = get_group_data($group_id)) {
|
if (!$group_info = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($group_info['group_moderator'] != $group_moderator) {
|
if ($group_info['group_moderator'] != $group_moderator) {
|
||||||
|
@ -131,9 +131,9 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
// Update group's data
|
// Update group's data
|
||||||
OLD_DB()->query('UPDATE ' . BB_GROUPS . " SET $sql_args WHERE group_id = $group_id");
|
OLD_DB()->query('UPDATE ' . BB_GROUPS . " SET $sql_args WHERE group_id = $group_id");
|
||||||
|
|
||||||
$message = $lang['UPDATED_GROUP'] . '<br /><br />';
|
$message = trans('messages.UPDATED_GROUP') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_GROUPSADMIN'], '<a href="admin_groups.php">', '</a>') . '<br /><br />';
|
$message .= sprintf(trans('messages.CLICK_RETURN_GROUPSADMIN'), '<a href="admin_groups.php">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} elseif ($mode == 'newgroup') {
|
} elseif ($mode == 'newgroup') {
|
||||||
|
@ -147,13 +147,13 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
||||||
// Create user_group for group's moderator
|
// Create user_group for group's moderator
|
||||||
add_user_into_group($new_group_id, $group_moderator);
|
add_user_into_group($new_group_id, $group_moderator);
|
||||||
|
|
||||||
$message = $lang['ADDED_NEW_GROUP'] . '<br /><br />';
|
$message = trans('messages.ADDED_NEW_GROUP') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_GROUPSADMIN'], '<a href="admin_groups.php">', '</a>') . '<br /><br />';
|
$message .= sprintf(trans('messages.CLICK_RETURN_GROUPSADMIN'), '<a href="admin_groups.php">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_GROUP_ACTION']);
|
bb_die(trans('messages.NO_GROUP_ACTION'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -66,7 +66,7 @@ if (!$mod = $datastore->get('moderators')) {
|
||||||
array_deep($mod['moderators'], 'html_entity_decode');
|
array_deep($mod['moderators'], 'html_entity_decode');
|
||||||
array_deep($mod['admins'], 'html_entity_decode');
|
array_deep($mod['admins'], 'html_entity_decode');
|
||||||
|
|
||||||
$users = array($lang['ACTS_LOG_ALL_ACTIONS'] => $all_users) + array_flip($mod['moderators']) + array_flip($mod['admins']);
|
$users = array(trans('messages.ACTS_LOG_ALL_ACTIONS') => $all_users) + array_flip($mod['moderators']) + array_flip($mod['admins']);
|
||||||
|
|
||||||
unset($mod);
|
unset($mod);
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ if ($log_rowset) {
|
||||||
$datetime_href_s = url_arg($datetime_href_s, $daysback_key, 1);
|
$datetime_href_s = url_arg($datetime_href_s, $daysback_key, 1);
|
||||||
|
|
||||||
$template->assign_block_vars('log', array(
|
$template->assign_block_vars('log', array(
|
||||||
'ACTION_DESC' => $lang['LOG_ACTION']['LOG_TYPE'][$log_type_flip[$row['log_type_id']]],
|
'ACTION_DESC' => trans('messages.LOG_ACTION.LOG_TYPE.' . $log_type_flip[$row['log_type_id']]),
|
||||||
'ACTION_HREF_S' => url_arg($url, $type_key, $row['log_type_id']),
|
'ACTION_HREF_S' => url_arg($url, $type_key, $row['log_type_id']),
|
||||||
|
|
||||||
'USER_ID' => $row['log_user_id'],
|
'USER_ID' => $row['log_user_id'],
|
||||||
|
@ -323,7 +323,7 @@ if ($log_rowset) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select
|
// Select
|
||||||
$log_type_select = array($lang['ACTS_LOG_ALL_ACTIONS'] => $all_types) + $log_action->log_type_select;
|
$log_type_select = array(trans('messages.ACTS_LOG_ALL_ACTIONS') => $all_types) + $log_action->log_type_select;
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'LOG_COLSPAN' => 4,
|
'LOG_COLSPAN' => 4,
|
||||||
|
@ -332,7 +332,7 @@ $template->assign_vars(array(
|
||||||
'DATETIME_VAL' => date('Y-m-d', $datetime_val),
|
'DATETIME_VAL' => date('Y-m-d', $datetime_val),
|
||||||
'DAYSBACK_NAME' => $daysback_key,
|
'DAYSBACK_NAME' => $daysback_key,
|
||||||
'DAYSBACK_VAL' => $daysback_val,
|
'DAYSBACK_VAL' => $daysback_val,
|
||||||
'FIRST_LOG_TIME' => $first_log_time ? date('Y-m-d', $first_log_time) : $lang['ACC_NONE'],
|
'FIRST_LOG_TIME' => $first_log_time ? date('Y-m-d', $first_log_time) : trans('messages.ACC_NONE'),
|
||||||
|
|
||||||
'TITLE_MATCH_MAX' => $title_match_max_len,
|
'TITLE_MATCH_MAX' => $title_match_max_len,
|
||||||
'TITLE_MATCH_NAME' => $title_match_key,
|
'TITLE_MATCH_NAME' => $title_match_key,
|
||||||
|
|
|
@ -24,13 +24,13 @@ $errors = $user_id_sql = [];
|
||||||
|
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
if (!$subject) {
|
if (!$subject) {
|
||||||
$errors[] = $lang['EMPTY_SUBJECT'];
|
$errors[] = trans('messages.EMPTY_SUBJECT');
|
||||||
}
|
}
|
||||||
if (!$message) {
|
if (!$message) {
|
||||||
$errors[] = $lang['EMPTY_MESSAGE'];
|
$errors[] = trans('messages.EMPTY_MESSAGE');
|
||||||
}
|
}
|
||||||
if (!$group_id) {
|
if (!$group_id) {
|
||||||
$errors[] = $lang['GROUP_NOT_EXIST'];
|
$errors[] = trans('messages.GROUP_NOT_EXIST');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$errors) {
|
if (!$errors) {
|
||||||
|
@ -88,7 +88,7 @@ $sql = 'SELECT group_id, group_name
|
||||||
ORDER BY group_name
|
ORDER BY group_name
|
||||||
';
|
';
|
||||||
|
|
||||||
$groups = array('-- ' . $lang['ALL_USERS'] . ' --' => -1);
|
$groups = array('-- ' . trans('messages.ALL_USERS') . ' --' => -1);
|
||||||
foreach (OLD_DB()->fetch_rowset($sql) as $row) {
|
foreach (OLD_DB()->fetch_rowset($sql) as $row) {
|
||||||
$groups[$row['group_name']] = $row['group_id'];
|
$groups[$row['group_name']] = $row['group_id'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ if ($mode != '') {
|
||||||
|
|
||||||
if ($mode == 'edit') {
|
if ($mode == 'edit') {
|
||||||
if (empty($rank_id)) {
|
if (empty($rank_id)) {
|
||||||
bb_die($lang['MUST_SELECT_RANK']);
|
bb_die(trans('messages.MUST_SELECT_RANK'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . BB_RANKS . " WHERE rank_id = $rank_id";
|
$sql = 'SELECT * FROM ' . BB_RANKS . " WHERE rank_id = $rank_id";
|
||||||
|
@ -76,7 +76,7 @@ if ($mode != '') {
|
||||||
$rank_image = isset($_POST['rank_image']) ? trim($_POST['rank_image']) : '';
|
$rank_image = isset($_POST['rank_image']) ? trim($_POST['rank_image']) : '';
|
||||||
|
|
||||||
if ($rank_title == '') {
|
if ($rank_title == '') {
|
||||||
bb_die($lang['MUST_SELECT_RANK']);
|
bb_die(trans('messages.MUST_SELECT_RANK'));
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -91,7 +91,7 @@ if ($mode != '') {
|
||||||
if ($rank_id) {
|
if ($rank_id) {
|
||||||
$sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id";
|
$sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id";
|
||||||
if (!$result = OLD_DB()->sql_query($sql)) {
|
if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
bb_die($lang['NO_UPDATE_RANKS']);
|
bb_die(trans('messages.NO_UPDATE_RANKS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . BB_RANKS . "
|
$sql = 'UPDATE ' . BB_RANKS . "
|
||||||
|
@ -100,19 +100,19 @@ if ($mode != '') {
|
||||||
rank_style = '" . OLD_DB()->escape($rank_style) . "'
|
rank_style = '" . OLD_DB()->escape($rank_style) . "'
|
||||||
WHERE rank_id = $rank_id";
|
WHERE rank_id = $rank_id";
|
||||||
|
|
||||||
$message = $lang['RANK_UPDATED'];
|
$message = trans('messages.RANK_UPDATED');
|
||||||
} else {
|
} else {
|
||||||
$sql = 'INSERT INTO ' . BB_RANKS . " (rank_title, rank_image, rank_style)
|
$sql = 'INSERT INTO ' . BB_RANKS . " (rank_title, rank_image, rank_style)
|
||||||
VALUES ('" . OLD_DB()->escape($rank_title) . "', '" . OLD_DB()->escape($rank_image) . "', '" . OLD_DB()->escape($rank_style) . "')";
|
VALUES ('" . OLD_DB()->escape($rank_title) . "', '" . OLD_DB()->escape($rank_image) . "', '" . OLD_DB()->escape($rank_style) . "')";
|
||||||
|
|
||||||
$message = $lang['RANK_ADDED'];
|
$message = trans('messages.RANK_ADDED');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$result = OLD_DB()->sql_query($sql)) {
|
if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
bb_die('Could not update / insert into ranks table');
|
bb_die('Could not update / insert into ranks table');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message .= '<br /><br />' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '<a href="admin_ranks.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_RANKADMIN'), '<a href="admin_ranks.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
$datastore->update('ranks');
|
$datastore->update('ranks');
|
||||||
|
|
||||||
|
@ -137,14 +137,14 @@ if ($mode != '') {
|
||||||
|
|
||||||
$sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id";
|
$sql = 'UPDATE ' . BB_USERS . " SET user_rank = 0 WHERE user_rank = $rank_id";
|
||||||
if (!$result = OLD_DB()->sql_query($sql)) {
|
if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
bb_die($lang['NO_UPDATE_RANKS']);
|
bb_die(trans('messages.NO_UPDATE_RANKS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$datastore->update('ranks');
|
$datastore->update('ranks');
|
||||||
|
|
||||||
bb_die($lang['RANK_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_RANKADMIN'], '<a href="admin_ranks.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.RANK_REMOVED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_RANKADMIN'), '<a href="admin_ranks.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['MUST_SELECT_RANK']);
|
bb_die(trans('messages.MUST_SELECT_RANK'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bb_die('Invalid mode');
|
bb_die('Invalid mode');
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!empty($setmodules)) {
|
||||||
require __DIR__ . '/pagestart.php';
|
require __DIR__ . '/pagestart.php';
|
||||||
|
|
||||||
if (!IS_SUPER_ADMIN) {
|
if (!IS_SUPER_ADMIN) {
|
||||||
bb_die($lang['NOT_ADMIN']);
|
bb_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
require INC_DIR . '/bbcode.php';
|
require INC_DIR . '/bbcode.php';
|
||||||
|
@ -50,7 +50,7 @@ if (isset($_REQUEST['cancel_button'])) {
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_die(sprintf($lang['REBUILD_SEARCH_ABORTED'], $last_session_data['end_post_id']) . '<br /><br />' . sprintf($lang['CLICK_RETURN_REBUILD_SEARCH'], '<a href="admin_rebuild_search.php">', '</a>'));
|
bb_die(sprintf(trans('messages.REBUILD_SEARCH_ABORTED'), $last_session_data['end_post_id']) . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_REBUILD_SEARCH'), '<a href="admin_rebuild_search.php">', '</a>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// from which post to start processing
|
// from which post to start processing
|
||||||
|
@ -98,13 +98,13 @@ if (isset($_REQUEST['time_limit'])) {
|
||||||
$time_limit = (int)$_REQUEST['time_limit'];
|
$time_limit = (int)$_REQUEST['time_limit'];
|
||||||
} else {
|
} else {
|
||||||
$time_limit = $def_time_limit;
|
$time_limit = $def_time_limit;
|
||||||
$time_limit_explain = $lang['TIME_LIMIT_EXPLAIN'];
|
$time_limit_explain = trans('messages.TIME_LIMIT_EXPLAIN');
|
||||||
|
|
||||||
// check for webserver timeout (IE returns null)
|
// check for webserver timeout (IE returns null)
|
||||||
if (isset($_SERVER['HTTP_KEEP_ALIVE'])) {
|
if (isset($_SERVER['HTTP_KEEP_ALIVE'])) {
|
||||||
// get webserver timeout
|
// get webserver timeout
|
||||||
$webserver_timeout = (int)$_SERVER['HTTP_KEEP_ALIVE'];
|
$webserver_timeout = (int)$_SERVER['HTTP_KEEP_ALIVE'];
|
||||||
$time_limit_explain .= '<br />' . sprintf($lang['TIME_LIMIT_EXPLAIN_WEBSERVER'], $webserver_timeout);
|
$time_limit_explain .= '<br />' . sprintf(trans('messages.TIME_LIMIT_EXPLAIN_WEBSERVER'), $webserver_timeout);
|
||||||
|
|
||||||
if ($time_limit > $webserver_timeout) {
|
if ($time_limit > $webserver_timeout) {
|
||||||
$time_limit = $webserver_timeout;
|
$time_limit = $webserver_timeout;
|
||||||
|
@ -118,7 +118,7 @@ $refresh_rate = isset($_REQUEST['refresh_rate']) ? (int)$_REQUEST['refresh_rate'
|
||||||
// check if the user gave wrong input
|
// check if the user gave wrong input
|
||||||
if ($mode == 'submit') {
|
if ($mode == 'submit') {
|
||||||
if (($session_posts_processing || $post_limit || $refresh_rate || $time_limit) <= 0) {
|
if (($session_posts_processing || $post_limit || $refresh_rate || $time_limit) <= 0) {
|
||||||
bb_die($lang['WRONG_INPUT'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_REBUILD_SEARCH'], '<a href="admin_rebuild_search.php">', '</a>'));
|
bb_die(trans('messages.WRONG_INPUT') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_REBUILD_SEARCH'), '<a href="admin_rebuild_search.php">', '</a>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,8 +222,8 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
$template->assign_vars(array('TPL_REBUILD_SEARCH_PROGRESS' => true));
|
$template->assign_vars(array('TPL_REBUILD_SEARCH_PROGRESS' => true));
|
||||||
|
|
||||||
$processing_messages = '';
|
$processing_messages = '';
|
||||||
$processing_messages .= $timer_expired ? sprintf($lang['TIMER_EXPIRED'], TIMENOW - $start_time) : '';
|
$processing_messages .= $timer_expired ? sprintf(trans('messages.TIMER_EXPIRED'), TIMENOW - $start_time) : '';
|
||||||
$processing_messages .= ($start == 0 && $clear_search) ? $lang['CLEARED_SEARCH_TABLES'] : '';
|
$processing_messages .= ($start == 0 && $clear_search) ? trans('messages.CLEARED_SEARCH_TABLES') : '';
|
||||||
|
|
||||||
// check if we have reached the end of our post processing
|
// check if we have reached the end of our post processing
|
||||||
$session_posts_processed = get_processed_posts('session');
|
$session_posts_processed = get_processed_posts('session');
|
||||||
|
@ -238,10 +238,10 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
$form_parameters .= '&refresh_rate=' . $refresh_rate;
|
$form_parameters .= '&refresh_rate=' . $refresh_rate;
|
||||||
|
|
||||||
$form_action = 'admin_rebuild_search.php' . '?mode=refresh' . $form_parameters;
|
$form_action = 'admin_rebuild_search.php' . '?mode=refresh' . $form_parameters;
|
||||||
$next_button = $lang['NEXT'];
|
$next_button = trans('messages.NEXT');
|
||||||
$progress_bar_img = $images['progress_bar'];
|
$progress_bar_img = $images['progress_bar'];
|
||||||
|
|
||||||
$processing_messages .= sprintf($lang['PROCESSING_NEXT_POSTS'], $post_limit);
|
$processing_messages .= sprintf(trans('messages.PROCESSING_NEXT_POSTS'), $post_limit);
|
||||||
|
|
||||||
meta_refresh($form_action, $refresh_rate);
|
meta_refresh($form_action, $refresh_rate);
|
||||||
|
|
||||||
|
@ -253,11 +253,11 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
// end of processing
|
// end of processing
|
||||||
|
|
||||||
$form_action = 'admin_rebuild_search.php';
|
$form_action = 'admin_rebuild_search.php';
|
||||||
$next_button = $lang['FINISHED'];
|
$next_button = trans('messages.FINISHED');
|
||||||
$progress_bar_img = $images['progress_bar_full'];
|
$progress_bar_img = $images['progress_bar_full'];
|
||||||
|
|
||||||
$processing_messages .= ($session_posts_processed < $session_posts_processing) ? sprintf($lang['DELETED_POSTS'], $session_posts_processing - $session_posts_processed) : '';
|
$processing_messages .= ($session_posts_processed < $session_posts_processing) ? sprintf(trans('messages.DELETED_POSTS'), $session_posts_processing - $session_posts_processed) : '';
|
||||||
$processing_messages .= ($total_posts_processed == $total_posts) ? $lang['ALL_POSTS_PROCESSED'] : $lang['ALL_SESSION_POSTS_PROCESSED'];
|
$processing_messages .= ($total_posts_processed == $total_posts) ? trans('messages.ALL_POSTS_PROCESSED') : trans('messages.ALL_SESSION_POSTS_PROCESSED');
|
||||||
|
|
||||||
// if we have processed all the db posts we need to update the rebuild_status
|
// if we have processed all the db posts we need to update the rebuild_status
|
||||||
OLD_DB()->query('UPDATE ' . BB_SEARCH_REBUILD . ' SET
|
OLD_DB()->query('UPDATE ' . BB_SEARCH_REBUILD . ' SET
|
||||||
|
@ -274,7 +274,7 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
OLD_DB()->query("OPTIMIZE TABLE $table");
|
OLD_DB()->query("OPTIMIZE TABLE $table");
|
||||||
}
|
}
|
||||||
|
|
||||||
$processing_messages .= '<br />' . $lang['ALL_TABLES_OPTIMIZED'];
|
$processing_messages .= '<br />' . trans('messages.ALL_TABLES_OPTIMIZED');
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate the percent
|
// calculate the percent
|
||||||
|
@ -315,17 +315,17 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_NEXT' => $next_button,
|
'L_NEXT' => $next_button,
|
||||||
'L_TIME_LAST_POSTS_ADMIN' => sprintf($lang['TIME_LAST_POSTS'], $num_rows),
|
'L_TIME_LAST_POSTS_ADMIN' => sprintf(trans('messages.TIME_LAST_POSTS'), $num_rows),
|
||||||
|
|
||||||
'PROCESSING_POSTS' => sprintf($lang['PROCESSED_POST_IDS'], $start_post_id, $end_post_id),
|
'PROCESSING_POSTS' => sprintf(trans('messages.PROCESSED_POST_IDS'), $start_post_id, $end_post_id),
|
||||||
'PROCESSING_MESSAGES' => $processing_messages,
|
'PROCESSING_MESSAGES' => $processing_messages,
|
||||||
'PROGRESS_BAR_IMG' => $progress_bar_img,
|
'PROGRESS_BAR_IMG' => $progress_bar_img,
|
||||||
|
|
||||||
'SESSION_DETAILS' => sprintf($lang['PROCESS_DETAILS'], $session_posts_processed - $num_rows + 1, $session_posts_processed, $session_posts_processing),
|
'SESSION_DETAILS' => sprintf(trans('messages.PROCESS_DETAILS'), $session_posts_processed - $num_rows + 1, $session_posts_processed, $session_posts_processing),
|
||||||
'SESSION_PERCENT' => sprintf($lang['PERCENT_COMPLETED'], round($session_percent, 2)),
|
'SESSION_PERCENT' => sprintf(trans('messages.PERCENT_COMPLETED'), round($session_percent, 2)),
|
||||||
|
|
||||||
'TOTAL_DETAILS' => sprintf($lang['PROCESS_DETAILS'], $total_posts_processed - $num_rows + 1, $total_posts_processed, $total_posts),
|
'TOTAL_DETAILS' => sprintf(trans('messages.PROCESS_DETAILS'), $total_posts_processed - $num_rows + 1, $total_posts_processed, $total_posts),
|
||||||
'TOTAL_PERCENT' => sprintf($lang['PERCENT_COMPLETED'], round($total_percent, 2)),
|
'TOTAL_PERCENT' => sprintf(trans('messages.PERCENT_COMPLETED'), round($total_percent, 2)),
|
||||||
|
|
||||||
'LAST_CYCLE_TIME' => delta_time(TIMENOW),
|
'LAST_CYCLE_TIME' => delta_time(TIMENOW),
|
||||||
'SESSION_TIME' => delta_time($last_session_data['start_time']),
|
'SESSION_TIME' => delta_time($last_session_data['start_time']),
|
||||||
|
@ -363,15 +363,15 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
|
|
||||||
// check our last status
|
// check our last status
|
||||||
if ($last_session_data['rebuild_session_status'] == REBUILD_SEARCH_PROCESSED) {
|
if ($last_session_data['rebuild_session_status'] == REBUILD_SEARCH_PROCESSED) {
|
||||||
$last_saved_processing = sprintf($lang['INFO_PROCESSING_STOPPED'], $last_saved_post_id, $total_posts_processed, $last_saved_date);
|
$last_saved_processing = sprintf(trans('messages.INFO_PROCESSING_STOPPED'), $last_saved_post_id, $total_posts_processed, $last_saved_date);
|
||||||
$clear_search_disabled = 'disabled="disabled"';
|
$clear_search_disabled = 'disabled="disabled"';
|
||||||
|
|
||||||
$template->assign_block_vars('start_select_input', array());
|
$template->assign_block_vars('start_select_input', array());
|
||||||
} elseif ($last_session_data['rebuild_session_status'] == REBUILD_SEARCH_ABORTED) {
|
} elseif ($last_session_data['rebuild_session_status'] == REBUILD_SEARCH_ABORTED) {
|
||||||
$last_saved_processing = sprintf($lang['INFO_PROCESSING_ABORTED'], $last_saved_post_id, $total_posts_processed, $last_saved_date);
|
$last_saved_processing = sprintf(trans('messages.INFO_PROCESSING_ABORTED'), $last_saved_post_id, $total_posts_processed, $last_saved_date);
|
||||||
// check if the interrupted cycle has finished
|
// check if the interrupted cycle has finished
|
||||||
if (TIMENOW - $last_session_data['end_time'] < $last_session_data['last_cycle_time']) {
|
if (TIMENOW - $last_session_data['end_time'] < $last_session_data['last_cycle_time']) {
|
||||||
$last_saved_processing .= '<br />' . $lang['INFO_PROCESSING_ABORTED_SOON'];
|
$last_saved_processing .= '<br />' . trans('messages.INFO_PROCESSING_ABORTED_SOON');
|
||||||
}
|
}
|
||||||
$clear_search_disabled = 'disabled="disabled"';
|
$clear_search_disabled = 'disabled="disabled"';
|
||||||
|
|
||||||
|
@ -380,12 +380,12 @@ if ($mode == 'submit' || $mode == 'refresh') {
|
||||||
// when finished
|
// when finished
|
||||||
|
|
||||||
if ($last_session_data['end_post_id'] < $max_post_id) {
|
if ($last_session_data['end_post_id'] < $max_post_id) {
|
||||||
$last_saved_processing = sprintf($lang['INFO_PROCESSING_FINISHED_NEW'], $last_saved_post_id, $total_posts_processed, $last_saved_date, $total_posts - $total_posts_processed);
|
$last_saved_processing = sprintf(trans('messages.INFO_PROCESSING_FINISHED_NEW'), $last_saved_post_id, $total_posts_processed, $last_saved_date, $total_posts - $total_posts_processed);
|
||||||
$clear_search_disabled = 'disabled="disabled"';
|
$clear_search_disabled = 'disabled="disabled"';
|
||||||
|
|
||||||
$template->assign_block_vars('start_select_input', array());
|
$template->assign_block_vars('start_select_input', array());
|
||||||
} else {
|
} else {
|
||||||
$last_saved_processing = sprintf($lang['INFO_PROCESSING_FINISHED'], $total_posts, $last_saved_date);
|
$last_saved_processing = sprintf(trans('messages.INFO_PROCESSING_FINISHED'), $total_posts, $last_saved_date);
|
||||||
|
|
||||||
$template->assign_block_vars('start_text_input', array());
|
$template->assign_block_vars('start_text_input', array());
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,8 @@ if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$s_mess = $lang['SITEMAP_CREATED'] . ': <b>' . bb_date($new['sitemap_time'], config('tp.post_date_format')) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
|
$s_mess = trans('messages.SITEMAP_CREATED') . ': <b>' . bb_date($new['sitemap_time'], config('tp.post_date_format')) . '</b> ' . trans('messages.SITEMAP_AVAILABLE') . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
|
||||||
$message = file_exists(SITEMAP_DIR . '/sitemap.xml') ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
|
$message = file_exists(SITEMAP_DIR . '/sitemap.xml') ? $s_mess : trans('messages.SITEMAP_NOT_CREATED');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'STATIC_SITEMAP' => $new['static_sitemap'],
|
'STATIC_SITEMAP' => $new['static_sitemap'],
|
||||||
|
|
|
@ -109,10 +109,10 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_die($lang['SMILEY_IMPORT_SUCCESS'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.SMILEY_IMPORT_SUCCESS') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_SMILEADMIN'), '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
} else {
|
} else {
|
||||||
// Display the script to get the smile_pak cfg file
|
// Display the script to get the smile_pak cfg file
|
||||||
$smile_paks_select = '<select name="smile_pak"><option value="">' . $lang['SELECT_PAK'] . '</option>';
|
$smile_paks_select = '<select name="smile_pak"><option value="">' . trans('messages.SELECT_PAK') . '</option>';
|
||||||
foreach ($smiley_paks as $key => $value) {
|
foreach ($smiley_paks as $key => $value) {
|
||||||
if (!empty($value)) {
|
if (!empty($value)) {
|
||||||
$smile_paks_select .= '<option>' . $value . '</option>';
|
$smile_paks_select .= '<option>' . $value . '</option>';
|
||||||
|
@ -156,7 +156,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_die(sprintf($lang['EXPORT_SMILES'], '<a href="admin_smilies.php?export_pack=send">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(sprintf(trans('messages.EXPORT_SMILES'), '<a href="admin_smilies.php?export_pack=send">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_SMILEADMIN'), '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
} elseif (isset($_POST['add']) || isset($_GET['add'])) {
|
} elseif (isset($_POST['add']) || isset($_GET['add'])) {
|
||||||
$filename_list = '';
|
$filename_list = '';
|
||||||
for ($i = 0, $iMax = count($smiley_images); $i < $iMax; $i++) {
|
for ($i = 0, $iMax = count($smiley_images); $i < $iMax; $i++) {
|
||||||
|
@ -186,7 +186,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
}
|
}
|
||||||
$datastore->update('smile_replacements');
|
$datastore->update('smile_replacements');
|
||||||
|
|
||||||
bb_die($lang['SMILEY_DEL_SUCCESS'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.SMILEY_DEL_SUCCESS') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_SMILEADMIN'), '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
|
@ -235,7 +235,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
|
|
||||||
// If no code was entered complain
|
// If no code was entered complain
|
||||||
if ($smile_code == '' || $smile_url == '') {
|
if ($smile_code == '' || $smile_url == '') {
|
||||||
bb_die($lang['FIELDS_EMPTY']);
|
bb_die(trans('messages.FIELDS_EMPTY'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert < and > to proper htmlentities for parsing
|
// Convert < and > to proper htmlentities for parsing
|
||||||
|
@ -251,7 +251,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
}
|
}
|
||||||
$datastore->update('smile_replacements');
|
$datastore->update('smile_replacements');
|
||||||
|
|
||||||
bb_die($lang['SMILEY_EDIT_SUCCESS'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.SMILEY_EDIT_SUCCESS') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_SMILEADMIN'), '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'savenew':
|
case 'savenew':
|
||||||
|
@ -265,7 +265,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
|
|
||||||
// If no code was entered complain
|
// If no code was entered complain
|
||||||
if ($smile_code == '' || $smile_url == '') {
|
if ($smile_code == '' || $smile_url == '') {
|
||||||
bb_die($lang['FIELDS_EMPTY']);
|
bb_die(trans('messages.FIELDS_EMPTY'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert < and > to proper htmlentities for parsing
|
// Convert < and > to proper htmlentities for parsing
|
||||||
|
@ -281,7 +281,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
||||||
}
|
}
|
||||||
$datastore->update('smile_replacements');
|
$datastore->update('smile_replacements');
|
||||||
|
|
||||||
bb_die($lang['SMILEY_ADD_SUCCESS'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_SMILEADMIN'], '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.SMILEY_ADD_SUCCESS') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_SMILEADMIN'), '<a href="admin_smilies.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,7 +16,7 @@ require INC_DIR . '/bbcode.php';
|
||||||
|
|
||||||
if (isset($_POST['post']) && config('tp.terms') != $_POST['message']) {
|
if (isset($_POST['post']) && config('tp.terms') != $_POST['message']) {
|
||||||
bb_update_config(array('terms' => $_POST['message']));
|
bb_update_config(array('terms' => $_POST['message']));
|
||||||
bb_die($lang['CONFIG_UPDATED']);
|
bb_die(trans('messages.CONFIG_UPDATED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|
|
@ -49,7 +49,7 @@ if ($submit && $mode == 'user') {
|
||||||
|
|
||||||
// Obtain relevant data for this user
|
// Obtain relevant data for this user
|
||||||
if (!$row = get_userdata($user_id)) {
|
if (!$row = get_userdata($user_id)) {
|
||||||
bb_die($lang['NO_SUCH_USER']);
|
bb_die(trans('messages.NO_SUCH_USER'));
|
||||||
}
|
}
|
||||||
$this_user_level = $row['user_level'];
|
$this_user_level = $row['user_level'];
|
||||||
|
|
||||||
|
@ -81,9 +81,9 @@ if ($submit && $mode == 'user') {
|
||||||
// Delete any entries in auth_access, they are not required if user is becoming an admin
|
// Delete any entries in auth_access, they are not required if user is becoming an admin
|
||||||
delete_permissions($group_id, $user_id);
|
delete_permissions($group_id, $user_id);
|
||||||
|
|
||||||
$message = $lang['AUTH_UPDATED'] . '<br /><br />';
|
$message = trans('messages.AUTH_UPDATED') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_USERAUTH'], '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
$message .= sprintf(trans('messages.CLICK_RETURN_USERAUTH'), '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} // Make admin a user (if already admin)
|
} // Make admin a user (if already admin)
|
||||||
|
@ -97,9 +97,9 @@ if ($submit && $mode == 'user') {
|
||||||
|
|
||||||
delete_permissions($group_id, $user_id);
|
delete_permissions($group_id, $user_id);
|
||||||
|
|
||||||
$message = $lang['AUTH_UPDATED'] . '<br /><br />';
|
$message = trans('messages.AUTH_UPDATED') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_USERAUTH'], '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
$message .= sprintf(trans('messages.CLICK_RETURN_USERAUTH'), '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
@ -124,10 +124,10 @@ if ($submit && $mode == 'user') {
|
||||||
|
|
||||||
update_user_level($user_id);
|
update_user_level($user_id);
|
||||||
|
|
||||||
$l_auth_return = ($mode == 'user') ? $lang['CLICK_RETURN_USERAUTH'] : $lang['CLICK_RETURN_GROUPAUTH'];
|
$l_auth_return = ($mode == 'user') ? trans('messages.CLICK_RETURN_USERAUTH') : trans('messages.CLICK_RETURN_GROUPAUTH');
|
||||||
$message = $lang['AUTH_UPDATED'] . '<br /><br />';
|
$message = trans('messages.AUTH_UPDATED') . '<br /><br />';
|
||||||
$message .= sprintf($l_auth_return, '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
$message .= sprintf($l_auth_return, '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ if ($submit && $mode == 'user') {
|
||||||
//
|
//
|
||||||
elseif ($submit && $mode == 'group' && is_array($_POST['auth'])) {
|
elseif ($submit && $mode == 'group' && is_array($_POST['auth'])) {
|
||||||
if (!$group_data = get_group_data($group_id)) {
|
if (!$group_data = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$auth = array();
|
$auth = array();
|
||||||
|
@ -153,10 +153,10 @@ elseif ($submit && $mode == 'group' && is_array($_POST['auth'])) {
|
||||||
|
|
||||||
update_user_level('all');
|
update_user_level('all');
|
||||||
|
|
||||||
$l_auth_return = $lang['CLICK_RETURN_GROUPAUTH'];
|
$l_auth_return = trans('messages.CLICK_RETURN_GROUPAUTH');
|
||||||
$message = $lang['AUTH_UPDATED'] . '<br /><br />';
|
$message = trans('messages.AUTH_UPDATED') . '<br /><br />';
|
||||||
$message .= sprintf($l_auth_return, '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
$message .= sprintf($l_auth_return, '<a href="admin_ug_auth.php?mode=' . $mode . '">', '</a>') . '<br /><br />';
|
||||||
$message .= sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
$this_userdata = get_userdata($user_id);
|
$this_userdata = get_userdata($user_id);
|
||||||
}
|
}
|
||||||
if (!$this_userdata) {
|
if (!$this_userdata) {
|
||||||
bb_die($lang['NO_SUCH_USER']);
|
bb_die(trans('messages.NO_SUCH_USER'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$forums = $datastore->get('cat_forums')) {
|
if (!$forums = $datastore->get('cat_forums')) {
|
||||||
|
@ -211,7 +211,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
'FORUM_NAME' => str_short($forums['forum_name_html'][$f_id], $max_forum_name_length),
|
'FORUM_NAME' => str_short($forums['forum_name_html'][$f_id], $max_forum_name_length),
|
||||||
'SF_SPACER' => $f_data['forum_parent'] ? HTML_SF_SPACER : '',
|
'SF_SPACER' => $f_data['forum_parent'] ? HTML_SF_SPACER : '',
|
||||||
'IS_MODERATOR' => (bool)$auth_mod,
|
'IS_MODERATOR' => (bool)$auth_mod,
|
||||||
'MOD_STATUS' => $auth_mod ? $lang['MODERATOR'] : $lang['NONE'],
|
'MOD_STATUS' => $auth_mod ? trans('messages.MODERATOR') : trans('messages.NONE'),
|
||||||
'MOD_CLASS' => $auth_mod ? ($disabled ? 'yesDisabled' : 'yesMOD') : 'noMOD',
|
'MOD_CLASS' => $auth_mod ? ($disabled ? 'yesDisabled' : 'yesMOD') : 'noMOD',
|
||||||
'AUTH_MOD_VAL' => $auth_mod ? 1 : 0,
|
'AUTH_MOD_VAL' => $auth_mod ? 1 : 0,
|
||||||
));
|
));
|
||||||
|
@ -251,7 +251,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
|
|
||||||
foreach ($forum_auth_fields as $auth_type) {
|
foreach ($forum_auth_fields as $auth_type) {
|
||||||
$template->assign_block_vars('acltype', array(
|
$template->assign_block_vars('acltype', array(
|
||||||
'ACL_TYPE_NAME' => preg_replace('#(.{5})#u', "\\1<br />", $lang[strtoupper($auth_type)]),
|
'ACL_TYPE_NAME' => preg_replace('#(.{5})#u', "\\1<br />", trans('messages.' . strtoupper($auth_type))),
|
||||||
'ACL_TYPE_BF' => $bf['forum_perm'][$auth_type],
|
'ACL_TYPE_BF' => $bf['forum_perm'][$auth_type],
|
||||||
));
|
));
|
||||||
$s_column_span++;
|
$s_column_span++;
|
||||||
|
@ -267,13 +267,13 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
|
|
||||||
$s_user_type = ($this_userdata['user_level'] == ADMIN) ? '
|
$s_user_type = ($this_userdata['user_level'] == ADMIN) ? '
|
||||||
<select name="userlevel">
|
<select name="userlevel">
|
||||||
<option value="admin" selected="selected">' . $lang['AUTH_ADMIN'] . '</option>
|
<option value="admin" selected="selected">' . trans('messages.AUTH_ADMIN') . '</option>
|
||||||
<option value="user">' . $lang['AUTH_USER'] . '</option>
|
<option value="user">' . trans('messages.AUTH_USER') . '</option>
|
||||||
</select>
|
</select>
|
||||||
' : '
|
' : '
|
||||||
<select name="userlevel">
|
<select name="userlevel">
|
||||||
<option value="admin">' . $lang['AUTH_ADMIN'] . '</option>
|
<option value="admin">' . trans('messages.AUTH_ADMIN') . '</option>
|
||||||
<option value="user" selected="selected">' . $lang['AUTH_USER'] . '</option>
|
<option value="user" selected="selected">' . trans('messages.AUTH_USER') . '</option>
|
||||||
</select>
|
</select>
|
||||||
';
|
';
|
||||||
|
|
||||||
|
@ -282,10 +282,10 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'TPL_AUTH_UG_MAIN' => true,
|
'TPL_AUTH_UG_MAIN' => true,
|
||||||
'USER_OR_GROUPNAME' => $this_userdata['username'],
|
'USER_OR_GROUPNAME' => $this_userdata['username'],
|
||||||
'USER_LEVEL' => $lang['USER_LEVEL'] . ' : ' . $s_user_type,
|
'USER_LEVEL' => trans('messages.USER_LEVEL') . ' : ' . $s_user_type,
|
||||||
'T_USER_OR_GROUPNAME' => $lang['USERNAME'],
|
'T_USER_OR_GROUPNAME' => trans('messages.USERNAME'),
|
||||||
'T_AUTH_TITLE' => $lang['AUTH_CONTROL_USER'],
|
'T_AUTH_TITLE' => trans('messages.AUTH_CONTROL_USER'),
|
||||||
'T_AUTH_EXPLAIN' => $lang['USER_AUTH_EXPLAIN'],
|
'T_AUTH_EXPLAIN' => trans('messages.USER_AUTH_EXPLAIN'),
|
||||||
'S_COLUMN_SPAN' => $s_column_span,
|
'S_COLUMN_SPAN' => $s_column_span,
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
));
|
));
|
||||||
|
@ -293,7 +293,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
$page_cfg['quirks_mode'] = true;
|
$page_cfg['quirks_mode'] = true;
|
||||||
|
|
||||||
if (!$group_data = get_group_data($group_id)) {
|
if (!$group_data = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$forums = $datastore->get('cat_forums')) {
|
if (!$forums = $datastore->get('cat_forums')) {
|
||||||
|
@ -326,7 +326,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
'FORUM_NAME' => str_short($forums['forum_name_html'][$f_id], $max_forum_name_length),
|
'FORUM_NAME' => str_short($forums['forum_name_html'][$f_id], $max_forum_name_length),
|
||||||
'SF_SPACER' => $f_data['forum_parent'] ? HTML_SF_SPACER : '',
|
'SF_SPACER' => $f_data['forum_parent'] ? HTML_SF_SPACER : '',
|
||||||
'IS_MODERATOR' => (bool)$auth_mod,
|
'IS_MODERATOR' => (bool)$auth_mod,
|
||||||
'MOD_STATUS' => $auth_mod ? $lang['MODERATOR'] : $lang['NO'],
|
'MOD_STATUS' => $auth_mod ? trans('messages.MODERATOR') : trans('messages.NO'),
|
||||||
'MOD_CLASS' => $auth_mod ? 'yesMOD' : 'noMOD',
|
'MOD_CLASS' => $auth_mod ? 'yesMOD' : 'noMOD',
|
||||||
'AUTH_MOD_VAL' => $auth_mod ? 1 : 0,
|
'AUTH_MOD_VAL' => $auth_mod ? 1 : 0,
|
||||||
));
|
));
|
||||||
|
@ -366,7 +366,7 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
|
|
||||||
foreach ($forum_auth_fields as $auth_type) {
|
foreach ($forum_auth_fields as $auth_type) {
|
||||||
$template->assign_block_vars('acltype', array(
|
$template->assign_block_vars('acltype', array(
|
||||||
'ACL_TYPE_NAME' => preg_replace('#(.{5})#u', "\\1<br />", $lang[strtoupper($auth_type)]),
|
'ACL_TYPE_NAME' => preg_replace('#(.{5})#u', "\\1<br />", trans('messages.' . strtoupper($auth_type))),
|
||||||
'ACL_TYPE_BF' => $bf['forum_perm'][$auth_type],
|
'ACL_TYPE_BF' => $bf['forum_perm'][$auth_type],
|
||||||
));
|
));
|
||||||
$s_column_span++;
|
$s_column_span++;
|
||||||
|
@ -382,10 +382,10 @@ if ($mode == 'user' && (!empty($_POST['username']) || $user_id)) {
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'TPL_AUTH_UG_MAIN' => true,
|
'TPL_AUTH_UG_MAIN' => true,
|
||||||
'T_USER_OR_GROUPNAME' => $lang['GROUP_NAME'],
|
'T_USER_OR_GROUPNAME' => trans('messages.GROUP_NAME'),
|
||||||
'USER_LEVEL' => false,
|
'USER_LEVEL' => false,
|
||||||
'T_AUTH_TITLE' => $lang['AUTH_CONTROL_GROUP'],
|
'T_AUTH_TITLE' => trans('messages.AUTH_CONTROL_GROUP'),
|
||||||
'T_AUTH_EXPLAIN' => $lang['GROUP_AUTH_EXPLAIN'],
|
'T_AUTH_EXPLAIN' => trans('messages.GROUP_AUTH_EXPLAIN'),
|
||||||
'USER_OR_GROUPNAME' => htmlCHR($group_data['group_name']),
|
'USER_OR_GROUPNAME' => htmlCHR($group_data['group_name']),
|
||||||
'S_COLUMN_SPAN' => $s_column_span,
|
'S_COLUMN_SPAN' => $s_column_span,
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
|
|
|
@ -23,7 +23,7 @@ if (isset($_POST['submit'])) {
|
||||||
if (!empty($_POST['username'])) {
|
if (!empty($_POST['username'])) {
|
||||||
$this_userdata = get_userdata($_POST['username'], true);
|
$this_userdata = get_userdata($_POST['username'], true);
|
||||||
if (!$this_userdata) {
|
if (!$this_userdata) {
|
||||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
bb_die(trans('messages.NO_USER_ID_SPECIFIED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$user_list[] = $this_userdata['user_id'];
|
$user_list[] = $this_userdata['user_id'];
|
||||||
|
@ -165,7 +165,7 @@ if (isset($_POST['submit'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_die($lang['BAN_UPDATE_SUCESSFUL'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_BANADMIN'], '<a href="admin_user_ban.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.BAN_UPDATE_SUCESSFUL') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_BANADMIN'), '<a href="admin_user_ban.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
} else {
|
} else {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_BANLIST_ACTION' => 'admin_user_ban.php',
|
'S_BANLIST_ACTION' => 'admin_user_ban.php',
|
||||||
|
@ -195,7 +195,7 @@ if (isset($_POST['submit'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($select_userlist == '') {
|
if ($select_userlist == '') {
|
||||||
$select_userlist = '<option value="-1">' . $lang['NO_BANNED_USERS'] . '</option>';
|
$select_userlist = '<option value="-1">' . trans('messages.NO_BANNED_USERS') . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$select_userlist = '<select name="unban_user[]" multiple size="5">' . $select_userlist . '</select>';
|
$select_userlist = '<select name="unban_user[]" multiple size="5">' . $select_userlist . '</select>';
|
||||||
|
@ -226,11 +226,11 @@ if (isset($_POST['submit'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($select_iplist == '') {
|
if ($select_iplist == '') {
|
||||||
$select_iplist = '<option value="-1">' . $lang['NO_BANNED_IP'] . '</option>';
|
$select_iplist = '<option value="-1">' . trans('messages.NO_BANNED_IP') . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($select_emaillist == '') {
|
if ($select_emaillist == '') {
|
||||||
$select_emaillist = '<option value="-1">' . $lang['NO_BANNED_EMAIL'] . '</option>';
|
$select_emaillist = '<option value="-1">' . trans('messages.NO_BANNED_EMAIL') . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$select_iplist = '<select name="unban_ip[]" multiple size="15">' . $select_iplist . '</select>';
|
$select_iplist = '<select name="unban_ip[]" multiple size="15">' . $select_iplist . '</select>';
|
||||||
|
|
|
@ -86,7 +86,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$lastvisited_list = '';
|
$lastvisited_list = '';
|
||||||
|
|
||||||
foreach ($lastvisited as $days) {
|
foreach ($lastvisited as $days) {
|
||||||
$lastvisited_list .= '<option value="' . $days . '">' . $days . ' ' . (($days > 1) ? $lang['DAYS'] : $lang['DAY']) . '</option>';
|
$lastvisited_list .= '<option value="' . $days . '">' . $days . ' ' . (($days > 1) ? trans('messages.DAYS') : trans('messages.DAY')) . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -141,21 +141,21 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
case 'search_username':
|
case 'search_username':
|
||||||
$username = $_REQUEST['username'];
|
$username = $_REQUEST['username'];
|
||||||
if (!$username) {
|
if (!$username) {
|
||||||
bb_die($lang['SEARCH_INVALID_USERNAME']);
|
bb_die(trans('messages.SEARCH_INVALID_USERNAME'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_email':
|
case 'search_email':
|
||||||
$email = $_REQUEST['email'];
|
$email = $_REQUEST['email'];
|
||||||
if (!$email) {
|
if (!$email) {
|
||||||
bb_die($lang['SEARCH_INVALID_EMAIL']);
|
bb_die(trans('messages.SEARCH_INVALID_EMAIL'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_ip':
|
case 'search_ip':
|
||||||
$ip_address = $_REQUEST['ip_address'];
|
$ip_address = $_REQUEST['ip_address'];
|
||||||
if (!$ip_address) {
|
if (!$ip_address) {
|
||||||
bb_die($lang['SEARCH_INVALID_IP']);
|
bb_die(trans('messages.SEARCH_INVALID_IP'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -165,21 +165,21 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$date_month = $_REQUEST['date_month'];
|
$date_month = $_REQUEST['date_month'];
|
||||||
$date_year = $_REQUEST['date_year'];
|
$date_year = $_REQUEST['date_year'];
|
||||||
if (!($date_type || $date_day || $date_month || $date_year)) {
|
if (!($date_type || $date_day || $date_month || $date_year)) {
|
||||||
bb_die($lang['SEARCH_INVALID_DATE']);
|
bb_die(trans('messages.SEARCH_INVALID_DATE'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_group':
|
case 'search_group':
|
||||||
$group_id = $_REQUEST['group_id'];
|
$group_id = $_REQUEST['group_id'];
|
||||||
if (!$group_id) {
|
if (!$group_id) {
|
||||||
bb_die($lang['SEARCH_INVALID_GROUP']);
|
bb_die(trans('messages.SEARCH_INVALID_GROUP'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_rank':
|
case 'search_rank':
|
||||||
$rank_id = $_REQUEST['rank_id'];
|
$rank_id = $_REQUEST['rank_id'];
|
||||||
if (!$rank_id) {
|
if (!$rank_id) {
|
||||||
bb_die($lang['SEARCH_INVALID_RANK']);
|
bb_die(trans('messages.SEARCH_INVALID_RANK'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$postcount_type = $_REQUEST['postcount_type'];
|
$postcount_type = $_REQUEST['postcount_type'];
|
||||||
$postcount_value = $_REQUEST['postcount_value'];
|
$postcount_value = $_REQUEST['postcount_value'];
|
||||||
if (!$postcount_type || (!$postcount_value && $postcount_value != 0)) {
|
if (!$postcount_type || (!$postcount_value && $postcount_value != 0)) {
|
||||||
bb_die($lang['SEARCH_INVALID_POSTCOUNT']);
|
bb_die(trans('messages.SEARCH_INVALID_POSTCOUNT'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$userfield_type = $_REQUEST['userfield_type'];
|
$userfield_type = $_REQUEST['userfield_type'];
|
||||||
$userfield_value = $_REQUEST['userfield_value'];
|
$userfield_value = $_REQUEST['userfield_value'];
|
||||||
if (!$userfield_type || !$userfield_value) {
|
if (!$userfield_type || !$userfield_value) {
|
||||||
bb_die($lang['SEARCH_INVALID_USERFIELD']);
|
bb_die(trans('messages.SEARCH_INVALID_USERFIELD'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -203,35 +203,35 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$lastvisited_days = $_REQUEST['lastvisited_days'];
|
$lastvisited_days = $_REQUEST['lastvisited_days'];
|
||||||
$lastvisited_type = $_REQUEST['lastvisited_type'];
|
$lastvisited_type = $_REQUEST['lastvisited_type'];
|
||||||
if (!$lastvisited_days || !$lastvisited_type) {
|
if (!$lastvisited_days || !$lastvisited_type) {
|
||||||
bb_die($lang['SEARCH_INVALID_LASTVISITED']);
|
bb_die(trans('messages.SEARCH_INVALID_LASTVISITED'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_language':
|
case 'search_language':
|
||||||
$language_type = $_REQUEST['language_type'];
|
$language_type = $_REQUEST['language_type'];
|
||||||
if (!$language_type) {
|
if (!$language_type) {
|
||||||
bb_die($lang['SEARCH_INVALID_LANGUAGE']);
|
bb_die(trans('messages.SEARCH_INVALID_LANGUAGE'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_timezone':
|
case 'search_timezone':
|
||||||
$timezone_type = $_REQUEST['timezone_type'];
|
$timezone_type = $_REQUEST['timezone_type'];
|
||||||
if (!$timezone_type && $timezone_type != 0) {
|
if (!$timezone_type && $timezone_type != 0) {
|
||||||
bb_die($lang['SEARCH_INVALID_TIMEZONE']);
|
bb_die(trans('messages.SEARCH_INVALID_TIMEZONE'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_moderators':
|
case 'search_moderators':
|
||||||
$moderators_forum = $_REQUEST['moderators_forum'];
|
$moderators_forum = $_REQUEST['moderators_forum'];
|
||||||
if (!$moderators_forum) {
|
if (!$moderators_forum) {
|
||||||
bb_die($lang['SEARCH_INVALID_MODERATORS']);
|
bb_die(trans('messages.SEARCH_INVALID_MODERATORS'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'search_misc':
|
case 'search_misc':
|
||||||
$misc = $_REQUEST['misc'];
|
$misc = $_REQUEST['misc'];
|
||||||
if (!$misc) {
|
if (!$misc) {
|
||||||
bb_die($lang['SEARCH_INVALID']);
|
bb_die(trans('messages.SEARCH_INVALID'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
case 'search_username':
|
case 'search_username':
|
||||||
$base_url .= '&search_username=true&username=' . rawurlencode(stripslashes($username));
|
$base_url .= '&search_username=true&username=' . rawurlencode(stripslashes($username));
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERNAME'], strip_tags(htmlspecialchars(stripslashes($username))));
|
$text = sprintf(trans('messages.SEARCH_FOR_USERNAME'), strip_tags(htmlspecialchars(stripslashes($username))));
|
||||||
|
|
||||||
$username = preg_replace('/\*/', '%', trim(strip_tags(strtolower($username))));
|
$username = preg_replace('/\*/', '%', trim(strip_tags(strtolower($username))));
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($username == '') {
|
if ($username == '') {
|
||||||
bb_die($lang['SEARCH_INVALID_USERNAME']);
|
bb_die(trans('messages.SEARCH_INVALID_USERNAME'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE {$lower_b}username{$lower_e} $op '" . OLD_DB()->escape($username) . "' AND user_id <> " . GUEST_UID;
|
$total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE {$lower_b}username{$lower_e} $op '" . OLD_DB()->escape($username) . "' AND user_id <> " . GUEST_UID;
|
||||||
|
@ -272,7 +272,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
case 'search_email':
|
case 'search_email':
|
||||||
$base_url .= '&search_email=true&email=' . rawurlencode(stripslashes($email));
|
$base_url .= '&search_email=true&email=' . rawurlencode(stripslashes($email));
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_EMAIL'], strip_tags(htmlspecialchars(stripslashes($email))));
|
$text = sprintf(trans('messages.SEARCH_FOR_EMAIL'), strip_tags(htmlspecialchars(stripslashes($email))));
|
||||||
|
|
||||||
$email = preg_replace('/\*/', '%', trim(strip_tags(strtolower($email))));
|
$email = preg_replace('/\*/', '%', trim(strip_tags(strtolower($email))));
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($email == '') {
|
if ($email == '') {
|
||||||
bb_die($lang['SEARCH_INVALID_EMAIL']);
|
bb_die(trans('messages.SEARCH_INVALID_EMAIL'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE {$lower_b}user_email{$lower_e} $op '" . OLD_DB()->escape($email) . "' AND user_id <> " . GUEST_UID;
|
$total_sql .= 'SELECT COUNT(user_id) AS total FROM ' . BB_USERS . " WHERE {$lower_b}user_email{$lower_e} $op '" . OLD_DB()->escape($email) . "' AND user_id <> " . GUEST_UID;
|
||||||
|
@ -295,7 +295,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
$ip_address = trim($ip_address);
|
$ip_address = trim($ip_address);
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_IP'], strip_tags(htmlspecialchars(stripslashes($ip_address))));
|
$text = sprintf(trans('messages.SEARCH_FOR_IP'), strip_tags(htmlspecialchars(stripslashes($ip_address))));
|
||||||
|
|
||||||
unset($users);
|
unset($users);
|
||||||
$users = [];
|
$users = [];
|
||||||
|
@ -304,7 +304,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$ip = encode_ip($ip_address);
|
$ip = encode_ip($ip_address);
|
||||||
$users[] = $ip;
|
$users[] = $ip;
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['SEARCH_INVALID_IP']);
|
bb_die(trans('messages.SEARCH_INVALID_IP'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ip_in_sql = $ip_like_sql = $ip_like_sql_flylast = $ip_like_sql_flyreg = '';
|
$ip_in_sql = $ip_like_sql = $ip_like_sql_flylast = $ip_like_sql_flyreg = '';
|
||||||
|
@ -375,7 +375,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($no_result_search == true) {
|
if ($no_result_search == true) {
|
||||||
bb_die($lang['SEARCH_NO_RESULTS']);
|
bb_die(trans('messages.SEARCH_NO_RESULTS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$select_sql .= " WHERE u.user_id IN ($ip_users_sql)";
|
$select_sql .= " WHERE u.user_id IN ($ip_users_sql)";
|
||||||
|
@ -387,28 +387,28 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$date_type = strtolower(trim($date_type));
|
$date_type = strtolower(trim($date_type));
|
||||||
|
|
||||||
if ($date_type != 'before' && $date_type != 'after') {
|
if ($date_type != 'before' && $date_type != 'after') {
|
||||||
bb_die($lang['SEARCH_INVALID_DATE']);
|
bb_die(trans('messages.SEARCH_INVALID_DATE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_day = (int)$date_day;
|
$date_day = (int)$date_day;
|
||||||
|
|
||||||
if (!preg_match('/^([1-9]|[0-2][0-9]|3[0-1])$/', $date_day)) {
|
if (!preg_match('/^([1-9]|[0-2][0-9]|3[0-1])$/', $date_day)) {
|
||||||
bb_die($lang['SEARCH_INVALID_DAY']);
|
bb_die(trans('messages.SEARCH_INVALID_DAY'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_month = (int)$date_month;
|
$date_month = (int)$date_month;
|
||||||
|
|
||||||
if (!preg_match('/^(0?[1-9]|1[0-2])$/', $date_month)) {
|
if (!preg_match('/^(0?[1-9]|1[0-2])$/', $date_month)) {
|
||||||
bb_die($lang['SEARCH_INVALID_MONTH']);
|
bb_die(trans('messages.SEARCH_INVALID_MONTH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$date_year = (int)$date_year;
|
$date_year = (int)$date_year;
|
||||||
|
|
||||||
if (!preg_match('/^(20[0-9]{2}|19[0-9]{2})$/', $date_year)) {
|
if (!preg_match('/^(20[0-9]{2}|19[0-9]{2})$/', $date_year)) {
|
||||||
bb_die($lang['SEARCH_INVALID_YEAR']);
|
bb_die(trans('messages.SEARCH_INVALID_YEAR'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_DATE'], strip_tags(htmlspecialchars(stripslashes($date_type))), $date_year, $date_month, $date_day);
|
$text = sprintf(trans('messages.SEARCH_FOR_DATE'), strip_tags(htmlspecialchars(stripslashes($date_type))), $date_year, $date_month, $date_day);
|
||||||
|
|
||||||
$time = mktime(0, 0, 0, $date_month, $date_day, $date_year);
|
$time = mktime(0, 0, 0, $date_month, $date_day, $date_year);
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$base_url .= '&search_group=true&group_id=' . rawurlencode($group_id);
|
$base_url .= '&search_group=true&group_id=' . rawurlencode($group_id);
|
||||||
|
|
||||||
if (!$group_id) {
|
if (!$group_id) {
|
||||||
bb_die($lang['SEARCH_INVALID_GROUP']);
|
bb_die(trans('messages.SEARCH_INVALID_GROUP'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT group_name FROM ' . BB_GROUPS . " WHERE group_id = $group_id AND group_single_user = 0";
|
$sql = 'SELECT group_name FROM ' . BB_GROUPS . " WHERE group_id = $group_id AND group_single_user = 0";
|
||||||
|
@ -438,12 +438,12 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OLD_DB()->num_rows($result) == 0) {
|
if (OLD_DB()->num_rows($result) == 0) {
|
||||||
bb_die($lang['SEARCH_INVALID_GROUP']);
|
bb_die(trans('messages.SEARCH_INVALID_GROUP'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$group_name = OLD_DB()->sql_fetchrow($result);
|
$group_name = OLD_DB()->sql_fetchrow($result);
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_GROUP'], strip_tags(htmlspecialchars($group_name['group_name'])));
|
$text = sprintf(trans('messages.SEARCH_FOR_GROUP'), strip_tags(htmlspecialchars($group_name['group_name'])));
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(u.user_id) AS total
|
$total_sql .= 'SELECT COUNT(u.user_id) AS total
|
||||||
FROM ' . BB_USERS . ' AS u, ' . BB_USER_GROUP . " AS ug
|
FROM ' . BB_USERS . ' AS u, ' . BB_USER_GROUP . " AS ug
|
||||||
|
@ -463,7 +463,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$base_url .= '&search_rank=true&rank_id=' . rawurlencode($rank_id);
|
$base_url .= '&search_rank=true&rank_id=' . rawurlencode($rank_id);
|
||||||
|
|
||||||
if (!$rank_id) {
|
if (!$rank_id) {
|
||||||
bb_die($lang['SEARCH_INVALID_RANK']);
|
bb_die(trans('messages.SEARCH_INVALID_RANK'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT rank_title FROM ' . BB_RANKS . " WHERE rank_id = $rank_id";
|
$sql = 'SELECT rank_title FROM ' . BB_RANKS . " WHERE rank_id = $rank_id";
|
||||||
|
@ -473,12 +473,12 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OLD_DB()->num_rows($result) == 0) {
|
if (OLD_DB()->num_rows($result) == 0) {
|
||||||
bb_die($lang['SEARCH_INVALID_RANK']);
|
bb_die(trans('messages.SEARCH_INVALID_RANK'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$rank_title = OLD_DB()->sql_fetchrow($result);
|
$rank_title = OLD_DB()->sql_fetchrow($result);
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_RANK'], strip_tags(htmlspecialchars($rank_title['rank_title'])));
|
$text = sprintf(trans('messages.SEARCH_FOR_RANK'), strip_tags(htmlspecialchars($rank_title['rank_title'])));
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -499,7 +499,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
case 'greater':
|
case 'greater':
|
||||||
$postcount_value = (int)$postcount_value;
|
$postcount_value = (int)$postcount_value;
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_POSTCOUNT_GREATER'], $postcount_value);
|
$text = sprintf(trans('messages.SEARCH_FOR_POSTCOUNT_GREATER'), $postcount_value);
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -512,7 +512,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
case 'lesser':
|
case 'lesser':
|
||||||
$postcount_value = (int)$postcount_value;
|
$postcount_value = (int)$postcount_value;
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_POSTCOUNT_LESSER'], $postcount_value);
|
$text = sprintf(trans('messages.SEARCH_FOR_POSTCOUNT_LESSER'), $postcount_value);
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -531,10 +531,10 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$range_end = (int)$range[1];
|
$range_end = (int)$range[1];
|
||||||
|
|
||||||
if ($range_begin > $range_end) {
|
if ($range_begin > $range_end) {
|
||||||
bb_die($lang['SEARCH_INVALID_POSTCOUNT']);
|
bb_die(trans('messages.SEARCH_INVALID_POSTCOUNT'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_POSTCOUNT_RANGE'], $range_begin, $range_end);
|
$text = sprintf(trans('messages.SEARCH_FOR_POSTCOUNT_RANGE'), $range_begin, $range_end);
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -548,7 +548,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
} else {
|
} else {
|
||||||
$postcount_value = (int)$postcount_value;
|
$postcount_value = (int)$postcount_value;
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_POSTCOUNT_EQUALS'], $postcount_value);
|
$text = sprintf(trans('messages.SEARCH_FOR_POSTCOUNT_EQUALS'), $postcount_value);
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -560,7 +560,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bb_die($lang['SEARCH_INVALID']);
|
bb_die(trans('messages.SEARCH_INVALID'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -578,42 +578,42 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($userfield_value == '') {
|
if ($userfield_value == '') {
|
||||||
bb_die($lang['SEARCH_INVALID_USERFIELD']);
|
bb_die(trans('messages.SEARCH_INVALID_USERFIELD'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$userfield_type = strtolower(trim($userfield_type));
|
$userfield_type = strtolower(trim($userfield_type));
|
||||||
|
|
||||||
switch ($userfield_type) {
|
switch ($userfield_type) {
|
||||||
case 'icq':
|
case 'icq':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_ICQ'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_ICQ'), $text);
|
||||||
$field = 'user_icq';
|
$field = 'user_icq';
|
||||||
break;
|
break;
|
||||||
case 'skype':
|
case 'skype':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_SKYPE'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_SKYPE'), $text);
|
||||||
$field = 'user_skype';
|
$field = 'user_skype';
|
||||||
break;
|
break;
|
||||||
case 'twitter':
|
case 'twitter':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_TWITTER'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_TWITTER'), $text);
|
||||||
$field = 'user_twitter';
|
$field = 'user_twitter';
|
||||||
break;
|
break;
|
||||||
case 'website':
|
case 'website':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_WEBSITE'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_WEBSITE'), $text);
|
||||||
$field = 'user_website';
|
$field = 'user_website';
|
||||||
break;
|
break;
|
||||||
case 'location':
|
case 'location':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_LOCATION'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_LOCATION'), $text);
|
||||||
$field = 'user_from';
|
$field = 'user_from';
|
||||||
break;
|
break;
|
||||||
case 'interests':
|
case 'interests':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_INTERESTS'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_INTERESTS'), $text);
|
||||||
$field = 'user_interests';
|
$field = 'user_interests';
|
||||||
break;
|
break;
|
||||||
case 'occupation':
|
case 'occupation':
|
||||||
$text = sprintf($lang['SEARCH_FOR_USERFIELD_OCCUPATION'], $text);
|
$text = sprintf(trans('messages.SEARCH_FOR_USERFIELD_OCCUPATION'), $text);
|
||||||
$field = 'user_occ';
|
$field = 'user_occ';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bb_die($lang['SEARCH_INVALID']);
|
bb_die(trans('messages.SEARCH_INVALID'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
|
@ -635,7 +635,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
switch ($lastvisited_type) {
|
switch ($lastvisited_type) {
|
||||||
case 'in':
|
case 'in':
|
||||||
$text = sprintf($lang['SEARCH_FOR_LASTVISITED_INTHELAST'], $lastvisited_days, (($lastvisited_days > 1) ? $lang['DAYS'] : $lang['DAY']));
|
$text = sprintf(trans('messages.SEARCH_FOR_LASTVISITED_INTHELAST'), $lastvisited_days, (($lastvisited_days > 1) ? trans('messages.DAYS') : trans('messages.DAY')));
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -646,7 +646,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
AND u.user_id <> " . GUEST_UID;
|
AND u.user_id <> " . GUEST_UID;
|
||||||
break;
|
break;
|
||||||
case 'after':
|
case 'after':
|
||||||
$text = sprintf($lang['SEARCH_FOR_LASTVISITED_AFTERTHELAST'], $lastvisited_days, (($lastvisited_days > 1) ? $lang['DAYS'] : $lang['DAY']));
|
$text = sprintf(trans('messages.SEARCH_FOR_LASTVISITED_AFTERTHELAST'), $lastvisited_days, (($lastvisited_days > 1) ? trans('messages.DAYS') : trans('messages.DAY')));
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -658,7 +658,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bb_die($lang['SEARCH_INVALID_LASTVISITED']);
|
bb_die(trans('messages.SEARCH_INVALID_LASTVISITED'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -668,10 +668,10 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$language_type = strtolower(trim(stripslashes($language_type)));
|
$language_type = strtolower(trim(stripslashes($language_type)));
|
||||||
|
|
||||||
if ($language_type == '') {
|
if ($language_type == '') {
|
||||||
bb_die($lang['SEARCH_INVALID_LANGUAGE']);
|
bb_die(trans('messages.SEARCH_INVALID_LANGUAGE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_LANGUAGE'], strip_tags(htmlspecialchars($language_type)));
|
$text = sprintf(trans('messages.SEARCH_FOR_LANGUAGE'), strip_tags(htmlspecialchars($language_type)));
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . "
|
FROM ' . BB_USERS . "
|
||||||
|
@ -684,7 +684,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
case 'search_timezone':
|
case 'search_timezone':
|
||||||
$base_url .= '&search_timezone=true&timezone_type=' . rawurlencode(stripslashes($timezone_type));
|
$base_url .= '&search_timezone=true&timezone_type=' . rawurlencode(stripslashes($timezone_type));
|
||||||
$text = sprintf($lang['SEARCH_FOR_TIMEZONE'], strip_tags(htmlspecialchars(stripslashes($timezone_type))));
|
$text = sprintf(trans('messages.SEARCH_FOR_TIMEZONE'), strip_tags(htmlspecialchars(stripslashes($timezone_type))));
|
||||||
|
|
||||||
$timezone_type = (int)$timezone_type;
|
$timezone_type = (int)$timezone_type;
|
||||||
|
|
||||||
|
@ -708,12 +708,12 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OLD_DB()->num_rows($result) == 0) {
|
if (OLD_DB()->num_rows($result) == 0) {
|
||||||
bb_die($lang['SEARCH_INVALID_MODERATORS']);
|
bb_die(trans('messages.SEARCH_INVALID_MODERATORS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$forum_name = OLD_DB()->sql_fetchrow($result);
|
$forum_name = OLD_DB()->sql_fetchrow($result);
|
||||||
|
|
||||||
$text = sprintf($lang['SEARCH_FOR_MODERATORS'], htmlCHR($forum_name['forum_name']));
|
$text = sprintf(trans('messages.SEARCH_FOR_MODERATORS'), htmlCHR($forum_name['forum_name']));
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(DISTINCT u.user_id) AS total
|
$total_sql .= 'SELECT COUNT(DISTINCT u.user_id) AS total
|
||||||
FROM ' . BB_USERS . ' AS u, ' . BB_GROUPS . ' AS g, ' . BB_USER_GROUP . ' AS ug, ' . BB_AUTH_ACCESS . ' AS aa
|
FROM ' . BB_USERS . ' AS u, ' . BB_GROUPS . ' AS g, ' . BB_USER_GROUP . ' AS ug, ' . BB_AUTH_ACCESS . ' AS aa
|
||||||
|
@ -742,7 +742,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
switch ($misc) {
|
switch ($misc) {
|
||||||
case 'admins':
|
case 'admins':
|
||||||
$text = $lang['SEARCH_FOR_ADMINS'];
|
$text = trans('messages.SEARCH_FOR_ADMINS');
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . '
|
FROM ' . BB_USERS . '
|
||||||
|
@ -753,7 +753,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
AND u.user_id <> ' . GUEST_UID;
|
AND u.user_id <> ' . GUEST_UID;
|
||||||
break;
|
break;
|
||||||
case 'mods':
|
case 'mods':
|
||||||
$text = $lang['SEARCH_FOR_MODS'];
|
$text = trans('messages.SEARCH_FOR_MODS');
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . '
|
FROM ' . BB_USERS . '
|
||||||
|
@ -764,7 +764,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
AND u.user_id <> ' . GUEST_UID;
|
AND u.user_id <> ' . GUEST_UID;
|
||||||
break;
|
break;
|
||||||
case 'banned':
|
case 'banned':
|
||||||
$text = $lang['SEARCH_FOR_BANNED'];
|
$text = trans('messages.SEARCH_FOR_BANNED');
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(u.user_id) AS total
|
$total_sql .= 'SELECT COUNT(u.user_id) AS total
|
||||||
FROM ' . BB_USERS . ' AS u, ' . BB_BANLIST . ' AS b
|
FROM ' . BB_USERS . ' AS u, ' . BB_BANLIST . ' AS b
|
||||||
|
@ -777,7 +777,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
$text = $lang['SEARCH_FOR_DISABLED'];
|
$text = trans('messages.SEARCH_FOR_DISABLED');
|
||||||
|
|
||||||
$total_sql .= 'SELECT COUNT(user_id) AS total
|
$total_sql .= 'SELECT COUNT(user_id) AS total
|
||||||
FROM ' . BB_USERS . '
|
FROM ' . BB_USERS . '
|
||||||
|
@ -789,7 +789,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bb_die($lang['SEARCH_INVALID']);
|
bb_die(trans('messages.SEARCH_INVALID'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,7 +860,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$total_pages = OLD_DB()->sql_fetchrow($result);
|
$total_pages = OLD_DB()->sql_fetchrow($result);
|
||||||
|
|
||||||
if ($total_pages['total'] == 0) {
|
if ($total_pages['total'] == 0) {
|
||||||
bb_die($lang['SEARCH_NO_RESULTS']);
|
bb_die(trans('messages.SEARCH_NO_RESULTS'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$num_pages = ceil($total_pages['total'] / config('tp.topics_per_page'));
|
$num_pages = ceil($total_pages['total'] / config('tp.topics_per_page'));
|
||||||
|
@ -868,20 +868,20 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
$pagination = '';
|
$pagination = '';
|
||||||
|
|
||||||
if ($page > 1) {
|
if ($page > 1) {
|
||||||
$pagination .= '<a href="' . $base_url . '&sort=' . $sort . '&order=' . $order . '&page=' . ($page - 1) . '">' . $lang['PREVIOUS'] . '</a>';
|
$pagination .= '<a href="' . $base_url . '&sort=' . $sort . '&order=' . $order . '&page=' . ($page - 1) . '">' . trans('messages.PREVIOUS') . '</a>';
|
||||||
}
|
}
|
||||||
if ($page < $num_pages) {
|
if ($page < $num_pages) {
|
||||||
$pagination .= ($pagination == '') ? '<a href="' . $base_url . '&sort=' . $sort . '&order=' . $order . '&page=' . ($page + 1) . '">' . $lang['NEXT'] . '</a>' : ' | <a href="' . $base_url . '&sort=' . $sort . '&order=' . $order . '&page=' . ($page + 1) . '">' . $lang['NEXT'] . '</a>';
|
$pagination .= ($pagination == '') ? '<a href="' . $base_url . '&sort=' . $sort . '&order=' . $order . '&page=' . ($page + 1) . '">' . trans('messages.NEXT') . '</a>' : ' | <a href="' . $base_url . '&sort=' . $sort . '&order=' . $order . '&page=' . ($page + 1) . '">' . trans('messages.NEXT') . '</a>';
|
||||||
}
|
}
|
||||||
if ($num_pages > 2) {
|
if ($num_pages > 2) {
|
||||||
$pagination .= ' <input type="text" name="page" maxlength="5" size="2" class="post" /> <input type="submit" name="submit" value="' . $lang['GO'] . '" class="post" />';
|
$pagination .= ' <input type="text" name="page" maxlength="5" size="2" class="post" /> <input type="submit" name="submit" value="' . trans('messages.GO') . '" class="post" />';
|
||||||
}
|
}
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'TPL_ADMIN_USER_SEARCH_RESULTS' => true,
|
'TPL_ADMIN_USER_SEARCH_RESULTS' => true,
|
||||||
|
|
||||||
'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], $page, $num_pages),
|
'PAGE_NUMBER' => sprintf(trans('messages.PAGE_OF'), $page, $num_pages),
|
||||||
'PAGINATION' => $pagination,
|
'PAGINATION' => $pagination,
|
||||||
'NEW_SEARCH' => sprintf($lang['SEARCH_USERS_NEW'], $text, $total_pages['total'], 'admin_user_search.php'),
|
'NEW_SEARCH' => sprintf(trans('messages.SEARCH_USERS_NEW'), $text, $total_pages['total'], 'admin_user_search.php'),
|
||||||
|
|
||||||
'U_USERNAME' => ($sort == 'username') ? "$base_url&sort=$sort&order=$o_order" : "$base_url&sort=username&order=$order",
|
'U_USERNAME' => ($sort == 'username') ? "$base_url&sort=$sort&order=$o_order" : "$base_url&sort=username&order=$order",
|
||||||
'U_EMAIL' => ($sort == 'user_email') ? "$base_url&sort=$sort&order=$o_order" : "$base_url&sort=user_email&order=$order",
|
'U_EMAIL' => ($sort == 'user_email') ? "$base_url&sort=$sort&order=$o_order" : "$base_url&sort=user_email&order=$order",
|
||||||
|
@ -928,8 +928,8 @@ if (!isset($_REQUEST['dosearch'])) {
|
||||||
'JOINDATE' => bb_date($rowset[$i]['user_regdate']),
|
'JOINDATE' => bb_date($rowset[$i]['user_regdate']),
|
||||||
'LASTVISIT' => bb_date($rowset[$i]['user_lastvisit']),
|
'LASTVISIT' => bb_date($rowset[$i]['user_lastvisit']),
|
||||||
'POSTS' => $rowset[$i]['user_posts'],
|
'POSTS' => $rowset[$i]['user_posts'],
|
||||||
'BAN' => (!isset($banned[$rowset[$i]['user_id']])) ? $lang['NOT_BANNED'] : $lang['BANNED'],
|
'BAN' => (!isset($banned[$rowset[$i]['user_id']])) ? trans('messages.NOT_BANNED') : trans('messages.BANNED'),
|
||||||
'ABLED' => $rowset[$i]['user_active'] ? $lang['ENABLED'] : $lang['DISABLED'],
|
'ABLED' => $rowset[$i]['user_active'] ? trans('messages.ENABLED') : trans('messages.DISABLED'),
|
||||||
|
|
||||||
'U_VIEWPOSTS' => "../search.php?search_author=1&uid={$rowset[$i]['user_id']}",
|
'U_VIEWPOSTS' => "../search.php?search_author=1&uid={$rowset[$i]['user_id']}",
|
||||||
'U_MANAGE' => '../profile.php?mode=editprofile&' . POST_USERS_URL . '=' . $rowset[$i]['user_id'] . '&admin=1',
|
'U_MANAGE' => '../profile.php?mode=editprofile&' . POST_USERS_URL . '=' . $rowset[$i]['user_id'] . '&admin=1',
|
||||||
|
|
|
@ -45,7 +45,7 @@ if ($mode != '') {
|
||||||
$word = $word_info['word'];
|
$word = $word_info['word'];
|
||||||
$replacement = $word_info['replacement'];
|
$replacement = $word_info['replacement'];
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_WORD_SELECTED']);
|
bb_die(trans('messages.NO_WORD_SELECTED'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,18 +62,18 @@ if ($mode != '') {
|
||||||
$replacement = trim(request_var('replacement', ''));
|
$replacement = trim(request_var('replacement', ''));
|
||||||
|
|
||||||
if ($word == '' || $replacement == '') {
|
if ($word == '' || $replacement == '') {
|
||||||
bb_die($lang['MUST_ENTER_WORD']);
|
bb_die(trans('messages.MUST_ENTER_WORD'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($word_id) {
|
if ($word_id) {
|
||||||
$sql = 'UPDATE ' . BB_WORDS . "
|
$sql = 'UPDATE ' . BB_WORDS . "
|
||||||
SET word = '" . OLD_DB()->escape($word) . "', replacement = '" . OLD_DB()->escape($replacement) . "'
|
SET word = '" . OLD_DB()->escape($word) . "', replacement = '" . OLD_DB()->escape($replacement) . "'
|
||||||
WHERE word_id = $word_id";
|
WHERE word_id = $word_id";
|
||||||
$message = $lang['WORD_UPDATED'];
|
$message = trans('messages.WORD_UPDATED');
|
||||||
} else {
|
} else {
|
||||||
$sql = 'INSERT INTO ' . BB_WORDS . " (word, replacement)
|
$sql = 'INSERT INTO ' . BB_WORDS . " (word, replacement)
|
||||||
VALUES ('" . OLD_DB()->escape($word) . "', '" . OLD_DB()->escape($replacement) . "')";
|
VALUES ('" . OLD_DB()->escape($word) . "', '" . OLD_DB()->escape($replacement) . "')";
|
||||||
$message = $lang['WORD_ADDED'];
|
$message = trans('messages.WORD_ADDED');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$result = OLD_DB()->sql_query($sql)) {
|
if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
|
@ -81,7 +81,7 @@ if ($mode != '') {
|
||||||
}
|
}
|
||||||
|
|
||||||
OLD_CACHE('bb_cache')->rm('censored');
|
OLD_CACHE('bb_cache')->rm('censored');
|
||||||
$message .= '<br /><br />' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>');
|
$message .= '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_WORDADMIN'), '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} elseif ($mode == 'delete') {
|
} elseif ($mode == 'delete') {
|
||||||
|
@ -96,9 +96,9 @@ if ($mode != '') {
|
||||||
|
|
||||||
OLD_CACHE('bb_cache')->rm('censored');
|
OLD_CACHE('bb_cache')->rm('censored');
|
||||||
|
|
||||||
bb_die($lang['WORD_REMOVED'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_WORDADMIN'], '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
bb_die(trans('messages.WORD_REMOVED') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_WORDADMIN'), '<a href="admin_words.php">', '</a>') . '<br /><br />' . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), '<a href="index.php?pane=right">', '</a>'));
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_WORD_SELECTED']);
|
bb_die(trans('messages.NO_WORD_SELECTED'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -34,7 +34,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
ksort($module);
|
ksort($module);
|
||||||
|
|
||||||
foreach ($module as $cat => $action_array) {
|
foreach ($module as $cat => $action_array) {
|
||||||
$cat = (!empty($lang[$cat])) ? $lang[$cat] : preg_replace('/_/', ' ', $cat);
|
$cat = (trans('messages.' . $cat) !== 'messages.' . $cat) ? trans('messages.' . $cat) : preg_replace('/_/', ' ', $cat);
|
||||||
|
|
||||||
$template->assign_block_vars('catrow', array(
|
$template->assign_block_vars('catrow', array(
|
||||||
'ADMIN_CATEGORY' => $cat,
|
'ADMIN_CATEGORY' => $cat,
|
||||||
|
@ -46,7 +46,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
foreach ($action_array as $action => $file) {
|
foreach ($action_array as $action => $file) {
|
||||||
$row_class = !($row_count % 2) ? 'row1' : 'row2';
|
$row_class = !($row_count % 2) ? 'row1' : 'row2';
|
||||||
|
|
||||||
$action = (!empty($lang[$action])) ? $lang[$action] : preg_replace('/_/', ' ', $action);
|
$action = (trans('messages.' . $action) !== 'messages.' . $action) ? trans('messages.' . $action) : preg_replace('/_/', ' ', $action);
|
||||||
|
|
||||||
$template->assign_block_vars('catrow.modulerow', array(
|
$template->assign_block_vars('catrow.modulerow', array(
|
||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
|
@ -86,7 +86,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
|
|
||||||
$avatar_dir_size = humn_size($avatar_dir_size);
|
$avatar_dir_size = humn_size($avatar_dir_size);
|
||||||
} else {
|
} else {
|
||||||
$avatar_dir_size = $lang['NOT_AVAILABLE'];
|
$avatar_dir_size = trans('messages.NOT_AVAILABLE');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int)$posts_per_day > $total_posts) {
|
if ((int)$posts_per_day > $total_posts) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ if (IS_GUEST) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_ADMIN) {
|
if (!IS_ADMIN) {
|
||||||
bb_die($lang['NOT_ADMIN']);
|
bb_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$userdata['session_admin']) {
|
if (!$userdata['session_admin']) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ require BB_ROOT . 'common.php';
|
||||||
$user->session_start();
|
$user->session_start();
|
||||||
|
|
||||||
if (!IS_ADMIN) {
|
if (!IS_ADMIN) {
|
||||||
bb_die($lang['NOT_AUTHORISED']);
|
bb_die(trans('messages.NOT_AUTHORISED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql[] = 'SELECT count(*) FROM `' . BB_USERS . '` WHERE `user_lastvisit` < UNIX_TIMESTAMP()-2592000';
|
$sql[] = 'SELECT count(*) FROM `' . BB_USERS . '` WHERE `user_lastvisit` < UNIX_TIMESTAMP()-2592000';
|
||||||
|
@ -31,7 +31,7 @@ echo '<br /><br /><table border="1" cellspacing="0" cellpadding="6" align="cente
|
||||||
|
|
||||||
foreach ($sql as $i => $query) {
|
foreach ($sql as $i => $query) {
|
||||||
$row = mysqli_fetch_row(OLD_DB()->query($query));
|
$row = mysqli_fetch_row(OLD_DB()->query($query));
|
||||||
echo "<tr><td>{$lang['TR_STATS'][$i]}</td><td><b>{$row[0]}</b></td>";
|
echo "<tr><td>" . trans('messages.TR_STATS.' . $i) . "</td><td><b>{$row[0]}</b></td>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
|
@ -14,7 +14,7 @@ require BB_ROOT . 'common.php';
|
||||||
$user->session_start();
|
$user->session_start();
|
||||||
|
|
||||||
if (!IS_ADMIN) {
|
if (!IS_ADMIN) {
|
||||||
bb_die($lang['NOT_AUTHORISED']);
|
bb_die(trans('messages.NOT_AUTHORISED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$peers_in_last_minutes = [30, 15, 5, 1];
|
$peers_in_last_minutes = [30, 15, 5, 1];
|
||||||
|
|
4
ajax.php
4
ajax.php
|
@ -22,9 +22,9 @@ $user->session_start();
|
||||||
// Exit if board is disabled via ON/OFF trigger or by admin
|
// Exit if board is disabled via ON/OFF trigger or by admin
|
||||||
if ($ajax->action != 'manage_admin') {
|
if ($ajax->action != 'manage_admin') {
|
||||||
if (config('tp.board_disable')) {
|
if (config('tp.board_disable')) {
|
||||||
$ajax->ajax_die($lang['BOARD_DISABLE']);
|
$ajax->ajax_die(trans('messages.BOARD_DISABLE'));
|
||||||
} elseif (file_exists(BB_DISABLED)) {
|
} elseif (file_exists(BB_DISABLED)) {
|
||||||
$ajax->ajax_die($lang['BOARD_DISABLE_CRON']);
|
$ajax->ajax_die(trans('messages.BOARD_DISABLE_CRON'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@ use Illuminate\Database\Capsule\Manager;
|
||||||
use Illuminate\Database\Events\StatementPrepared;
|
use Illuminate\Database\Events\StatementPrepared;
|
||||||
use Illuminate\Events\Dispatcher;
|
use Illuminate\Events\Dispatcher;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
use Illuminate\Filesystem\Filesystem;
|
||||||
|
use Illuminate\Translation\FileLoader;
|
||||||
|
use Illuminate\Translation\Translator;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -138,3 +140,21 @@ $container->singleton('cache', function ($container) {
|
||||||
|
|
||||||
return $cache->driver();
|
return $cache->driver();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Localization
|
||||||
|
*/
|
||||||
|
$container->singleton('translator', function ($app) {
|
||||||
|
$loader = $app['translation.loader'];
|
||||||
|
$locale = $app['config']['app.locale'];
|
||||||
|
|
||||||
|
$trans = new Translator($loader, $locale);
|
||||||
|
|
||||||
|
$trans->setFallback($app['config']['app.fallback_locale']);
|
||||||
|
|
||||||
|
return $trans;
|
||||||
|
});
|
||||||
|
|
||||||
|
$container->singleton('translation.loader', function ($app) {
|
||||||
|
return new FileLoader($app['files'], __DIR__ . '/resources/lang');
|
||||||
|
});
|
||||||
|
|
14
callseed.php
14
callseed.php
|
@ -21,10 +21,10 @@ $forum_id = $t_data['forum_id'];
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
|
|
||||||
if ($t_data['seeders'] > 2) {
|
if ($t_data['seeders'] > 2) {
|
||||||
bb_die(sprintf($lang['CALLSEED_HAVE_SEED'], $t_data['seeders']));
|
bb_die(sprintf(trans('messages.CALLSEED_HAVE_SEED'), $t_data['seeders']));
|
||||||
} elseif ($t_data['call_seed_time'] > (TIMENOW - 86400)) {
|
} elseif ($t_data['call_seed_time'] > (TIMENOW - 86400)) {
|
||||||
$time_left = delta_time($t_data['call_seed_time'] + 86400, TIMENOW, 'days');
|
$time_left = delta_time($t_data['call_seed_time'] + 86400, TIMENOW, 'days');
|
||||||
bb_die(sprintf($lang['CALLSEED_MSG_SPAM'], $time_left));
|
bb_die(sprintf(trans('messages.CALLSEED_MSG_SPAM'), $time_left));
|
||||||
}
|
}
|
||||||
|
|
||||||
$ban_user_id = [];
|
$ban_user_id = [];
|
||||||
|
@ -48,8 +48,8 @@ $user_list = OLD_DB()->fetch_rowset("
|
||||||
GROUP BY dl.user_id
|
GROUP BY dl.user_id
|
||||||
");
|
");
|
||||||
|
|
||||||
$subject = sprintf($lang['CALLSEED_SUBJECT'], $t_data['topic_title']);
|
$subject = sprintf(trans('messages.CALLSEED_SUBJECT'), $t_data['topic_title']);
|
||||||
$message = sprintf($lang['CALLSEED_TEXT'], make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DOWNLOAD_URL . $t_data['attach_id']));
|
$message = sprintf(trans('messages.CALLSEED_TEXT'), make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DOWNLOAD_URL . $t_data['attach_id']));
|
||||||
|
|
||||||
if ($user_list) {
|
if ($user_list) {
|
||||||
foreach ($user_list as $row) {
|
foreach ($user_list as $row) {
|
||||||
|
@ -68,12 +68,10 @@ if ($user_list) {
|
||||||
OLD_DB()->query("UPDATE " . BB_BT_TORRENTS . " SET call_seed_time = " . TIMENOW . " WHERE topic_id = $topic_id");
|
OLD_DB()->query("UPDATE " . BB_BT_TORRENTS . " SET call_seed_time = " . TIMENOW . " WHERE topic_id = $topic_id");
|
||||||
|
|
||||||
meta_refresh(TOPIC_URL . $topic_id);
|
meta_refresh(TOPIC_URL . $topic_id);
|
||||||
bb_die($lang['CALLSEED_MSG_OK']);
|
bb_die(trans('messages.CALLSEED_MSG_OK'));
|
||||||
|
|
||||||
function topic_info($topic_id)
|
function topic_info($topic_id)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT
|
SELECT
|
||||||
tor.poster_id, tor.forum_id, tor.attach_id, tor.call_seed_time,
|
tor.poster_id, tor.forum_id, tor.attach_id, tor.call_seed_time,
|
||||||
|
@ -85,7 +83,7 @@ function topic_info($topic_id)
|
||||||
";
|
";
|
||||||
|
|
||||||
if (!$torrent = OLD_DB()->fetch_row($sql)) {
|
if (!$torrent = OLD_DB()->fetch_row($sql)) {
|
||||||
bb_die($lang['TOPIC_POST_NOT_EXIST']);
|
bb_die(trans('messages.TOPIC_POST_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $torrent;
|
return $torrent;
|
||||||
|
|
10
common.php
10
common.php
|
@ -107,6 +107,11 @@ if (config('tp.bugsnag.enabled')) {
|
||||||
*/
|
*/
|
||||||
$DBS = new TorrentPier\Legacy\Dbs(config('tp'));
|
$DBS = new TorrentPier\Legacy\Dbs(config('tp'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $db_alias
|
||||||
|
* @return mixed
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
function OLD_DB($db_alias = 'db')
|
function OLD_DB($db_alias = 'db')
|
||||||
{
|
{
|
||||||
global $DBS;
|
global $DBS;
|
||||||
|
@ -118,6 +123,11 @@ function OLD_DB($db_alias = 'db')
|
||||||
*/
|
*/
|
||||||
$CACHES = new TorrentPier\Legacy\Caches(config('tp'));
|
$CACHES = new TorrentPier\Legacy\Caches(config('tp'));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $cache_name
|
||||||
|
* @return mixed
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
function OLD_CACHE($cache_name)
|
function OLD_CACHE($cache_name)
|
||||||
{
|
{
|
||||||
global $CACHES;
|
global $CACHES;
|
||||||
|
|
13
config/app.php
Normal file
13
config/app.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* TorrentPier – Bull-powered BitTorrent tracker engine
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2005-2017 TorrentPier (https://torrentpier.com)
|
||||||
|
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
|
||||||
|
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||||||
|
*/
|
||||||
|
|
||||||
|
return [
|
||||||
|
'locale' => 'ru',
|
||||||
|
'fallback_locale' => 'source',
|
||||||
|
];
|
|
@ -376,8 +376,6 @@ return [
|
||||||
'copyright_holders_url' => 'info.php?show=copyright_holders',
|
'copyright_holders_url' => 'info.php?show=copyright_holders',
|
||||||
'advert_url' => 'info.php?show=advert',
|
'advert_url' => 'info.php?show=advert',
|
||||||
|
|
||||||
'default_lang_dir' => LANG_ROOT_DIR . '/en/',
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extensions
|
* Extensions
|
||||||
*/
|
*/
|
||||||
|
|
12
crowdin.yml
12
crowdin.yml
|
@ -1,7 +1,7 @@
|
||||||
files:
|
files:
|
||||||
- source: /library/language/source/*.*
|
- source: /resources/lang/source/*.*
|
||||||
translation: /library/language/%two_letters_code%/%original_file_name%
|
translation: /resources/lang/%two_letters_code%/%original_file_name%
|
||||||
- source: /library/language/source/email/*.*
|
- source: /resources/lang/source/email/*.*
|
||||||
translation: /library/language/%two_letters_code%/email/%original_file_name%
|
translation: /resources/lang/%two_letters_code%/email/%original_file_name%
|
||||||
- source: /library/language/source/html/*.*
|
- source: /resources/lang/source/html/*.*
|
||||||
translation: /library/language/%two_letters_code%/html/%original_file_name%
|
translation: /resources/lang/%two_letters_code%/html/%original_file_name%
|
||||||
|
|
22
dl.php
22
dl.php
|
@ -24,14 +24,14 @@ $thumbnail = request_var('thumb', 0);
|
||||||
// Send file to browser
|
// Send file to browser
|
||||||
function send_file_to_browser($attachment, $upload_dir)
|
function send_file_to_browser($attachment, $upload_dir)
|
||||||
{
|
{
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
$filename = ($upload_dir == '') ? $attachment['physical_filename'] : $upload_dir . '/' . $attachment['physical_filename'];
|
$filename = ($upload_dir == '') ? $attachment['physical_filename'] : $upload_dir . '/' . $attachment['physical_filename'];
|
||||||
|
|
||||||
$gotit = false;
|
$gotit = false;
|
||||||
|
|
||||||
if (@!file_exists(@amod_realpath($filename))) {
|
if (@!file_exists(@amod_realpath($filename))) {
|
||||||
bb_die($lang['ERROR_NO_ATTACHMENT'] . "<br /><br />" . $filename . "<br /><br />" . $lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.ERROR_NO_ATTACHMENT') . "<br /><br />" . $filename . "<br /><br />" . trans('messages.TOR_NOT_FOUND'));
|
||||||
} else {
|
} else {
|
||||||
$gotit = true;
|
$gotit = true;
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ function send_file_to_browser($attachment, $upload_dir)
|
||||||
}
|
}
|
||||||
readfile($filename);
|
readfile($filename);
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['ERROR_NO_ATTACHMENT'] . "<br /><br />" . $filename . "<br /><br />" . $lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.ERROR_NO_ATTACHMENT') . "<br /><br />" . $filename . "<br /><br />" . trans('messages.TOR_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
|
@ -81,11 +81,11 @@ $user->session_start();
|
||||||
set_die_append_msg();
|
set_die_append_msg();
|
||||||
|
|
||||||
if (!$download_id) {
|
if (!$download_id) {
|
||||||
bb_die($lang['NO_ATTACHMENT_SELECTED']);
|
bb_die(trans('messages.NO_ATTACHMENT_SELECTED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($attach_config['disable_mod'] && !IS_ADMIN) {
|
if ($attach_config['disable_mod'] && !IS_ADMIN) {
|
||||||
bb_die($lang['ATTACHMENT_FEATURE_DISABLED']);
|
bb_die(trans('messages.ATTACHMENT_FEATURE_DISABLED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT * FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int)$download_id;
|
$sql = 'SELECT * FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int)$download_id;
|
||||||
|
@ -95,7 +95,7 @@ if (!($result = OLD_DB()->sql_query($sql))) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!($attachment = OLD_DB()->sql_fetchrow($result))) {
|
if (!($attachment = OLD_DB()->sql_fetchrow($result))) {
|
||||||
bb_die($lang['ERROR_NO_ATTACHMENT']);
|
bb_die(trans('messages.ERROR_NO_ATTACHMENT'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$attachment['physical_filename'] = basename($attachment['physical_filename']);
|
$attachment['physical_filename'] = basename($attachment['physical_filename']);
|
||||||
|
@ -140,7 +140,7 @@ for ($i = 0; $i < $num_auth_pages && $authorised == false; $i++) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$authorised) {
|
if (!$authorised) {
|
||||||
bb_die($lang['SORRY_AUTH_VIEW_ATTACH']);
|
bb_die(trans('messages.SORRY_AUTH_VIEW_ATTACH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$datastore->rm('cat_forums');
|
$datastore->rm('cat_forums');
|
||||||
|
@ -159,7 +159,7 @@ for ($i = 0; $i < $num_rows; $i++) {
|
||||||
|
|
||||||
// Disallowed
|
// Disallowed
|
||||||
if (!in_array($attachment['extension'], $allowed_extensions) && !IS_ADMIN) {
|
if (!in_array($attachment['extension'], $allowed_extensions) && !IS_ADMIN) {
|
||||||
bb_die(sprintf($lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']));
|
bb_die(sprintf(trans('messages.EXTENSION_DISABLED_AFTER_POSTING'), $attachment['extension']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$download_mode = (int)$download_mode[$attachment['extension']];
|
$download_mode = (int)$download_mode[$attachment['extension']];
|
||||||
|
@ -189,11 +189,11 @@ if (IS_GUEST && !bb_captcha('check')) {
|
||||||
|
|
||||||
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';
|
$redirect_url = $_POST['redirect_url'] ?? $_SERVER['HTTP_REFERER'] ?? '/';
|
||||||
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
|
$message = '<form action="' . DOWNLOAD_URL . $attachment['attach_id'] . '" method="post">';
|
||||||
$message .= $lang['CAPTCHA'] . ':';
|
$message .= trans('messages.CAPTCHA') . ':';
|
||||||
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
|
$message .= '<div class="mrg_10" align="center">' . bb_captcha('get') . '</div>';
|
||||||
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
|
$message .= '<input type="hidden" name="redirect_url" value="' . $redirect_url . '" />';
|
||||||
$message .= '<input type="submit" class="bold" value="' . $lang['SUBMIT'] . '" /> ';
|
$message .= '<input type="submit" class="bold" value="' . trans('messages.SUBMIT') . '" /> ';
|
||||||
$message .= '<input type="button" class="bold" value="' . $lang['GO_BACK'] . '" onclick="document.location.href = \'' . $redirect_url . '\';" />';
|
$message .= '<input type="button" class="bold" value="' . trans('messages.GO_BACK') . '" onclick="document.location.href = \'' . $redirect_url . '\';" />';
|
||||||
$message .= '</form>';
|
$message .= '</form>';
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
|
|
@ -73,7 +73,7 @@ if ($mode == 'dl_delete' && $topic_id) {
|
||||||
$is_auth = auth_user(AUTH_ALL, $row['forum_id'], $userdata);
|
$is_auth = auth_user(AUTH_ALL, $row['forum_id'], $userdata);
|
||||||
|
|
||||||
if (!$is_auth['auth_mod']) {
|
if (!$is_auth['auth_mod']) {
|
||||||
bb_die($lang['NOT_MODERATOR']);
|
bb_die(trans('messages.NOT_MODERATOR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ if ($mode == 'dl_delete' && $topic_id) {
|
||||||
);
|
);
|
||||||
|
|
||||||
print_confirmation(array(
|
print_confirmation(array(
|
||||||
'QUESTION' => $lang['DL_LIST_DEL_CONFIRM'],
|
'QUESTION' => trans('messages.DL_LIST_DEL_CONFIRM'),
|
||||||
'FORM_ACTION' => 'dl_list.php',
|
'FORM_ACTION' => 'dl_list.php',
|
||||||
'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
||||||
));
|
));
|
||||||
|
@ -100,7 +100,7 @@ $req_topics_ary = $topics_ary = array();
|
||||||
// Get topics selected by user
|
// Get topics selected by user
|
||||||
if ($mode == 'set_topics_dl_status') {
|
if ($mode == 'set_topics_dl_status') {
|
||||||
if (!isset($_POST['dl_topics_id_list']) || !is_array($_POST['dl_topics_id_list'])) {
|
if (!isset($_POST['dl_topics_id_list']) || !is_array($_POST['dl_topics_id_list'])) {
|
||||||
bb_die($lang['NONE_SELECTED']);
|
bb_die(trans('messages.NONE_SELECTED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($_POST['dl_topics_id_list'] as $topic_id) {
|
foreach ($_POST['dl_topics_id_list'] as $topic_id) {
|
||||||
|
|
14
feed.php
14
feed.php
|
@ -19,7 +19,7 @@ $id = $_POST['id'] ?? 0;
|
||||||
$timecheck = TIMENOW - 600;
|
$timecheck = TIMENOW - 600;
|
||||||
|
|
||||||
if (!$mode) {
|
if (!$mode) {
|
||||||
bb_simple_die($lang['ATOM_NO_MODE']);
|
bb_simple_die(trans('messages.ATOM_NO_MODE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
|
if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
|
||||||
|
@ -30,7 +30,7 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
|
||||||
if ($id == 0) {
|
if ($id == 0) {
|
||||||
$forum_data = array();
|
$forum_data = array();
|
||||||
} else {
|
} else {
|
||||||
bb_simple_die($lang['ATOM_ERROR'] . ' #1');
|
bb_simple_die(trans('messages.ATOM_ERROR') . ' #1');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (file_exists(config('tp.atom.path') . '/f/' . $id . '.atom') && filemtime(config('tp.atom.path') . '/f/' . $id . '.atom') > $timecheck) {
|
if (file_exists(config('tp.atom.path') . '/f/' . $id . '.atom') && filemtime(config('tp.atom.path') . '/f/' . $id . '.atom') > $timecheck) {
|
||||||
|
@ -40,17 +40,17 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
|
||||||
if (update_forum_feed($id, $forum_data)) {
|
if (update_forum_feed($id, $forum_data)) {
|
||||||
redirectToUrl(config('tp.atom.url') . '/f/' . $id . '.atom');
|
redirectToUrl(config('tp.atom.url') . '/f/' . $id . '.atom');
|
||||||
} else {
|
} else {
|
||||||
bb_simple_die($lang['ATOM_NO_FORUM']);
|
bb_simple_die(trans('messages.ATOM_NO_FORUM'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($type == 'u') {
|
if ($type == 'u') {
|
||||||
// Check if the user has actually sent a user ID
|
// Check if the user has actually sent a user ID
|
||||||
if ($id < 1) {
|
if ($id < 1) {
|
||||||
bb_simple_die($lang['ATOM_ERROR'] . ' #2');
|
bb_simple_die(trans('messages.ATOM_ERROR') . ' #2');
|
||||||
}
|
}
|
||||||
if (!$username = get_username($id)) {
|
if (!$username = get_username($id)) {
|
||||||
bb_simple_die($lang['ATOM_ERROR'] . ' #3');
|
bb_simple_die(trans('messages.ATOM_ERROR') . ' #3');
|
||||||
}
|
}
|
||||||
if (file_exists(config('tp.atom.path') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') && filemtime(config('tp.atom.path') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') > $timecheck) {
|
if (file_exists(config('tp.atom.path') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') && filemtime(config('tp.atom.path') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom') > $timecheck) {
|
||||||
redirectToUrl(config('tp.atom.url') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
|
redirectToUrl(config('tp.atom.url') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
|
||||||
|
@ -59,10 +59,10 @@ if ($mode == 'get_feed_url' && ($type == 'f' || $type == 'u') && $id >= 0) {
|
||||||
if (update_user_feed($id, $username)) {
|
if (update_user_feed($id, $username)) {
|
||||||
redirectToUrl(config('tp.atom.url') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
|
redirectToUrl(config('tp.atom.url') . '/u/' . floor($id / 5000) . '/' . ($id % 100) . '/' . $id . '.atom');
|
||||||
} else {
|
} else {
|
||||||
bb_simple_die($lang['ATOM_NO_USER']);
|
bb_simple_die(trans('messages.ATOM_NO_USER'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bb_simple_die($lang['ATOM_ERROR'] . ' #4');
|
bb_simple_die(trans('messages.ATOM_ERROR') . ' #4');
|
||||||
}
|
}
|
||||||
|
|
75
group.php
75
group.php
|
@ -20,13 +20,13 @@ $select_sort_mode = $select_sort_order = '';
|
||||||
|
|
||||||
function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$pm, &$email, &$www, &$user_time, &$avatar)
|
function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$pm, &$email, &$www, &$user_time, &$avatar)
|
||||||
{
|
{
|
||||||
global $lang, $images;
|
global $images;
|
||||||
|
|
||||||
$from = (!empty($row['user_from'])) ? $row['user_from'] : '';
|
$from = (!empty($row['user_from'])) ? $row['user_from'] : '';
|
||||||
$joined = bb_date($row['user_regdate']);
|
$joined = bb_date($row['user_regdate']);
|
||||||
$user_time = (!empty($row['user_time'])) ? bb_date($row['user_time']) : $lang['NONE'];
|
$user_time = (!empty($row['user_time'])) ? bb_date($row['user_time']) : trans('messages.NONE');
|
||||||
$posts = $row['user_posts'] ?: 0;
|
$posts = $row['user_posts'] ?: 0;
|
||||||
$pm = '<a class="txtb" href="' . (PM_URL . "?mode=post&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $lang['SEND_PM_TXTB'] . '</a>';
|
$pm = '<a class="txtb" href="' . (PM_URL . "?mode=post&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . trans('messages.SEND_PM_TXTB') . '</a>';
|
||||||
$avatar = get_avatar($row['user_id'], $row['avatar_ext_id'], !bf($row['user_opt'], 'user_opt', 'dis_avatar'), '', 50, 50);
|
$avatar = get_avatar($row['user_id'], $row['avatar_ext_id'], !bf($row['user_opt'], 'user_opt', 'dis_avatar'), '', 50, 50);
|
||||||
|
|
||||||
if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || $group_mod) {
|
if (bf($row['user_opt'], 'user_opt', 'user_viewemail') || $group_mod) {
|
||||||
|
@ -37,7 +37,7 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row['user_website']) {
|
if ($row['user_website']) {
|
||||||
$www = '<a class="txtb" href="' . $row['user_website'] . '" target="_userwww">' . $lang['VISIT_WEBSITE_TXTB'] . '</a>';
|
$www = '<a class="txtb" href="' . $row['user_website'] . '" target="_userwww">' . trans('messages.VISIT_WEBSITE_TXTB') . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$www = '';
|
$www = '';
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ $is_moderator = false;
|
||||||
|
|
||||||
if ($group_id) {
|
if ($group_id) {
|
||||||
if (!$group_info = get_group_data($group_id)) {
|
if (!$group_info = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
if (!$group_info['group_id'] || !$group_info['group_moderator'] || !$group_info['moderator_name']) {
|
if (!$group_info['group_id'] || !$group_info['group_moderator'] || !$group_info['moderator_name']) {
|
||||||
bb_die("Invalid group data [group_id: $group_id]");
|
bb_die("Invalid group data [group_id: $group_id]");
|
||||||
|
@ -126,17 +126,16 @@ if (!$group_id) {
|
||||||
|
|
||||||
function build_group($params)
|
function build_group($params)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$options = '';
|
$options = '';
|
||||||
|
|
||||||
foreach ($params as $name => $data) {
|
foreach ($params as $name => $data) {
|
||||||
$text = htmlCHR(str_short(rtrim($name), HTML_SELECT_MAX_LENGTH));
|
$text = htmlCHR(str_short(rtrim($name), HTML_SELECT_MAX_LENGTH));
|
||||||
|
|
||||||
$members = ($data['m']) ? $lang['MEMBERS_IN_GROUP'] . ': ' . $data['m'] : $lang['NO_GROUP_MEMBERS'];
|
$members = ($data['m']) ? trans('messages.MEMBERS_IN_GROUP') . ': ' . $data['m'] : trans('messages.NO_GROUP_MEMBERS');
|
||||||
$candidates = ($data['c']) ? $lang['PENDING_MEMBERS'] . ': ' . $data['c'] : $lang['NO_PENDING_GROUP_MEMBERS'];
|
$candidates = ($data['c']) ? trans('messages.PENDING_MEMBERS') . ': ' . $data['c'] : trans('messages.NO_PENDING_GROUP_MEMBERS');
|
||||||
|
|
||||||
$options .= '<li class="pad_2"><a href="' . GROUP_URL . $data['id'] . '" class="med bold">' . $text . '</a></li>';
|
$options .= '<li class="pad_2"><a href="' . GROUP_URL . $data['id'] . '" class="med bold">' . $text . '</a></li>';
|
||||||
$options .= ($data['rg']) ? '<ul><li class="med">' . $lang['RELEASE_GROUP'] . '</li>' : '<ul>';
|
$options .= ($data['rg']) ? '<ul><li class="med">' . trans('messages.RELEASE_GROUP') . '</li>' : '<ul>';
|
||||||
$options .= '<li class="seedmed">' . $members . '</li>';
|
$options .= '<li class="seedmed">' . $members . '</li>';
|
||||||
if (IS_AM) {
|
if (IS_AM) {
|
||||||
$options .= '<li class="leechmed">' . $candidates . '</li>';
|
$options .= '<li class="leechmed">' . $candidates . '</li>';
|
||||||
|
@ -151,14 +150,14 @@ if (!$group_id) {
|
||||||
|
|
||||||
foreach ($groups as $type => $grp) {
|
foreach ($groups as $type => $grp) {
|
||||||
$template->assign_block_vars('groups', array(
|
$template->assign_block_vars('groups', array(
|
||||||
'MEMBERSHIP' => $lang["GROUP_MEMBER_{$type}"],
|
'MEMBERSHIP' => trans('messages.GROUP_MEMBER_' . $type),
|
||||||
'GROUP_SELECT' => build_group($grp),
|
'GROUP_SELECT' => build_group($grp),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SELECT_GROUP' => true,
|
'SELECT_GROUP' => true,
|
||||||
'PAGE_TITLE' => $lang['GROUP_CONTROL_PANEL'],
|
'PAGE_TITLE' => trans('messages.GROUP_CONTROL_PANEL'),
|
||||||
'S_USERGROUP_ACTION' => 'group.php',
|
'S_USERGROUP_ACTION' => 'group.php',
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
));
|
));
|
||||||
|
@ -166,12 +165,12 @@ if (!$group_id) {
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
redirectToUrl('admin/admin_groups.php');
|
redirectToUrl('admin/admin_groups.php');
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_GROUPS_EXIST']);
|
bb_die(trans('messages.NO_GROUPS_EXIST'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (isset($_POST['joingroup']) && $_POST['joingroup']) {
|
} elseif (isset($_POST['joingroup']) && $_POST['joingroup']) {
|
||||||
if ($group_info['group_type'] != GROUP_OPEN) {
|
if ($group_info['group_type'] != GROUP_OPEN) {
|
||||||
bb_die($lang['THIS_CLOSED_GROUP']);
|
bb_die(trans('messages.THIS_CLOSED_GROUP'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT g.group_id, g.group_name, ug.user_id, u.user_email, u.username, u.user_lang
|
$sql = "SELECT g.group_id, g.group_name, ug.user_id, u.user_email, u.username, u.user_lang
|
||||||
|
@ -186,11 +185,11 @@ if (!$group_id) {
|
||||||
$row = $moderator = OLD_DB()->fetch_row($sql);
|
$row = $moderator = OLD_DB()->fetch_row($sql);
|
||||||
|
|
||||||
if (!$row['group_id']) {
|
if (!$row['group_id']) {
|
||||||
bb_die($lang['NO_GROUPS_EXIST']);
|
bb_die(trans('messages.NO_GROUPS_EXIST'));
|
||||||
}
|
}
|
||||||
if ($row['user_id']) {
|
if ($row['user_id']) {
|
||||||
set_die_append_msg(false, false, $group_id);
|
set_die_append_msg(false, false, $group_id);
|
||||||
bb_die($lang['ALREADY_MEMBER_GROUP']);
|
bb_die(trans('messages.ALREADY_MEMBER_GROUP'));
|
||||||
}
|
}
|
||||||
|
|
||||||
add_user_into_group($group_id, $userdata['user_id'], 1, TIMENOW);
|
add_user_into_group($group_id, $userdata['user_id'], 1, TIMENOW);
|
||||||
|
@ -201,7 +200,7 @@ if (!$group_id) {
|
||||||
|
|
||||||
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
||||||
$emailer->set_to([$moderator['user_email'] => $moderator['username']]);
|
$emailer->set_to([$moderator['user_email'] => $moderator['username']]);
|
||||||
$emailer->set_subject($lang['EMAILER_SUBJECT']['GROUP_REQUEST']);
|
$emailer->set_subject(trans('messages.EMAILER_SUBJECT.GROUP_REQUEST'));
|
||||||
|
|
||||||
$emailer->set_template('group_request', $moderator['user_lang']);
|
$emailer->set_template('group_request', $moderator['user_lang']);
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
@ -215,24 +214,24 @@ if (!$group_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
set_die_append_msg(false, false, $group_id);
|
set_die_append_msg(false, false, $group_id);
|
||||||
bb_die($lang['GROUP_JOINED']);
|
bb_die(trans('messages.GROUP_JOINED'));
|
||||||
} elseif (!empty($_POST['unsub']) || !empty($_POST['unsubpending'])) {
|
} elseif (!empty($_POST['unsub']) || !empty($_POST['unsubpending'])) {
|
||||||
delete_user_group($group_id, $userdata['user_id']);
|
delete_user_group($group_id, $userdata['user_id']);
|
||||||
|
|
||||||
set_die_append_msg(false, false, $group_id);
|
set_die_append_msg(false, false, $group_id);
|
||||||
bb_die($lang['UNSUB_SUCCESS']);
|
bb_die(trans('messages.UNSUB_SUCCESS'));
|
||||||
} else {
|
} else {
|
||||||
// Handle Additions, removals, approvals and denials
|
// Handle Additions, removals, approvals and denials
|
||||||
$group_moderator = $group_info['group_moderator'];
|
$group_moderator = $group_info['group_moderator'];
|
||||||
|
|
||||||
if (!empty($_POST['add']) || !empty($_POST['remove']) || !empty($_POST['approve']) || !empty($_POST['deny'])) {
|
if (!empty($_POST['add']) || !empty($_POST['remove']) || !empty($_POST['approve']) || !empty($_POST['deny'])) {
|
||||||
if (!$is_moderator) {
|
if (!$is_moderator) {
|
||||||
bb_die($lang['NOT_GROUP_MODERATOR']);
|
bb_die(trans('messages.NOT_GROUP_MODERATOR'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['add'])) {
|
if (!empty($_POST['add'])) {
|
||||||
if (isset($_POST['username']) && !($row = get_userdata($_POST['username'], true))) {
|
if (isset($_POST['username']) && !($row = get_userdata($_POST['username'], true))) {
|
||||||
bb_die($lang['COULD_NOT_ADD_USER']);
|
bb_die(trans('messages.COULD_NOT_ADD_USER'));
|
||||||
}
|
}
|
||||||
|
|
||||||
add_user_into_group($group_id, $row['user_id']);
|
add_user_into_group($group_id, $row['user_id']);
|
||||||
|
@ -243,7 +242,7 @@ if (!$group_id) {
|
||||||
|
|
||||||
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
||||||
$emailer->set_to([$row['user_email'] => $row['username']]);
|
$emailer->set_to([$row['user_email'] => $row['username']]);
|
||||||
$emailer->set_subject($lang['EMAILER_SUBJECT']['GROUP_ADDED']);
|
$emailer->set_subject(trans('messages.EMAILER_SUBJECT.GROUP_ADDED'));
|
||||||
|
|
||||||
$emailer->set_template('group_added', $row['user_lang']);
|
$emailer->set_template('group_added', $row['user_lang']);
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
@ -263,7 +262,7 @@ if (!$group_id) {
|
||||||
$sql_in[] = (int)$members_id;
|
$sql_in[] = (int)$members_id;
|
||||||
}
|
}
|
||||||
if (!$sql_in = implode(',', $sql_in)) {
|
if (!$sql_in = implode(',', $sql_in)) {
|
||||||
bb_die($lang['NONE_SELECTED']);
|
bb_die(trans('messages.NONE_SELECTED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['approve'])) {
|
if (!empty($_POST['approve'])) {
|
||||||
|
@ -302,7 +301,7 @@ if (!$group_id) {
|
||||||
|
|
||||||
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
||||||
$emailer->set_to([$row['user_email'] => $row['username']]);
|
$emailer->set_to([$row['user_email'] => $row['username']]);
|
||||||
$emailer->set_subject($lang['EMAILER_SUBJECT']['GROUP_APPROVED']);
|
$emailer->set_subject(trans('messages.EMAILER_SUBJECT.GROUP_APPROVED'));
|
||||||
|
|
||||||
$emailer->set_template('group_approved', $row['user_lang']);
|
$emailer->set_template('group_approved', $row['user_lang']);
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
@ -344,29 +343,29 @@ if (!$group_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($userdata['user_id'] == $group_moderator['user_id']) {
|
if ($userdata['user_id'] == $group_moderator['user_id']) {
|
||||||
$group_details = $lang['ARE_GROUP_MODERATOR'];
|
$group_details = trans('messages.ARE_GROUP_MODERATOR');
|
||||||
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
||||||
} elseif ($is_group_member || $is_group_pending_member) {
|
} elseif ($is_group_member || $is_group_pending_member) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SHOW_UNSUBSCRIBE_CONTROLS' => true,
|
'SHOW_UNSUBSCRIBE_CONTROLS' => true,
|
||||||
'CONTROL_NAME' => ($is_group_member) ? 'unsub' : 'unsubpending',
|
'CONTROL_NAME' => ($is_group_member) ? 'unsub' : 'unsubpending',
|
||||||
));
|
));
|
||||||
$group_details = ($is_group_pending_member) ? $lang['PENDING_THIS_GROUP'] : $lang['MEMBER_THIS_GROUP'];
|
$group_details = ($is_group_pending_member) ? trans('messages.PENDING_THIS_GROUP') : trans('messages.MEMBER_THIS_GROUP');
|
||||||
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
||||||
} elseif (IS_GUEST) {
|
} elseif (IS_GUEST) {
|
||||||
$group_details = $lang['LOGIN_TO_JOIN'];
|
$group_details = trans('messages.LOGIN_TO_JOIN');
|
||||||
$s_hidden_fields = '';
|
$s_hidden_fields = '';
|
||||||
} else {
|
} else {
|
||||||
if ($group_info['group_type'] == GROUP_OPEN) {
|
if ($group_info['group_type'] == GROUP_OPEN) {
|
||||||
$template->assign_var('SHOW_SUBSCRIBE_CONTROLS');
|
$template->assign_var('SHOW_SUBSCRIBE_CONTROLS');
|
||||||
|
|
||||||
$group_details = $lang['THIS_OPEN_GROUP'];
|
$group_details = trans('messages.THIS_OPEN_GROUP');
|
||||||
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
||||||
} elseif ($group_info['group_type'] == GROUP_CLOSED) {
|
} elseif ($group_info['group_type'] == GROUP_CLOSED) {
|
||||||
$group_details = $lang['THIS_CLOSED_GROUP'];
|
$group_details = trans('messages.THIS_CLOSED_GROUP');
|
||||||
$s_hidden_fields = '';
|
$s_hidden_fields = '';
|
||||||
} elseif ($group_info['group_type'] == GROUP_HIDDEN) {
|
} elseif ($group_info['group_type'] == GROUP_HIDDEN) {
|
||||||
$group_details = $lang['THIS_HIDDEN_GROUP'];
|
$group_details = trans('messages.THIS_HIDDEN_GROUP');
|
||||||
$s_hidden_fields = '';
|
$s_hidden_fields = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -379,24 +378,24 @@ if (!$group_id) {
|
||||||
|
|
||||||
$group_type = '';
|
$group_type = '';
|
||||||
if ($group_info['group_type'] == GROUP_OPEN) {
|
if ($group_info['group_type'] == GROUP_OPEN) {
|
||||||
$group_type = $lang['GROUP_OPEN'];
|
$group_type = trans('messages.GROUP_OPEN');
|
||||||
} elseif ($group_info['group_type'] == GROUP_CLOSED) {
|
} elseif ($group_info['group_type'] == GROUP_CLOSED) {
|
||||||
$group_type = $lang['GROUP_CLOSED'];
|
$group_type = trans('messages.GROUP_CLOSED');
|
||||||
} elseif ($group_info['group_type'] == GROUP_HIDDEN) {
|
} elseif ($group_info['group_type'] == GROUP_HIDDEN) {
|
||||||
$group_type = $lang['GROUP_HIDDEN'];
|
$group_type = trans('messages.GROUP_HIDDEN');
|
||||||
}
|
}
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'ROW_NUMBER' => $i + ($start + 1),
|
'ROW_NUMBER' => $i + ($start + 1),
|
||||||
'GROUP_INFO' => true,
|
'GROUP_INFO' => true,
|
||||||
'PAGE_TITLE' => $lang['GROUP_CONTROL_PANEL'],
|
'PAGE_TITLE' => trans('messages.GROUP_CONTROL_PANEL'),
|
||||||
'GROUP_NAME' => htmlCHR($group_info['group_name']),
|
'GROUP_NAME' => htmlCHR($group_info['group_name']),
|
||||||
'GROUP_DESCRIPTION' => bbcode2html($group_info['group_description']),
|
'GROUP_DESCRIPTION' => bbcode2html($group_info['group_description']),
|
||||||
'GROUP_SIGNATURE' => bbcode2html($group_info['group_signature']),
|
'GROUP_SIGNATURE' => bbcode2html($group_info['group_signature']),
|
||||||
'GROUP_AVATAR' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id'], true),
|
'GROUP_AVATAR' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id'], true),
|
||||||
'GROUP_DETAILS' => $group_details,
|
'GROUP_DETAILS' => $group_details,
|
||||||
'GROUP_TIME' => (!empty($group_info['group_time'])) ? sprintf('%s <span class="posted_since">(%s)</span>', bb_date($group_info['group_time']), delta_time($group_info['group_time'])) : $lang['NONE'],
|
'GROUP_TIME' => (!empty($group_info['group_time'])) ? sprintf('%s <span class="posted_since">(%s)</span>', bb_date($group_info['group_time']), delta_time($group_info['group_time'])) : trans('messages.NONE'),
|
||||||
'MOD_USER' => profile_url($group_moderator),
|
'MOD_USER' => profile_url($group_moderator),
|
||||||
'MOD_AVATAR' => $avatar,
|
'MOD_AVATAR' => $avatar,
|
||||||
'MOD_FROM' => $from,
|
'MOD_FROM' => $from,
|
||||||
|
@ -405,7 +404,7 @@ if (!$group_id) {
|
||||||
'MOD_PM' => $pm,
|
'MOD_PM' => $pm,
|
||||||
'MOD_EMAIL' => $email,
|
'MOD_EMAIL' => $email,
|
||||||
'MOD_WWW' => $www,
|
'MOD_WWW' => $www,
|
||||||
'MOD_TIME' => (!empty($group_info['mod_time'])) ? bb_date($group_info['mod_time']) : $lang['NONE'],
|
'MOD_TIME' => (!empty($group_info['mod_time'])) ? bb_date($group_info['mod_time']) : trans('messages.NONE'),
|
||||||
'U_SEARCH_USER' => "search.php?mode=searchuser",
|
'U_SEARCH_USER' => "search.php?mode=searchuser",
|
||||||
'U_SEARCH_RELEASES' => "tracker.php?srg=$group_id",
|
'U_SEARCH_RELEASES' => "tracker.php?srg=$group_id",
|
||||||
'U_GROUP_RELEASES' => "group.php?view=releases&" . POST_GROUPS_URL . "=$group_id",
|
'U_GROUP_RELEASES' => "group.php?view=releases&" . POST_GROUPS_URL . "=$group_id",
|
||||||
|
@ -433,7 +432,7 @@ if (!$group_id) {
|
||||||
|
|
||||||
if (!$group_info['release_group']) {
|
if (!$group_info['release_group']) {
|
||||||
set_die_append_msg(false, false, $group_id);
|
set_die_append_msg(false, false, $group_id);
|
||||||
bb_die($lang['NOT_A_RELEASE_GROUP']);
|
bb_die(trans('messages.NOT_A_RELEASE_GROUP'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Count releases for pagination
|
// Count releases for pagination
|
||||||
|
@ -464,7 +463,7 @@ if (!$group_id) {
|
||||||
|
|
||||||
if (!$releases = OLD_DB()->fetch_rowset($sql)) {
|
if (!$releases = OLD_DB()->fetch_rowset($sql)) {
|
||||||
set_die_append_msg(false, false, $group_id);
|
set_die_append_msg(false, false, $group_id);
|
||||||
bb_die($lang['NO_SEARCH_MATCH']);
|
bb_die(trans('messages.NO_SEARCH_MATCH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($releases as $i => $release) {
|
foreach ($releases as $i => $release) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ $submit = !empty($_POST['submit']);
|
||||||
|
|
||||||
if ($group_id) {
|
if ($group_id) {
|
||||||
if (!$group_info = get_group_data($group_id)) {
|
if (!$group_info = get_group_data($group_id)) {
|
||||||
bb_die($lang['GROUP_NOT_EXIST']);
|
bb_die(trans('messages.GROUP_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
if (!$group_info['group_id'] || !$group_info['group_moderator'] || !$group_info['moderator_name']) {
|
if (!$group_info['group_id'] || !$group_info['group_moderator'] || !$group_info['moderator_name']) {
|
||||||
bb_die("Invalid group data [group_id: $group_id]");
|
bb_die("Invalid group data [group_id: $group_id]");
|
||||||
|
@ -51,17 +51,17 @@ if ($is_moderator) {
|
||||||
|
|
||||||
$group_type = '';
|
$group_type = '';
|
||||||
if ($group_info['group_type'] == GROUP_OPEN) {
|
if ($group_info['group_type'] == GROUP_OPEN) {
|
||||||
$group_type = $lang['GROUP_OPEN'];
|
$group_type = trans('messages.GROUP_OPEN');
|
||||||
} elseif ($group_info['group_type'] == GROUP_CLOSED) {
|
} elseif ($group_info['group_type'] == GROUP_CLOSED) {
|
||||||
$group_type = $lang['GROUP_CLOSED'];
|
$group_type = trans('messages.GROUP_CLOSED');
|
||||||
} elseif ($group_info['group_type'] == GROUP_HIDDEN) {
|
} elseif ($group_info['group_type'] == GROUP_HIDDEN) {
|
||||||
$group_type = $lang['GROUP_HIDDEN'];
|
$group_type = trans('messages.GROUP_HIDDEN');
|
||||||
}
|
}
|
||||||
|
|
||||||
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGE_TITLE' => $lang['GROUP_CONTROL_PANEL'],
|
'PAGE_TITLE' => trans('messages.GROUP_CONTROL_PANEL'),
|
||||||
'GROUP_NAME' => htmlCHR($group_info['group_name']),
|
'GROUP_NAME' => htmlCHR($group_info['group_name']),
|
||||||
'GROUP_ID' => $group_id,
|
'GROUP_ID' => $group_id,
|
||||||
'GROUP_DESCRIPTION' => htmlCHR($group_info['group_description']),
|
'GROUP_DESCRIPTION' => htmlCHR($group_info['group_description']),
|
||||||
|
@ -78,12 +78,12 @@ if ($is_moderator) {
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||||
'S_GROUP_CONFIG_ACTION' => "group_edit.php?" . POST_GROUPS_URL . "=$group_id",
|
'S_GROUP_CONFIG_ACTION' => "group_edit.php?" . POST_GROUPS_URL . "=$group_id",
|
||||||
|
|
||||||
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], config('tp.group_avatars.max_width'), config('tp.group_avatars.max_height'), round(config('tp.group_avatars.max_size') / 1024)),
|
'AVATAR_EXPLAIN' => sprintf(trans('messages.AVATAR_EXPLAIN'), config('tp.group_avatars.max_width'), config('tp.group_avatars.max_height'), round(config('tp.group_avatars.max_size') / 1024)),
|
||||||
'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']),
|
'AVATAR_IMG' => get_avatar(GROUP_AVATAR_MASK . $group_id, $group_info['avatar_ext_id']),
|
||||||
));
|
));
|
||||||
|
|
||||||
$template->set_filenames(array('body' => 'group_edit.tpl'));
|
$template->set_filenames(array('body' => 'group_edit.tpl'));
|
||||||
$template->assign_vars(array('PAGE_TITLE' => $lang['GROUP_CONFIGURATION']));
|
$template->assign_vars(array('PAGE_TITLE' => trans('messages.GROUP_CONFIGURATION')));
|
||||||
|
|
||||||
require(PAGE_HEADER);
|
require(PAGE_HEADER);
|
||||||
|
|
||||||
|
|
38
index.php
38
index.php
|
@ -44,7 +44,7 @@ $req_page = 'index_page';
|
||||||
$req_page .= ($viewcat) ? "_c{$viewcat}" : '';
|
$req_page .= ($viewcat) ? "_c{$viewcat}" : '';
|
||||||
|
|
||||||
define('REQUESTED_PAGE', $req_page);
|
define('REQUESTED_PAGE', $req_page);
|
||||||
caching_output(IS_GUEST, 'send', REQUESTED_PAGE . '_guest_' . config('tp.default_lang'));
|
caching_output(IS_GUEST, 'send', REQUESTED_PAGE . '_guest_' . config('app.locale'));
|
||||||
|
|
||||||
$hide_cat_opt = isset($user->opt_js['h_cat']) ? (string)$user->opt_js['h_cat'] : 0;
|
$hide_cat_opt = isset($user->opt_js['h_cat']) ? (string)$user->opt_js['h_cat'] : 0;
|
||||||
$hide_cat_user = array_flip(explode('-', $hide_cat_opt));
|
$hide_cat_user = array_flip(explode('-', $hide_cat_opt));
|
||||||
|
@ -240,7 +240,7 @@ foreach ($cat_forums as $cid => $c) {
|
||||||
'TOPICS' => commify($f['forum_topics']),
|
'TOPICS' => commify($f['forum_topics']),
|
||||||
'LAST_SF_ID' => $f['last_sf_id'] ?? null,
|
'LAST_SF_ID' => $f['last_sf_id'] ?? null,
|
||||||
'MODERATORS' => isset($moderators[$fid]) ? implode(', ', $moderators[$fid]) : '',
|
'MODERATORS' => isset($moderators[$fid]) ? implode(', ', $moderators[$fid]) : '',
|
||||||
'FORUM_FOLDER_ALT' => ($new) ? $lang['NEW'] : $lang['OLD'],
|
'FORUM_FOLDER_ALT' => $new ? trans('messages.NEW') : trans('messages.OLD'),
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($f['last_post_id']) {
|
if ($f['last_post_id']) {
|
||||||
|
@ -258,34 +258,34 @@ foreach ($cat_forums as $cid => $c) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SHOW_FORUMS' => $forums_count,
|
'SHOW_FORUMS' => $forums_count,
|
||||||
'SHOW_MAP' => (isset($_GET['map']) && !IS_GUEST),
|
'SHOW_MAP' => (isset($_GET['map']) && !IS_GUEST),
|
||||||
'PAGE_TITLE' => ($viewcat) ? $cat_title_html[$viewcat] : $lang['HOME'],
|
'PAGE_TITLE' => ($viewcat) ? $cat_title_html[$viewcat] : trans('messages.HOME'),
|
||||||
'NO_FORUMS_MSG' => ($only_new) ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'],
|
'NO_FORUMS_MSG' => ($only_new) ? trans('messages.NO_NEW_POSTS') : trans('messages.NO_FORUMS'),
|
||||||
|
|
||||||
'TOTAL_TOPICS' => sprintf($lang['POSTED_TOPICS_TOTAL'], $stats['topiccount']),
|
'TOTAL_TOPICS' => sprintf(trans('messages.POSTED_TOPICS_TOTAL'), $stats['topiccount']),
|
||||||
'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']),
|
'TOTAL_POSTS' => sprintf(trans('messages.POSTED_ARTICLES_TOTAL'), $stats['postcount']),
|
||||||
'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']),
|
'TOTAL_USERS' => sprintf(trans('messages.REGISTERED_USERS_TOTAL'), $stats['usercount']),
|
||||||
'TOTAL_GENDER' => config('tp.gender') ? sprintf(
|
'TOTAL_GENDER' => config('tp.gender') ? sprintf(
|
||||||
$lang['USERS_TOTAL_GENDER'],
|
trans('messages.USERS_TOTAL_GENDER'),
|
||||||
$stats['male'],
|
$stats['male'],
|
||||||
$stats['female'],
|
$stats['female'],
|
||||||
$stats['unselect']
|
$stats['unselect']
|
||||||
) : '',
|
) : '',
|
||||||
'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])),
|
'NEWEST_USER' => sprintf(trans('messages.NEWEST_USER'), profile_url($stats['newestuser'])),
|
||||||
|
|
||||||
// Tracker stats
|
// Tracker stats
|
||||||
'TORRENTS_STAT' => config('tp.tor_stats') ? sprintf(
|
'TORRENTS_STAT' => config('tp.tor_stats') ? sprintf(
|
||||||
$lang['TORRENTS_STAT'],
|
trans('messages.TORRENTS_STAT'),
|
||||||
$stats['torrentcount'],
|
$stats['torrentcount'],
|
||||||
humn_size($stats['size'])
|
humn_size($stats['size'])
|
||||||
) : '',
|
) : '',
|
||||||
'PEERS_STAT' => config('tp.tor_stats') ? sprintf(
|
'PEERS_STAT' => config('tp.tor_stats') ? sprintf(
|
||||||
$lang['PEERS_STAT'],
|
trans('messages.PEERS_STAT'),
|
||||||
$stats['peers'],
|
$stats['peers'],
|
||||||
$stats['seeders'],
|
$stats['seeders'],
|
||||||
$stats['leechers']
|
$stats['leechers']
|
||||||
) : '',
|
) : '',
|
||||||
'SPEED_STAT' => config('tp.tor_stats') ? sprintf(
|
'SPEED_STAT' => config('tp.tor_stats') ? sprintf(
|
||||||
$lang['SPEED_STAT'],
|
trans('messages.SPEED_STAT'),
|
||||||
humn_size($stats['speed']) . '/s'
|
humn_size($stats['speed']) . '/s'
|
||||||
) : '',
|
) : '',
|
||||||
'SHOW_MOD_INDEX' => config('tp.show_mod_index'),
|
'SHOW_MOD_INDEX' => config('tp.show_mod_index'),
|
||||||
|
@ -365,10 +365,10 @@ if (config('tp.birthday_check_day') && config('tp.birthday_enabled')) {
|
||||||
}
|
}
|
||||||
$week_list[] = profile_url($week) . ' <span class="small">(' . birthday_age($week['user_birthday'] - 1) . ')</span>';
|
$week_list[] = profile_url($week) . ' <span class="small">(' . birthday_age($week['user_birthday'] - 1) . ')</span>';
|
||||||
}
|
}
|
||||||
$week_all = ($week_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_week\'}); return false;" title="' . $lang['ALL'] . '">...</a>' : '';
|
$week_all = ($week_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_week\'}); return false;" title="' . trans('messages.ALL') . '">...</a>' : '';
|
||||||
$week_list = sprintf($lang['BIRTHDAY_WEEK'], config('tp.birthday_check_day'), implode(', ', $week_list)) . $week_all;
|
$week_list = sprintf(trans('messages.BIRTHDAY_WEEK'), config('tp.birthday_check_day'), implode(', ', $week_list)) . $week_all;
|
||||||
} else {
|
} else {
|
||||||
$week_list = sprintf($lang['NOBIRTHDAY_WEEK'], config('tp.birthday_check_day'));
|
$week_list = sprintf(trans('messages.NOBIRTHDAY_WEEK'), config('tp.birthday_check_day'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($stats['birthday_today_list'])) {
|
if (!empty($stats['birthday_today_list'])) {
|
||||||
|
@ -380,10 +380,10 @@ if (config('tp.birthday_check_day') && config('tp.birthday_enabled')) {
|
||||||
}
|
}
|
||||||
$today_list[] = profile_url($today) . ' <span class="small">(' . birthday_age($today['user_birthday']) . ')</span>';
|
$today_list[] = profile_url($today) . ' <span class="small">(' . birthday_age($today['user_birthday']) . ')</span>';
|
||||||
}
|
}
|
||||||
$today_all = ($today_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_today\'}); return false;" title="' . $lang['ALL'] . '">...</a>' : '';
|
$today_all = ($today_all) ? ' <a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_today\'}); return false;" title="' . trans('messages.ALL') . '">...</a>' : '';
|
||||||
$today_list = $lang['BIRTHDAY_TODAY'] . implode(', ', $today_list) . $today_all;
|
$today_list = trans('messages.BIRTHDAY_TODAY') . implode(', ', $today_list) . $today_all;
|
||||||
} else {
|
} else {
|
||||||
$today_list = $lang['NOBIRTHDAY_TODAY'];
|
$today_list = trans('messages.NOBIRTHDAY_TODAY');
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -406,7 +406,7 @@ if (IS_AM) {
|
||||||
define('SHOW_ONLINE', $show_online_users);
|
define('SHOW_ONLINE', $show_online_users);
|
||||||
|
|
||||||
if (isset($_GET['map'])) {
|
if (isset($_GET['map'])) {
|
||||||
$template->assign_vars(array('PAGE_TITLE' => $lang['FORUM_MAP']));
|
$template->assign_vars(array('PAGE_TITLE' => trans('messages.FORUM_MAP')));
|
||||||
}
|
}
|
||||||
|
|
||||||
print_page('index.tpl');
|
print_page('index.tpl');
|
||||||
|
|
12
info.php
12
info.php
|
@ -14,30 +14,28 @@ require __DIR__ . '/common.php';
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->session_start();
|
$user->session_start();
|
||||||
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$info = array();
|
$info = array();
|
||||||
$html_dir = LANG_DIR . 'html/';
|
$html_dir = LANG_DIR . 'html/';
|
||||||
$req_mode = !empty($_REQUEST['show']) ? (string)$_REQUEST['show'] : 'not_found';
|
$req_mode = !empty($_REQUEST['show']) ? (string)$_REQUEST['show'] : 'not_found';
|
||||||
|
|
||||||
switch ($req_mode) {
|
switch ($req_mode) {
|
||||||
case 'advert':
|
case 'advert':
|
||||||
$info['title'] = $lang['ADVERT'];
|
$info['title'] = trans('messages.ADVERT');
|
||||||
$info['src'] = 'advert.html';
|
$info['src'] = 'advert.html';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'copyright_holders':
|
case 'copyright_holders':
|
||||||
$info['title'] = $lang['COPYRIGHT_HOLDERS'];
|
$info['title'] = trans('messages.COPYRIGHT_HOLDERS');
|
||||||
$info['src'] = 'copyright_holders.html';
|
$info['src'] = 'copyright_holders.html';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'not_found':
|
case 'not_found':
|
||||||
$info['title'] = $lang['NOT_FOUND'];
|
$info['title'] = trans('messages.NOT_FOUND');
|
||||||
$info['src'] = 'not_found.html';
|
$info['src'] = 'not_found.html';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_agreement':
|
case 'user_agreement':
|
||||||
$info['title'] = $lang['USER_AGREEMENT'];
|
$info['title'] = trans('messages.USER_AGREEMENT');
|
||||||
$info['src'] = 'user_agreement.html';
|
$info['src'] = 'user_agreement.html';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -82,7 +80,7 @@ $require = file_exists($html_dir . $info['src']) ? $html_dir . $info['src'] : $h
|
||||||
<?php require($require); ?>
|
<?php require($require); ?>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ <?php echo $lang['LOCK']; ?> ]</a>
|
<p class="gen tRight pad_6"><a href="javascript:window.close();" class="gen">[ <?php echo trans('messages.LOCK'); ?> ]</a>
|
||||||
</p>
|
</p>
|
||||||
</div><!--/infobox-wrap-->
|
</div><!--/infobox-wrap-->
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -512,7 +512,6 @@ INSERT INTO `bb_config` VALUES ('bt_tor_browse_only_reg', '0');
|
||||||
INSERT INTO `bb_config` VALUES ('bt_unset_dltype_on_tor_unreg', '1');
|
INSERT INTO `bb_config` VALUES ('bt_unset_dltype_on_tor_unreg', '1');
|
||||||
INSERT INTO `bb_config` VALUES ('cron_last_check', '0');
|
INSERT INTO `bb_config` VALUES ('cron_last_check', '0');
|
||||||
INSERT INTO `bb_config` VALUES ('default_dateformat', 'Y-m-d H:i');
|
INSERT INTO `bb_config` VALUES ('default_dateformat', 'Y-m-d H:i');
|
||||||
INSERT INTO `bb_config` VALUES ('default_lang', 'ru');
|
|
||||||
INSERT INTO `bb_config` VALUES ('flood_interval', '15');
|
INSERT INTO `bb_config` VALUES ('flood_interval', '15');
|
||||||
INSERT INTO `bb_config` VALUES ('hot_threshold', '300');
|
INSERT INTO `bb_config` VALUES ('hot_threshold', '300');
|
||||||
INSERT INTO `bb_config` VALUES ('login_reset_time', '30');
|
INSERT INTO `bb_config` VALUES ('login_reset_time', '30');
|
||||||
|
|
|
@ -32,3 +32,6 @@ ALTER TABLE `bb_banlist` CHANGE `ban_ip` `ban_ip` varchar(42) NOT NULL DEFAULT '
|
||||||
// 2.2.2
|
// 2.2.2
|
||||||
ALTER TABLE `bb_ranks` DROP `rank_min`;
|
ALTER TABLE `bb_ranks` DROP `rank_min`;
|
||||||
ALTER TABLE `bb_ranks` DROP `rank_special`;
|
ALTER TABLE `bb_ranks` DROP `rank_special`;
|
||||||
|
|
||||||
|
// 3.0.0
|
||||||
|
DELETE FROM `bb_config` WHERE `config_name` = 'default_lang';
|
||||||
|
|
|
@ -61,8 +61,6 @@ class Ajax
|
||||||
*/
|
*/
|
||||||
public function exec()
|
public function exec()
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
// Exit if we already have errors
|
// Exit if we already have errors
|
||||||
if (!empty($this->response['error_code'])) {
|
if (!empty($this->response['error_code'])) {
|
||||||
$this->send();
|
$this->send();
|
||||||
|
@ -86,14 +84,14 @@ class Ajax
|
||||||
// USER
|
// USER
|
||||||
case 'user':
|
case 'user':
|
||||||
if (IS_GUEST) {
|
if (IS_GUEST) {
|
||||||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
$this->ajax_die(trans('messages.NEED_TO_LOGIN_FIRST'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// MOD
|
// MOD
|
||||||
case 'mod':
|
case 'mod':
|
||||||
if (!IS_AM) {
|
if (!IS_AM) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die(trans('messages.ONLY_FOR_MOD'));
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
break;
|
break;
|
||||||
|
@ -101,7 +99,7 @@ class Ajax
|
||||||
// ADMIN
|
// ADMIN
|
||||||
case 'admin':
|
case 'admin':
|
||||||
if (!IS_ADMIN) {
|
if (!IS_ADMIN) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_ADMIN']);
|
$this->ajax_die(trans('messages.ONLY_FOR_ADMIN'));
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
break;
|
break;
|
||||||
|
@ -109,7 +107,7 @@ class Ajax
|
||||||
// SUPER_ADMIN
|
// SUPER_ADMIN
|
||||||
case 'super_admin':
|
case 'super_admin':
|
||||||
if (!IS_SUPER_ADMIN) {
|
if (!IS_SUPER_ADMIN) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_SUPER_ADMIN']);
|
$this->ajax_die(trans('messages.ONLY_FOR_SUPER_ADMIN'));
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
break;
|
break;
|
||||||
|
@ -243,12 +241,12 @@ class Ajax
|
||||||
*/
|
*/
|
||||||
public function verify_mod_rights($forum_id)
|
public function verify_mod_rights($forum_id)
|
||||||
{
|
{
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
$is_auth = auth_user(AUTH_MOD, $forum_id, $userdata);
|
$is_auth = auth_user(AUTH_MOD, $forum_id, $userdata);
|
||||||
|
|
||||||
if (!$is_auth['auth_mod']) {
|
if (!$is_auth['auth_mod']) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die(trans('messages.ONLY_FOR_MOD'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ class Attach
|
||||||
*/
|
*/
|
||||||
public function handle_attachments($mode)
|
public function handle_attachments($mode)
|
||||||
{
|
{
|
||||||
global $is_auth, $attach_config, $refresh, $post_id, $submit, $preview, $error, $error_msg, $lang;
|
global $is_auth, $attach_config, $refresh, $post_id, $submit, $preview, $error, $error_msg;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ok, what shall we do ;)
|
// ok, what shall we do ;)
|
||||||
|
@ -274,7 +274,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['TOO_MANY_ATTACHMENTS'], (int)$max_attachments);
|
$error_msg .= sprintf(trans('messages.TOO_MANY_ATTACHMENTS'), (int)$max_attachments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -394,7 +394,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= $lang['ERROR_EMPTY_ADD_ATTACHBOX'];
|
$error_msg .= trans('messages.ERROR_EMPTY_ADD_ATTACHBOX');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->upload_attachment();
|
$this->upload_attachment();
|
||||||
|
@ -426,7 +426,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= $lang['ERROR_MISSING_OLD_ENTRY'];
|
$error_msg .= trans('messages.ERROR_MISSING_OLD_ENTRY');
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = OLD_DB()->sql_fetchrow($result);
|
$row = OLD_DB()->sql_fetchrow($result);
|
||||||
|
@ -503,7 +503,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['TOO_MANY_ATTACHMENTS'], (int)$max_attachments);
|
$error_msg .= sprintf(trans('messages.TOO_MANY_ATTACHMENTS'), (int)$max_attachments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,7 @@ class Attach
|
||||||
*/
|
*/
|
||||||
public function display_attachment_bodies()
|
public function display_attachment_bodies()
|
||||||
{
|
{
|
||||||
global $attach_config, $is_auth, $lang, $template, $upload_dir, $forum_id;
|
global $attach_config, $is_auth, $template, $upload_dir, $forum_id;
|
||||||
|
|
||||||
// Choose what to display
|
// Choose what to display
|
||||||
$value_add = $value_posted = 0;
|
$value_add = $value_posted = 0;
|
||||||
|
@ -726,7 +726,7 @@ class Attach
|
||||||
*/
|
*/
|
||||||
public function upload_attachment()
|
public function upload_attachment()
|
||||||
{
|
{
|
||||||
global $error, $error_msg, $lang, $attach_config, $userdata, $upload_dir, $forum_id;
|
global $error, $error_msg, $attach_config, $userdata, $upload_dir, $forum_id;
|
||||||
|
|
||||||
$this->post_attach = (bool)$this->filename;
|
$this->post_attach = (bool)$this->filename;
|
||||||
|
|
||||||
|
@ -768,7 +768,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['INVALID_FILENAME'], htmlspecialchars($this->filename));
|
$error_msg .= sprintf(trans('messages.INVALID_FILENAME'), htmlspecialchars($this->filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
// check php upload-size
|
// check php upload-size
|
||||||
|
@ -782,9 +782,9 @@ class Attach
|
||||||
$max_size = @$ini_val('upload_max_filesize');
|
$max_size = @$ini_val('upload_max_filesize');
|
||||||
|
|
||||||
if (empty($max_size)) {
|
if (empty($max_size)) {
|
||||||
$error_msg .= $lang['ATTACHMENT_PHP_SIZE_NA'];
|
$error_msg .= trans('messages.ATTACHMENT_PHP_SIZE_NA');
|
||||||
} else {
|
} else {
|
||||||
$error_msg .= sprintf($lang['ATTACHMENT_PHP_SIZE_OVERRUN'], $max_size);
|
$error_msg .= sprintf(trans('messages.ATTACHMENT_PHP_SIZE_OVERRUN'), $max_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -794,7 +794,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['DISALLOWED_EXTENSION'], htmlspecialchars($this->extension));
|
$error_msg .= sprintf(trans('messages.DISALLOWED_EXTENSION'), htmlspecialchars($this->extension));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check Forum Permissions
|
// Check Forum Permissions
|
||||||
|
@ -803,7 +803,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['DISALLOWED_EXTENSION_WITHIN_FORUM'], htmlspecialchars($this->extension));
|
$error_msg .= sprintf(trans('messages.DISALLOWED_EXTENSION_WITHIN_FORUM'), htmlspecialchars($this->extension));
|
||||||
}
|
}
|
||||||
|
|
||||||
//bt
|
//bt
|
||||||
|
@ -815,7 +815,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= $lang['ALLOWED_ONLY_1ST_POST_ATTACH'];
|
$error_msg .= trans('messages.ALLOWED_ONLY_1ST_POST_ATTACH');
|
||||||
}
|
}
|
||||||
//bt end
|
//bt end
|
||||||
|
|
||||||
|
@ -916,7 +916,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['ERROR_IMAGESIZE'], (int)$attach_config['img_max_width'], (int)$attach_config['img_max_height']);
|
$error_msg .= sprintf(trans('messages.ERROR_IMAGESIZE'), (int)$attach_config['img_max_width'], (int)$attach_config['img_max_height']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -929,7 +929,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['ATTACHMENT_TOO_BIG'], $allowed_filesize);
|
$error_msg .= sprintf(trans('messages.ATTACHMENT_TOO_BIG'), $allowed_filesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check our complete quota
|
// Check our complete quota
|
||||||
|
@ -950,7 +950,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= $lang['ATTACH_QUOTA_REACHED'];
|
$error_msg .= trans('messages.ATTACH_QUOTA_REACHED');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -996,7 +996,7 @@ class Attach
|
||||||
|
|
||||||
if (($total_filesize + $this->filesize) > $attach_config['upload_filesize_limit']) {
|
if (($total_filesize + $this->filesize) > $attach_config['upload_filesize_limit']) {
|
||||||
$upload_filesize_limit = $attach_config['upload_filesize_limit'];
|
$upload_filesize_limit = $attach_config['upload_filesize_limit'];
|
||||||
$size_lang = ($upload_filesize_limit >= 1048576) ? $lang['MB'] : (($upload_filesize_limit >= 1024) ? $lang['KB'] : $lang['BYTES']);
|
$size_lang = ($upload_filesize_limit >= 1048576) ? trans('messages.MB') : (($upload_filesize_limit >= 1024) ? trans('messages.KB') : trans('messages.BYTES'));
|
||||||
|
|
||||||
if ($upload_filesize_limit >= 1048576) {
|
if ($upload_filesize_limit >= 1048576) {
|
||||||
$upload_filesize_limit = round($upload_filesize_limit / 1048576 * 100) / 100;
|
$upload_filesize_limit = round($upload_filesize_limit / 1048576 * 100) / 100;
|
||||||
|
@ -1008,7 +1008,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['USER_UPLOAD_QUOTA_REACHED'], $upload_filesize_limit, $size_lang);
|
$error_msg .= sprintf(trans('messages.USER_UPLOAD_QUOTA_REACHED'), $upload_filesize_limit, $size_lang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1023,7 +1023,7 @@ class Attach
|
||||||
// Copy the temporary attachment to the right location (copy, move_uploaded_file)
|
// Copy the temporary attachment to the right location (copy, move_uploaded_file)
|
||||||
public function move_uploaded_attachment($upload_mode, $file)
|
public function move_uploaded_attachment($upload_mode, $file)
|
||||||
{
|
{
|
||||||
global $error, $error_msg, $lang, $upload_dir;
|
global $error, $error_msg, $upload_dir;
|
||||||
|
|
||||||
if (!is_uploaded_file($file)) {
|
if (!is_uploaded_file($file)) {
|
||||||
bb_die('Unable to upload file. The given source has not been uploaded');
|
bb_die('Unable to upload file. The given source has not been uploaded');
|
||||||
|
@ -1038,7 +1038,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['GENERAL_UPLOAD_ERROR'], './' . $upload_dir . '/' . $this->attach_filename);
|
$error_msg .= sprintf(trans('messages.GENERAL_UPLOAD_ERROR'), './' . $upload_dir . '/' . $this->attach_filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1054,7 +1054,7 @@ class Attach
|
||||||
if (!empty($error_msg)) {
|
if (!empty($error_msg)) {
|
||||||
$error_msg .= '<br />';
|
$error_msg .= '<br />';
|
||||||
}
|
}
|
||||||
$error_msg .= sprintf($lang['GENERAL_UPLOAD_ERROR'], './' . $upload_dir . '/' . $this->attach_filename);
|
$error_msg .= sprintf(trans('messages.GENERAL_UPLOAD_ERROR'), './' . $upload_dir . '/' . $this->attach_filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,15 +53,14 @@ class Upload
|
||||||
*/
|
*/
|
||||||
public function init(array $cfg = [], array $post_params = [], $uploaded_only = true)
|
public function init(array $cfg = [], array $post_params = [], $uploaded_only = true)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$this->cfg = array_merge($this->cfg, $cfg);
|
$this->cfg = array_merge($this->cfg, $cfg);
|
||||||
$this->file = $post_params;
|
$this->file = $post_params;
|
||||||
|
|
||||||
// upload errors from $_FILES
|
// upload errors from $_FILES
|
||||||
if ($this->file['error']) {
|
if ($this->file['error']) {
|
||||||
$msg = $lang['UPLOAD_ERROR_COMMON'];
|
$msg = trans('messages.UPLOAD_ERROR_COMMON');
|
||||||
$msg .= ($err_desc =& $lang['UPLOAD_ERRORS'][$this->file['error']]) ? " ($err_desc)" : '';
|
$errorLang = trans('messages.UPLOAD_ERRORS.' . $this->file['error']);
|
||||||
|
$msg .= ($err_desc =& $errorLang) ? " ($err_desc)" : '';
|
||||||
$this->errors[] = $msg;
|
$this->errors[] = $msg;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +75,7 @@ class Upload
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($this->cfg['max_size'] && $this->file_size > $this->cfg['max_size']) {
|
if ($this->cfg['max_size'] && $this->file_size > $this->cfg['max_size']) {
|
||||||
$this->errors[] = sprintf($lang['UPLOAD_ERROR_SIZE'], humn_size($this->cfg['max_size']));
|
$this->errors[] = sprintf(trans('messages.UPLOAD_ERROR_SIZE'), humn_size($this->cfg['max_size']));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// is_uploaded_file
|
// is_uploaded_file
|
||||||
|
@ -96,24 +95,24 @@ class Upload
|
||||||
|
|
||||||
// redefine ext
|
// redefine ext
|
||||||
if (!$width || !$height || !$type || !isset($this->img_types[$type])) {
|
if (!$width || !$height || !$type || !isset($this->img_types[$type])) {
|
||||||
$this->errors[] = $lang['UPLOAD_ERROR_FORMAT'];
|
$this->errors[] = trans('messages.UPLOAD_ERROR_FORMAT');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->file_ext = $this->img_types[$type];
|
$this->file_ext = $this->img_types[$type];
|
||||||
|
|
||||||
// width & height
|
// width & height
|
||||||
if (($this->cfg['max_width'] && $width > $this->cfg['max_width']) || ($this->cfg['max_height'] && $height > $this->cfg['max_height'])) {
|
if (($this->cfg['max_width'] && $width > $this->cfg['max_width']) || ($this->cfg['max_height'] && $height > $this->cfg['max_height'])) {
|
||||||
$this->errors[] = sprintf($lang['UPLOAD_ERROR_DIMENSIONS'], $this->cfg['max_width'], $this->cfg['max_height']);
|
$this->errors[] = sprintf(trans('messages.UPLOAD_ERROR_DIMENSIONS'), $this->cfg['max_width'], $this->cfg['max_height']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->errors[] = $lang['UPLOAD_ERROR_NOT_IMAGE'];
|
$this->errors[] = trans('messages.UPLOAD_ERROR_NOT_IMAGE');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check ext
|
// check ext
|
||||||
if ($uploaded_only && (!isset($this->ext_ids[$this->file_ext]) || !in_array($this->file_ext, $this->cfg['allowed_ext'], true))) {
|
if ($uploaded_only && (!isset($this->ext_ids[$this->file_ext]) || !in_array($this->file_ext, $this->cfg['allowed_ext'], true))) {
|
||||||
$this->errors[] = sprintf($lang['UPLOAD_ERROR_NOT_ALLOWED'], htmlCHR($this->file_ext));
|
$this->errors[] = sprintf(trans('messages.UPLOAD_ERROR_NOT_ALLOWED'), htmlCHR($this->file_ext));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->file_ext_id = $this->ext_ids[$this->file_ext];
|
$this->file_ext_id = $this->ext_ids[$this->file_ext];
|
||||||
|
|
|
@ -549,43 +549,20 @@ class User
|
||||||
*/
|
*/
|
||||||
public function init_userprefs()
|
public function init_userprefs()
|
||||||
{
|
{
|
||||||
global $theme, $source_lang, $DeltaTime;
|
global $theme, $DeltaTime;
|
||||||
|
|
||||||
if (defined('LANG_DIR')) {
|
define('DEFAULT_LANG_DIR', LANG_ROOT_DIR . '/' . config('app.locale') . '/');
|
||||||
return;
|
define('LANG_DIR', DEFAULT_LANG_DIR);
|
||||||
} // prevent multiple calling
|
|
||||||
|
|
||||||
define('DEFAULT_LANG_DIR', LANG_ROOT_DIR . '/' . config('tp.default_lang') . '/');
|
|
||||||
define('SOURCE_LANG_DIR', LANG_ROOT_DIR . '/source/');
|
|
||||||
|
|
||||||
if ($this->data['user_id'] != GUEST_UID) {
|
if ($this->data['user_id'] != GUEST_UID) {
|
||||||
if ($this->data['user_lang'] && $this->data['user_lang'] != config('tp.default_lang')) {
|
|
||||||
config(['tp.default_lang' => basename($this->data['user_lang'])]);
|
|
||||||
define('LANG_DIR', LANG_ROOT_DIR . '/' . config('tp.default_lang') . '/');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->data['user_timezone'])) {
|
if (isset($this->data['user_timezone'])) {
|
||||||
config(['tp.board_timezone' => $this->data['user_timezone']]);
|
config(['tp.board_timezone' => $this->data['user_timezone']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data['user_lang'] = config('tp.default_lang');
|
$this->data['user_lang'] = config('app.locale');
|
||||||
$this->data['user_timezone'] = config('tp.board_timezone');
|
$this->data['user_timezone'] = config('tp.board_timezone');
|
||||||
|
|
||||||
if (!defined('LANG_DIR')) {
|
|
||||||
define('LANG_DIR', DEFAULT_LANG_DIR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Temporary place source language to the global */
|
|
||||||
$lang = [];
|
|
||||||
require(SOURCE_LANG_DIR . 'main.php');
|
|
||||||
$source_lang = $lang;
|
|
||||||
unset($lang);
|
|
||||||
|
|
||||||
/** Place user language to the global */
|
|
||||||
global $lang;
|
|
||||||
require(LANG_DIR . 'main.php');
|
|
||||||
|
|
||||||
setlocale(LC_ALL, config('language.lang.' . $this->data['user_lang'] . '.locale') ?? 'en_US.UTF-8');
|
setlocale(LC_ALL, config('language.lang.' . $this->data['user_lang'] . '.locale') ?? 'en_US.UTF-8');
|
||||||
|
|
||||||
$theme = setup_style();
|
$theme = setup_style();
|
||||||
|
|
|
@ -27,10 +27,8 @@ class DateDelta
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
global $lang;
|
$this->intervals = trans('messages.DELTA_TIME.INTERVALS');
|
||||||
|
$this->format = trans('messages.DELTA_TIME.FORMAT');
|
||||||
$this->intervals = $lang['DELTA_TIME']['INTERVALS'];
|
|
||||||
$this->format = $lang['DELTA_TIME']['FORMAT'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,7 +66,7 @@ class DateDelta
|
||||||
|
|
||||||
// Make spellable phrase.
|
// Make spellable phrase.
|
||||||
$parts = [];
|
$parts = [];
|
||||||
$intervals = $GLOBALS['lang']['DELTA_TIME']['INTERVALS'];
|
$intervals = trans('messages.DELTA_TIME.INTERVALS');
|
||||||
|
|
||||||
foreach (array_reverse($delta) as $k => $n) {
|
foreach (array_reverse($delta) as $k => $n) {
|
||||||
if (!$n) {
|
if (!$n) {
|
||||||
|
|
|
@ -124,14 +124,14 @@ class Emailer
|
||||||
public function set_template($template_file, $template_lang = '')
|
public function set_template($template_file, $template_lang = '')
|
||||||
{
|
{
|
||||||
if (!$template_lang) {
|
if (!$template_lang) {
|
||||||
$template_lang = config('tp.default_lang');
|
$template_lang = config('app.locale');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($this->tpl_msg[$template_lang . $template_file])) {
|
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($tpl_file)) {
|
if (!file_exists($tpl_file)) {
|
||||||
$tpl_file = LANG_ROOT_DIR . '/' . config('tp.default_lang') . '/email/' . $template_file . '.html';
|
$tpl_file = LANG_ROOT_DIR . '/' . config('app.fallback_locale') . '/email/' . $template_file . '.html';
|
||||||
|
|
||||||
/** @noinspection NotOptimalIfConditionsInspection */
|
/** @noinspection NotOptimalIfConditionsInspection */
|
||||||
if (!file_exists($tpl_file)) {
|
if (!file_exists($tpl_file)) {
|
||||||
|
@ -158,8 +158,6 @@ class Emailer
|
||||||
*/
|
*/
|
||||||
public function send($email_format = self::FORMAT_TEXT)
|
public function send($email_format = self::FORMAT_TEXT)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
if (!config('email.enabled')) {
|
if (!config('email.enabled')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -172,7 +170,7 @@ class Emailer
|
||||||
$this->message = trim($this->message);
|
$this->message = trim($this->message);
|
||||||
|
|
||||||
/** Set some variables */
|
/** Set some variables */
|
||||||
$this->subject = !empty($this->subject) ? $this->subject : $lang['EMAILER_SUBJECT']['EMPTY'];
|
$this->subject = !empty($this->subject) ? $this->subject : trans('messages.EMAILER_SUBJECT.EMPTY');
|
||||||
$this->encoding = config('language.charset');
|
$this->encoding = config('language.charset');
|
||||||
|
|
||||||
/** Prepare message */
|
/** Prepare message */
|
||||||
|
|
|
@ -31,9 +31,9 @@ class LogAction
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
global $lang;
|
/** @var array $logTypes */
|
||||||
|
$logTypes = trans('messages.LOG_ACTION.LOG_TYPE');
|
||||||
foreach ($lang['LOG_ACTION']['LOG_TYPE'] as $log_type => $log_desc) {
|
foreach ($logTypes as $log_type => $log_desc) {
|
||||||
$this->log_type_select[strip_tags($log_desc)] = $this->log_type[$log_type];
|
$this->log_type_select[strip_tags($log_desc)] = $this->log_type[$log_type];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,7 @@ class Poll
|
||||||
$this->poll_votes = [];
|
$this->poll_votes = [];
|
||||||
|
|
||||||
if (!$poll_caption = str_compact($poll_caption)) {
|
if (!$poll_caption = str_compact($poll_caption)) {
|
||||||
global $lang;
|
return $this->err_msg = trans('messages.EMPTY_POLL_TITLE');
|
||||||
return $this->err_msg = $lang['EMPTY_POLL_TITLE'];
|
|
||||||
}
|
}
|
||||||
$this->poll_votes[] = $poll_caption; // заголовок имеет vote_id = 0
|
$this->poll_votes[] = $poll_caption; // заголовок имеет vote_id = 0
|
||||||
|
|
||||||
|
@ -51,8 +50,7 @@ class Poll
|
||||||
|
|
||||||
// проверять на "< 3" -- 2 варианта ответа + заголовок
|
// проверять на "< 3" -- 2 варианта ответа + заголовок
|
||||||
if (count($this->poll_votes) < 3 || count($this->poll_votes) > $this->max_votes + 1) {
|
if (count($this->poll_votes) < 3 || count($this->poll_votes) > $this->max_votes + 1) {
|
||||||
global $lang;
|
return $this->err_msg = sprintf(trans('messages.NEW_POLL_VOTES'), $this->max_votes);
|
||||||
return $this->err_msg = sprintf($lang['NEW_POLL_VOTES'], $this->max_votes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,6 @@ class Template
|
||||||
/** @var array style configuration */
|
/** @var array style configuration */
|
||||||
public $style_config = [];
|
public $style_config = [];
|
||||||
|
|
||||||
public $lang = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Installs XS mod on first run or updates it and sets the root dir.
|
* Constructor. Installs XS mod on first run or updates it and sets the root dir.
|
||||||
*
|
*
|
||||||
|
@ -99,15 +97,12 @@ class Template
|
||||||
*/
|
*/
|
||||||
public function __construct($root = '.')
|
public function __construct($root = '.')
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
// setting pointer "vars"
|
// setting pointer "vars"
|
||||||
$this->vars = &$this->_tpldata['.'][0];
|
$this->vars = &$this->_tpldata['.'][0];
|
||||||
// load configuration
|
// load configuration
|
||||||
$this->tpldir = TEMPLATES_DIR;
|
$this->tpldir = TEMPLATES_DIR;
|
||||||
$this->root = $root;
|
$this->root = $root;
|
||||||
$this->tpl = basename($root);
|
$this->tpl = basename($root);
|
||||||
$this->lang =& $lang;
|
|
||||||
$this->use_cache = config('tp.xs_use_cache');
|
$this->use_cache = config('tp.xs_use_cache');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,11 +218,9 @@ class Template
|
||||||
{
|
{
|
||||||
$this->cur_tpl = $filename;
|
$this->cur_tpl = $filename;
|
||||||
|
|
||||||
global $lang, $source_lang, $user;
|
global $user;
|
||||||
|
|
||||||
$L =& $lang;
|
|
||||||
$V =& $this->vars;
|
$V =& $this->vars;
|
||||||
$SL =& $source_lang;
|
|
||||||
|
|
||||||
if ($filename) {
|
if ($filename) {
|
||||||
include $filename;
|
include $filename;
|
||||||
|
@ -758,7 +751,7 @@ class Template
|
||||||
$code = str_replace($search, $replace, $code);
|
$code = str_replace($search, $replace, $code);
|
||||||
}
|
}
|
||||||
// This will handle the remaining root-level varrefs
|
// This will handle the remaining root-level varrefs
|
||||||
$code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '<?php echo isset($L[\'$2\']) ? $L[\'$2\'] : (isset($SL[\'$2\']) ? $SL[\'$2\'] : \'$2\'); ?>', $code);
|
$code = preg_replace('#\{(L_([a-z0-9\-_]+?))\}#i', '<?php echo (trans(\'messages.$2\') !== \'messages.$2\') ? trans(\'messages.$2\') : $V[\'$1\']; ?>', $code);
|
||||||
$code = preg_replace('#\{(\$[a-z_][a-z0-9_$\->\'\"\.\[\]]*?)\}#i', '<?php echo isset($1) ? $1 : \'\'; ?>', $code);
|
$code = preg_replace('#\{(\$[a-z_][a-z0-9_$\->\'\"\.\[\]]*?)\}#i', '<?php echo isset($1) ? $1 : \'\'; ?>', $code);
|
||||||
$code = preg_replace('#\{(\#([a-z_][a-z0-9_]*?))\}#i', '<?php echo defined(\'$2\') ? $2 : \'\'; ?>', $code);
|
$code = preg_replace('#\{(\#([a-z_][a-z0-9_]*?))\}#i', '<?php echo defined(\'$2\') ? $2 : \'\'; ?>', $code);
|
||||||
$code = preg_replace('#\{([a-z0-9\-_]+?)\}#i', '<?php echo isset($V[\'$1\']) ? $V[\'$1\'] : \'\'; ?>', $code);
|
$code = preg_replace('#\{([a-z0-9\-_]+?)\}#i', '<?php echo isset($V[\'$1\']) ? $V[\'$1\'] : \'\'; ?>', $code);
|
||||||
|
@ -979,10 +972,6 @@ class Template
|
||||||
|
|
||||||
public function xs_startup()
|
public function xs_startup()
|
||||||
{
|
{
|
||||||
// adding language variable (eg: "english" or "german")
|
|
||||||
// can be used to make truly multi-lingual templates
|
|
||||||
$this->vars['LANG'] = $this->vars['LANG'] ?? config('tp.default_lang');
|
|
||||||
// adding current template
|
|
||||||
$tpl = $this->root . '/';
|
$tpl = $this->root . '/';
|
||||||
if (substr($tpl, 0, 2) === './') {
|
if (substr($tpl, 0, 2) === './') {
|
||||||
$tpl = substr($tpl, 2, strlen($tpl));
|
$tpl = substr($tpl, 2, strlen($tpl));
|
||||||
|
|
|
@ -122,13 +122,13 @@ class TorrentFileList
|
||||||
*/
|
*/
|
||||||
private function build_file_item($name, $length)
|
private function build_file_item($name, $length)
|
||||||
{
|
{
|
||||||
global $images, $lang;
|
global $images;
|
||||||
|
|
||||||
$magnet_name = $magnet_ext = '';
|
$magnet_name = $magnet_ext = '';
|
||||||
|
|
||||||
if (config('tp.magnet_links_enabled')) {
|
if (config('tp.magnet_links_enabled')) {
|
||||||
$magnet_name = '<a title="' . $lang['DC_MAGNET'] . '" href="dchub:magnet:?kt=' . $name . '&xl=' . $length . '"><img src="' . $images['icon_dc_magnet'] . '" width="10" height="10" border="0" /></a>';
|
$magnet_name = '<a title="' . trans('messages.DC_MAGNET') . '" href="dchub:magnet:?kt=' . $name . '&xl=' . $length . '"><img src="' . $images['icon_dc_magnet'] . '" width="10" height="10" border="0" /></a>';
|
||||||
$magnet_ext = '<a title="' . $lang['DC_MAGNET_EXT'] . '" href="dchub:magnet:?kt=.' . substr(strrchr($name, '.'), 1) . '&xl=' . $length . '"><img src="' . $images['icon_dc_magnet_ext'] . '" width="10" height="10" border="0" /></a>';
|
$magnet_ext = '<a title="' . trans('messages.DC_MAGNET_EXT') . '" href="dchub:magnet:?kt=.' . substr(strrchr($name, '.'), 1) . '&xl=' . $length . '"><img src="' . $images['icon_dc_magnet_ext'] . '" width="10" height="10" border="0" /></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return "$name <i>$length</i> $magnet_name $magnet_ext";
|
return "$name <i>$length</i> $magnet_name $magnet_ext";
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang, $user;
|
global $user;
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
$user_id = (int)$this->request['user_id'];
|
$user_id = (int)$this->request['user_id'];
|
||||||
|
@ -21,7 +21,7 @@ if (!$user_id or !$u_data = get_userdata($user_id)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_ADMIN && $user_id != $user->id) {
|
if (!IS_ADMIN && $user_id != $user->id) {
|
||||||
$this->ajax_die($lang['NOT_ADMIN']);
|
$this->ajax_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
|
|
|
@ -11,10 +11,10 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
if (!isset($this->request['attach_id'])) {
|
if (!isset($this->request['attach_id'])) {
|
||||||
$this->ajax_die($lang['EMPTY_ATTACH_ID']);
|
$this->ajax_die(trans('messages.EMPTY_ATTACH_ID'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$attach_id = (int)$this->request['attach_id'];
|
$attach_id = (int)$this->request['attach_id'];
|
||||||
|
@ -35,7 +35,7 @@ $tor = OLD_DB()->fetch_row("
|
||||||
");
|
");
|
||||||
|
|
||||||
if (!$tor) {
|
if (!$tor) {
|
||||||
$this->ajax_die($lang['TORRENT_FAILED']);
|
$this->ajax_die(trans('messages.TORRENT_FAILED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
|
@ -43,24 +43,24 @@ switch ($mode) {
|
||||||
$new_status = (int)$this->request['status'];
|
$new_status = (int)$this->request['status'];
|
||||||
|
|
||||||
// Валидность статуса
|
// Валидность статуса
|
||||||
if (!isset($lang['TOR_STATUS_NAME'][$new_status])) {
|
if (trans('messages.TOR_STATUS_NAME.' . $new_status) === 'messages.TOR_STATUS_NAME.' . $new_status) {
|
||||||
$this->ajax_die($lang['TOR_STATUS_FAILED']);
|
$this->ajax_die(trans('messages.TOR_STATUS_FAILED'));
|
||||||
}
|
}
|
||||||
if (!isset($this->request['status'])) {
|
if (!isset($this->request['status'])) {
|
||||||
$this->ajax_die($lang['TOR_DONT_CHANGE']);
|
$this->ajax_die(trans('messages.TOR_DONT_CHANGE'));
|
||||||
}
|
}
|
||||||
if (!IS_AM) {
|
if (!IS_AM) {
|
||||||
$this->ajax_die($lang['NOT_MODERATOR']);
|
$this->ajax_die(trans('messages.NOT_MODERATOR'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Тот же статус
|
// Тот же статус
|
||||||
if ($tor['tor_status'] == $new_status) {
|
if ($tor['tor_status'] == $new_status) {
|
||||||
$this->ajax_die($lang['TOR_STATUS_DUB']);
|
$this->ajax_die(trans('messages.TOR_STATUS_DUB'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Запрет на изменение/присвоение CH-статуса модератором
|
// Запрет на изменение/присвоение CH-статуса модератором
|
||||||
if ($new_status == TOR_CLOSED_CPHOLD && !IS_ADMIN) {
|
if ($new_status == TOR_CLOSED_CPHOLD && !IS_ADMIN) {
|
||||||
$this->ajax_die($lang['TOR_DONT_CHANGE']);
|
$this->ajax_die(trans('messages.TOR_DONT_CHANGE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Права на изменение статуса
|
// Права на изменение статуса
|
||||||
|
@ -76,24 +76,24 @@ switch ($mode) {
|
||||||
// Подтверждение изменения статуса, выставленного другим модератором
|
// Подтверждение изменения статуса, выставленного другим модератором
|
||||||
if ($tor['tor_status'] != TOR_NOT_APPROVED && $tor['checked_user_id'] != $userdata['user_id'] && $tor['checked_time'] + 2 * 3600 > TIMENOW) {
|
if ($tor['tor_status'] != TOR_NOT_APPROVED && $tor['checked_user_id'] != $userdata['user_id'] && $tor['checked_time'] + 2 * 3600 > TIMENOW) {
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$msg = $lang['TOR_STATUS_OF'] . " {$lang['TOR_STATUS_NAME'][$tor['tor_status']]}\n\n";
|
$msg = trans('messages.TOR_STATUS_OF') . ' ' . trans('messages.TOR_STATUS_NAME.' . $tor['tor_status']) . "\n\n";
|
||||||
$msg .= ($username = get_username($tor['checked_user_id'])) ? $lang['TOR_STATUS_CHANGED'] . html_entity_decode($username) . ", " . delta_time($tor['checked_time']) . $lang['TOR_BACK'] . "\n\n" : "";
|
$msg .= ($username = get_username($tor['checked_user_id'])) ? trans('messages.TOR_STATUS_CHANGED') . html_entity_decode($username) . ", " . delta_time($tor['checked_time']) . trans('messages.TOR_BACK') . "\n\n" : "";
|
||||||
$msg .= $lang['PROCEED'] . '?';
|
$msg .= trans('messages.PROCEED') . '?';
|
||||||
$this->prompt_for_confirm($msg);
|
$this->prompt_for_confirm($msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
change_tor_status($attach_id, $new_status);
|
change_tor_status($attach_id, $new_status);
|
||||||
|
|
||||||
$this->response['status'] = config('tp.tor_icons.' . $new_status) . ' <b> ' . $lang['TOR_STATUS_NAME'][$new_status] . '</b> · ' . profile_url($userdata) . ' · <i>' . delta_time(TIMENOW) . $lang['TOR_BACK'] . '</i>';
|
$this->response['status'] = config('tp.tor_icons.' . $new_status) . ' <b> ' . trans('messages.TOR_STATUS_NAME.' . $new_status) . '</b> · ' . profile_url($userdata) . ' · <i>' . delta_time(TIMENOW) . trans('messages.TOR_BACK') . '</i>';
|
||||||
|
|
||||||
if (config('tp.tor_comment') && (($comment && $comment != $lang['COMMENT']) || in_array($new_status, config('tp.tor_reply')))) {
|
if (config('tp.tor_comment') && (($comment && $comment != trans('messages.COMMENT')) || in_array($new_status, config('tp.tor_reply')))) {
|
||||||
if ($tor['poster_id'] > 0) {
|
if ($tor['poster_id'] > 0) {
|
||||||
$subject = sprintf($lang['TOR_MOD_TITLE'], $tor['topic_title']);
|
$subject = sprintf(trans('messages.TOR_MOD_TITLE'), $tor['topic_title']);
|
||||||
$message = sprintf($lang['TOR_MOD_MSG'], get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), config('tp.tor_icons.' . $new_status) . ' ' . $lang['TOR_STATUS_NAME'][$new_status]);
|
$message = sprintf(trans('messages.TOR_MOD_MSG'), get_username($tor['poster_id']), make_url(TOPIC_URL . $tor['topic_id']), config('tp.tor_icons.' . $new_status) . ' ' . trans('messages.TOR_STATUS_NAME.' . $new_status));
|
||||||
|
|
||||||
if ($comment && $comment != $lang['COMMENT']) {
|
if ($comment && $comment != trans('messages.COMMENT')) {
|
||||||
$message .= "\n\n[b]" . $lang['COMMENT'] . '[/b]: ' . $comment;
|
$message .= "\n\n[b]" . trans('messages.COMMENT') . '[/b]: ' . $comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_pm($tor['poster_id'], $subject, $message, $userdata['user_id']);
|
send_pm($tor['poster_id'], $subject, $message, $userdata['user_id']);
|
||||||
|
@ -104,14 +104,14 @@ switch ($mode) {
|
||||||
|
|
||||||
case 'status_reply':
|
case 'status_reply':
|
||||||
if (!config('tp.tor_comment')) {
|
if (!config('tp.tor_comment')) {
|
||||||
$this->ajax_die($lang['MODULE_OFF']);
|
$this->ajax_die(trans('messages.MODULE_OFF'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$subject = sprintf($lang['TOR_AUTH_TITLE'], $tor['topic_title']);
|
$subject = sprintf(trans('messages.TOR_AUTH_TITLE'), $tor['topic_title']);
|
||||||
$message = sprintf($lang['TOR_AUTH_MSG'], get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']);
|
$message = sprintf(trans('messages.TOR_AUTH_MSG'), get_username($tor['checked_user_id']), make_url(TOPIC_URL . $tor['topic_id']), $tor['topic_title']);
|
||||||
|
|
||||||
if ($comment && $comment != $lang['COMMENT']) {
|
if ($comment && $comment != trans('messages.COMMENT')) {
|
||||||
$message .= "\n\n[b]" . $lang['COMMENT'] . '[/b]: ' . $comment;
|
$message .= "\n\n[b]" . trans('messages.COMMENT') . '[/b]: ' . $comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']);
|
send_pm($tor['checked_user_id'], $subject, $message, $userdata['user_id']);
|
||||||
|
|
|
@ -11,10 +11,10 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
if (!isset($this->request['attach_id'])) {
|
if (!isset($this->request['attach_id'])) {
|
||||||
$this->ajax_die($lang['EMPTY_ATTACH_ID']);
|
$this->ajax_die(trans('messages.EMPTY_ATTACH_ID'));
|
||||||
}
|
}
|
||||||
if (!isset($this->request['type'])) {
|
if (!isset($this->request['type'])) {
|
||||||
$this->ajax_die('type');
|
$this->ajax_die('type');
|
||||||
|
@ -44,17 +44,17 @@ $torrent = OLD_DB()->fetch_row("
|
||||||
");
|
");
|
||||||
|
|
||||||
if (!$torrent) {
|
if (!$torrent) {
|
||||||
$this->ajax_die($lang['INVALID_ATTACH_ID']);
|
$this->ajax_die(trans('messages.INVALID_ATTACH_ID'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($torrent['poster_id'] == $userdata['user_id'] && !IS_AM) {
|
if ($torrent['poster_id'] == $userdata['user_id'] && !IS_AM) {
|
||||||
if ($type == 'del_torrent' || $type == 'reg' || $type == 'unreg') {
|
if ($type == 'del_torrent' || $type == 'reg' || $type == 'unreg') {
|
||||||
true;
|
true;
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die(trans('messages.ONLY_FOR_MOD'));
|
||||||
}
|
}
|
||||||
} elseif (!IS_AM) {
|
} elseif (!IS_AM) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die(trans('messages.ONLY_FOR_MOD'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = $url = '';
|
$title = $url = '';
|
||||||
|
@ -70,7 +70,7 @@ switch ($type) {
|
||||||
$tor_type = 0;
|
$tor_type = 0;
|
||||||
}
|
}
|
||||||
change_tor_type($attach_id, $tor_type);
|
change_tor_type($attach_id, $tor_type);
|
||||||
$title = $lang['CHANGE_TOR_TYPE'];
|
$title = trans('messages.CHANGE_TOR_TYPE');
|
||||||
$url = make_url(TOPIC_URL . $torrent['topic_id']);
|
$url = make_url(TOPIC_URL . $torrent['topic_id']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ switch ($type) {
|
||||||
|
|
||||||
case 'del_torrent':
|
case 'del_torrent':
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['DEL_TORRENT']);
|
$this->prompt_for_confirm(trans('messages.DEL_TORRENT'));
|
||||||
}
|
}
|
||||||
delete_torrent($attach_id);
|
delete_torrent($attach_id);
|
||||||
$url = make_url(TOPIC_URL . $torrent['topic_id']);
|
$url = make_url(TOPIC_URL . $torrent['topic_id']);
|
||||||
|
@ -94,7 +94,7 @@ switch ($type) {
|
||||||
|
|
||||||
case 'del_torrent_move_topic':
|
case 'del_torrent_move_topic':
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['DEL_MOVE_TORRENT']);
|
$this->prompt_for_confirm(trans('messages.DEL_MOVE_TORRENT'));
|
||||||
}
|
}
|
||||||
delete_torrent($attach_id);
|
delete_torrent($attach_id);
|
||||||
$url = make_url("modcp.php?t={$torrent['topic_id']}&mode=move&sid={$userdata['session_id']}");
|
$url = make_url("modcp.php?t={$torrent['topic_id']}&mode=move&sid={$userdata['session_id']}");
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $bf, $lang;
|
global $bf;
|
||||||
|
|
||||||
$user_id = (int)$this->request['user_id'];
|
$user_id = (int)$this->request['user_id'];
|
||||||
$new_opt = json_decode($this->request['user_opt'], true);
|
$new_opt = json_decode($this->request['user_opt'], true);
|
||||||
|
@ -35,4 +35,4 @@ OLD_DB()->query("UPDATE " . BB_USERS . " SET user_opt = {$u_data['user_opt']} WH
|
||||||
// Удаляем данные из кеша
|
// Удаляем данные из кеша
|
||||||
cache_rm_user_sessions($user_id);
|
cache_rm_user_sessions($user_id);
|
||||||
|
|
||||||
$this->response['resp_html'] = $lang['SAVED'];
|
$this->response['resp_html'] = trans('messages.SAVED');
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $datastore, $lang;
|
global $datastore;
|
||||||
|
|
||||||
$ranks = $datastore->get('ranks');
|
$ranks = $datastore->get('ranks');
|
||||||
$rank_id = (int)$this->request['rank_id'];
|
$rank_id = (int)$this->request['rank_id'];
|
||||||
|
@ -30,5 +30,5 @@ cache_rm_user_sessions($user_id);
|
||||||
|
|
||||||
$user_rank = ($rank_id) ? '<span class="' . $ranks[$rank_id]['rank_style'] . '">' . $ranks[$rank_id]['rank_title'] . '</span>' : '';
|
$user_rank = ($rank_id) ? '<span class="' . $ranks[$rank_id]['rank_style'] . '">' . $ranks[$rank_id]['rank_title'] . '</span>' : '';
|
||||||
|
|
||||||
$this->response['html'] = ($rank_id) ? $lang['AWARDED_RANK'] . "<b> $user_rank </b>" : $lang['SHOT_RANK'];
|
$this->response['html'] = ($rank_id) ? trans('messages.AWARDED_RANK') . "<b> $user_rank </b>" : trans('messages.SHOT_RANK');
|
||||||
$this->response['rank_name'] = ($rank_id) ? $user_rank : $lang['USER'];
|
$this->response['rank_name'] = ($rank_id) ? $user_rank : trans('messages.USER');
|
||||||
|
|
|
@ -11,10 +11,10 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
if (!$group_id = (int)$this->request['group_id'] or !$group_info = get_group_data($group_id)) {
|
if (!$group_id = (int)$this->request['group_id'] or !$group_info = get_group_data($group_id)) {
|
||||||
$this->ajax_die($lang['NO_GROUP_ID_SPECIFIED']);
|
$this->ajax_die(trans('messages.NO_GROUP_ID_SPECIFIED'));
|
||||||
}
|
}
|
||||||
if (!$mode = (string)$this->request['mode']) {
|
if (!$mode = (string)$this->request['mode']) {
|
||||||
$this->ajax_die('No mode specified');
|
$this->ajax_die('No mode specified');
|
||||||
|
@ -23,7 +23,7 @@ if (!$mode = (string)$this->request['mode']) {
|
||||||
$value = $this->request['value'] = (string)(isset($this->request['value'])) ? $this->request['value'] : 0;
|
$value = $this->request['value'] = (string)(isset($this->request['value'])) ? $this->request['value'] : 0;
|
||||||
|
|
||||||
if (!IS_ADMIN && $userdata['user_id'] != $group_info['group_moderator']) {
|
if (!IS_ADMIN && $userdata['user_id'] != $group_info['group_moderator']) {
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die(trans('messages.ONLY_FOR_MOD'));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
|
|
|
@ -11,10 +11,8 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
if (!$user_id = (int)$this->request['user_id'] or !$profiledata = get_userdata($user_id)) {
|
if (!$user_id = (int)$this->request['user_id'] or !$profiledata = get_userdata($user_id)) {
|
||||||
$this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
$this->ajax_die(trans('messages.NO_USER_ID_SPECIFIED'));
|
||||||
}
|
}
|
||||||
if (!$field = (string)$this->request['field']) {
|
if (!$field = (string)$this->request['field']) {
|
||||||
$this->ajax_die('invalid profile field');
|
$this->ajax_die('invalid profile field');
|
||||||
|
@ -46,34 +44,34 @@ switch ($field) {
|
||||||
if ($value == '' || preg_match('#^https?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+$#iu', $value)) {
|
if ($value == '' || preg_match('#^https?://[\w\#!$%&~/.\-;:=,?@а-яА-Я\[\]+]+$#iu', $value)) {
|
||||||
$this->response['new_value'] = htmlCHR($value);
|
$this->response['new_value'] = htmlCHR($value);
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['WEBSITE_ERROR']);
|
$this->ajax_die(trans('messages.WEBSITE_ERROR'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_gender':
|
case 'user_gender':
|
||||||
if (!config('tp.gender')) {
|
if (!config('tp.gender')) {
|
||||||
$this->ajax_die($lang['MODULE_OFF']);
|
$this->ajax_die(trans('messages.MODULE_OFF'));
|
||||||
}
|
}
|
||||||
if (!isset($lang['GENDER_SELECT'][$value])) {
|
if (trans('messages.GENDER_SELECT.' . $value) === 'messages.GENDER_SELECT.' . $value) {
|
||||||
$this->ajax_die($lang['ERROR']);
|
$this->ajax_die(trans('messages.ERROR'));
|
||||||
} else {
|
} else {
|
||||||
$this->response['new_value'] = $lang['GENDER_SELECT'][$value];
|
$this->response['new_value'] = trans('messages.GENDER_SELECT.' . $value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_birthday':
|
case 'user_birthday':
|
||||||
if (!config('tp.birthday_enabled')) {
|
if (!config('tp.birthday_enabled')) {
|
||||||
$this->ajax_die($lang['MODULE_OFF']);
|
$this->ajax_die(trans('messages.MODULE_OFF'));
|
||||||
}
|
}
|
||||||
$birthday_date = date_parse($value);
|
$birthday_date = date_parse($value);
|
||||||
|
|
||||||
if (!empty($birthday_date['year'])) {
|
if (!empty($birthday_date['year'])) {
|
||||||
if (strtotime($value) >= TIMENOW) {
|
if (strtotime($value) >= TIMENOW) {
|
||||||
$this->ajax_die($lang['WRONG_BIRTHDAY_FORMAT']);
|
$this->ajax_die(trans('messages.WRONG_BIRTHDAY_FORMAT'));
|
||||||
} elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] > config('tp.birthday_max_age')) {
|
} elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] > config('tp.birthday_max_age')) {
|
||||||
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_HIGH'], config('tp.birthday_max_age')));
|
$this->ajax_die(sprintf(trans('messages.BIRTHDAY_TO_HIGH'), config('tp.birthday_max_age')));
|
||||||
} elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] < config('tp.birthday_min_age')) {
|
} elseif (bb_date(TIMENOW, 'Y', 'false') - $birthday_date['year'] < config('tp.birthday_min_age')) {
|
||||||
$this->ajax_die(sprintf($lang['BIRTHDAY_TO_LOW'], config('tp.birthday_min_age')));
|
$this->ajax_die(sprintf(trans('messages.BIRTHDAY_TO_LOW'), config('tp.birthday_min_age')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,21 +80,21 @@ switch ($field) {
|
||||||
|
|
||||||
case 'user_icq':
|
case 'user_icq':
|
||||||
if ($value && !preg_match('#^\d{6,15}$#', $value)) {
|
if ($value && !preg_match('#^\d{6,15}$#', $value)) {
|
||||||
$this->ajax_die($lang['ICQ_ERROR']);
|
$this->ajax_die(trans('messages.ICQ_ERROR'));
|
||||||
}
|
}
|
||||||
$this->response['new_value'] = $this->request['value'];
|
$this->response['new_value'] = $this->request['value'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_skype':
|
case 'user_skype':
|
||||||
if ($value && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $value)) {
|
if ($value && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $value)) {
|
||||||
$this->ajax_die($lang['SKYPE_ERROR']);
|
$this->ajax_die(trans('messages.SKYPE_ERROR'));
|
||||||
}
|
}
|
||||||
$this->response['new_value'] = $this->request['value'];
|
$this->response['new_value'] = $this->request['value'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_twitter':
|
case 'user_twitter':
|
||||||
if ($value && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $value)) {
|
if ($value && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $value)) {
|
||||||
$this->ajax_die($lang['TWITTER_ERROR']);
|
$this->ajax_die(trans('messages.TWITTER_ERROR'));
|
||||||
}
|
}
|
||||||
$this->response['new_value'] = $this->request['value'];
|
$this->response['new_value'] = $this->request['value'];
|
||||||
break;
|
break;
|
||||||
|
@ -112,7 +110,7 @@ switch ($field) {
|
||||||
case 'user_lastvisit':
|
case 'user_lastvisit':
|
||||||
$tz = TIMENOW + (3600 * config('tp.board_timezone'));
|
$tz = TIMENOW + (3600 * config('tp.board_timezone'));
|
||||||
if (($value = strtotime($value, $tz)) < config('tp.board_startdate') || $value > TIMENOW) {
|
if (($value = strtotime($value, $tz)) < config('tp.board_startdate') || $value > TIMENOW) {
|
||||||
$this->ajax_die($lang['INVALID_DATE'] . $this->request['value']);
|
$this->ajax_die(trans('messages.INVALID_DATE') . $this->request['value']);
|
||||||
}
|
}
|
||||||
$this->response['new_value'] = bb_date($value, 'Y-m-d H:i', false);
|
$this->response['new_value'] = bb_date($value, 'Y-m-d H:i', false);
|
||||||
break;
|
break;
|
||||||
|
@ -122,7 +120,7 @@ switch ($field) {
|
||||||
case 'u_up_release':
|
case 'u_up_release':
|
||||||
case 'u_up_bonus':
|
case 'u_up_bonus':
|
||||||
if (!IS_ADMIN) {
|
if (!IS_ADMIN) {
|
||||||
$this->ajax_die($lang['NOT_ADMIN']);
|
$this->ajax_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = BB_BT_USERS;
|
$table = BB_BT_USERS;
|
||||||
|
|
|
@ -11,13 +11,13 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
$req_uid = (int)$this->request['user_id'];
|
$req_uid = (int)$this->request['user_id'];
|
||||||
|
|
||||||
if ($req_uid == $userdata['user_id'] || IS_ADMIN) {
|
if ($req_uid == $userdata['user_id'] || IS_ADMIN) {
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['BT_GEN_PASSKEY_NEW']);
|
$this->prompt_for_confirm(trans('messages.BT_GEN_PASSKEY_NEW'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$passkey = generate_passkey($req_uid, IS_ADMIN)) {
|
if (!$passkey = generate_passkey($req_uid, IS_ADMIN)) {
|
||||||
|
@ -28,5 +28,5 @@ if ($req_uid == $userdata['user_id'] || IS_ADMIN) {
|
||||||
|
|
||||||
$this->response['passkey'] = $passkey;
|
$this->response['passkey'] = $passkey;
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['NOT_AUTHORISED']);
|
$this->ajax_die(trans('messages.NOT_AUTHORISED'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang, $user;
|
global $user;
|
||||||
|
|
||||||
if (!$user_id = (int)$this->request['user_id'] or !$profiledata = get_userdata($user_id)) {
|
if (!$user_id = (int)$this->request['user_id'] or !$profiledata = get_userdata($user_id)) {
|
||||||
$this->ajax_die("invalid user_id: $user_id");
|
$this->ajax_die("invalid user_id: $user_id");
|
||||||
|
@ -57,7 +57,7 @@ switch ($mode) {
|
||||||
if ($html) {
|
if ($html) {
|
||||||
$this->response['group_list_html'] = '<ul><li>' . implode('</li><li>', $html) . '</li></ul>';
|
$this->response['group_list_html'] = '<ul><li>' . implode('</li><li>', $html) . '</li></ul>';
|
||||||
} else {
|
} else {
|
||||||
$this->response['group_list_html'] = $lang['GROUP_LIST_HIDDEN'];
|
$this->response['group_list_html'] = trans('messages.GROUP_LIST_HIDDEN');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang, $userdata, $datastore;
|
global $userdata, $datastore;
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
$html = '';
|
$html = '';
|
||||||
|
@ -27,9 +27,9 @@ switch ($mode) {
|
||||||
foreach ($stats['birthday_week_list'] as $week) {
|
foreach ($stats['birthday_week_list'] as $week) {
|
||||||
$html[] = profile_url($week) . ' <span class="small">(' . birthday_age($week['user_birthday']) . ')</span>';
|
$html[] = profile_url($week) . ' <span class="small">(' . birthday_age($week['user_birthday']) . ')</span>';
|
||||||
}
|
}
|
||||||
$html = sprintf($lang['BIRTHDAY_WEEK'], config('tp.birthday_check_day'), implode(', ', $html));
|
$html = sprintf(trans('messages.BIRTHDAY_WEEK'), config('tp.birthday_check_day'), implode(', ', $html));
|
||||||
} else {
|
} else {
|
||||||
$html = sprintf($lang['NOBIRTHDAY_WEEK'], config('tp.birthday_check_day'));
|
$html = sprintf(trans('messages.NOBIRTHDAY_WEEK'), config('tp.birthday_check_day'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@ switch ($mode) {
|
||||||
foreach ($stats['birthday_today_list'] as $today) {
|
foreach ($stats['birthday_today_list'] as $today) {
|
||||||
$html[] = profile_url($today) . ' <span class="small">(' . birthday_age($today['user_birthday']) . ')</span>';
|
$html[] = profile_url($today) . ' <span class="small">(' . birthday_age($today['user_birthday']) . ')</span>';
|
||||||
}
|
}
|
||||||
$html = $lang['BIRTHDAY_TODAY'] . implode(', ', $html);
|
$html = trans('messages.BIRTHDAY_TODAY') . implode(', ', $html);
|
||||||
} else {
|
} else {
|
||||||
$html = $lang['NOBIRTHDAY_TODAY'];
|
$html = trans('messages.NOBIRTHDAY_TODAY');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ switch ($mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$html = ': ';
|
$html = ': ';
|
||||||
$html .= ($moderators) ? implode(', ', $moderators) : $lang['NONE'];
|
$html .= ($moderators) ? implode(', ', $moderators) : trans('messages.NONE');
|
||||||
unset($moderators, $mod);
|
unset($moderators, $mod);
|
||||||
$datastore->rm('moderators');
|
$datastore->rm('moderators');
|
||||||
break;
|
break;
|
||||||
|
@ -101,19 +101,19 @@ switch ($mode) {
|
||||||
|
|
||||||
$speed_up = ($btu['speed_up']) ? humn_size($btu['speed_up']) . '/s' : '0 KB/s';
|
$speed_up = ($btu['speed_up']) ? humn_size($btu['speed_up']) . '/s' : '0 KB/s';
|
||||||
$speed_down = ($btu['speed_down']) ? humn_size($btu['speed_down']) . '/s' : '0 KB/s';
|
$speed_down = ($btu['speed_down']) ? humn_size($btu['speed_down']) . '/s' : '0 KB/s';
|
||||||
$user_ratio = ($btu['u_down_total'] > MIN_DL_FOR_RATIO) ? '<b class="gen">' . get_bt_ratio($btu) . '</b>' : $lang['IT_WILL_BE_DOWN'] . ' <b>' . humn_size(MIN_DL_FOR_RATIO) . '</b>';
|
$user_ratio = ($btu['u_down_total'] > MIN_DL_FOR_RATIO) ? '<b class="gen">' . get_bt_ratio($btu) . '</b>' : trans('messages.IT_WILL_BE_DOWN') . ' <b>' . humn_size(MIN_DL_FOR_RATIO) . '</b>';
|
||||||
|
|
||||||
$html = '
|
$html = '
|
||||||
<tr class="row3">
|
<tr class="row3">
|
||||||
<th style="padding: 0;"></th>
|
<th style="padding: 0;"></th>
|
||||||
<th>' . $lang['DOWNLOADED'] . '</th>
|
<th>' . trans('messages.DOWNLOADED') . '</th>
|
||||||
<th>' . $lang['UPLOADED'] . '</th>
|
<th>' . trans('messages.UPLOADED') . '</th>
|
||||||
<th>' . $lang['RELEASED'] . '</th>
|
<th>' . trans('messages.RELEASED') . '</th>
|
||||||
<th>' . $lang['BONUS'] . '</th>';
|
<th>' . trans('messages.BONUS') . '</th>';
|
||||||
$html .= config('tp.seed_bonus_enabled') ? '<th>' . $lang['SEED_BONUS'] . '</th>' : '';
|
$html .= config('tp.seed_bonus_enabled') ? '<th>' . trans('messages.SEED_BONUS') . '</th>' : '';
|
||||||
$html .= '</tr>
|
$html .= '</tr>
|
||||||
<tr class="row1">
|
<tr class="row1">
|
||||||
<td>' . $lang['TOTAL_TRAF'] . '</td>
|
<td>' . trans('messages.TOTAL_TRAF') . '</td>
|
||||||
<td id="u_down_total"><span class="editable bold leechmed">' . humn_size($btu['u_down_total']) . '</span></td>
|
<td id="u_down_total"><span class="editable bold leechmed">' . humn_size($btu['u_down_total']) . '</span></td>
|
||||||
<td id="u_up_total"><span class="editable bold seedmed">' . humn_size($btu['u_up_total']) . '</span></td>
|
<td id="u_up_total"><span class="editable bold seedmed">' . humn_size($btu['u_up_total']) . '</span></td>
|
||||||
<td id="u_up_release"><span class="editable bold seedmed">' . humn_size($btu['u_up_release']) . '</span></td>
|
<td id="u_up_release"><span class="editable bold seedmed">' . humn_size($btu['u_up_release']) . '</span></td>
|
||||||
|
@ -121,14 +121,14 @@ switch ($mode) {
|
||||||
$html .= config('tp.seed_bonus_enabled') ? '<td id="user_points"><span class="editable bold points">' . $profiledata['user_points'] . '</b></td>' : '';
|
$html .= config('tp.seed_bonus_enabled') ? '<td id="user_points"><span class="editable bold points">' . $profiledata['user_points'] . '</b></td>' : '';
|
||||||
$html .= '</tr>
|
$html .= '</tr>
|
||||||
<tr class="row5">
|
<tr class="row5">
|
||||||
<td colspan="1">' . $lang['MAX_SPEED'] . '</td>
|
<td colspan="1">' . trans('messages.MAX_SPEED') . '</td>
|
||||||
<td colspan="2">' . $lang['DL_DL_SPEED'] . ': ' . $speed_down . '</span></td>
|
<td colspan="2">' . trans('messages.DL_DL_SPEED') . ': ' . $speed_down . '</span></td>
|
||||||
<td colspan="2">' . $lang['DL_UL_SPEED'] . ': ' . $speed_up . '</span></td>';
|
<td colspan="2">' . trans('messages.DL_UL_SPEED') . ': ' . $speed_up . '</span></td>';
|
||||||
$html .= config('tp.seed_bonus_enabled') ? '<td colspan="1"></td>' : '';
|
$html .= config('tp.seed_bonus_enabled') ? '<td colspan="1"></td>' : '';
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
|
|
||||||
$this->response['user_ratio'] = '
|
$this->response['user_ratio'] = '
|
||||||
<th><a href="' . config('tp.ratio_url_help') . '" class="bold">' . $lang['USER_RATIO'] . '</a>:</th>
|
<th><a href="' . config('tp.ratio_url_help') . '" class="bold">' . trans('messages.USER_RATIO') . '</a>:</th>
|
||||||
<td>' . $user_ratio . '</td>
|
<td>' . $user_ratio . '</td>
|
||||||
';
|
';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ switch ($mode) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response['cache_html'] = '<span class="seed bold">' . $lang['ALL_CACHE_CLEARED'] . '</span>';
|
$this->response['cache_html'] = '<span class="seed bold">' . trans('messages.ALL_CACHE_CLEARED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ switch ($mode) {
|
||||||
|
|
||||||
$datastore->clean();
|
$datastore->clean();
|
||||||
|
|
||||||
$this->response['datastore_html'] = '<span class="seed bold">' . $lang['DATASTORE_CLEARED'] . '</span>';
|
$this->response['datastore_html'] = '<span class="seed bold">' . trans('messages.DATASTORE_CLEARED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ switch ($mode) {
|
||||||
}
|
}
|
||||||
closedir($res);
|
closedir($res);
|
||||||
|
|
||||||
$this->response['template_cache_html'] = '<span class="seed bold">' . $lang['ALL_TEMPLATE_CLEARED'] . '</span>';
|
$this->response['template_cache_html'] = '<span class="seed bold">' . trans('messages.ALL_TEMPLATE_CLEARED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ switch ($mode) {
|
||||||
file_put_contents(config('tp.sphinx_config_path') . '.log', "\r\n", FILE_APPEND);
|
file_put_contents(config('tp.sphinx_config_path') . '.log', "\r\n", FILE_APPEND);
|
||||||
file_put_contents(config('tp.sphinx_config_path') . '.log', "\r\n", FILE_APPEND);
|
file_put_contents(config('tp.sphinx_config_path') . '.log', "\r\n", FILE_APPEND);
|
||||||
|
|
||||||
$this->response['indexer_html'] = '<span class="seed bold">' . $lang['INDEXER'] . '</span>';
|
$this->response['indexer_html'] = '<span class="seed bold">' . trans('messages.INDEXER') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ switch ($mode) {
|
||||||
|
|
||||||
update_user_level('all');
|
update_user_level('all');
|
||||||
|
|
||||||
$this->response['update_user_level_html'] = '<span class="seed bold">' . $lang['USER_LEVELS_UPDATED'] . '</span>';
|
$this->response['update_user_level_html'] = '<span class="seed bold">' . trans('messages.USER_LEVELS_UPDATED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ switch ($mode) {
|
||||||
sync('topic', 'all');
|
sync('topic', 'all');
|
||||||
sync_all_forums();
|
sync_all_forums();
|
||||||
|
|
||||||
$this->response['sync_topics_html'] = '<span class="seed bold">' . $lang['TOPICS_DATA_SYNCHRONIZED'] . '</span>';
|
$this->response['sync_topics_html'] = '<span class="seed bold">' . trans('messages.TOPICS_DATA_SYNCHRONIZED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ switch ($mode) {
|
||||||
|
|
||||||
sync('user_posts', 'all');
|
sync('user_posts', 'all');
|
||||||
|
|
||||||
$this->response['sync_user_posts_html'] = '<span class="seed bold">' . $lang['USER_POSTS_COUNT_SYNCHRONIZED'] . '</span>';
|
$this->response['sync_user_posts_html'] = '<span class="seed bold">' . trans('messages.USER_POSTS_COUNT_SYNCHRONIZED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ switch ($mode) {
|
||||||
|
|
||||||
TorrentPier\Helpers\CronHelper::enableBoard();
|
TorrentPier\Helpers\CronHelper::enableBoard();
|
||||||
|
|
||||||
$this->response['unlock_cron_html'] = '<span class="seed bold">' . $lang['ADMIN_UNLOCKED'] . '</span>';
|
$this->response['unlock_cron_html'] = '<span class="seed bold">' . trans('messages.ADMIN_UNLOCKED') . '</span>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
$user_id = $this->request['user_id'];
|
$user_id = $this->request['user_id'];
|
||||||
|
@ -20,19 +20,19 @@ switch ($mode) {
|
||||||
case 'delete_profile':
|
case 'delete_profile':
|
||||||
|
|
||||||
if ($userdata['user_id'] == $user_id) {
|
if ($userdata['user_id'] == $user_id) {
|
||||||
$this->ajax_die($lang['USER_DELETE_ME']);
|
$this->ajax_die(trans('messages.USER_DELETE_ME'));
|
||||||
}
|
}
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['USER_DELETE_CONFIRM']);
|
$this->prompt_for_confirm(trans('messages.USER_DELETE_CONFIRM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user_id != BOT_UID) {
|
if ($user_id != BOT_UID) {
|
||||||
delete_user_sessions($user_id);
|
delete_user_sessions($user_id);
|
||||||
user_delete($user_id);
|
user_delete($user_id);
|
||||||
|
|
||||||
$this->response['info'] = $lang['USER_DELETED'];
|
$this->response['info'] = trans('messages.USER_DELETED');
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['USER_DELETE_CSV']);
|
$this->ajax_die(trans('messages.USER_DELETE_CSV'));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -40,10 +40,10 @@ switch ($mode) {
|
||||||
case 'delete_topics':
|
case 'delete_topics':
|
||||||
|
|
||||||
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) {
|
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) {
|
||||||
$this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']);
|
$this->prompt_for_confirm(trans('messages.DELETE_USER_POSTS_ME'));
|
||||||
}
|
}
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['DELETE_USER_ALL_POSTS_CONFIRM']);
|
$this->prompt_for_confirm(trans('messages.DELETE_USER_ALL_POSTS_CONFIRM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
|
@ -51,9 +51,9 @@ switch ($mode) {
|
||||||
$deleted_topics = topic_delete($user_topics);
|
$deleted_topics = topic_delete($user_topics);
|
||||||
$deleted_posts = post_delete('user', $user_id);
|
$deleted_posts = post_delete('user', $user_id);
|
||||||
|
|
||||||
$this->response['info'] = $lang['USER_DELETED_POSTS'];
|
$this->response['info'] = trans('messages.USER_DELETED_POSTS');
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['NOT_ADMIN']);
|
$this->ajax_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -61,18 +61,18 @@ switch ($mode) {
|
||||||
case 'delete_message':
|
case 'delete_message':
|
||||||
|
|
||||||
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) {
|
if (empty($this->request['confirmed']) && $userdata['user_id'] == $user_id) {
|
||||||
$this->prompt_for_confirm($lang['DELETE_USER_POSTS_ME']);
|
$this->prompt_for_confirm(trans('messages.DELETE_USER_POSTS_ME'));
|
||||||
}
|
}
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['DELETE_USER_POSTS_CONFIRM']);
|
$this->prompt_for_confirm(trans('messages.DELETE_USER_POSTS_CONFIRM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
post_delete('user', $user_id);
|
post_delete('user', $user_id);
|
||||||
|
|
||||||
$this->response['info'] = $lang['USER_DELETED_POSTS'];
|
$this->response['info'] = trans('messages.USER_DELETED_POSTS');
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['NOT_ADMIN']);
|
$this->ajax_die(trans('messages.NOT_ADMIN'));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -80,28 +80,28 @@ switch ($mode) {
|
||||||
case 'user_activate':
|
case 'user_activate':
|
||||||
|
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['DEACTIVATE_CONFIRM']);
|
$this->prompt_for_confirm(trans('messages.DEACTIVATE_CONFIRM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
OLD_DB()->query("UPDATE " . BB_USERS . " SET user_active = '1' WHERE user_id = " . $user_id);
|
OLD_DB()->query("UPDATE " . BB_USERS . " SET user_active = '1' WHERE user_id = " . $user_id);
|
||||||
|
|
||||||
$this->response['info'] = $lang['USER_ACTIVATE_ON'];
|
$this->response['info'] = trans('messages.USER_ACTIVATE_ON');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_deactivate':
|
case 'user_deactivate':
|
||||||
|
|
||||||
if ($userdata['user_id'] == $user_id) {
|
if ($userdata['user_id'] == $user_id) {
|
||||||
$this->ajax_die($lang['USER_DEACTIVATE_ME']);
|
$this->ajax_die(trans('messages.USER_DEACTIVATE_ME'));
|
||||||
}
|
}
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['ACTIVATE_CONFIRM']);
|
$this->prompt_for_confirm(trans('messages.ACTIVATE_CONFIRM'));
|
||||||
}
|
}
|
||||||
|
|
||||||
OLD_DB()->query("UPDATE " . BB_USERS . " SET user_active = '0' WHERE user_id = " . $user_id);
|
OLD_DB()->query("UPDATE " . BB_USERS . " SET user_active = '0' WHERE user_id = " . $user_id);
|
||||||
delete_user_sessions($user_id);
|
delete_user_sessions($user_id);
|
||||||
|
|
||||||
$this->response['info'] = $lang['USER_ACTIVATE_OFF'];
|
$this->response['info'] = trans('messages.USER_ACTIVATE_OFF');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $lang, $datastore;
|
global $userdata, $datastore;
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ switch ($mode) {
|
||||||
$status = (int)$this->request['status'];
|
$status = (int)$this->request['status'];
|
||||||
|
|
||||||
// Валидность статуса
|
// Валидность статуса
|
||||||
if (!isset($lang['TOR_STATUS_NAME'][$status])) {
|
if (trans('messages.TOR_STATUS_NAME.' . $status) === 'messages.TOR_STATUS_NAME.' . $status) {
|
||||||
$this->ajax_die($lang['STATUS_DOES_EXIST'] . $new_status);
|
$this->ajax_die(trans('messages.STATUS_DOES_EXIST') . $new_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_ids = OLD_DB()->fetch_rowset("SELECT attach_id FROM " . BB_BT_TORRENTS . " WHERE topic_id IN($topics)", 'attach_id');
|
$topic_ids = OLD_DB()->fetch_rowset("SELECT attach_id FROM " . BB_BT_TORRENTS . " WHERE topic_id IN($topics)", 'attach_id');
|
||||||
|
@ -40,14 +40,14 @@ switch ($mode) {
|
||||||
$new_title = clean_title($topic_title);
|
$new_title = clean_title($topic_title);
|
||||||
|
|
||||||
if (!$topic_id) {
|
if (!$topic_id) {
|
||||||
$this->ajax_die($lang['INVALID_TOPIC_ID']);
|
$this->ajax_die(trans('messages.INVALID_TOPIC_ID'));
|
||||||
}
|
}
|
||||||
if ($new_title == '') {
|
if ($new_title == '') {
|
||||||
$this->ajax_die($lang['DONT_MESSAGE_TITLE']);
|
$this->ajax_die(trans('messages.DONT_MESSAGE_TITLE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$t_data = OLD_DB()->fetch_row("SELECT forum_id FROM " . BB_TOPICS . " WHERE topic_id = $topic_id LIMIT 1")) {
|
if (!$t_data = OLD_DB()->fetch_row("SELECT forum_id FROM " . BB_TOPICS . " WHERE topic_id = $topic_id LIMIT 1")) {
|
||||||
$this->ajax_die($lang['INVALID_TOPIC_ID_DB']);
|
$this->ajax_die(trans('messages.INVALID_TOPIC_ID_DB'));
|
||||||
}
|
}
|
||||||
$this->verify_mod_rights($t_data['forum_id']);
|
$this->verify_mod_rights($t_data['forum_id']);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ switch ($mode) {
|
||||||
$profiledata = get_userdata($user_id);
|
$profiledata = get_userdata($user_id);
|
||||||
|
|
||||||
if (!$user_id) {
|
if (!$user_id) {
|
||||||
$this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
$this->ajax_die(trans('messages.NO_USER_ID_SPECIFIED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$reg_ip = OLD_DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " . BB_USERS . "
|
$reg_ip = OLD_DB()->fetch_rowset("SELECT username, user_id, user_rank FROM " . BB_USERS . "
|
||||||
|
@ -94,23 +94,23 @@ switch ($mode) {
|
||||||
$link_reg_ip = $link_last_ip = '';
|
$link_reg_ip = $link_last_ip = '';
|
||||||
|
|
||||||
if (!empty($reg_ip)) {
|
if (!empty($reg_ip)) {
|
||||||
$link_reg_ip .= $lang['OTHER_IP'] . ' ';
|
$link_reg_ip .= trans('messages.OTHER_IP') . ' ';
|
||||||
foreach ($reg_ip as $row) {
|
foreach ($reg_ip as $row) {
|
||||||
$link_reg_ip .= profile_url($row) . ' ';
|
$link_reg_ip .= profile_url($row) . ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($last_ip)) {
|
if (!empty($last_ip)) {
|
||||||
$link_last_ip .= $lang['OTHER_IP'] . ' ';
|
$link_last_ip .= trans('messages.OTHER_IP') . ' ';
|
||||||
foreach ($last_ip as $row) {
|
foreach ($last_ip as $row) {
|
||||||
$link_last_ip .= profile_url($row) . ' ';
|
$link_last_ip .= profile_url($row) . ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($profiledata['user_level'] == ADMIN && !IS_ADMIN) {
|
if ($profiledata['user_level'] == ADMIN && !IS_ADMIN) {
|
||||||
$reg_ip = $last_ip = $lang['HIDDEN'];
|
$reg_ip = $last_ip = trans('messages.HIDDEN');
|
||||||
} elseif ($profiledata['user_level'] == MOD && IS_MOD) {
|
} elseif ($profiledata['user_level'] == MOD && IS_MOD) {
|
||||||
$reg_ip = $last_ip = $lang['HIDDEN'];
|
$reg_ip = $last_ip = trans('messages.HIDDEN');
|
||||||
} else {
|
} else {
|
||||||
$user_reg_ip = decode_ip($profiledata['user_reg_ip']);
|
$user_reg_ip = decode_ip($profiledata['user_reg_ip']);
|
||||||
$user_last_ip = decode_ip($profiledata['user_last_ip']);
|
$user_last_ip = decode_ip($profiledata['user_last_ip']);
|
||||||
|
@ -121,12 +121,12 @@ switch ($mode) {
|
||||||
$this->response['ip_list_html'] = '
|
$this->response['ip_list_html'] = '
|
||||||
<br /><table class="mod_ip bCenter borderless" cellspacing="1">
|
<br /><table class="mod_ip bCenter borderless" cellspacing="1">
|
||||||
<tr class="row5" >
|
<tr class="row5" >
|
||||||
<td>' . $lang['REG_IP'] . '</td>
|
<td>' . trans('messages.REG_IP') . '</td>
|
||||||
<td class="tCenter">' . $reg_ip . '</td>
|
<td class="tCenter">' . $reg_ip . '</td>
|
||||||
<td><div>' . $link_reg_ip . '</div></td>
|
<td><div>' . $link_reg_ip . '</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="row4">
|
<tr class="row4">
|
||||||
<td>' . $lang['LAST_IP'] . '</td>
|
<td>' . trans('messages.LAST_IP') . '</td>
|
||||||
<td class="tCenter">' . $last_ip . '</td>
|
<td class="tCenter">' . $last_ip . '</td>
|
||||||
<td><div>' . $link_last_ip . '</div></td>
|
<td><div>' . $link_last_ip . '</div></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -11,13 +11,13 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
$post_id = (int)$this->request['post_id'];
|
$post_id = (int)$this->request['post_id'];
|
||||||
$mc_type = (int)$this->request['mc_type'];
|
$mc_type = (int)$this->request['mc_type'];
|
||||||
$mc_text = (string)$this->request['mc_text'];
|
$mc_text = (string)$this->request['mc_text'];
|
||||||
if (!$mc_text = prepare_message($mc_text)) {
|
if (!$mc_text = prepare_message($mc_text)) {
|
||||||
$this->ajax_die($lang['EMPTY_MESSAGE']);
|
$this->ajax_die(trans('messages.EMPTY_MESSAGE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$post = OLD_DB()->fetch_row("
|
$post = OLD_DB()->fetch_row("
|
||||||
|
@ -39,8 +39,8 @@ $sql_args = OLD_DB()->build_array('UPDATE', $data);
|
||||||
OLD_DB()->query("UPDATE " . BB_POSTS . " SET $sql_args WHERE post_id = $post_id");
|
OLD_DB()->query("UPDATE " . BB_POSTS . " SET $sql_args WHERE post_id = $post_id");
|
||||||
|
|
||||||
if ($mc_type && $post['poster_id'] != $userdata['user_id']) {
|
if ($mc_type && $post['poster_id'] != $userdata['user_id']) {
|
||||||
$subject = sprintf($lang['MC_COMMENT_PM_SUBJECT'], $lang['MC_COMMENT'][$mc_type]['type']);
|
$subject = sprintf(trans('messages.MC_COMMENT_PM_SUBJECT'), trans('messages.MC_COMMENT.' . $mc_type . '.type'));
|
||||||
$message = sprintf($lang['MC_COMMENT_PM_MSG'], get_username($post['poster_id']), make_url(POST_URL . "$post_id#$post_id"), $lang['MC_COMMENT'][$mc_type]['type'], $mc_text);
|
$message = sprintf(trans('messages.MC_COMMENT_PM_MSG'), get_username($post['poster_id']), make_url(POST_URL . "$post_id#$post_id"), trans('messages.MC_COMMENT.' . $mc_type . '.type'), $mc_text);
|
||||||
|
|
||||||
send_pm($post['poster_id'], $subject, $message);
|
send_pm($post['poster_id'], $subject, $message);
|
||||||
cache_rm_user_sessions($post['poster_id']);
|
cache_rm_user_sessions($post['poster_id']);
|
||||||
|
@ -66,6 +66,6 @@ switch ($mc_type) {
|
||||||
|
|
||||||
$this->response['mc_type'] = $mc_type;
|
$this->response['mc_type'] = $mc_type;
|
||||||
$this->response['post_id'] = $post_id;
|
$this->response['post_id'] = $post_id;
|
||||||
$this->response['mc_title'] = sprintf($lang['MC_COMMENT'][$mc_type]['title'], profile_url($userdata));
|
$this->response['mc_title'] = sprintf(trans('messages.MC_COMMENT.' . $mc_type . '.title'), profile_url($userdata));
|
||||||
$this->response['mc_text'] = bbcode2html($mc_text);
|
$this->response['mc_text'] = bbcode2html($mc_text);
|
||||||
$this->response['mc_class'] = $mc_class;
|
$this->response['mc_class'] = $mc_class;
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
if (!isset($this->request['type'])) {
|
if (!isset($this->request['type'])) {
|
||||||
$this->ajax_die('empty type');
|
$this->ajax_die('empty type');
|
||||||
|
@ -31,7 +31,7 @@ if (isset($this->request['post_id'])) {
|
||||||
|
|
||||||
$is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post);
|
$is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post);
|
||||||
if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) {
|
if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) {
|
||||||
$this->ajax_die($lang['TOPIC_LOCKED']);
|
$this->ajax_die(trans('messages.TOPIC_LOCKED'));
|
||||||
}
|
}
|
||||||
} elseif (isset($this->request['topic_id'])) {
|
} elseif (isset($this->request['topic_id'])) {
|
||||||
$topic_id = (int)$this->request['topic_id'];
|
$topic_id = (int)$this->request['topic_id'];
|
||||||
|
@ -58,7 +58,7 @@ switch ($this->request['type']) {
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if ($post['post_id'] != $post['topic_first_post_id'] && $is_auth['auth_delete'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600 * 3 > TIMENOW))) {
|
if ($post['post_id'] != $post['topic_first_post_id'] && $is_auth['auth_delete'] && ($is_auth['auth_mod'] || ($userdata['user_id'] == $post['poster_id'] && $post['topic_last_post_id'] == $post['post_id'] && $post['post_time'] + 3600 * 3 > TIMENOW))) {
|
||||||
if (empty($this->request['confirmed'])) {
|
if (empty($this->request['confirmed'])) {
|
||||||
$this->prompt_for_confirm($lang['CONFIRM_DELETE']);
|
$this->prompt_for_confirm(trans('messages.CONFIRM_DELETE'));
|
||||||
}
|
}
|
||||||
post_delete($post_id);
|
post_delete($post_id);
|
||||||
|
|
||||||
|
@ -68,15 +68,15 @@ switch ($this->request['type']) {
|
||||||
$this->response['hide'] = true;
|
$this->response['hide'] = true;
|
||||||
$this->response['post_id'] = $post_id;
|
$this->response['post_id'] = $post_id;
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die(sprintf($lang['SORRY_AUTH_DELETE'], strip_tags($is_auth['auth_delete_type'])));
|
$this->ajax_die(sprintf(trans('messages.SORRY_AUTH_DELETE'), strip_tags($is_auth['auth_delete_type'])));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'reply':
|
case 'reply':
|
||||||
if (bf($userdata['user_opt'], 'user_opt', 'dis_post')) {
|
if (bf($userdata['user_opt'], 'user_opt', 'dis_post')) {
|
||||||
$this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT']));
|
$this->ajax_die(strip_tags(trans('messages.RULES_REPLY_CANNOT')));
|
||||||
} elseif (!$is_auth['auth_reply']) {
|
} elseif (!$is_auth['auth_reply']) {
|
||||||
$this->ajax_die(sprintf($lang['SORRY_AUTH_REPLY'], strip_tags($is_auth['auth_reply_type'])));
|
$this->ajax_die(sprintf(trans('messages.SORRY_AUTH_REPLY'), strip_tags($is_auth['auth_reply_type'])));
|
||||||
}
|
}
|
||||||
|
|
||||||
$quote_username = ($post['post_username'] != '') ? $post['post_username'] : get_username($post['poster_id']);
|
$quote_username = ($post['post_username'] != '') ? $post['post_username'] : get_username($post['poster_id']);
|
||||||
|
@ -105,7 +105,7 @@ switch ($this->request['type']) {
|
||||||
case 'view_message':
|
case 'view_message':
|
||||||
$message = (string)$this->request['message'];
|
$message = (string)$this->request['message'];
|
||||||
if (!trim($message)) {
|
if (!trim($message)) {
|
||||||
$this->ajax_die($lang['EMPTY_MESSAGE']);
|
$this->ajax_die(trans('messages.EMPTY_MESSAGE'));
|
||||||
}
|
}
|
||||||
$message = htmlCHR($message, false, ENT_NOQUOTES);
|
$message = htmlCHR($message, false, ENT_NOQUOTES);
|
||||||
|
|
||||||
|
@ -116,10 +116,10 @@ switch ($this->request['type']) {
|
||||||
case 'edit':
|
case 'edit':
|
||||||
case 'editor':
|
case 'editor':
|
||||||
if (bf($userdata['user_opt'], 'user_opt', 'dis_post_edit')) {
|
if (bf($userdata['user_opt'], 'user_opt', 'dis_post_edit')) {
|
||||||
$this->ajax_die($lang['POST_EDIT_CANNOT']);
|
$this->ajax_die(trans('messages.POST_EDIT_CANNOT'));
|
||||||
}
|
}
|
||||||
if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) {
|
if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) {
|
||||||
$this->ajax_die($lang['EDIT_OWN_POSTS']);
|
$this->ajax_die(trans('messages.EDIT_OWN_POSTS'));
|
||||||
}
|
}
|
||||||
if ((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id)) {
|
if ((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id)) {
|
||||||
$this->response['redirect'] = make_url(POSTING_URL . '?mode=editpost&p=' . $post_id);
|
$this->response['redirect'] = make_url(POSTING_URL . '?mode=editpost&p=' . $post_id);
|
||||||
|
@ -132,7 +132,7 @@ switch ($this->request['type']) {
|
||||||
if (config('tp.max_smilies')) {
|
if (config('tp.max_smilies')) {
|
||||||
$count_smilies = substr_count(bbcode2html($text), '<img class="smile" src="' . config('tp.smilies_path'));
|
$count_smilies = substr_count(bbcode2html($text), '<img class="smile" src="' . config('tp.smilies_path'));
|
||||||
if ($count_smilies > config('tp.max_smilies')) {
|
if ($count_smilies > config('tp.max_smilies')) {
|
||||||
$this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], config('tp.max_smilies')));
|
$this->ajax_die(sprintf(trans('messages.MAX_SMILIES_PER_POST'), config('tp.max_smilies')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OLD_DB()->query("UPDATE " . BB_POSTS_TEXT . " SET post_text = '" . OLD_DB()->escape($text) . "' WHERE post_id = $post_id");
|
OLD_DB()->query("UPDATE " . BB_POSTS_TEXT . " SET post_text = '" . OLD_DB()->escape($text) . "' WHERE post_id = $post_id");
|
||||||
|
@ -148,7 +148,7 @@ switch ($this->request['type']) {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['EMPTY_MESSAGE']);
|
$this->ajax_die(trans('messages.EMPTY_MESSAGE'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update atom feed
|
// Update atom feed
|
||||||
|
@ -158,9 +158,9 @@ switch ($this->request['type']) {
|
||||||
} else {
|
} else {
|
||||||
$is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post);
|
$is_auth = auth_user(AUTH_ALL, $post['forum_id'], $userdata, $post);
|
||||||
if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) {
|
if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) {
|
||||||
$this->ajax_die($lang['TOPIC_LOCKED']);
|
$this->ajax_die(trans('messages.TOPIC_LOCKED'));
|
||||||
} elseif (!$is_auth['auth_edit']) {
|
} elseif (!$is_auth['auth_edit']) {
|
||||||
$this->ajax_die(sprintf($lang['SORRY_AUTH_EDIT'], strip_tags($is_auth['auth_edit_type'])));
|
$this->ajax_die(sprintf(trans('messages.SORRY_AUTH_EDIT'), strip_tags($is_auth['auth_edit_type'])));
|
||||||
}
|
}
|
||||||
|
|
||||||
$hidden_form = '<input type="hidden" name="mode" value="editpost" />';
|
$hidden_form = '<input type="hidden" name="mode" value="editpost" />';
|
||||||
|
@ -171,23 +171,23 @@ switch ($this->request['type']) {
|
||||||
<form action="' . POSTING_URL . '" method="post" name="post">
|
<form action="' . POSTING_URL . '" method="post" name="post">
|
||||||
' . $hidden_form . '
|
' . $hidden_form . '
|
||||||
<div class="buttons mrg_4">
|
<div class="buttons mrg_4">
|
||||||
<input type="button" value="B" name="codeB" title="' . $lang['BOLD'] . '" style="font-weight: bold; width: 25px;" />
|
<input type="button" value="B" name="codeB" title="' . trans('messages.BOLD') . '" style="font-weight: bold; width: 25px;" />
|
||||||
<input type="button" value="i" name="codeI" title="' . $lang['ITALIC'] . '" style="width: 25px; font-style: italic;" />
|
<input type="button" value="i" name="codeI" title="' . trans('messages.ITALIC') . '" style="width: 25px; font-style: italic;" />
|
||||||
<input type="button" value="u" name="codeU" title="' . $lang['UNDERLINE'] . '" style="width: 25px; text-decoration: underline;" />
|
<input type="button" value="u" name="codeU" title="' . trans('messages.UNDERLINE') . '" style="width: 25px; text-decoration: underline;" />
|
||||||
<input type="button" value="s" name="codeS" title="' . $lang['STRIKEOUT'] . '" style="width: 25px; text-decoration: line-through;" />
|
<input type="button" value="s" name="codeS" title="' . trans('messages.STRIKEOUT') . '" style="width: 25px; text-decoration: line-through;" />
|
||||||
<input type="button" value="' . $lang['QUOTE'] . '" name="codeQuote" title="' . $lang['QUOTE_TITLE'] . '" style="width: 57px;" />
|
<input type="button" value="' . trans('messages.QUOTE') . '" name="codeQuote" title="' . trans('messages.QUOTE_TITLE') . '" style="width: 57px;" />
|
||||||
<input type="button" value="Img" name="codeImg" title="' . $lang['IMG_TITLE'] . '" style="width: 40px;" />
|
<input type="button" value="Img" name="codeImg" title="' . trans('messages.IMG_TITLE') . '" style="width: 40px;" />
|
||||||
<input type="button" value="' . $lang['URL'] . '" name="codeUrl" title="' . $lang['URL_TITLE'] . '" style="width: 63px; text-decoration: underline;" />
|
<input type="button" value="' . trans('messages.URL') . '" name="codeUrl" title="' . trans('messages.URL_TITLE') . '" style="width: 63px; text-decoration: underline;" />
|
||||||
<input type="button" value="' . $lang['CODE'] . '" name="codeCode" title="' . $lang['CODE_TITLE'] . '" style="width: 43px;" />
|
<input type="button" value="' . trans('messages.CODE') . '" name="codeCode" title="' . trans('messages.CODE_TITLE') . '" style="width: 43px;" />
|
||||||
<input type="button" value="' . $lang['LIST'] . '" name="codeList" title="' . $lang['LIST_TITLE'] . '" style="width: 60px;" />
|
<input type="button" value="' . trans('messages.LIST') . '" name="codeList" title="' . trans('messages.LIST_TITLE') . '" style="width: 60px;" />
|
||||||
<input type="button" value="1." name="codeOpt" title="' . $lang['LIST_ITEM'] . '" style="width: 30px;" />
|
<input type="button" value="1." name="codeOpt" title="' . trans('messages.LIST_ITEM') . '" style="width: 30px;" />
|
||||||
<input type="button" value="' . $lang['QUOTE_SEL'] . '" name="quoteselected" title="' . $lang['QUOTE_SELECTED'] . '" onclick="bbcode.onclickQuoteSel();" />
|
<input type="button" value="' . trans('messages.QUOTE_SEL') . '" name="quoteselected" title="' . trans('messages.QUOTE_SELECTED') . '" onclick="bbcode.onclickQuoteSel();" />
|
||||||
</div>
|
</div>
|
||||||
<textarea id="message-' . $post_id . '" class="editor mrg_4" name="message" rows="18" cols="92">' . $post['post_text'] . '</textarea>
|
<textarea id="message-' . $post_id . '" class="editor mrg_4" name="message" rows="18" cols="92">' . $post['post_text'] . '</textarea>
|
||||||
<div class="mrg_4 tCenter">
|
<div class="mrg_4 tCenter">
|
||||||
<input title="Alt+Enter" name="preview" type="submit" value="' . $lang['PREVIEW'] . '">
|
<input title="Alt+Enter" name="preview" type="submit" value="' . trans('messages.PREVIEW') . '">
|
||||||
<input type="button" onclick="edit_post(' . $post_id . ');" value="' . $lang['CANCEL'] . '">
|
<input type="button" onclick="edit_post(' . $post_id . ');" value="' . trans('messages.CANCEL') . '">
|
||||||
<input type="button" onclick="edit_post(' . $post_id . ', \'editor\', $(\'#message-' . $post_id . '\').val()); return false;" class="bold" value="' . $lang['SUBMIT'] . '">
|
<input type="button" onclick="edit_post(' . $post_id . ', \'editor\', $(\'#message-' . $post_id . '\').val()); return false;" class="bold" value="' . trans('messages.SUBMIT') . '">
|
||||||
</div><hr>
|
</div><hr>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var bbcode = new BBCode("message-' . $post_id . '");
|
var bbcode = new BBCode("message-' . $post_id . '");
|
||||||
|
@ -217,12 +217,12 @@ switch ($this->request['type']) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bf($userdata['user_opt'], 'user_opt', 'dis_post')) {
|
if (bf($userdata['user_opt'], 'user_opt', 'dis_post')) {
|
||||||
$this->ajax_die(strip_tags($lang['RULES_REPLY_CANNOT']));
|
$this->ajax_die(strip_tags(trans('messages.RULES_REPLY_CANNOT')));
|
||||||
} elseif (!$is_auth['auth_reply']) {
|
} elseif (!$is_auth['auth_reply']) {
|
||||||
$this->ajax_die(sprintf($lang['SORRY_AUTH_REPLY'], strip_tags($is_auth['auth_reply_type'])));
|
$this->ajax_die(sprintf(trans('messages.SORRY_AUTH_REPLY'), strip_tags($is_auth['auth_reply_type'])));
|
||||||
}
|
}
|
||||||
if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) {
|
if ($post['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod']) {
|
||||||
$this->ajax_die($lang['TOPIC_LOCKED']);
|
$this->ajax_die(trans('messages.TOPIC_LOCKED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = (string)$this->request['message'];
|
$message = (string)$this->request['message'];
|
||||||
|
@ -235,7 +235,7 @@ switch ($this->request['type']) {
|
||||||
if ($row = OLD_DB()->fetch_row($sql) and $row['last_post_time']) {
|
if ($row = OLD_DB()->fetch_row($sql) and $row['last_post_time']) {
|
||||||
if ($userdata['user_level'] == USER) {
|
if ($userdata['user_level'] == USER) {
|
||||||
if (TIMENOW - $row['last_post_time'] < config('tp.flood_interval')) {
|
if (TIMENOW - $row['last_post_time'] < config('tp.flood_interval')) {
|
||||||
$this->ajax_die($lang['FLOOD_ERROR']);
|
$this->ajax_die(trans('messages.FLOOD_ERROR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ switch ($this->request['type']) {
|
||||||
$last_msg = OLD_DB()->escape($row['post_text']);
|
$last_msg = OLD_DB()->escape($row['post_text']);
|
||||||
|
|
||||||
if ($last_msg == $message) {
|
if ($last_msg == $message) {
|
||||||
$this->ajax_die($lang['DOUBLE_POST_ERROR']);
|
$this->ajax_die(trans('messages.DOUBLE_POST_ERROR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ switch ($this->request['type']) {
|
||||||
if (config('tp.max_smilies')) {
|
if (config('tp.max_smilies')) {
|
||||||
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="' . config('tp.smilies_path'));
|
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="' . config('tp.smilies_path'));
|
||||||
if ($count_smilies > config('tp.max_smilies')) {
|
if ($count_smilies > config('tp.max_smilies')) {
|
||||||
$this->ajax_die(sprintf($lang['MAX_SMILIES_PER_POST'], config('tp.max_smilies')));
|
$this->ajax_die(sprintf(trans('messages.MAX_SMILIES_PER_POST'), config('tp.max_smilies')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
$map = new TorrentPier\Legacy\Sitemap();
|
$map = new TorrentPier\Legacy\Sitemap();
|
||||||
$html = '';
|
$html = '';
|
||||||
|
@ -21,9 +19,9 @@ switch ($mode) {
|
||||||
case 'create':
|
case 'create':
|
||||||
$map->createSitemap();
|
$map->createSitemap();
|
||||||
if (file_exists(SITEMAP_DIR . '/sitemap.xml')) {
|
if (file_exists(SITEMAP_DIR . '/sitemap.xml')) {
|
||||||
$html .= $lang['SITEMAP_CREATED'] . ': <b>' . bb_date(TIMENOW, config('tp.post_date_format')) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
|
$html .= trans('messages.SITEMAP_CREATED') . ': <b>' . bb_date(TIMENOW, config('tp.post_date_format')) . '</b> ' . trans('messages.SITEMAP_AVAILABLE') . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$html .= $lang['SITEMAP_NOT_CREATED'];
|
$html .= trans('messages.SITEMAP_NOT_CREATED');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -35,21 +33,21 @@ switch ($mode) {
|
||||||
$map_link = make_url('sitemap/sitemap.xml');
|
$map_link = make_url('sitemap/sitemap.xml');
|
||||||
|
|
||||||
if ($map->sendSitemap('http://google.com/webmasters/sitemaps/ping?sitemap=', $map_link)) {
|
if ($map->sendSitemap('http://google.com/webmasters/sitemaps/ping?sitemap=', $map_link)) {
|
||||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Google: <span style="color: green;">' . $lang['SITEMAP_SENT'] . '</span>';
|
$html .= '<br />' . trans('messages.SITEMAP_NOTIFY_SEARCH') . ' Google: <span style="color: green;">' . trans('messages.SITEMAP_SENT') . '</span>';
|
||||||
} else {
|
} else {
|
||||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Google: <span style="color: red;">' . $lang['SITEMAP_ERROR'] . '</span> URL: <a href="http://google.com/webmasters/sitemaps/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://google.com/webmasters/sitemaps/ping?sitemap=' . $map_link . '</a>';
|
$html .= '<br />' . trans('messages.SITEMAP_NOTIFY_SEARCH') . ' Google: <span style="color: red;">' . trans('messages.SITEMAP_ERROR') . '</span> URL: <a href="http://google.com/webmasters/sitemaps/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://google.com/webmasters/sitemaps/ping?sitemap=' . $map_link . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($map->sendSitemap('http://ping.blogs.yandex.ru/ping?sitemap=', $map_link)) {
|
if ($map->sendSitemap('http://ping.blogs.yandex.ru/ping?sitemap=', $map_link)) {
|
||||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Yandex: <span style="color: green;">' . $lang['SITEMAP_SENT'] . '</span>';
|
$html .= '<br />' . trans('messages.SITEMAP_NOTIFY_SEARCH') . ' Yandex: <span style="color: green;">' . trans('messages.SITEMAP_SENT') . '</span>';
|
||||||
} else {
|
} else {
|
||||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Yandex: <span style="color: red;">' . $lang['SITEMAP_ERROR'] . '</span> URL: <a href="http://ping.blogs.yandex.ru/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://ping.blogs.yandex.ru/ping?sitemap=' . $map_link . '</a>';
|
$html .= '<br />' . trans('messages.SITEMAP_NOTIFY_SEARCH') . ' Yandex: <span style="color: red;">' . trans('messages.SITEMAP_ERROR') . '</span> URL: <a href="http://ping.blogs.yandex.ru/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://ping.blogs.yandex.ru/ping?sitemap=' . $map_link . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($map->sendSitemap('http://www.bing.com/ping?sitemap=', $map_link)) {
|
if ($map->sendSitemap('http://www.bing.com/ping?sitemap=', $map_link)) {
|
||||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Bing: <span style="color: green;">' . $lang['SITEMAP_SENT'] . '</span>';
|
$html .= '<br />' . trans('messages.SITEMAP_NOTIFY_SEARCH') . ' Bing: <span style="color: green;">' . trans('messages.SITEMAP_SENT') . '</span>';
|
||||||
} else {
|
} else {
|
||||||
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . ' Bing: <span style="color: red;">' . $lang['SITEMAP_ERROR'] . '</span> URL: <a href="http://www.bing.com/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://www.bing.com/ping?sitemap=' . $map_link . '</a>';
|
$html .= '<br />' . trans('messages.SITEMAP_NOTIFY_SEARCH') . ' Bing: <span style="color: red;">' . trans('messages.SITEMAP_ERROR') . '</span> URL: <a href="http://www.bing.com/ping?sitemap=' . urlencode($map_link) . '" target="_blank">http://www.bing.com/ping?sitemap=' . $map_link . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
$mode = (string)$this->request['mode'];
|
$mode = (string)$this->request['mode'];
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ switch ($mode) {
|
||||||
$username = clean_username($this->request['username']);
|
$username = clean_username($this->request['username']);
|
||||||
|
|
||||||
if (empty($username)) {
|
if (empty($username)) {
|
||||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $lang['CHOOSE_A_NAME'] . '</span>';
|
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . trans('messages.CHOOSE_A_NAME') . '</span>';
|
||||||
} elseif ($err = validate_username($username)) {
|
} elseif ($err = validate_username($username)) {
|
||||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $err . '</span>';
|
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $err . '</span>';
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ switch ($mode) {
|
||||||
$email = (string)$this->request['email'];
|
$email = (string)$this->request['email'];
|
||||||
|
|
||||||
if (empty($email)) {
|
if (empty($email)) {
|
||||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $lang['CHOOSE_E_MAIL'] . '</span>';
|
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . trans('messages.CHOOSE_E_MAIL') . '</span>';
|
||||||
} elseif ($err = validate_email($email)) {
|
} elseif ($err = validate_email($email)) {
|
||||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $err . '</span>';
|
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $err . '</span>';
|
||||||
}
|
}
|
||||||
|
@ -41,17 +41,17 @@ switch ($mode) {
|
||||||
$pass = (string)$this->request['pass'];
|
$pass = (string)$this->request['pass'];
|
||||||
$pass_confirm = (string)$this->request['pass_confirm'];
|
$pass_confirm = (string)$this->request['pass_confirm'];
|
||||||
if (empty($pass) || empty($pass_confirm)) {
|
if (empty($pass) || empty($pass_confirm)) {
|
||||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $lang['CHOOSE_PASS'] . '</span>';
|
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . trans('messages.CHOOSE_PASS') . '</span>';
|
||||||
} else {
|
} else {
|
||||||
if ($pass != $pass_confirm) {
|
if ($pass != $pass_confirm) {
|
||||||
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . $lang['CHOOSE_PASS_ERR'] . '</span>';
|
$html = '<img src="./styles/images/bad.gif"> <span class="leechmed bold">' . trans('messages.CHOOSE_PASS_ERR') . '</span>';
|
||||||
} else {
|
} else {
|
||||||
if (mb_strlen($pass, 'UTF-8') > 20) {
|
if (mb_strlen($pass, 'UTF-8') > 20) {
|
||||||
$html = '<img src="./styles/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(trans('messages.CHOOSE_PASS_ERR_MAX'), 20) . '</span>';
|
||||||
} elseif (mb_strlen($pass, 'UTF-8') < 5) {
|
} elseif (mb_strlen($pass, 'UTF-8') < 5) {
|
||||||
$html = '<img src="./styles/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(trans('messages.CHOOSE_PASS_ERR_MIN'), 5) . '</span>';
|
||||||
} else {
|
} else {
|
||||||
$text = (IS_GUEST) ? $lang['CHOOSE_PASS_REG_OK'] : $lang['CHOOSE_PASS_OK'];
|
$text = (IS_GUEST) ? trans('messages.CHOOSE_PASS_REG_OK') : trans('messages.CHOOSE_PASS_OK');
|
||||||
$html = '<img src="./styles/images/good.gif"> <span class="seedmed bold">' . $text . '</span>';
|
$html = '<img src="./styles/images/good.gif"> <span class="seedmed bold">' . $text . '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $user, $lang;
|
global $user;
|
||||||
|
|
||||||
$post_id = (int)@$this->request['post_id'];
|
$post_id = (int)@$this->request['post_id'];
|
||||||
$topic_id = (int)@$this->request['topic_id'];
|
$topic_id = (int)@$this->request['topic_id'];
|
||||||
|
@ -35,18 +35,18 @@ $sql = "
|
||||||
";
|
";
|
||||||
|
|
||||||
if (!$post_data = OLD_DB()->fetch_row($sql)) {
|
if (!$post_data = OLD_DB()->fetch_row($sql)) {
|
||||||
$this->ajax_die($lang['TOPIC_POST_NOT_EXIST']);
|
$this->ajax_die(trans('messages.TOPIC_POST_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auth check
|
// Auth check
|
||||||
if ($post_data['auth_read'] == AUTH_REG) {
|
if ($post_data['auth_read'] == AUTH_REG) {
|
||||||
if (IS_GUEST) {
|
if (IS_GUEST) {
|
||||||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
$this->ajax_die(trans('messages.NEED_TO_LOGIN_FIRST'));
|
||||||
}
|
}
|
||||||
} elseif ($post_data['auth_read'] != AUTH_ALL) {
|
} elseif ($post_data['auth_read'] != AUTH_ALL) {
|
||||||
$is_auth = auth_user(AUTH_READ, $post_data['forum_id'], $user->data, $post_data);
|
$is_auth = auth_user(AUTH_READ, $post_data['forum_id'], $user->data, $post_data);
|
||||||
if (!$is_auth['auth_read']) {
|
if (!$is_auth['auth_read']) {
|
||||||
$this->ajax_die($lang['TOPIC_POST_NOT_EXIST']);
|
$this->ajax_die(trans('messages.TOPIC_POST_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,29 +11,27 @@ if (!defined('IN_AJAX')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
if (!isset($this->request['attach_id'])) {
|
if (!isset($this->request['attach_id'])) {
|
||||||
$this->ajax_die($lang['EMPTY_ATTACH_ID']);
|
$this->ajax_die(trans('messages.EMPTY_ATTACH_ID'));
|
||||||
}
|
}
|
||||||
$attach_id = (int)$this->request['attach_id'];
|
$attach_id = (int)$this->request['attach_id'];
|
||||||
|
|
||||||
$torrent = OLD_DB()->fetch_row("SELECT attach_id, physical_filename FROM " . BB_ATTACHMENTS_DESC . " WHERE attach_id = $attach_id LIMIT 1");
|
$torrent = OLD_DB()->fetch_row("SELECT attach_id, physical_filename FROM " . BB_ATTACHMENTS_DESC . " WHERE attach_id = $attach_id LIMIT 1");
|
||||||
if (!$torrent) {
|
if (!$torrent) {
|
||||||
$this->ajax_die($lang['ERROR_BUILD']);
|
$this->ajax_die(trans('messages.ERROR_BUILD'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$filename = get_attachments_dir() . '/' . $torrent['physical_filename'];
|
$filename = get_attachments_dir() . '/' . $torrent['physical_filename'];
|
||||||
if (file_exists($filename) && !$file_contents = file_get_contents($filename)) {
|
if (file_exists($filename) && !$file_contents = file_get_contents($filename)) {
|
||||||
if (IS_AM) {
|
if (IS_AM) {
|
||||||
$this->ajax_die($lang['ERROR_NO_ATTACHMENT'] . "\n\n" . htmlCHR($filename));
|
$this->ajax_die(trans('messages.ERROR_NO_ATTACHMENT') . "\n\n" . htmlCHR($filename));
|
||||||
} else {
|
} else {
|
||||||
$this->ajax_die($lang['ERROR_NO_ATTACHMENT']);
|
$this->ajax_die(trans('messages.ERROR_NO_ATTACHMENT'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$tor = \Rych\Bencode\Bencode::decode($file_contents)) {
|
if (!$tor = \Rych\Bencode\Bencode::decode($file_contents)) {
|
||||||
return $lang['TORFILE_INVALID'];
|
return trans('messages.TORFILE_INVALID');
|
||||||
}
|
}
|
||||||
|
|
||||||
$torrent = new TorrentPier\Legacy\TorrentFileList($tor);
|
$torrent = new TorrentPier\Legacy\TorrentFileList($tor);
|
||||||
|
|
|
@ -21,26 +21,6 @@ if (defined('ATTACH_INSTALL')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* wrapper function for determining the correct language directory
|
|
||||||
*/
|
|
||||||
function attach_mod_get_lang($language_file)
|
|
||||||
{
|
|
||||||
global $attach_config;
|
|
||||||
|
|
||||||
$file = LANG_ROOT_DIR . '/' . config('tp.default_lang') . '/' . $language_file . '.php';
|
|
||||||
if (file_exists($file)) {
|
|
||||||
return config('tp.default_lang');
|
|
||||||
}
|
|
||||||
|
|
||||||
$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');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get attachment mod configuration
|
* Get attachment mod configuration
|
||||||
*/
|
*/
|
||||||
|
@ -58,9 +38,6 @@ function get_config()
|
||||||
$attach_config[$row['config_name']] = trim($row['config_value']);
|
$attach_config[$row['config_name']] = trim($row['config_value']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We assign the original default board language here, because it gets overwritten later with the users default language
|
|
||||||
$attach_config['board_lang'] = trim(config('tp.default_lang'));
|
|
||||||
|
|
||||||
return $attach_config;
|
return $attach_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ function display_post_attachments($post_id, $switch_attachment)
|
||||||
*/
|
*/
|
||||||
function init_display_post_attachments($switch_attachment)
|
function init_display_post_attachments($switch_attachment)
|
||||||
{
|
{
|
||||||
global $attach_config, $is_auth, $template, $lang, $postrow, $total_posts, $attachments, $forum_row, $t_data;
|
global $attach_config, $is_auth, $template, $postrow, $total_posts, $attachments, $forum_row, $t_data;
|
||||||
|
|
||||||
if (empty($t_data) && !empty($forum_row)) {
|
if (empty($t_data) && !empty($forum_row)) {
|
||||||
$switch_attachment = $forum_row['topic_attachment'];
|
$switch_attachment = $forum_row['topic_attachment'];
|
||||||
|
@ -165,7 +165,7 @@ function init_display_post_attachments($switch_attachment)
|
||||||
*/
|
*/
|
||||||
function display_attachments($post_id)
|
function display_attachments($post_id)
|
||||||
{
|
{
|
||||||
global $template, $upload_dir, $userdata, $allowed_extensions, $display_categories, $download_modes, $lang, $attachments, $upload_icons, $attach_config;
|
global $template, $upload_dir, $userdata, $allowed_extensions, $display_categories, $download_modes, $attachments, $upload_icons, $attach_config;
|
||||||
|
|
||||||
$num_attachments = @count($attachments['_' . $post_id]);
|
$num_attachments = @count($attachments['_' . $post_id]);
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ function display_attachments($post_id)
|
||||||
$denied = true;
|
$denied = true;
|
||||||
|
|
||||||
$template->assign_block_vars('postrow.attach.denyrow', array(
|
$template->assign_block_vars('postrow.attach.denyrow', array(
|
||||||
'L_DENIED' => sprintf($lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachments['_' . $post_id][$i]['extension']))
|
'L_DENIED' => sprintf(trans('messages.EXTENSION_DISABLED_AFTER_POSTING'), $attachments['_' . $post_id][$i]['extension']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ function display_attachments($post_id)
|
||||||
'FILESIZE' => $filesize,
|
'FILESIZE' => $filesize,
|
||||||
'COMMENT' => $comment,
|
'COMMENT' => $comment,
|
||||||
'TARGET_BLANK' => $target_blank,
|
'TARGET_BLANK' => $target_blank,
|
||||||
'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $attachments['_' . $post_id][$i]['download_count']),
|
'DOWNLOAD_COUNT' => sprintf(trans('messages.DOWNLOAD_NUMBER'), $attachments['_' . $post_id][$i]['download_count']),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $t_data, $poster_id, $is_auth, $dl_link_css, $dl_status_css, $lang, $images;
|
global $t_data, $poster_id, $is_auth, $dl_link_css, $dl_status_css, $images;
|
||||||
|
|
||||||
$change_peers_bgr_over = true;
|
$change_peers_bgr_over = true;
|
||||||
$bgr_class_1 = 'row1';
|
$bgr_class_1 = 'row1';
|
||||||
|
@ -24,7 +24,7 @@ $peers_overflow_div_height = '400px';
|
||||||
$peers_div_style_normal = 'padding: 3px;';
|
$peers_div_style_normal = 'padding: 3px;';
|
||||||
$peers_div_style_overflow = "padding: 6px; height: $peers_overflow_div_height; overflow: auto; border: 1px inset;";
|
$peers_div_style_overflow = "padding: 6px; height: $peers_overflow_div_height; overflow: auto; border: 1px inset;";
|
||||||
$s_last_seed_date_format = 'Y-m-d';
|
$s_last_seed_date_format = 'Y-m-d';
|
||||||
$upload_image = '<img src="' . $images['icon_dn'] . '" alt="' . $lang['DL_TORRENT'] . '" border="0" />';
|
$upload_image = '<img src="' . $images['icon_dn'] . '" alt="' . trans('messages.DL_TORRENT') . '" border="0" />';
|
||||||
|
|
||||||
$peers_cnt = $seed_count = 0;
|
$peers_cnt = $seed_count = 0;
|
||||||
$seeders = $leechers = '';
|
$seeders = $leechers = '';
|
||||||
|
@ -75,14 +75,14 @@ $tor_auth = ($bt_user_id != GUEST_UID && (($bt_user_id == $poster_id && !$locked
|
||||||
$tor_auth_reg = ($tor_auth && $t_data['allow_reg_tracker'] && $post_id == $t_data['topic_first_post_id']);
|
$tor_auth_reg = ($tor_auth && $t_data['allow_reg_tracker'] && $post_id == $t_data['topic_first_post_id']);
|
||||||
$tor_auth_del = ($tor_auth && $tor_reged);
|
$tor_auth_del = ($tor_auth && $tor_reged);
|
||||||
|
|
||||||
$tracker_link = ($tor_reged) ? $lang['BT_REG_YES'] : $lang['BT_REG_NO'];
|
$tracker_link = ($tor_reged) ? trans('messages.BT_REG_YES') : trans('messages.BT_REG_NO');
|
||||||
|
|
||||||
$download_link = DOWNLOAD_URL . $attach_id;
|
$download_link = DOWNLOAD_URL . $attach_id;
|
||||||
$description = ($comment) ?: preg_replace("#.torrent$#i", '', $display_name);
|
$description = ($comment) ?: preg_replace("#.torrent$#i", '', $display_name);
|
||||||
|
|
||||||
if ($tor_auth_reg || $tor_auth_del) {
|
if ($tor_auth_reg || $tor_auth_del) {
|
||||||
$reg_tor_url = '<a class="txtb" href="#" onclick="ajax.exec({ action: \'change_torrent\', attach_id : ' . $attach_id . ', type: \'reg\'}); return false;">' . $lang['BT_REG_ON_TRACKER'] . '</a>';
|
$reg_tor_url = '<a class="txtb" href="#" onclick="ajax.exec({ action: \'change_torrent\', attach_id : ' . $attach_id . ', type: \'reg\'}); return false;">' . trans('messages.BT_REG_ON_TRACKER') . '</a>';
|
||||||
$unreg_tor_url = '<a class="txtb" href="#" onclick="ajax.exec({ action: \'change_torrent\', attach_id : ' . $attach_id . ', type: \'unreg\'}); return false;">' . $lang['BT_UNREG_FROM_TRACKER'] . '</a>';
|
$unreg_tor_url = '<a class="txtb" href="#" onclick="ajax.exec({ action: \'change_torrent\', attach_id : ' . $attach_id . ', type: \'unreg\'}); return false;">' . trans('messages.BT_UNREG_FROM_TRACKER') . '</a>';
|
||||||
|
|
||||||
$tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url;
|
$tracker_link = ($tor_reged) ? $unreg_tor_url : $reg_tor_url;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ if (!$tor_reged) {
|
||||||
'U_DOWNLOAD_LINK' => $download_link,
|
'U_DOWNLOAD_LINK' => $download_link,
|
||||||
'FILESIZE' => $tor_file_size,
|
'FILESIZE' => $tor_file_size,
|
||||||
|
|
||||||
'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $download_count),
|
'DOWNLOAD_COUNT' => sprintf(trans('messages.DOWNLOAD_NUMBER'), $download_count),
|
||||||
'POSTED_TIME' => $tor_file_time,
|
'POSTED_TIME' => $tor_file_time,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ if ($tor_reged && $tor_info) {
|
||||||
if ((isset($user_ratio) && isset($min_ratio_warn) && $user_ratio < $min_ratio_warn && TR_RATING_LIMITS) || ($bt_userdata['u_down_total'] < MIN_DL_FOR_RATIO)) {
|
if ((isset($user_ratio) && isset($min_ratio_warn) && $user_ratio < $min_ratio_warn && TR_RATING_LIMITS) || ($bt_userdata['u_down_total'] < MIN_DL_FOR_RATIO)) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SHOW_RATIO_WARN' => true,
|
'SHOW_RATIO_WARN' => true,
|
||||||
'RATIO_WARN_MSG' => sprintf($lang['BT_RATIO_WARNING_MSG'], $min_ratio_dl, config('tp.ratio_url_help')),
|
'RATIO_WARN_MSG' => sprintf(trans('messages.BT_RATIO_WARNING_MSG'), $min_ratio_dl, config('tp.ratio_url_help')),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ if ($tor_reged && $tor_info) {
|
||||||
$template->assign_block_vars('postrow.attach.tor_reged', array());
|
$template->assign_block_vars('postrow.attach.tor_reged', array());
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'TOR_BLOCKED' => true,
|
'TOR_BLOCKED' => true,
|
||||||
'TOR_BLOCKED_MSG' => sprintf($lang['BT_LOW_RATIO_FOR_DL'], round($user_ratio, 2), "search.php?dlu=$bt_user_id&dlc=1"),
|
'TOR_BLOCKED_MSG' => sprintf(trans('messages.BT_LOW_RATIO_FOR_DL'), round($user_ratio, 2), "search.php?dlu=$bt_user_id&dlc=1"),
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$template->assign_block_vars('postrow.attach.tor_reged', array(
|
$template->assign_block_vars('postrow.attach.tor_reged', array(
|
||||||
|
@ -197,10 +197,10 @@ if ($tor_reged && $tor_info) {
|
||||||
|
|
||||||
// torrent status mod
|
// torrent status mod
|
||||||
'TOR_FROZEN' => (!IS_AM) ? (null !== config('tp.tor_frozen.' . $tor_info['tor_status'])) && !(null !== config('tp.tor_frozen_author_download.' . $tor_info['tor_status']) && $userdata['user_id'] == $tor_info['poster_id']) ? true : '' : '',
|
'TOR_FROZEN' => (!IS_AM) ? (null !== config('tp.tor_frozen.' . $tor_info['tor_status'])) && !(null !== config('tp.tor_frozen_author_download.' . $tor_info['tor_status']) && $userdata['user_id'] == $tor_info['poster_id']) ? true : '' : '',
|
||||||
'TOR_STATUS_TEXT' => $lang['TOR_STATUS_NAME'][$tor_info['tor_status']],
|
'TOR_STATUS_TEXT' => trans('messages.TOR_STATUS_NAME.' . $tor_info['tor_status']),
|
||||||
'TOR_STATUS_ICON' => config('tp.tor_icons.' . $tor_info['tor_status']),
|
'TOR_STATUS_ICON' => config('tp.tor_icons.' . $tor_info['tor_status']),
|
||||||
'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && $is_auth['auth_mod']) ? ('<span title="' . bb_date($tor_info['checked_time']) . '"> · ' . profile_url($tor_info) . ' · <i>' . delta_time($tor_info['checked_time']) . $lang['TOR_BACK'] . '</i></span>') : '',
|
'TOR_STATUS_BY' => ($tor_info['checked_user_id'] && $is_auth['auth_mod']) ? ('<span title="' . bb_date($tor_info['checked_time']) . '"> · ' . profile_url($tor_info) . ' · <i>' . delta_time($tor_info['checked_time']) . trans('messages.TOR_BACK') . '</i></span>') : '',
|
||||||
'TOR_STATUS_SELECT' => build_select('sel_status', array_flip($lang['TOR_STATUS_NAME']), TOR_APPROVED),
|
'TOR_STATUS_SELECT' => build_select('sel_status', array_flip(trans('messages.TOR_STATUS_NAME')), TOR_APPROVED),
|
||||||
'TOR_STATUS_REPLY' => config('tp.tor_comment') && !IS_GUEST && in_array($tor_info['tor_status'], config('tp.tor_reply')) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED,
|
'TOR_STATUS_REPLY' => config('tp.tor_comment') && !IS_GUEST && in_array($tor_info['tor_status'], config('tp.tor_reply')) && $userdata['user_id'] == $tor_info['poster_id'] && $t_data['topic_status'] != TOPIC_LOCKED,
|
||||||
//end torrent status mod
|
//end torrent status mod
|
||||||
|
|
||||||
|
@ -211,11 +211,11 @@ if ($tor_reged && $tor_info) {
|
||||||
'FILESIZE' => $tor_file_size,
|
'FILESIZE' => $tor_file_size,
|
||||||
'MAGNET' => $tor_magnet,
|
'MAGNET' => $tor_magnet,
|
||||||
'HASH' => strtoupper(bin2hex($tor_info['info_hash'])),
|
'HASH' => strtoupper(bin2hex($tor_info['info_hash'])),
|
||||||
'DOWNLOAD_COUNT' => sprintf($lang['DOWNLOAD_NUMBER'], $download_count),
|
'DOWNLOAD_COUNT' => sprintf(trans('messages.DOWNLOAD_NUMBER'), $download_count),
|
||||||
'REGED_TIME' => bb_date($tor_info['reg_time']),
|
'REGED_TIME' => bb_date($tor_info['reg_time']),
|
||||||
'REGED_DELTA' => delta_time($tor_info['reg_time']),
|
'REGED_DELTA' => delta_time($tor_info['reg_time']),
|
||||||
'TORRENT_SIZE' => humn_size($tor_size),
|
'TORRENT_SIZE' => humn_size($tor_size),
|
||||||
'COMPLETED' => sprintf($lang['DOWNLOAD_NUMBER'], $tor_info['complete_count']),
|
'COMPLETED' => sprintf(trans('messages.DOWNLOAD_NUMBER'), $tor_info['complete_count']),
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($comment) {
|
if ($comment) {
|
||||||
|
@ -447,8 +447,8 @@ if ($tor_reged && $tor_info) {
|
||||||
'DOWN_TOTAL_RAW' => $peer['downloaded'],
|
'DOWN_TOTAL_RAW' => $peer['downloaded'],
|
||||||
'SPEED_UP_RAW' => $peer['speed_up'],
|
'SPEED_UP_RAW' => $peer['speed_up'],
|
||||||
'SPEED_DOWN_RAW' => $peer['speed_down'],
|
'SPEED_DOWN_RAW' => $peer['speed_down'],
|
||||||
'UPD_EXP_TIME' => ($peer['update_time']) ? $lang['DL_UPD'] . bb_date($peer['update_time'], 'd-M-y H:i') . ' · ' . delta_time($peer['update_time']) . $lang['TOR_BACK'] : $lang['DL_STOPPED'],
|
'UPD_EXP_TIME' => ($peer['update_time']) ? trans('messages.DL_UPD') . bb_date($peer['update_time'], 'd-M-y H:i') . ' · ' . delta_time($peer['update_time']) . trans('messages.TOR_BACK') : trans('messages.DL_STOPPED'),
|
||||||
'TOR_RATIO' => ($up_ratio) ? $lang['USER_RATIO'] . "UL/DL: $up_ratio" : '',
|
'TOR_RATIO' => ($up_ratio) ? trans('messages.USER_RATIO') . "UL/DL: $up_ratio" : '',
|
||||||
));
|
));
|
||||||
|
|
||||||
if ($ip) {
|
if ($ip) {
|
||||||
|
@ -493,10 +493,10 @@ if ($tor_reged && $tor_info) {
|
||||||
|
|
||||||
// Show "seeder last seen info"
|
// Show "seeder last seen info"
|
||||||
if (($s_mode == 'count' && !$seed_count) || (!$seeders && !defined('SEEDER_EXIST'))) {
|
if (($s_mode == 'count' && !$seed_count) || (!$seeders && !defined('SEEDER_EXIST'))) {
|
||||||
$last_seen_time = ($tor_info['seeder_last_seen']) ? delta_time($tor_info['seeder_last_seen']) : $lang['NEVER'];
|
$last_seen_time = ($tor_info['seeder_last_seen']) ? delta_time($tor_info['seeder_last_seen']) : trans('messages.NEVER');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'SEEDER_LAST_SEEN' => sprintf($lang['SEEDER_LAST_SEEN'], $last_seen_time),
|
'SEEDER_LAST_SEEN' => sprintf(trans('messages.SEEDER_LAST_SEEN'), $last_seen_time),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ function sort_multi_array($sort_array, $key, $sort_order, $pre_string_sort = 0)
|
||||||
*/
|
*/
|
||||||
function get_formatted_dirsize()
|
function get_formatted_dirsize()
|
||||||
{
|
{
|
||||||
global $lang, $upload_dir;
|
global $upload_dir;
|
||||||
|
|
||||||
$upload_dir_size = 0;
|
$upload_dir_size = 0;
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ function get_formatted_dirsize()
|
||||||
}
|
}
|
||||||
closedir($dirname);
|
closedir($dirname);
|
||||||
} else {
|
} else {
|
||||||
return $lang['NOT_AVAILABLE'];
|
return trans('messages.NOT_AVAILABLE');
|
||||||
}
|
}
|
||||||
|
|
||||||
return humn_size($upload_dir_size);
|
return humn_size($upload_dir_size);
|
||||||
|
@ -166,8 +166,6 @@ function get_formatted_dirsize()
|
||||||
*/
|
*/
|
||||||
function search_attachments($order_by, &$total_rows)
|
function search_attachments($order_by, &$total_rows)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$where_sql = [];
|
$where_sql = [];
|
||||||
|
|
||||||
// Author name search
|
// Author name search
|
||||||
|
@ -194,7 +192,7 @@ function search_attachments($order_by, &$total_rows)
|
||||||
|
|
||||||
OLD_DB()->sql_freeresult($result);
|
OLD_DB()->sql_freeresult($result);
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_ATTACH_SEARCH_MATCH']);
|
bb_die(trans('messages.NO_ATTACH_SEARCH_MATCH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$where_sql[] = ' (t.user_id_1 IN (' . $matching_userids . ')) ';
|
$where_sql[] = ' (t.user_id_1 IN (' . $matching_userids . ')) ';
|
||||||
|
@ -265,7 +263,7 @@ function search_attachments($order_by, &$total_rows)
|
||||||
OLD_DB()->sql_freeresult($result);
|
OLD_DB()->sql_freeresult($result);
|
||||||
|
|
||||||
if ($num_attach == 0) {
|
if ($num_attach == 0) {
|
||||||
bb_die($lang['NO_ATTACH_SEARCH_MATCH']);
|
bb_die(trans('messages.NO_ATTACH_SEARCH_MATCH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!($result = OLD_DB()->sql_query($total_rows_sql))) {
|
if (!($result = OLD_DB()->sql_query($total_rows_sql))) {
|
||||||
|
|
|
@ -135,7 +135,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
||||||
AND $sql_id IN (" . implode(', ', $post_id_array) . ')';
|
AND $sql_id IN (" . implode(', ', $post_id_array) . ')';
|
||||||
|
|
||||||
if (!(OLD_DB()->sql_query($sql))) {
|
if (!(OLD_DB()->sql_query($sql))) {
|
||||||
bb_die($lang['ERROR_DELETED_ATTACHMENTS']);
|
bb_die(trans('messages.ERROR_DELETED_ATTACHMENTS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
//bt
|
//bt
|
||||||
|
@ -143,7 +143,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
||||||
$sql = "SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE attach_id IN(" . implode(',', $attach_id_array) . ")";
|
$sql = "SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE attach_id IN(" . implode(',', $attach_id_array) . ")";
|
||||||
|
|
||||||
if (!$result = OLD_DB()->sql_query($sql)) {
|
if (!$result = OLD_DB()->sql_query($sql)) {
|
||||||
bb_die($lang['ERROR_DELETED_ATTACHMENTS']);
|
bb_die(trans('messages.ERROR_DELETED_ATTACHMENTS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$torrents_sql = array();
|
$torrents_sql = array();
|
||||||
|
@ -166,7 +166,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
||||||
WHERE attach_id IN(" . implode(',', $attach_id_array) . ")";
|
WHERE attach_id IN(" . implode(',', $attach_id_array) . ")";
|
||||||
|
|
||||||
if (!OLD_DB()->sql_query($sql)) {
|
if (!OLD_DB()->sql_query($sql)) {
|
||||||
bb_die($lang['ERROR_DELETED_ATTACHMENTS']);
|
bb_die(trans('messages.ERROR_DELETED_ATTACHMENTS'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//bt end
|
//bt end
|
||||||
|
@ -209,7 +209,7 @@ function delete_attachment($post_id_array = 0, $attach_id_array = 0, $page = 0,
|
||||||
$sql = 'DELETE FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int)$attachments[$j]['attach_id'];
|
$sql = 'DELETE FROM ' . BB_ATTACHMENTS_DESC . ' WHERE attach_id = ' . (int)$attachments[$j]['attach_id'];
|
||||||
|
|
||||||
if (!(OLD_DB()->sql_query($sql))) {
|
if (!(OLD_DB()->sql_query($sql))) {
|
||||||
bb_die($lang['ERROR_DELETED_ATTACHMENTS']);
|
bb_die(trans('messages.ERROR_DELETED_ATTACHMENTS'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
*/
|
*/
|
||||||
function attach_build_auth_levels($is_auth, &$s_auth_can)
|
function attach_build_auth_levels($is_auth, &$s_auth_can)
|
||||||
{
|
{
|
||||||
global $lang, $attach_config;
|
global $attach_config;
|
||||||
|
|
||||||
if ((int)$attach_config['disable_mod']) {
|
if ((int)$attach_config['disable_mod']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line
|
// If you want to have the rules window link within the forum view too, comment out the two lines, and comment the third line
|
||||||
$s_auth_can .= (($is_auth['auth_attachments']) ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT']) . '<br />';
|
$s_auth_can .= (($is_auth['auth_attachments']) ? trans('messages.RULES_ATTACH_CAN') : trans('messages.RULES_ATTACH_CANNOT')) . '<br />';
|
||||||
$s_auth_can .= (($is_auth['auth_download']) ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT']) . '<br />';
|
$s_auth_can .= (($is_auth['auth_download']) ? trans('messages.RULES_DOWNLOAD_CAN') : trans('messages.RULES_DOWNLOAD_CANNOT')) . '<br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,7 @@ function attach_build_auth_levels($is_auth, &$s_auth_can)
|
||||||
*/
|
*/
|
||||||
function attachment_quota_settings($admin_mode, $submit = false, $mode)
|
function attachment_quota_settings($admin_mode, $submit = false, $mode)
|
||||||
{
|
{
|
||||||
global $template, $lang, $attach_config;
|
global $template, $attach_config;
|
||||||
|
|
||||||
if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) {
|
if ($attach_config['upload_dir'][0] == '/' || ($attach_config['upload_dir'][0] != '/' && $attach_config['upload_dir'][1] == ':')) {
|
||||||
$upload_dir = $attach_config['upload_dir'];
|
$upload_dir = $attach_config['upload_dir'];
|
||||||
|
@ -52,7 +52,7 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode)
|
||||||
$u_name = get_var('username', '');
|
$u_name = get_var('username', '');
|
||||||
|
|
||||||
if (!$user_id && !$u_name) {
|
if (!$user_id && !$u_name) {
|
||||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
bb_die(trans('messages.NO_USER_ID_SPECIFIED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user_id) {
|
if ($user_id) {
|
||||||
|
@ -67,7 +67,7 @@ function attachment_quota_settings($admin_mode, $submit = false, $mode)
|
||||||
$user_id = get_var('id', 0);
|
$user_id = get_var('id', 0);
|
||||||
|
|
||||||
if (!$user_id) {
|
if (!$user_id) {
|
||||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
bb_die(trans('messages.NO_USER_ID_SPECIFIED'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
*/
|
*/
|
||||||
function group_select($select_name, $default_group = 0)
|
function group_select($select_name, $default_group = 0)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$sql = 'SELECT group_id, group_name FROM ' . BB_EXTENSION_GROUPS . ' ORDER BY group_name';
|
$sql = 'SELECT group_id, group_name FROM ' . BB_EXTENSION_GROUPS . ' ORDER BY group_name';
|
||||||
|
|
||||||
if (!($result = OLD_DB()->sql_query($sql))) {
|
if (!($result = OLD_DB()->sql_query($sql))) {
|
||||||
|
@ -32,7 +30,7 @@ function group_select($select_name, $default_group = 0)
|
||||||
|
|
||||||
if ($num_rows > 0) {
|
if ($num_rows > 0) {
|
||||||
$group_name[$num_rows]['group_id'] = 0;
|
$group_name[$num_rows]['group_id'] = 0;
|
||||||
$group_name[$num_rows]['group_name'] = $lang['NOT_ASSIGNED'];
|
$group_name[$num_rows]['group_name'] = trans('messages.NOT_ASSIGNED');
|
||||||
|
|
||||||
for ($i = 0, $iMax = count($group_name); $i < $iMax; $i++) {
|
for ($i = 0, $iMax = count($group_name); $i < $iMax; $i++) {
|
||||||
if (!$default_group) {
|
if (!$default_group) {
|
||||||
|
@ -149,9 +147,7 @@ function category_select($select_name, $group_id = 0)
|
||||||
*/
|
*/
|
||||||
function size_select($select_name, $size_compare)
|
function size_select($select_name, $size_compare)
|
||||||
{
|
{
|
||||||
global $lang;
|
$size_types_text = array(trans('messages.BYTES'), trans('messages.KB'), trans('messages.MB'));
|
||||||
|
|
||||||
$size_types_text = array($lang['BYTES'], $lang['KB'], $lang['MB']);
|
|
||||||
$size_types = array('b', 'kb', 'mb');
|
$size_types = array('b', 'kb', 'mb');
|
||||||
|
|
||||||
$select_field = '<select name="' . $select_name . '">';
|
$select_field = '<select name="' . $select_name . '">';
|
||||||
|
@ -171,8 +167,6 @@ function size_select($select_name, $size_compare)
|
||||||
*/
|
*/
|
||||||
function quota_limit_select($select_name, $default_quota = 0)
|
function quota_limit_select($select_name, $default_quota = 0)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$sql = 'SELECT quota_limit_id, quota_desc FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit ASC';
|
$sql = 'SELECT quota_limit_id, quota_desc FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit ASC';
|
||||||
|
|
||||||
if (!($result = OLD_DB()->sql_query($sql))) {
|
if (!($result = OLD_DB()->sql_query($sql))) {
|
||||||
|
@ -181,7 +175,7 @@ function quota_limit_select($select_name, $default_quota = 0)
|
||||||
|
|
||||||
$quota_select = '<select name="' . $select_name . '">';
|
$quota_select = '<select name="' . $select_name . '">';
|
||||||
$quota_name[0]['quota_limit_id'] = 0;
|
$quota_name[0]['quota_limit_id'] = 0;
|
||||||
$quota_name[0]['quota_desc'] = $lang['NOT_ASSIGNED'];
|
$quota_name[0]['quota_desc'] = trans('messages.NOT_ASSIGNED');
|
||||||
|
|
||||||
while ($row = OLD_DB()->sql_fetchrow($result)) {
|
while ($row = OLD_DB()->sql_fetchrow($result)) {
|
||||||
$quota_name[] = $row;
|
$quota_name[] = $row;
|
||||||
|
@ -202,8 +196,6 @@ function quota_limit_select($select_name, $default_quota = 0)
|
||||||
*/
|
*/
|
||||||
function default_quota_limit_select($select_name, $default_quota = 0)
|
function default_quota_limit_select($select_name, $default_quota = 0)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$sql = 'SELECT quota_limit_id, quota_desc FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit ASC';
|
$sql = 'SELECT quota_limit_id, quota_desc FROM ' . BB_QUOTA_LIMITS . ' ORDER BY quota_limit ASC';
|
||||||
|
|
||||||
if (!($result = OLD_DB()->sql_query($sql))) {
|
if (!($result = OLD_DB()->sql_query($sql))) {
|
||||||
|
@ -212,7 +204,7 @@ function default_quota_limit_select($select_name, $default_quota = 0)
|
||||||
|
|
||||||
$quota_select = '<select name="' . $select_name . '">';
|
$quota_select = '<select name="' . $select_name . '">';
|
||||||
$quota_name[0]['quota_limit_id'] = 0;
|
$quota_name[0]['quota_limit_id'] = 0;
|
||||||
$quota_name[0]['quota_desc'] = $lang['NO_QUOTA_LIMIT'];
|
$quota_name[0]['quota_desc'] = trans('messages.NO_QUOTA_LIMIT');
|
||||||
|
|
||||||
while ($row = OLD_DB()->sql_fetchrow($result)) {
|
while ($row = OLD_DB()->sql_fetchrow($result)) {
|
||||||
$quota_name[] = $row;
|
$quota_name[] = $row;
|
||||||
|
|
|
@ -26,10 +26,9 @@ define('LOG_DIR', BB_PATH . '/internal_data/log');
|
||||||
define('TRIGGERS_DIR', BB_PATH . '/internal_data/triggers');
|
define('TRIGGERS_DIR', BB_PATH . '/internal_data/triggers');
|
||||||
define('AJAX_DIR', BB_PATH . '/library/ajax');
|
define('AJAX_DIR', BB_PATH . '/library/ajax');
|
||||||
define('ATTACH_DIR', BB_PATH . '/library/attach_mod');
|
define('ATTACH_DIR', BB_PATH . '/library/attach_mod');
|
||||||
define('CFG_DIR', BB_PATH . '/library/config');
|
|
||||||
define('INC_DIR', BB_PATH . '/library/includes');
|
define('INC_DIR', BB_PATH . '/library/includes');
|
||||||
define('UCP_DIR', BB_PATH . '/library/includes/ucp');
|
define('UCP_DIR', BB_PATH . '/library/includes/ucp');
|
||||||
define('LANG_ROOT_DIR', BB_PATH . '/library/language');
|
define('LANG_ROOT_DIR', BB_PATH . '/resources/lang');
|
||||||
define('SITEMAP_DIR', BB_PATH . '/sitemap');
|
define('SITEMAP_DIR', BB_PATH . '/sitemap');
|
||||||
define('IMAGES_DIR', BB_PATH . '/styles/images');
|
define('IMAGES_DIR', BB_PATH . '/styles/images');
|
||||||
define('TEMPLATES_DIR', BB_PATH . '/styles/templates');
|
define('TEMPLATES_DIR', BB_PATH . '/styles/templates');
|
||||||
|
@ -105,3 +104,32 @@ define('CRON_DIR', INC_DIR . '/cron/');
|
||||||
define('CRON_JOB_DIR', CRON_DIR . 'jobs/');
|
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
|
define('CRON_LOG_FILE', 'cron'); // without ext
|
||||||
|
|
||||||
|
// Auth
|
||||||
|
define('AUTH_LIST_ALL', 0);
|
||||||
|
|
||||||
|
// forum's ACL types (bb_forums: auth_view, auth_read... values)
|
||||||
|
define('AUTH_REG', 1);
|
||||||
|
define('AUTH_ACL', 2);
|
||||||
|
define('AUTH_ADMIN', 5);
|
||||||
|
|
||||||
|
// forum_perm bitfields - backward compatible with auth_user($type)
|
||||||
|
define('AUTH_ALL', 0);
|
||||||
|
define('AUTH_VIEW', 1);
|
||||||
|
define('AUTH_READ', 2);
|
||||||
|
define('AUTH_MOD', 3);
|
||||||
|
define('AUTH_POST', 4);
|
||||||
|
define('AUTH_REPLY', 5);
|
||||||
|
define('AUTH_EDIT', 6);
|
||||||
|
define('AUTH_DELETE', 7);
|
||||||
|
define('AUTH_STICKY', 8);
|
||||||
|
define('AUTH_ANNOUNCE', 9);
|
||||||
|
define('AUTH_VOTE', 10);
|
||||||
|
define('AUTH_POLLCREATE', 11);
|
||||||
|
define('AUTH_ATTACH', 12);
|
||||||
|
define('AUTH_DOWNLOAD', 13);
|
||||||
|
|
||||||
|
// When defining user permissions, take into account:
|
||||||
|
define('UG_PERM_BOTH', 1); // both user and group
|
||||||
|
define('UG_PERM_USER_ONLY', 2); // only personal user permissions
|
||||||
|
define('UG_PERM_GROUP_ONLY', 3); // only group permissions
|
||||||
|
|
|
@ -106,7 +106,7 @@ function prepare_message($message)
|
||||||
// Either in a window or inline
|
// Either in a window or inline
|
||||||
function generate_smilies($mode)
|
function generate_smilies($mode)
|
||||||
{
|
{
|
||||||
global $template, $lang, $user, $datastore;
|
global $template, $user, $datastore;
|
||||||
|
|
||||||
$inline_columns = 4;
|
$inline_columns = 4;
|
||||||
$inline_rows = 7;
|
$inline_rows = 7;
|
||||||
|
@ -170,7 +170,7 @@ function generate_smilies($mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGE_TITLE' => $lang['EMOTICONS'],
|
'PAGE_TITLE' => trans('messages.EMOTICONS'),
|
||||||
'S_SMILIES_COLSPAN' => $s_colspan,
|
'S_SMILIES_COLSPAN' => $s_colspan,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,36 +114,8 @@ function is_unread($ref, $topic_id = 0, $forum_id = 0)
|
||||||
//
|
//
|
||||||
// Auth
|
// Auth
|
||||||
//
|
//
|
||||||
define('AUTH_LIST_ALL', 0);
|
|
||||||
|
|
||||||
// forum's ACL types (bb_forums: auth_view, auth_read... values)
|
|
||||||
define('AUTH_REG', 1);
|
|
||||||
define('AUTH_ACL', 2);
|
|
||||||
define('AUTH_ADMIN', 5);
|
|
||||||
|
|
||||||
// forum_perm bitfields - backward compatible with auth_user($type)
|
|
||||||
define('AUTH_ALL', 0);
|
|
||||||
define('AUTH_VIEW', 1);
|
|
||||||
define('AUTH_READ', 2);
|
|
||||||
define('AUTH_MOD', 3);
|
|
||||||
define('AUTH_POST', 4);
|
|
||||||
define('AUTH_REPLY', 5);
|
|
||||||
define('AUTH_EDIT', 6);
|
|
||||||
define('AUTH_DELETE', 7);
|
|
||||||
define('AUTH_STICKY', 8);
|
|
||||||
define('AUTH_ANNOUNCE', 9);
|
|
||||||
define('AUTH_VOTE', 10);
|
|
||||||
define('AUTH_POLLCREATE', 11);
|
|
||||||
define('AUTH_ATTACH', 12);
|
|
||||||
define('AUTH_DOWNLOAD', 13);
|
|
||||||
|
|
||||||
define('BF_AUTH_MOD', bit2dec(AUTH_MOD));
|
define('BF_AUTH_MOD', bit2dec(AUTH_MOD));
|
||||||
|
|
||||||
// When defining user permissions, take into account:
|
|
||||||
define('UG_PERM_BOTH', 1); // both user and group
|
|
||||||
define('UG_PERM_USER_ONLY', 2); // only personal user permissions
|
|
||||||
define('UG_PERM_GROUP_ONLY', 3); // only group permissions
|
|
||||||
|
|
||||||
$bf['forum_perm'] = array(
|
$bf['forum_perm'] = array(
|
||||||
'auth_view' => AUTH_VIEW,
|
'auth_view' => AUTH_VIEW,
|
||||||
'auth_read' => AUTH_READ,
|
'auth_read' => AUTH_READ,
|
||||||
|
@ -242,7 +214,7 @@ function setbit(&$int, $bit_num, $on)
|
||||||
*/
|
*/
|
||||||
function auth_user($type, $forum_id, $ug_data, array $f_access = array(), $group_perm = UG_PERM_BOTH)
|
function auth_user($type, $forum_id, $ug_data, array $f_access = array(), $group_perm = UG_PERM_BOTH)
|
||||||
{
|
{
|
||||||
global $lang, $bf, $datastore;
|
global $bf, $datastore;
|
||||||
|
|
||||||
$is_guest = true;
|
$is_guest = true;
|
||||||
$is_admin = false;
|
$is_admin = false;
|
||||||
|
@ -389,7 +361,8 @@ function auth_user($type, $forum_id, $ug_data, array $f_access = array(), $group
|
||||||
$auth[$f_id][$auth_type] = false;
|
$auth[$f_id][$auth_type] = false;
|
||||||
}
|
}
|
||||||
if ($add_auth_type_desc) {
|
if ($add_auth_type_desc) {
|
||||||
$auth[$f_id][$auth_type . '_type'] =& $lang['AUTH_TYPES'][$f_data[$auth_type]];
|
$transAuth = trans('messages.AUTH_TYPES.' . $f_data[$auth_type]);
|
||||||
|
$auth[$f_id][$auth_type . '_type'] =& $transAuth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -490,7 +463,7 @@ function build_hidden_fields($fields_ary)
|
||||||
function declension($int, $expressions, $format = '%1$s %2$s')
|
function declension($int, $expressions, $format = '%1$s %2$s')
|
||||||
{
|
{
|
||||||
if (!is_array($expressions)) {
|
if (!is_array($expressions)) {
|
||||||
$expressions = $GLOBALS['lang']['DECLENSION'][strtoupper($expressions)];
|
$expressions = trans('messages.DECLENSION.' . strtoupper($expressions));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($expressions) < 3) {
|
if (count($expressions) < 3) {
|
||||||
|
@ -798,7 +771,7 @@ function get_bt_ratio($btu)
|
||||||
|
|
||||||
function show_bt_userdata($user_id)
|
function show_bt_userdata($user_id)
|
||||||
{
|
{
|
||||||
global $lang, $template;
|
global $template;
|
||||||
|
|
||||||
$btu = get_bt_userdata($user_id);
|
$btu = get_bt_userdata($user_id);
|
||||||
|
|
||||||
|
@ -812,7 +785,7 @@ function show_bt_userdata($user_id)
|
||||||
'USER_RATIO' => get_bt_ratio($btu),
|
'USER_RATIO' => get_bt_ratio($btu),
|
||||||
'MIN_DL_FOR_RATIO' => humn_size(MIN_DL_FOR_RATIO),
|
'MIN_DL_FOR_RATIO' => humn_size(MIN_DL_FOR_RATIO),
|
||||||
'MIN_DL_BYTES' => MIN_DL_FOR_RATIO,
|
'MIN_DL_BYTES' => MIN_DL_FOR_RATIO,
|
||||||
'AUTH_KEY' => ($btu['auth_key']) ?: $lang['NONE'],
|
'AUTH_KEY' => ($btu['auth_key']) ?: trans('messages.NONE'),
|
||||||
|
|
||||||
'TD_DL' => humn_size($btu['down_today']),
|
'TD_DL' => humn_size($btu['down_today']),
|
||||||
'TD_UL' => humn_size($btu['up_today']),
|
'TD_UL' => humn_size($btu['up_today']),
|
||||||
|
@ -1005,7 +978,7 @@ function make_jumpbox($selected = 0)
|
||||||
// $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode'
|
// $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode'
|
||||||
function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '', $all_forums_option = null)
|
function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = null, $max_length = HTML_SELECT_MAX_LENGTH, $multiple_size = null, $js = '', $all_forums_option = null)
|
||||||
{
|
{
|
||||||
global $lang, $datastore;
|
global $datastore;
|
||||||
|
|
||||||
if (is_array($mode)) {
|
if (is_array($mode)) {
|
||||||
$not_auth_forums_fary = array_flip($mode);
|
$not_auth_forums_fary = array_flip($mode);
|
||||||
|
@ -1014,7 +987,7 @@ function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = n
|
||||||
if (null === $max_length) {
|
if (null === $max_length) {
|
||||||
$max_length = HTML_SELECT_MAX_LENGTH;
|
$max_length = HTML_SELECT_MAX_LENGTH;
|
||||||
}
|
}
|
||||||
$select = null === $all_forums_option ? array() : array($lang['ALL_AVAILABLE'] => $all_forums_option);
|
$select = null === $all_forums_option ? array() : [trans('messages.ALL_AVAILABLE') => $all_forums_option];
|
||||||
if (!$forums = $datastore->get('cat_forums')) {
|
if (!$forums = $datastore->get('cat_forums')) {
|
||||||
$datastore->update('cat_forums');
|
$datastore->update('cat_forums');
|
||||||
$forums = $datastore->get('cat_forums');
|
$forums = $datastore->get('cat_forums');
|
||||||
|
@ -1102,16 +1075,13 @@ function setup_style()
|
||||||
// Create date / time with format and friendly date
|
// Create date / time with format and friendly date
|
||||||
function bb_date($gmepoch, $format = false, $friendly_date = true)
|
function bb_date($gmepoch, $format = false, $friendly_date = true)
|
||||||
{
|
{
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
$gmepoch = (int)$gmepoch;
|
$gmepoch = (int)$gmepoch;
|
||||||
|
|
||||||
if (!$format) {
|
if (!$format) {
|
||||||
$format = config('tp.default_dateformat');
|
$format = config('tp.default_dateformat');
|
||||||
}
|
}
|
||||||
if (empty($lang)) {
|
|
||||||
require_once(config('tp.default_lang_dir') . 'main.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($userdata['session_logged_in'])) {
|
if (empty($userdata['session_logged_in'])) {
|
||||||
$tz = config('tp.board_timezone');
|
$tz = config('tp.board_timezone');
|
||||||
|
@ -1149,7 +1119,7 @@ function bb_date($gmepoch, $format = false, $friendly_date = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return config('tp.translate_dates') ? strtr(strtoupper($date), $lang['DATETIME']) : $date;
|
return config('tp.translate_dates') ? strtr(strtoupper($date), trans('messages.DATETIME')) : $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
function birthday_age($date)
|
function birthday_age($date)
|
||||||
|
@ -1168,7 +1138,7 @@ function birthday_age($date)
|
||||||
//
|
//
|
||||||
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = true)
|
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = true)
|
||||||
{
|
{
|
||||||
global $lang, $template;
|
global $template;
|
||||||
|
|
||||||
// Pagination Mod
|
// Pagination Mod
|
||||||
$begin_end = 3;
|
$begin_end = 3;
|
||||||
|
@ -1242,20 +1212,20 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
|
||||||
|
|
||||||
if ($add_prevnext_text) {
|
if ($add_prevnext_text) {
|
||||||
if ($on_page > 1) {
|
if ($on_page > 1) {
|
||||||
$page_string = ' <a href="' . $base_url . "&start=" . (($on_page - 2) * $per_page) . '">' . $lang['PREVIOUS_PAGE'] . '</a> ' . $page_string;
|
$page_string = ' <a href="' . $base_url . "&start=" . (($on_page - 2) * $per_page) . '">' . trans('messages.PREVIOUS_PAGE') . '</a> ' . $page_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($on_page < $total_pages) {
|
if ($on_page < $total_pages) {
|
||||||
$page_string .= ' <a href="' . $base_url . "&start=" . ($on_page * $per_page) . '">' . $lang['NEXT_PAGE'] . '</a>';
|
$page_string .= ' <a href="' . $base_url . "&start=" . ($on_page * $per_page) . '">' . trans('messages.NEXT_PAGE') . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pagination = ($page_string) ? '<a class="menu-root" href="#pg-jump">' . $lang['GOTO_PAGE'] . '</a> : ' . $page_string : '';
|
$pagination = ($page_string) ? '<a class="menu-root" href="#pg-jump">' . trans('messages.GOTO_PAGE') . '</a> : ' . $page_string : '';
|
||||||
$pagination = str_replace('&start=0', '', $pagination);
|
$pagination = str_replace('&start=0', '', $pagination);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGINATION' => $pagination,
|
'PAGINATION' => $pagination,
|
||||||
'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], (floor($start_item / $per_page) + 1), ceil($num_items / $per_page)),
|
'PAGE_NUMBER' => sprintf(trans('messages.PAGE_OF'), (floor($start_item / $per_page) + 1), ceil($num_items / $per_page)),
|
||||||
'PG_BASE_URL' => $base_url,
|
'PG_BASE_URL' => $base_url,
|
||||||
'PG_PER_PAGE' => $per_page,
|
'PG_PER_PAGE' => $per_page,
|
||||||
));
|
));
|
||||||
|
@ -1305,7 +1275,7 @@ function obtain_word_list(&$orig_word, &$replacement_word)
|
||||||
|
|
||||||
function bb_die($msg_text)
|
function bb_die($msg_text)
|
||||||
{
|
{
|
||||||
global $ajax, $lang, $template, $theme, $userdata;
|
global $ajax, $template, $theme, $userdata;
|
||||||
|
|
||||||
if (defined('IN_AJAX')) {
|
if (defined('IN_AJAX')) {
|
||||||
$ajax->ajax_die($msg_text);
|
$ajax->ajax_die($msg_text);
|
||||||
|
@ -1318,11 +1288,6 @@ function bb_die($msg_text)
|
||||||
define('HAS_DIED', 1);
|
define('HAS_DIED', 1);
|
||||||
define('DISABLE_CACHING_OUTPUT', true);
|
define('DISABLE_CACHING_OUTPUT', true);
|
||||||
|
|
||||||
// If empty lang
|
|
||||||
if (empty($lang)) {
|
|
||||||
require(config('tp.default_lang_dir') . 'main.php');
|
|
||||||
}
|
|
||||||
|
|
||||||
// If empty session
|
// If empty session
|
||||||
if (empty($userdata)) {
|
if (empty($userdata)) {
|
||||||
$userdata = session_pagestart();
|
$userdata = session_pagestart();
|
||||||
|
@ -1340,8 +1305,8 @@ function bb_die($msg_text)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for lang variable
|
// Check for lang variable
|
||||||
if (!empty($lang[$msg_text])) {
|
if (trans('messages.' . $msg_text) !== 'messages.' . $msg_text) {
|
||||||
$msg_text = $lang[$msg_text];
|
$msg_text = trans('messages.' . $msg_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -1416,8 +1381,6 @@ function redirectToUrl($url)
|
||||||
// build a list of the sortable fields or return field name
|
// build a list of the sortable fields or return field name
|
||||||
function get_forum_display_sort_option($selected_row = 0, $action = 'list', $list = 'sort')
|
function get_forum_display_sort_option($selected_row = 0, $action = 'list', $list = 'sort')
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$forum_display_sort = array(
|
$forum_display_sort = array(
|
||||||
'lang_key' => array('LASTPOST', 'SORT_TOPIC_TITLE', 'SORT_TIME'),
|
'lang_key' => array('LASTPOST', 'SORT_TOPIC_TITLE', 'SORT_TIME'),
|
||||||
'fields' => array('t.topic_last_post_time', 't.topic_title', 't.topic_time'),
|
'fields' => array('t.topic_last_post_time', 't.topic_title', 't.topic_time'),
|
||||||
|
@ -1441,7 +1404,7 @@ function get_forum_display_sort_option($selected_row = 0, $action = 'list', $lis
|
||||||
if ($action == 'list') {
|
if ($action == 'list') {
|
||||||
for ($i = 0, $iMax = count($listrow['lang_key']); $i < $iMax; $i++) {
|
for ($i = 0, $iMax = count($listrow['lang_key']); $i < $iMax; $i++) {
|
||||||
$selected = ($i == $selected_row) ? ' selected="selected"' : '';
|
$selected = ($i == $selected_row) ? ' selected="selected"' : '';
|
||||||
$l_value = $lang[$listrow['lang_key'][$i]] ?? $listrow['lang_key'][$i];
|
$l_value = trans('messages.' . $listrow['lang_key'][$i]) ?? $listrow['lang_key'][$i];
|
||||||
$res .= '<option value="' . $i . '"' . $selected . '>' . $l_value . '</option>';
|
$res .= '<option value="' . $i . '"' . $selected . '>' . $l_value . '</option>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1690,11 +1653,11 @@ function poll_is_active($t_data)
|
||||||
|
|
||||||
function print_confirmation($tpl_vars)
|
function print_confirmation($tpl_vars)
|
||||||
{
|
{
|
||||||
global $template, $lang;
|
global $template;
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'TPL_CONFIRM' => true,
|
'TPL_CONFIRM' => true,
|
||||||
'CONFIRM_TITLE' => $lang['CONFIRM'],
|
'CONFIRM_TITLE' => trans('messages.CONFIRM'),
|
||||||
'FORM_METHOD' => 'post',
|
'FORM_METHOD' => 'post',
|
||||||
));
|
));
|
||||||
$template->assign_vars($tpl_vars);
|
$template->assign_vars($tpl_vars);
|
||||||
|
@ -1763,8 +1726,6 @@ function clean_title($str, $replace_underscore = false)
|
||||||
|
|
||||||
function clean_text_match($text, $ltrim_star = true, $die_if_empty = false)
|
function clean_text_match($text, $ltrim_star = true, $die_if_empty = false)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$text = str_compact($text);
|
$text = str_compact($text);
|
||||||
$ltrim_chars = ($ltrim_star) ? ' *-!' : ' ';
|
$ltrim_chars = ($ltrim_star) ? ' *-!' : ' ';
|
||||||
$wrap_with_quotes = preg_match('#^"[^"]+"$#', $text);
|
$wrap_with_quotes = preg_match('#^"[^"]+"$#', $text);
|
||||||
|
@ -1787,7 +1748,7 @@ function clean_text_match($text, $ltrim_star = true, $die_if_empty = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$text_match_sql && $die_if_empty) {
|
if (!$text_match_sql && $die_if_empty) {
|
||||||
bb_die($lang['NO_SEARCH_MATCH']);
|
bb_die(trans('messages.NO_SEARCH_MATCH'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $text_match_sql;
|
return $text_match_sql;
|
||||||
|
@ -1822,7 +1783,7 @@ function log_sphinx_error($err_type, $err_msg, $query = '')
|
||||||
|
|
||||||
function get_title_match_topics($title_match_sql, array $forum_ids = array())
|
function get_title_match_topics($title_match_sql, array $forum_ids = array())
|
||||||
{
|
{
|
||||||
global $sphinx, $userdata, $title_match, $lang;
|
global $sphinx, $userdata, $title_match;
|
||||||
|
|
||||||
$where_ids = [];
|
$where_ids = [];
|
||||||
if ($forum_ids) {
|
if ($forum_ids) {
|
||||||
|
@ -1848,7 +1809,7 @@ function get_title_match_topics($title_match_sql, array $forum_ids = array())
|
||||||
}
|
}
|
||||||
} elseif ($error = $sphinx->getLastError()) {
|
} elseif ($error = $sphinx->getLastError()) {
|
||||||
if (strpos($error, 'errno=110')) {
|
if (strpos($error, 'errno=110')) {
|
||||||
bb_die($lang['SEARCH_ERROR']);
|
bb_die(trans('messages.SEARCH_ERROR'));
|
||||||
}
|
}
|
||||||
log_sphinx_error('ERR', $error, $title_match_sql);
|
log_sphinx_error('ERR', $error, $title_match_sql);
|
||||||
}
|
}
|
||||||
|
@ -1876,7 +1837,7 @@ function get_title_match_topics($title_match_sql, array $forum_ids = array())
|
||||||
$where_ids[] = $row[$where_id];
|
$where_ids[] = $row[$where_id];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['SEARCH_OFF']);
|
bb_die(trans('messages.SEARCH_OFF'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $where_ids;
|
return $where_ids;
|
||||||
|
@ -1908,26 +1869,26 @@ function create_magnet($infohash, $auth_key, $logged_in)
|
||||||
|
|
||||||
function set_die_append_msg($forum_id = null, $topic_id = null, $group_id = null)
|
function set_die_append_msg($forum_id = null, $topic_id = null, $group_id = null)
|
||||||
{
|
{
|
||||||
global $lang, $template;
|
global $template;
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
$msg .= $topic_id ? '<p class="mrg_10"><a href="' . TOPIC_URL . $topic_id . '">' . $lang['TOPIC_RETURN'] . '</a></p>' : '';
|
$msg .= $topic_id ? '<p class="mrg_10"><a href="' . TOPIC_URL . $topic_id . '">' . trans('messages.TOPIC_RETURN') . '</a></p>' : '';
|
||||||
$msg .= $forum_id ? '<p class="mrg_10"><a href="' . FORUM_URL . $forum_id . '">' . $lang['FORUM_RETURN'] . '</a></p>' : '';
|
$msg .= $forum_id ? '<p class="mrg_10"><a href="' . FORUM_URL . $forum_id . '">' . trans('messages.FORUM_RETURN') . '</a></p>' : '';
|
||||||
$msg .= $group_id ? '<p class="mrg_10"><a href="' . GROUP_URL . $group_id . '">' . $lang['GROUP_RETURN'] . '</a></p>' : '';
|
$msg .= $group_id ? '<p class="mrg_10"><a href="' . GROUP_URL . $group_id . '">' . trans('messages.GROUP_RETURN') . '</a></p>' : '';
|
||||||
$msg .= '<p class="mrg_10"><a href="index.php">' . $lang['INDEX_RETURN'] . '</a></p>';
|
$msg .= '<p class="mrg_10"><a href="index.php">' . trans('messages.INDEX_RETURN') . '</a></p>';
|
||||||
$template->assign_var('BB_DIE_APPEND_MSG', $msg);
|
$template->assign_var('BB_DIE_APPEND_MSG', $msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_pr_die_append_msg($pr_uid)
|
function set_pr_die_append_msg($pr_uid)
|
||||||
{
|
{
|
||||||
global $lang, $template;
|
global $template;
|
||||||
|
|
||||||
$template->assign_var('BB_DIE_APPEND_MSG', '
|
$template->assign_var('BB_DIE_APPEND_MSG', '
|
||||||
<a href="' . PROFILE_URL . $pr_uid . '" onclick="return post2url(this.href, {after_edit: 1});">' . $lang['PROFILE_RETURN'] . '</a>
|
<a href="' . PROFILE_URL . $pr_uid . '" onclick="return post2url(this.href, {after_edit: 1});">' . trans('messages.PROFILE_RETURN') . '</a>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<a href="profile.php?mode=editprofile' . (IS_ADMIN ? "&u=$pr_uid" : '') . '" onclick="return post2url(this.href, {after_edit: 1});">' . $lang['PROFILE_EDIT_RETURN'] . '</a>
|
<a href="profile.php?mode=editprofile' . (IS_ADMIN ? "&u=$pr_uid" : '') . '" onclick="return post2url(this.href, {after_edit: 1});">' . trans('messages.PROFILE_EDIT_RETURN') . '</a>
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<a href="index.php">' . $lang['INDEX_RETURN'] . '</a>
|
<a href="index.php">' . trans('messages.INDEX_RETURN') . '</a>
|
||||||
');
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1956,7 +1917,7 @@ function send_pm($user_id, $subject, $message, $poster_id = BOT_UID)
|
||||||
|
|
||||||
function profile_url($data)
|
function profile_url($data)
|
||||||
{
|
{
|
||||||
global $lang, $datastore;
|
global $datastore;
|
||||||
|
|
||||||
if (!$ranks = $datastore->get('ranks')) {
|
if (!$ranks = $datastore->get('ranks')) {
|
||||||
$datastore->update('ranks');
|
$datastore->update('ranks');
|
||||||
|
@ -1970,7 +1931,7 @@ function profile_url($data)
|
||||||
$style = $ranks[$user_rank]['rank_style'];
|
$style = $ranks[$user_rank]['rank_style'];
|
||||||
}
|
}
|
||||||
if (empty($title)) {
|
if (empty($title)) {
|
||||||
$title = $lang['USER'];
|
$title = trans('messages.USER');
|
||||||
}
|
}
|
||||||
if (empty($style)) {
|
if (empty($style)) {
|
||||||
$style = 'colorUser';
|
$style = 'colorUser';
|
||||||
|
@ -1980,8 +1941,8 @@ function profile_url($data)
|
||||||
$style = '';
|
$style = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
|
$username = !empty($data['username']) ? $data['username'] : trans('messages.GUEST');
|
||||||
$user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : GUEST_UID;
|
$user_id = (!empty($data['user_id']) && $username != trans('messages.GUEST')) ? $data['user_id'] : GUEST_UID;
|
||||||
|
|
||||||
$profile = '<span title="' . $title . '" class="' . $style . '">' . $username . '</span>';
|
$profile = '<span title="' . $title . '" class="' . $style . '">' . $username . '</span>';
|
||||||
|
|
||||||
|
@ -2012,7 +1973,7 @@ function get_avatar($user_id, $ext_id, $allow_avatar = true, $size = true, $heig
|
||||||
|
|
||||||
function gender_image($gender)
|
function gender_image($gender)
|
||||||
{
|
{
|
||||||
global $lang, $images;
|
global $images;
|
||||||
|
|
||||||
if (!config('tp.gender')) {
|
if (!config('tp.gender')) {
|
||||||
$user_gender = '';
|
$user_gender = '';
|
||||||
|
@ -2021,13 +1982,13 @@ function gender_image($gender)
|
||||||
|
|
||||||
switch ($gender) {
|
switch ($gender) {
|
||||||
case MALE:
|
case MALE:
|
||||||
$user_gender = '<img src="' . $images['icon_male'] . '" alt="' . $lang['GENDER_SELECT'][MALE] . '" title="' . $lang['GENDER_SELECT'][MALE] . '" border="0" />';
|
$user_gender = '<img src="' . $images['icon_male'] . '" alt="' . trans('messages.GENDER_SELECT.' . MALE) . '" title="' . trans('messages.GENDER_SELECT.' . MALE) . '" border="0" />';
|
||||||
break;
|
break;
|
||||||
case FEMALE:
|
case FEMALE:
|
||||||
$user_gender = '<img src="' . $images['icon_female'] . '" alt="' . $lang['GENDER_SELECT'][FEMALE] . '" title="' . $lang['GENDER_SELECT'][FEMALE] . '" border="0" />';
|
$user_gender = '<img src="' . $images['icon_female'] . '" alt="' . trans('messages.GENDER_SELECT.' . FEMALE) . '" title="' . trans('messages.GENDER_SELECT.' . FEMALE) . '" border="0" />';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$user_gender = '<img src="' . $images['icon_nogender'] . '" alt="' . $lang['GENDER_SELECT'][NOGENDER] . '" title="' . $lang['GENDER_SELECT'][NOGENDER] . '" border="0" />';
|
$user_gender = '<img src="' . $images['icon_nogender'] . '" alt="' . trans('messages.GENDER_SELECT.' . NOGENDER) . '" title="' . trans('messages.GENDER_SELECT.' . NOGENDER) . '" border="0" />';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2036,8 +1997,6 @@ function gender_image($gender)
|
||||||
|
|
||||||
function is_gold($type)
|
function is_gold($type)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
if (!config('tracker.gold_silver_enabled')) {
|
if (!config('tracker.gold_silver_enabled')) {
|
||||||
$is_gold = '';
|
$is_gold = '';
|
||||||
return $is_gold;
|
return $is_gold;
|
||||||
|
@ -2045,10 +2004,10 @@ function is_gold($type)
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case TOR_TYPE_GOLD:
|
case TOR_TYPE_GOLD:
|
||||||
$is_gold = '<img src="styles/images/tor_gold.gif" width="16" height="15" title="' . $lang['GOLD'] . '" /> ';
|
$is_gold = '<img src="styles/images/tor_gold.gif" width="16" height="15" title="' . trans('messages.GOLD') . '" /> ';
|
||||||
break;
|
break;
|
||||||
case TOR_TYPE_SILVER:
|
case TOR_TYPE_SILVER:
|
||||||
$is_gold = '<img src="styles/images/tor_silver.gif" width="16" height="15" title="' . $lang['SILVER'] . '" /> ';
|
$is_gold = '<img src="styles/images/tor_silver.gif" width="16" height="15" title="' . trans('messages.SILVER') . '" /> ';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$is_gold = '';
|
$is_gold = '';
|
||||||
|
@ -2076,12 +2035,10 @@ function update_atom($type, $id)
|
||||||
|
|
||||||
function hash_search($hash)
|
function hash_search($hash)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$hash = htmlCHR(trim($hash));
|
$hash = htmlCHR(trim($hash));
|
||||||
|
|
||||||
if (!isset($hash) || mb_strlen($hash, 'UTF-8') != 40) {
|
if (!isset($hash) || mb_strlen($hash, 'UTF-8') != 40) {
|
||||||
bb_die(sprintf($lang['HASH_INVALID'], $hash));
|
bb_die(sprintf(trans('messages.HASH_INVALID'), $hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
$info_hash = OLD_DB()->escape(pack("H*", $hash));
|
$info_hash = OLD_DB()->escape(pack("H*", $hash));
|
||||||
|
@ -2089,7 +2046,7 @@ function hash_search($hash)
|
||||||
if ($row = OLD_DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE info_hash = '$info_hash'")) {
|
if ($row = OLD_DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE info_hash = '$info_hash'")) {
|
||||||
redirectToUrl(TOPIC_URL . $row['topic_id']);
|
redirectToUrl(TOPIC_URL . $row['topic_id']);
|
||||||
} else {
|
} else {
|
||||||
bb_die(sprintf($lang['HASH_NOT_FOUND'], $hash));
|
bb_die(sprintf(trans('messages.HASH_NOT_FOUND'), $hash));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2103,14 +2060,12 @@ function hash_search($hash)
|
||||||
*/
|
*/
|
||||||
function bb_captcha($mode, $callback = '')
|
function bb_captcha($mode, $callback = '')
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$secret = config('tp.captcha.secret_key');
|
$secret = config('tp.captcha.secret_key');
|
||||||
$public = config('tp.captcha.public_key');
|
$public = config('tp.captcha.public_key');
|
||||||
$cp_theme = config('tp.captcha.theme');
|
$cp_theme = config('tp.captcha.theme');
|
||||||
|
|
||||||
if (!$public && !$secret) {
|
if (!$public && !$secret) {
|
||||||
bb_die($lang['CAPTCHA_SETTINGS']);
|
bb_die(trans('messages.CAPTCHA_SETTINGS'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$reCaptcha = new \ReCaptcha\ReCaptcha($secret);
|
$reCaptcha = new \ReCaptcha\ReCaptcha($secret);
|
||||||
|
|
|
@ -192,7 +192,7 @@ function sync($type, $id)
|
||||||
|
|
||||||
function topic_delete($mode_or_topic_id, $forum_id = null, $prune_time = 0, $prune_all = false)
|
function topic_delete($mode_or_topic_id, $forum_id = null, $prune_time = 0, $prune_all = false)
|
||||||
{
|
{
|
||||||
global $lang, $log_action;
|
global $log_action;
|
||||||
|
|
||||||
$prune = ($mode_or_topic_id === 'prune');
|
$prune = ($mode_or_topic_id === 'prune');
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ function topic_delete($mode_or_topic_id, $forum_id = null, $prune_time = 0, $pru
|
||||||
} else {
|
} else {
|
||||||
foreach ($log_topics as $row) {
|
foreach ($log_topics as $row) {
|
||||||
if ($row['topic_status'] == TOPIC_MOVED) {
|
if ($row['topic_status'] == TOPIC_MOVED) {
|
||||||
$row['topic_title'] = '<i>' . $lang['TOPIC_MOVED'] . '</i> ' . $row['topic_title'];
|
$row['topic_title'] = '<i>' . trans('messages.TOPIC_MOVED') . '</i> ' . $row['topic_title'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$log_action->mod('mod_topic_delete', array(
|
$log_action->mod('mod_topic_delete', array(
|
||||||
|
|
|
@ -88,15 +88,13 @@ function insert_cron_job($cron_arr)
|
||||||
$row = OLD_DB()->fetch_row("SELECT cron_title, cron_script FROM " . BB_CRON . " WHERE cron_title = '" . $_POST['cron_title'] . "' or cron_script = '" . $_POST['cron_script'] . "' ");
|
$row = OLD_DB()->fetch_row("SELECT cron_title, cron_script FROM " . BB_CRON . " WHERE cron_title = '" . $_POST['cron_title'] . "' or cron_script = '" . $_POST['cron_script'] . "' ");
|
||||||
|
|
||||||
if ($row) {
|
if ($row) {
|
||||||
global $lang;
|
|
||||||
|
|
||||||
if ($_POST['cron_script'] == $row['cron_script']) {
|
if ($_POST['cron_script'] == $row['cron_script']) {
|
||||||
$langmode = $lang['SCRIPT_DUPLICATE'];
|
$errMess = trans('messages.SCRIPT_DUPLICATE');
|
||||||
} else {
|
} else {
|
||||||
$langmode = $lang['TITLE_DUPLICATE'];
|
$errMess = trans('messages.TITLE_DUPLICATE');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = $langmode . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS_ADDED'], "<a href=\"javascript:history.back(-1)\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_JOBS'], "<a href=\"admin_cron.php?mode=list\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"index.php?pane=right\">", "</a>");
|
$message = $errMess . "<br /><br />" . sprintf(trans('messages.CLICK_RETURN_JOBS_ADDED'), "<a href=\"javascript:history.back(-1)\">", "</a>") . "<br /><br />" . sprintf(trans('messages.CLICK_RETURN_JOBS'), "<a href=\"admin_cron.php?mode=list\">", "</a>") . "<br /><br />" . sprintf(trans('messages.CLICK_RETURN_ADMIN_INDEX'), "<a href=\"index.php?pane=right\">", "</a>");
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ function set_tpl_vars($default_cfg, $cfg)
|
||||||
|
|
||||||
function set_tpl_vars_bool($default_cfg, $cfg)
|
function set_tpl_vars_bool($default_cfg, $cfg)
|
||||||
{
|
{
|
||||||
global $template, $lang;
|
global $template;
|
||||||
|
|
||||||
foreach ($default_cfg as $config_name => $config_value) {
|
foreach ($default_cfg as $config_name => $config_value) {
|
||||||
// YES/NO 'checked="checked"'
|
// YES/NO 'checked="checked"'
|
||||||
|
@ -65,21 +65,21 @@ function set_tpl_vars_bool($default_cfg, $cfg)
|
||||||
));
|
));
|
||||||
// YES/NO lang vars
|
// YES/NO lang vars
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_' . strtoupper($config_name) . '_YES' => ($cfg[$config_name]) ? "<u>$lang[YES]</u>" : $lang['YES'],
|
'L_' . strtoupper($config_name) . '_YES' => ($cfg[$config_name]) ? '<u>' . trans('messages.YES') . '</u>' : trans('messages.YES'),
|
||||||
'L_' . strtoupper($config_name) . '_NO' => (!$cfg[$config_name]) ? "<u>$lang[NO]</u>" : $lang['NO'],
|
'L_' . strtoupper($config_name) . '_NO' => (!$cfg[$config_name]) ? '<u>' . trans('messages.NO') . '</u>' : trans('messages.NO'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_tpl_vars_lang($default_cfg)
|
function set_tpl_vars_lang($default_cfg)
|
||||||
{
|
{
|
||||||
global $template, $lang;
|
global $template;
|
||||||
|
|
||||||
foreach ($default_cfg as $config_name => $config_value) {
|
foreach ($default_cfg as $config_name => $config_value) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_' . strtoupper($config_name) => $lang[$config_name] ?? '',
|
'L_' . strtoupper($config_name) => trans('messages.' . $config_name) ?? '',
|
||||||
'L_' . strtoupper($config_name) . '_EXPL' => $lang[$config_name . '_expl'] ?? '',
|
'L_' . strtoupper($config_name) . '_EXPL' => trans('messages.' . $config_name . '_expl') ?? '',
|
||||||
'L_' . strtoupper($config_name) . '_HEAD' => $lang[$config_name . '_head'] ?? '',
|
'L_' . strtoupper($config_name) . '_HEAD' => trans('messages.' . $config_name . '_head') ?? '',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (!defined('BB_ROOT')) {
|
||||||
//
|
//
|
||||||
function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &$message)
|
function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &$message)
|
||||||
{
|
{
|
||||||
global $user, $userdata, $lang;
|
global $user, $userdata;
|
||||||
|
|
||||||
// Check username
|
// Check username
|
||||||
if (!empty($username)) {
|
if (!empty($username)) {
|
||||||
|
@ -37,26 +37,26 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
|
||||||
if (!empty($subject)) {
|
if (!empty($subject)) {
|
||||||
$subject = str_replace('&', '&', $subject);
|
$subject = str_replace('&', '&', $subject);
|
||||||
} elseif ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) {
|
} elseif ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) {
|
||||||
$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['EMPTY_SUBJECT'] : $lang['EMPTY_SUBJECT'];
|
$error_msg .= (!empty($error_msg)) ? '<br />' . trans('messages.EMPTY_SUBJECT') : trans('messages.EMPTY_SUBJECT');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check message
|
// Check message
|
||||||
if (!empty($message)) {
|
if (!empty($message)) {
|
||||||
} elseif ($mode != 'delete') {
|
} elseif ($mode != 'delete') {
|
||||||
$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['EMPTY_MESSAGE'] : $lang['EMPTY_MESSAGE'];
|
$error_msg .= (!empty($error_msg)) ? '<br />' . trans('messages.EMPTY_MESSAGE') : trans('messages.EMPTY_MESSAGE');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check smilies limit
|
// Check smilies limit
|
||||||
if (config('tp.max_smilies')) {
|
if (config('tp.max_smilies')) {
|
||||||
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="' . config('tp.smilies_path'));
|
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="' . config('tp.smilies_path'));
|
||||||
if ($count_smilies > config('tp.max_smilies')) {
|
if ($count_smilies > config('tp.max_smilies')) {
|
||||||
$to_many_smilies = sprintf($lang['MAX_SMILIES_PER_POST'], config('tp.max_smilies'));
|
$to_many_smilies = sprintf(trans('messages.MAX_SMILIES_PER_POST'), config('tp.max_smilies'));
|
||||||
$error_msg .= (!empty($error_msg)) ? '<br />' . $to_many_smilies : $to_many_smilies;
|
$error_msg .= (!empty($error_msg)) ? '<br />' . $to_many_smilies : $to_many_smilies;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_GUEST && !bb_captcha('check')) {
|
if (IS_GUEST && !bb_captcha('check')) {
|
||||||
$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['CAPTCHA_WRONG'] : $lang['CAPTCHA_WRONG'];
|
$error_msg .= (!empty($error_msg)) ? '<br />' . trans('messages.CAPTCHA_WRONG') : trans('messages.CAPTCHA_WRONG');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
|
||||||
//
|
//
|
||||||
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$topic_type, $post_username, $post_subject, $post_message, $update_post_time, $poster_rg_id, $attach_rg_sig)
|
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$topic_type, $post_username, $post_subject, $post_message, $update_post_time, $poster_rg_id, $attach_rg_sig)
|
||||||
{
|
{
|
||||||
global $userdata, $post_info, $is_auth, $lang, $datastore;
|
global $userdata, $post_info, $is_auth, $datastore;
|
||||||
|
|
||||||
$current_time = TIMENOW;
|
$current_time = TIMENOW;
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
|
||||||
if ($row = OLD_DB()->fetch_row($sql) && $row['last_post_time']) {
|
if ($row = OLD_DB()->fetch_row($sql) && $row['last_post_time']) {
|
||||||
if ($userdata['user_level'] == USER) {
|
if ($userdata['user_level'] == USER) {
|
||||||
if (TIMENOW - $row['last_post_time'] < config('tp.flood_interval')) {
|
if (TIMENOW - $row['last_post_time'] < config('tp.flood_interval')) {
|
||||||
bb_die($lang['FLOOD_ERROR']);
|
bb_die(trans('messages.FLOOD_ERROR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
|
||||||
$last_msg = OLD_DB()->escape($row['post_text']);
|
$last_msg = OLD_DB()->escape($row['post_text']);
|
||||||
|
|
||||||
if ($last_msg == $post_message) {
|
if ($last_msg == $post_message) {
|
||||||
bb_die($lang['DOUBLE_POST_ERROR']);
|
bb_die(trans('messages.DOUBLE_POST_ERROR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,9 +274,7 @@ function update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $u
|
||||||
//
|
//
|
||||||
function delete_post($mode, $post_data, &$message, &$meta, $forum_id, $topic_id, $post_id)
|
function delete_post($mode, $post_data, &$message, &$meta, $forum_id, $topic_id, $post_id)
|
||||||
{
|
{
|
||||||
global $lang;
|
$message = trans('messages.DELETED');
|
||||||
|
|
||||||
$message = $lang['DELETED'];
|
|
||||||
post_delete($post_id);
|
post_delete($post_id);
|
||||||
|
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
|
@ -287,7 +285,7 @@ function delete_post($mode, $post_data, &$message, &$meta, $forum_id, $topic_id,
|
||||||
//
|
//
|
||||||
function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$notify_user)
|
function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$notify_user)
|
||||||
{
|
{
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
if (!config('tp.topic_notify_enabled')) {
|
if (!config('tp.topic_notify_enabled')) {
|
||||||
return;
|
return;
|
||||||
|
@ -331,7 +329,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
|
||||||
|
|
||||||
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
||||||
$emailer->set_to([$row['user_email'] => $row['username']]);
|
$emailer->set_to([$row['user_email'] => $row['username']]);
|
||||||
$emailer->set_subject(sprintf($lang['EMAILER_SUBJECT']['TOPIC_NOTIFY'], $topic_title));
|
$emailer->set_subject(sprintf(trans('messages.EMAILER_SUBJECT.TOPIC_NOTIFY'), $topic_title));
|
||||||
|
|
||||||
$emailer->set_template('topic_notify', $row['user_lang']);
|
$emailer->set_template('topic_notify', $row['user_lang']);
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
@ -373,7 +371,7 @@ function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topi
|
||||||
|
|
||||||
function insert_post($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_topic_id = '', $new_topic_title = '', $old_topic_id = '', $message = '', $poster_id = '')
|
function insert_post($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_topic_id = '', $new_topic_title = '', $old_topic_id = '', $message = '', $poster_id = '')
|
||||||
{
|
{
|
||||||
global $userdata, $lang;
|
global $userdata;
|
||||||
|
|
||||||
if (!$topic_id) {
|
if (!$topic_id) {
|
||||||
return;
|
return;
|
||||||
|
@ -400,12 +398,12 @@ function insert_post($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_text = sprintf($lang['BOT_TOPIC_MOVED_FROM_TO'], '[url=' . make_url(FORUM_URL . $old_forum_id) . ']' . $forum_names[$old_forum_id] . '[/url]', '[url=' . make_url(FORUM_URL . $forum_id) . ']' . $forum_names[$forum_id] . '[/url]', profile_url($userdata));
|
$post_text = sprintf(trans('messages.BOT_TOPIC_MOVED_FROM_TO'), '[url=' . make_url(FORUM_URL . $old_forum_id) . ']' . $forum_names[$old_forum_id] . '[/url]', '[url=' . make_url(FORUM_URL . $forum_id) . ']' . $forum_names[$forum_id] . '[/url]', profile_url($userdata));
|
||||||
|
|
||||||
$poster_id = BOT_UID;
|
$poster_id = BOT_UID;
|
||||||
$poster_ip = '7f000001';
|
$poster_ip = '7f000001';
|
||||||
} elseif ($mode == 'after_split_to_old') {
|
} elseif ($mode == 'after_split_to_old') {
|
||||||
$post_text = sprintf($lang['BOT_MESS_SPLITS'], '[url=' . make_url(TOPIC_URL . $new_topic_id) . ']' . htmlCHR($new_topic_title) . '[/url]', profile_url($userdata));
|
$post_text = sprintf(trans('messages.BOT_MESS_SPLITS'), '[url=' . make_url(TOPIC_URL . $new_topic_id) . ']' . htmlCHR($new_topic_title) . '[/url]', profile_url($userdata));
|
||||||
|
|
||||||
$poster_id = BOT_UID;
|
$poster_id = BOT_UID;
|
||||||
$poster_ip = '7f000001';
|
$poster_ip = '7f000001';
|
||||||
|
@ -418,7 +416,7 @@ function insert_post($mode, $topic_id, $forum_id = '', $old_forum_id = '', $new_
|
||||||
if ($row = OLD_DB()->fetch_row($sql)) {
|
if ($row = OLD_DB()->fetch_row($sql)) {
|
||||||
$post_time = $row['post_time'] - 1;
|
$post_time = $row['post_time'] - 1;
|
||||||
|
|
||||||
$post_text = sprintf($lang['BOT_TOPIC_SPLITS'], '[url=' . make_url(TOPIC_URL . $old_topic_id) . ']' . $row['topic_title'] . '[/url]', profile_url($userdata));
|
$post_text = sprintf(trans('messages.BOT_TOPIC_SPLITS'), '[url=' . make_url(TOPIC_URL . $old_topic_id) . ']' . $row['topic_title'] . '[/url]', profile_url($userdata));
|
||||||
|
|
||||||
$poster_id = BOT_UID;
|
$poster_id = BOT_UID;
|
||||||
$poster_ip = '7f000001';
|
$poster_ip = '7f000001';
|
||||||
|
|
|
@ -36,14 +36,14 @@ function language_select($default_lang, $select_name = 'language')
|
||||||
//
|
//
|
||||||
function tz_select($default, $select_name = 'timezone')
|
function tz_select($default, $select_name = 'timezone')
|
||||||
{
|
{
|
||||||
global $sys_timezone, $lang;
|
global $sys_timezone;
|
||||||
|
|
||||||
if (!isset($default)) {
|
if (!isset($default)) {
|
||||||
$default == $sys_timezone;
|
$default = $sys_timezone;
|
||||||
}
|
}
|
||||||
$tz_select = '<select name="' . $select_name . '">';
|
$tz_select = '<select name="' . $select_name . '">';
|
||||||
|
|
||||||
foreach ($lang['TZ'] as $offset => $zone) {
|
foreach (trans('messages.TZ') as $offset => $zone) {
|
||||||
$selected = ($offset == $default) ? ' selected="selected"' : '';
|
$selected = ($offset == $default) ? ' selected="selected"' : '';
|
||||||
$tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>';
|
$tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,6 @@ if (!defined('BB_ROOT')) {
|
||||||
|
|
||||||
function get_torrent_info($attach_id)
|
function get_torrent_info($attach_id)
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$attach_id = (int)$attach_id;
|
$attach_id = (int)$attach_id;
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
|
@ -39,7 +37,7 @@ function get_torrent_info($attach_id)
|
||||||
";
|
";
|
||||||
|
|
||||||
if (!$torrent = OLD_DB()->fetch_row($sql)) {
|
if (!$torrent = OLD_DB()->fetch_row($sql)) {
|
||||||
bb_die($lang['INVALID_ATTACH_ID']);
|
bb_die(trans('messages.INVALID_ATTACH_ID'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $torrent;
|
return $torrent;
|
||||||
|
@ -47,7 +45,7 @@ function get_torrent_info($attach_id)
|
||||||
|
|
||||||
function torrent_auth_check($forum_id, $poster_id)
|
function torrent_auth_check($forum_id, $poster_id)
|
||||||
{
|
{
|
||||||
global $userdata, $lang, $attach_config;
|
global $userdata, $attach_config;
|
||||||
|
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -56,17 +54,15 @@ function torrent_auth_check($forum_id, $poster_id)
|
||||||
$is_auth = auth_user(AUTH_ALL, $forum_id, $userdata);
|
$is_auth = auth_user(AUTH_ALL, $forum_id, $userdata);
|
||||||
|
|
||||||
if ($poster_id != $userdata['user_id'] && !$is_auth['auth_mod']) {
|
if ($poster_id != $userdata['user_id'] && !$is_auth['auth_mod']) {
|
||||||
bb_die($lang['NOT_MODERATOR']);
|
bb_die(trans('messages.NOT_MODERATOR'));
|
||||||
} elseif (!$is_auth['auth_view'] || !$is_auth['auth_attachments'] || $attach_config['disable_mod']) {
|
} elseif (!$is_auth['auth_view'] || !$is_auth['auth_attachments'] || $attach_config['disable_mod']) {
|
||||||
bb_die(sprintf($lang['SORRY_AUTH_READ'], $is_auth['auth_read_type']));
|
bb_die(sprintf(trans('messages.SORRY_AUTH_READ'), $is_auth['auth_read_type']));
|
||||||
}
|
}
|
||||||
return $is_auth;
|
return $is_auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
function tracker_unregister($attach_id, $mode = '')
|
function tracker_unregister($attach_id, $mode = '')
|
||||||
{
|
{
|
||||||
global $lang;
|
|
||||||
|
|
||||||
$attach_id = (int)$attach_id;
|
$attach_id = (int)$attach_id;
|
||||||
$post_id = $topic_id = $forum_id = $info_hash = null;
|
$post_id = $topic_id = $forum_id = $info_hash = null;
|
||||||
|
|
||||||
|
@ -79,7 +75,7 @@ function tracker_unregister($attach_id, $mode = '')
|
||||||
|
|
||||||
if ($mode == 'request') {
|
if ($mode == 'request') {
|
||||||
if (!$torrent) {
|
if (!$torrent) {
|
||||||
bb_die($lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.TOR_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
if (!$torrent['tracker_status']) {
|
if (!$torrent['tracker_status']) {
|
||||||
bb_die('Torrent already unregistered');
|
bb_die('Torrent already unregistered');
|
||||||
|
@ -138,19 +134,19 @@ function tracker_unregister($attach_id, $mode = '')
|
||||||
|
|
||||||
if ($mode == 'request') {
|
if ($mode == 'request') {
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
bb_die($lang['BT_UNREGISTERED']);
|
bb_die(trans('messages.BT_UNREGISTERED'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_torrent($attach_id, $mode = '')
|
function delete_torrent($attach_id, $mode = '')
|
||||||
{
|
{
|
||||||
global $lang, $reg_mode, $topic_id;
|
global $reg_mode, $topic_id;
|
||||||
|
|
||||||
$attach_id = (int)$attach_id;
|
$attach_id = (int)$attach_id;
|
||||||
$reg_mode = $mode;
|
$reg_mode = $mode;
|
||||||
|
|
||||||
if (!$torrent = get_torrent_info($attach_id)) {
|
if (!$torrent = get_torrent_info($attach_id)) {
|
||||||
bb_die($lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.TOR_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_id = $torrent['topic_id'];
|
$topic_id = $torrent['topic_id'];
|
||||||
|
@ -158,7 +154,7 @@ function delete_torrent($attach_id, $mode = '')
|
||||||
$poster_id = $torrent['poster_id'];
|
$poster_id = $torrent['poster_id'];
|
||||||
|
|
||||||
if ($torrent['extension'] !== TORRENT_EXT) {
|
if ($torrent['extension'] !== TORRENT_EXT) {
|
||||||
bb_die($lang['NOT_TORRENT']);
|
bb_die(trans('messages.NOT_TORRENT'));
|
||||||
}
|
}
|
||||||
|
|
||||||
torrent_auth_check($forum_id, $poster_id);
|
torrent_auth_check($forum_id, $poster_id);
|
||||||
|
@ -176,7 +172,7 @@ function change_tor_status($attach_id, $new_tor_status)
|
||||||
$new_tor_status = (int)$new_tor_status;
|
$new_tor_status = (int)$new_tor_status;
|
||||||
|
|
||||||
if (!$torrent = get_torrent_info($attach_id)) {
|
if (!$torrent = get_torrent_info($attach_id)) {
|
||||||
bb_die($lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.TOR_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_id = $torrent['topic_id'];
|
$topic_id = $torrent['topic_id'];
|
||||||
|
@ -196,14 +192,14 @@ function change_tor_status($attach_id, $new_tor_status)
|
||||||
// Set gold/silver type for torrent
|
// Set gold/silver type for torrent
|
||||||
function change_tor_type($attach_id, $tor_status_gold)
|
function change_tor_type($attach_id, $tor_status_gold)
|
||||||
{
|
{
|
||||||
global $topic_id, $lang;
|
global $topic_id;
|
||||||
|
|
||||||
if (!$torrent = get_torrent_info($attach_id)) {
|
if (!$torrent = get_torrent_info($attach_id)) {
|
||||||
bb_die($lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.TOR_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_AM) {
|
if (!IS_AM) {
|
||||||
bb_die($lang['ONLY_FOR_MOD']);
|
bb_die(trans('messages.ONLY_FOR_MOD'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$topic_id = $torrent['topic_id'];
|
$topic_id = $torrent['topic_id'];
|
||||||
|
@ -223,13 +219,13 @@ function change_tor_type($attach_id, $tor_status_gold)
|
||||||
|
|
||||||
function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED, $reg_time = TIMENOW)
|
function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED, $reg_time = TIMENOW)
|
||||||
{
|
{
|
||||||
global $lang, $reg_mode;
|
global $reg_mode;
|
||||||
|
|
||||||
$attach_id = (int)$attach_id;
|
$attach_id = (int)$attach_id;
|
||||||
$reg_mode = $mode;
|
$reg_mode = $mode;
|
||||||
|
|
||||||
if (!$torrent = get_torrent_info($attach_id)) {
|
if (!$torrent = get_torrent_info($attach_id)) {
|
||||||
bb_die($lang['TOR_NOT_FOUND']);
|
bb_die(trans('messages.TOR_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_id = $torrent['post_id'];
|
$post_id = $torrent['post_id'];
|
||||||
|
@ -239,19 +235,19 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
$info_hash = null;
|
$info_hash = null;
|
||||||
|
|
||||||
if ($torrent['extension'] !== TORRENT_EXT) {
|
if ($torrent['extension'] !== TORRENT_EXT) {
|
||||||
return torrent_error_exit($lang['NOT_TORRENT']);
|
return torrent_error_exit(trans('messages.NOT_TORRENT'));
|
||||||
}
|
}
|
||||||
if (!$torrent['allow_reg_tracker']) {
|
if (!$torrent['allow_reg_tracker']) {
|
||||||
return torrent_error_exit($lang['REG_NOT_ALLOWED_IN_THIS_FORUM']);
|
return torrent_error_exit(trans('messages.REG_NOT_ALLOWED_IN_THIS_FORUM'));
|
||||||
}
|
}
|
||||||
if ($post_id != $torrent['topic_first_post_id']) {
|
if ($post_id != $torrent['topic_first_post_id']) {
|
||||||
return torrent_error_exit($lang['ALLOWED_ONLY_1ST_POST_REG']);
|
return torrent_error_exit(trans('messages.ALLOWED_ONLY_1ST_POST_REG'));
|
||||||
}
|
}
|
||||||
if ($torrent['tracker_status']) {
|
if ($torrent['tracker_status']) {
|
||||||
return torrent_error_exit($lang['ALREADY_REG']);
|
return torrent_error_exit(trans('messages.ALREADY_REG'));
|
||||||
}
|
}
|
||||||
if ($this_topic_torrents = get_registered_torrents($topic_id, 'topic')) {
|
if ($this_topic_torrents = get_registered_torrents($topic_id, 'topic')) {
|
||||||
return torrent_error_exit($lang['ONLY_1_TOR_PER_TOPIC']);
|
return torrent_error_exit(trans('messages.ONLY_1_TOR_PER_TOPIC'));
|
||||||
}
|
}
|
||||||
|
|
||||||
torrent_auth_check($forum_id, $torrent['poster_id']);
|
torrent_auth_check($forum_id, $torrent['poster_id']);
|
||||||
|
@ -283,7 +279,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
$announce_urls['main_url'] = config('tp.bt_announce_url');
|
$announce_urls['main_url'] = config('tp.bt_announce_url');
|
||||||
|
|
||||||
if (!$ann || !in_array($ann, $announce_urls)) {
|
if (!$ann || !in_array($ann, $announce_urls)) {
|
||||||
$msg = sprintf($lang['INVALID_ANN_URL'], htmlspecialchars($ann), $announce_urls['main_url']);
|
$msg = sprintf(trans('messages.INVALID_ANN_URL'), htmlspecialchars($ann), $announce_urls['main_url']);
|
||||||
return torrent_error_exit($msg);
|
return torrent_error_exit($msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -291,7 +287,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
$info = (@$tor['info']) ? $tor['info'] : array();
|
$info = (@$tor['info']) ? $tor['info'] : array();
|
||||||
|
|
||||||
if (!isset($info['name']) || !isset($info['piece length']) || !isset($info['pieces']) || strlen($info['pieces']) % 20 != 0) {
|
if (!isset($info['name']) || !isset($info['piece length']) || !isset($info['pieces']) || strlen($info['pieces']) % 20 != 0) {
|
||||||
return torrent_error_exit($lang['TORFILE_INVALID']);
|
return torrent_error_exit(trans('messages.TORFILE_INVALID'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$info_hash = pack('H*', sha1(\Rych\Bencode\Bencode::encode($info)));
|
$info_hash = pack('H*', sha1(\Rych\Bencode\Bencode::encode($info)));
|
||||||
|
@ -304,7 +300,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($row = OLD_DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE info_hash = '$info_hash_sql' LIMIT 1")) {
|
if ($row = OLD_DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE info_hash = '$info_hash_sql' LIMIT 1")) {
|
||||||
$msg = sprintf($lang['BT_REG_FAIL_SAME_HASH'], TOPIC_URL . $row['topic_id']);
|
$msg = sprintf(trans('messages.BT_REG_FAIL_SAME_HASH'), TOPIC_URL . $row['topic_id']);
|
||||||
bb_die($msg);
|
bb_die($msg);
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
}
|
}
|
||||||
|
@ -318,7 +314,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
$totallen += (float)$f['length'];
|
$totallen += (float)$f['length'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return torrent_error_exit($lang['TORFILE_INVALID']);
|
return torrent_error_exit(trans('messages.TORFILE_INVALID'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$size = sprintf('%.0f', (float)$totallen);
|
$size = sprintf('%.0f', (float)$totallen);
|
||||||
|
@ -334,7 +330,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
if ($sql_error['code'] == 1062) {
|
if ($sql_error['code'] == 1062) {
|
||||||
// Duplicate entry
|
// Duplicate entry
|
||||||
|
|
||||||
return torrent_error_exit($lang['BT_REG_FAIL_SAME_HASH']);
|
return torrent_error_exit(trans('messages.BT_REG_FAIL_SAME_HASH'));
|
||||||
}
|
}
|
||||||
bb_die('Could not register torrent on tracker');
|
bb_die('Could not register torrent on tracker');
|
||||||
}
|
}
|
||||||
|
@ -361,7 +357,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
|
|
||||||
if ($reg_mode == 'request' || $reg_mode == 'newtopic') {
|
if ($reg_mode == 'request' || $reg_mode == 'newtopic') {
|
||||||
set_die_append_msg($forum_id, $topic_id);
|
set_die_append_msg($forum_id, $topic_id);
|
||||||
$mess = sprintf($lang['BT_REGISTERED'], DOWNLOAD_URL . $attach_id);
|
$mess = sprintf(trans('messages.BT_REGISTERED'), DOWNLOAD_URL . $attach_id);
|
||||||
bb_die($mess);
|
bb_die($mess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +366,7 @@ function tracker_register($attach_id, $mode = '', $tor_status = TOR_NOT_APPROVED
|
||||||
|
|
||||||
function send_torrent_with_passkey($filename)
|
function send_torrent_with_passkey($filename)
|
||||||
{
|
{
|
||||||
global $attachment, $auth_pages, $userdata, $lang;
|
global $attachment, $auth_pages, $userdata;
|
||||||
|
|
||||||
if (!config('tp.bt_add_auth_key') || $attachment['extension'] !== TORRENT_EXT || !$size = @filesize($filename)) {
|
if (!config('tp.bt_add_auth_key') || $attachment['extension'] !== TORRENT_EXT || !$size = @filesize($filename)) {
|
||||||
return;
|
return;
|
||||||
|
@ -402,11 +398,11 @@ function send_torrent_with_passkey($filename)
|
||||||
$topic_id = $topic_id_row['topic_id'];
|
$topic_id = $topic_id_row['topic_id'];
|
||||||
|
|
||||||
if (!$attachment['tracker_status']) {
|
if (!$attachment['tracker_status']) {
|
||||||
bb_die($lang['PASSKEY_ERR_TOR_NOT_REG']);
|
bb_die(trans('messages.PASSKEY_ERR_TOR_NOT_REG'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bf($userdata['user_opt'], 'user_opt', 'dis_passkey') && !IS_GUEST) {
|
if (bf($userdata['user_opt'], 'user_opt', 'dis_passkey') && !IS_GUEST) {
|
||||||
bb_die($lang['DISALLOWED']);
|
bb_die(trans('messages.DISALLOWED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($bt_userdata = get_bt_userdata($user_id)) {
|
if ($bt_userdata = get_bt_userdata($user_id)) {
|
||||||
|
@ -435,7 +431,7 @@ function send_torrent_with_passkey($filename)
|
||||||
");
|
");
|
||||||
|
|
||||||
if (!isset($dl['user_status']) || $dl['user_status'] != DL_STATUS_COMPLETE) {
|
if (!isset($dl['user_status']) || $dl['user_status'] != DL_STATUS_COMPLETE) {
|
||||||
bb_die(sprintf($lang['BT_LOW_RATIO_FOR_DL'], round($user_ratio, 2), "search.php?dlu=$user_id&dlc=1"));
|
bb_die(sprintf(trans('messages.BT_LOW_RATIO_FOR_DL'), round($user_ratio, 2), "search.php?dlu=$user_id&dlc=1"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -511,7 +507,7 @@ function send_torrent_with_passkey($filename)
|
||||||
|
|
||||||
function generate_passkey($user_id, $force_generate = false)
|
function generate_passkey($user_id, $force_generate = false)
|
||||||
{
|
{
|
||||||
global $lang, $sql;
|
global $sql;
|
||||||
|
|
||||||
$user_id = (int)$user_id;
|
$user_id = (int)$user_id;
|
||||||
|
|
||||||
|
@ -524,7 +520,7 @@ function generate_passkey($user_id, $force_generate = false)
|
||||||
}
|
}
|
||||||
if ($row = OLD_DB()->sql_fetchrow($result)) {
|
if ($row = OLD_DB()->sql_fetchrow($result)) {
|
||||||
if (bf($row['user_opt'], 'user_opt', 'dis_passkey')) {
|
if (bf($row['user_opt'], 'user_opt', 'dis_passkey')) {
|
||||||
bb_die($lang['NOT_AUTHORISED']);
|
bb_die(trans('messages.NOT_AUTHORISED'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -586,7 +582,7 @@ function get_registered_torrents($id, $mode)
|
||||||
|
|
||||||
function torrent_error_exit($message)
|
function torrent_error_exit($message)
|
||||||
{
|
{
|
||||||
global $reg_mode, $return_message, $lang;
|
global $reg_mode, $return_message;
|
||||||
|
|
||||||
$msg = '';
|
$msg = '';
|
||||||
|
|
||||||
|
@ -594,7 +590,7 @@ function torrent_error_exit($message)
|
||||||
if (isset($return_message)) {
|
if (isset($return_message)) {
|
||||||
$msg .= $return_message . '<br /><br /><hr /><br />';
|
$msg .= $return_message . '<br /><br /><hr /><br />';
|
||||||
}
|
}
|
||||||
$msg .= '<b>' . $lang['BT_REG_FAIL'] . '</b><br /><br />';
|
$msg .= '<b>' . trans('messages.BT_REG_FAIL') . '</b><br /><br />';
|
||||||
}
|
}
|
||||||
|
|
||||||
bb_die($msg . $message);
|
bb_die($msg . $message);
|
||||||
|
|
|
@ -14,7 +14,7 @@ if (!defined('BB_ROOT')) {
|
||||||
// !!! $username должен быть предварительно обработан clean_username() !!!
|
// !!! $username должен быть предварительно обработан clean_username() !!!
|
||||||
function validate_username($username, $check_ban_and_taken = true)
|
function validate_username($username, $check_ban_and_taken = true)
|
||||||
{
|
{
|
||||||
global $user, $lang;
|
global $user;
|
||||||
|
|
||||||
static $name_chars = 'a-z0-9а-яё_@$%^&;(){}\#\-\'.:+ ';
|
static $name_chars = 'a-z0-9а-яё_@$%^&;(){}\#\-\'.:+ ';
|
||||||
|
|
||||||
|
@ -23,22 +23,22 @@ function validate_username($username, $check_ban_and_taken = true)
|
||||||
|
|
||||||
// Length
|
// Length
|
||||||
if (mb_strlen($username, 'UTF-8') > USERNAME_MAX_LENGTH) {
|
if (mb_strlen($username, 'UTF-8') > USERNAME_MAX_LENGTH) {
|
||||||
return $lang['USERNAME_TOO_LONG'];
|
return trans('messages.USERNAME_TOO_LONG');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mb_strlen($username, 'UTF-8') < USERNAME_MIN_LENGTH) {
|
if (mb_strlen($username, 'UTF-8') < USERNAME_MIN_LENGTH) {
|
||||||
return $lang['USERNAME_TOO_SMALL'];
|
return trans('messages.USERNAME_TOO_SMALL');
|
||||||
}
|
}
|
||||||
// Allowed symbols
|
// Allowed symbols
|
||||||
if (!preg_match('#^[' . $name_chars . ']+$#iu', $username, $m)) {
|
if (!preg_match('#^[' . $name_chars . ']+$#iu', $username, $m)) {
|
||||||
$invalid_chars = preg_replace('#[' . $name_chars . ']#iu', '', $username);
|
$invalid_chars = preg_replace('#[' . $name_chars . ']#iu', '', $username);
|
||||||
return "{$lang['USERNAME_INVALID']}: <b>" . htmlCHR($invalid_chars) . "</b>";
|
return "{trans('messages.USERNAME_INVALID')}: <b>" . htmlCHR($invalid_chars) . "</b>";
|
||||||
}
|
}
|
||||||
// HTML Entities
|
// HTML Entities
|
||||||
if (preg_match_all('/&(#[0-9]+|[a-z]+);/iu', $username, $m)) {
|
if (preg_match_all('/&(#[0-9]+|[a-z]+);/iu', $username, $m)) {
|
||||||
foreach ($m[0] as $ent) {
|
foreach ($m[0] as $ent) {
|
||||||
if (!preg_match('/^(&|<|>)$/iu', $ent)) {
|
if (!preg_match('/^(&|<|>)$/iu', $ent)) {
|
||||||
return $lang['USERNAME_INVALID'];
|
return trans('messages.USERNAME_INVALID');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ function validate_username($username, $check_ban_and_taken = true)
|
||||||
|
|
||||||
if ($row = OLD_DB()->fetch_row("SELECT username FROM " . BB_USERS . " WHERE username = '$username_sql' LIMIT 1")) {
|
if ($row = OLD_DB()->fetch_row("SELECT username FROM " . BB_USERS . " WHERE username = '$username_sql' LIMIT 1")) {
|
||||||
if ((!IS_GUEST && $row['username'] != $user->name) || IS_GUEST) {
|
if ((!IS_GUEST && $row['username'] != $user->name) || IS_GUEST) {
|
||||||
return $lang['USERNAME_TAKEN'];
|
return trans('messages.USERNAME_TAKEN');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Запрещено
|
// Запрещено
|
||||||
|
@ -59,7 +59,7 @@ function validate_username($username, $check_ban_and_taken = true)
|
||||||
}
|
}
|
||||||
if ($banned_names_exp = implode('|', $banned_names)) {
|
if ($banned_names_exp = implode('|', $banned_names)) {
|
||||||
if (preg_match("#^($banned_names_exp)$#iu", $username)) {
|
if (preg_match("#^($banned_names_exp)$#iu", $username)) {
|
||||||
return $lang['USERNAME_DISALLOWED'];
|
return trans('messages.USERNAME_DISALLOWED');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,13 +70,13 @@ function validate_username($username, $check_ban_and_taken = true)
|
||||||
// Check to see if email address is banned or already present in the DB
|
// Check to see if email address is banned or already present in the DB
|
||||||
function validate_email($email, $check_ban_and_taken = true)
|
function validate_email($email, $check_ban_and_taken = true)
|
||||||
{
|
{
|
||||||
global $lang, $userdata;
|
global $userdata;
|
||||||
|
|
||||||
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||||
return $lang['EMAIL_INVALID'];
|
return trans('messages.EMAIL_INVALID');
|
||||||
}
|
}
|
||||||
if (strlen($email) > USEREMAIL_MAX_LENGTH) {
|
if (strlen($email) > USEREMAIL_MAX_LENGTH) {
|
||||||
return $lang['EMAIL_TOO_LONG'];
|
return trans('messages.EMAIL_TOO_LONG');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($check_ban_and_taken) {
|
if ($check_ban_and_taken) {
|
||||||
|
@ -87,7 +87,7 @@ function validate_email($email, $check_ban_and_taken = true)
|
||||||
}
|
}
|
||||||
if ($banned_emails_exp = implode('|', $banned_emails)) {
|
if ($banned_emails_exp = implode('|', $banned_emails)) {
|
||||||
if (preg_match("#^($banned_emails_exp)$#i", $email)) {
|
if (preg_match("#^($banned_emails_exp)$#i", $email)) {
|
||||||
return sprintf($lang['EMAIL_BANNED'], $email);
|
return sprintf(trans('messages.EMAIL_BANNED'), $email);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ function validate_email($email, $check_ban_and_taken = true)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $lang['EMAIL_TAKEN'];
|
return trans('messages.EMAIL_TAKEN');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ if (version_compare(PHP_VERSION, '7.0', '<')) {
|
||||||
* Define some basic configuration arrays
|
* Define some basic configuration arrays
|
||||||
*/
|
*/
|
||||||
unset($stopwords, $synonyms_match, $synonyms_replace);
|
unset($stopwords, $synonyms_match, $synonyms_replace);
|
||||||
$userdata = $theme = $images = $lang = $nav_links = $bf = $attach_config = [];
|
$userdata = $theme = $images = $nav_links = $bf = $attach_config = [];
|
||||||
$gen_simple_header = false;
|
$gen_simple_header = false;
|
||||||
$user = null;
|
$user = null;
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ if (!defined('BB_ROOT')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $lang;
|
|
||||||
|
|
||||||
// Obtain user/online information
|
// Obtain user/online information
|
||||||
$logged_online = $guests_online = 0;
|
$logged_online = $guests_online = 0;
|
||||||
$time_online = TIMENOW - 300;
|
$time_online = TIMENOW - 300;
|
||||||
|
@ -95,7 +93,7 @@ if ($ulist) {
|
||||||
if (count($users) > 200) {
|
if (count($users) > 200) {
|
||||||
$style = 'margin: 3px 0; padding: 2px 4px; border: 1px inset; height: 200px; overflow: auto;';
|
$style = 'margin: 3px 0; padding: 2px 4px; border: 1px inset; height: 200px; overflow: auto;';
|
||||||
$block[] = "<div style=\"$style\">\n" . implode(",\n", $users) . "</div>\n";
|
$block[] = "<div style=\"$style\">\n" . implode(",\n", $users) . "</div>\n";
|
||||||
$short[] = '<a href="index.php?online_full=1#online">' . $lang['USERS'] . ': ' . count($users) . '</a>';
|
$short[] = '<a href="index.php?online_full=1#online">' . trans('messages.USERS') . ': ' . count($users) . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$inline[] = implode(",\n", $users);
|
$inline[] = implode(",\n", $users);
|
||||||
$short[] = implode(",\n", $users);
|
$short[] = implode(",\n", $users);
|
||||||
|
@ -109,9 +107,9 @@ if ($ulist) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$online['userlist']) {
|
if (!$online['userlist']) {
|
||||||
$online['userlist'] = $online_short['userlist'] = $lang['NONE'];
|
$online['userlist'] = $online_short['userlist'] = trans('messages.NONE');
|
||||||
} elseif (isset($_REQUEST['f'])) {
|
} elseif (isset($_REQUEST['f'])) {
|
||||||
$online['userlist'] = $online_short['userlist'] = $lang['BROWSING_FORUM'] . ' ' . $online['userlist'];
|
$online['userlist'] = $online_short['userlist'] = trans('messages.BROWSING_FORUM') . ' ' . $online['userlist'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_online = $logged_online + $guests_online;
|
$total_online = $logged_online + $guests_online;
|
||||||
|
@ -123,7 +121,7 @@ if ($total_online > config('tp.record_online_users')) {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
$online['stat'] = $online_short['stat'] = sprintf($lang['ONLINE_USERS'], $total_online, $logged_online, $guests_online);
|
$online['stat'] = $online_short['stat'] = sprintf(trans('messages.ONLINE_USERS'), $total_online, $logged_online, $guests_online);
|
||||||
|
|
||||||
$online['cnt'] = $online_short['cnt'] = <<<HTML
|
$online['cnt'] = $online_short['cnt'] = <<<HTML
|
||||||
[
|
[
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
|
||||||
die(basename(__FILE__));
|
die(basename(__FILE__));
|
||||||
}
|
}
|
||||||
|
|
||||||
global $userdata, $template, $DBS, $lang;
|
global $userdata, $template, $DBS;
|
||||||
|
|
||||||
if (!empty($template)) {
|
if (!empty($template)) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
|
@ -35,20 +35,20 @@ if ($show_dbg_info) {
|
||||||
$gen_time = utime() - TIMESTART;
|
$gen_time = utime() - TIMESTART;
|
||||||
$gen_time_txt = sprintf('%.3f', $gen_time);
|
$gen_time_txt = sprintf('%.3f', $gen_time);
|
||||||
$gzip_text = UA_GZIP_SUPPORTED ? 'GZIP ' : '<s>GZIP</s> ';
|
$gzip_text = UA_GZIP_SUPPORTED ? 'GZIP ' : '<s>GZIP</s> ';
|
||||||
$gzip_text .= config('tp.gzip_compress') ? $lang['ON'] : $lang['OFF'];
|
$gzip_text .= config('tp.gzip_compress') ? trans('messages.ON') : trans('messages.OFF');
|
||||||
|
|
||||||
$stat = '[ ' . $lang['EXECUTION_TIME'] . " $gen_time_txt " . $lang['SEC'];
|
$stat = '[ ' . trans('messages.EXECUTION_TIME') . " $gen_time_txt " . trans('messages.SEC');
|
||||||
|
|
||||||
if (!empty($DBS)) {
|
if (!empty($DBS)) {
|
||||||
$sql_t = $DBS->sql_timetotal;
|
$sql_t = $DBS->sql_timetotal;
|
||||||
$sql_time_txt = ($sql_t) ? sprintf('%.3f ' . $lang['SEC'] . ' (%d%%) · ', $sql_t, round($sql_t * 100 / $gen_time)) : '';
|
$sql_time_txt = ($sql_t) ? sprintf('%.3f ' . trans('messages.SEC') . ' (%d%%) · ', $sql_t, round($sql_t * 100 / $gen_time)) : '';
|
||||||
$num_q = $DBS->num_queries;
|
$num_q = $DBS->num_queries;
|
||||||
$stat .= " | MySQL: {$sql_time_txt}{$num_q} " . $lang['QUERIES'];
|
$stat .= " | MySQL: {$sql_time_txt}{$num_q} " . trans('messages.QUERIES');
|
||||||
}
|
}
|
||||||
|
|
||||||
$stat .= " | $gzip_text";
|
$stat .= " | $gzip_text";
|
||||||
|
|
||||||
$stat .= ' | ' . $lang['MEMORY'];
|
$stat .= ' | ' . trans('messages.MEMORY');
|
||||||
$stat .= humn_size(config('tp.mem_on_start'), 2) . ' / ';
|
$stat .= humn_size(config('tp.mem_on_start'), 2) . ' / ';
|
||||||
$stat .= humn_size(sys('mem_peak'), 2) . ' / ';
|
$stat .= humn_size(sys('mem_peak'), 2) . ' / ';
|
||||||
$stat .= humn_size(sys('mem'), 2);
|
$stat .= humn_size(sys('mem'), 2);
|
||||||
|
@ -58,7 +58,7 @@ if ($show_dbg_info) {
|
||||||
for ($i = 0; $i < 3; $i++) {
|
for ($i = 0; $i < 3; $i++) {
|
||||||
$l[$i] = round($l[$i], 1);
|
$l[$i] = round($l[$i], 1);
|
||||||
}
|
}
|
||||||
$stat .= " | " . $lang['LIMIT'] . " $l[0] $l[1] $l[2]";
|
$stat .= " | " . trans('messages.LIMIT') . " $l[0] $l[1] $l[2]";
|
||||||
}
|
}
|
||||||
|
|
||||||
$stat .= ' ]';
|
$stat .= ' ]';
|
||||||
|
@ -87,7 +87,7 @@ echo '
|
||||||
|
|
||||||
if (defined('REQUESTED_PAGE') && !defined('DISABLE_CACHING_OUTPUT')) {
|
if (defined('REQUESTED_PAGE') && !defined('DISABLE_CACHING_OUTPUT')) {
|
||||||
if (IS_GUEST === true) {
|
if (IS_GUEST === true) {
|
||||||
caching_output(true, 'store', REQUESTED_PAGE . '_guest_' . config('tp.default_lang'));
|
caching_output(true, 'store', REQUESTED_PAGE . '_guest_' . config('app.locale'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ if (defined('PAGE_HEADER_SENT')) {
|
||||||
|
|
||||||
// Parse and show the overall page header
|
// Parse and show the overall page header
|
||||||
|
|
||||||
global $page_cfg, $userdata, $user, $ads, $template, $lang, $images;
|
global $page_cfg, $userdata, $user, $ads, $template, $images;
|
||||||
|
|
||||||
$logged_in = (int)!empty($userdata['session_logged_in']);
|
$logged_in = (int)!empty($userdata['session_logged_in']);
|
||||||
|
|
||||||
|
@ -50,20 +50,20 @@ if (defined('SHOW_ONLINE') && SHOW_ONLINE) {
|
||||||
'TOTAL_USERS_ONLINE' => ${$online_list}['stat'],
|
'TOTAL_USERS_ONLINE' => ${$online_list}['stat'],
|
||||||
'LOGGED_IN_USER_LIST' => ${$online_list}['userlist'],
|
'LOGGED_IN_USER_LIST' => ${$online_list}['userlist'],
|
||||||
'USERS_ONLINE_COUNTS' => ${$online_list}['cnt'],
|
'USERS_ONLINE_COUNTS' => ${$online_list}['cnt'],
|
||||||
'RECORD_USERS' => sprintf($lang['RECORD_ONLINE_USERS'], config('tp.record_online_users'), bb_date(config('tp.record_online_date'))),
|
'RECORD_USERS' => sprintf(trans('messages.RECORD_ONLINE_USERS'), config('tp.record_online_users'), bb_date(config('tp.record_online_date'))),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Info about new private messages
|
// Info about new private messages
|
||||||
$icon_pm = $images['pm_no_new_msg'];
|
$icon_pm = $images['pm_no_new_msg'];
|
||||||
$pm_info = $lang['NO_NEW_PM'];
|
$pm_info = trans('messages.NO_NEW_PM');
|
||||||
$have_new_pm = $have_unread_pm = 0;
|
$have_new_pm = $have_unread_pm = 0;
|
||||||
|
|
||||||
if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
||||||
if ($userdata['user_new_privmsg']) {
|
if ($userdata['user_new_privmsg']) {
|
||||||
$have_new_pm = $userdata['user_new_privmsg'];
|
$have_new_pm = $userdata['user_new_privmsg'];
|
||||||
$icon_pm = $images['pm_new_msg'];
|
$icon_pm = $images['pm_new_msg'];
|
||||||
$pm_info = declension($userdata['user_new_privmsg'], $lang['NEW_PMS_DECLENSION'], $lang['NEW_PMS_FORMAT']);
|
$pm_info = declension($userdata['user_new_privmsg'], trans('messages.NEW_PMS_DECLENSION'), trans('messages.NEW_PMS_FORMAT'));
|
||||||
|
|
||||||
if ($userdata['user_last_privmsg'] > $userdata['user_lastvisit'] && defined('IN_PM')) {
|
if ($userdata['user_last_privmsg'] > $userdata['user_lastvisit'] && defined('IN_PM')) {
|
||||||
$userdata['user_last_privmsg'] = $userdata['user_lastvisit'];
|
$userdata['user_last_privmsg'] = $userdata['user_lastvisit'];
|
||||||
|
@ -97,7 +97,7 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pm_info = declension($userdata['user_unread_privmsg'], $lang['UNREAD_PMS_DECLENSION'], $lang['UNREAD_PMS_FORMAT']);
|
$pm_info = declension($userdata['user_unread_privmsg'], trans('messages.UNREAD_PMS_DECLENSION'), trans('messages.UNREAD_PMS_FORMAT'));
|
||||||
$have_unread_pm = true;
|
$have_unread_pm = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ $template->assign_vars(array(
|
||||||
|
|
||||||
'SITENAME' => config('tp.sitename'),
|
'SITENAME' => config('tp.sitename'),
|
||||||
'U_INDEX' => BB_ROOT . "index.php",
|
'U_INDEX' => BB_ROOT . "index.php",
|
||||||
'T_INDEX' => sprintf($lang['FORUM_INDEX'], config('tp.sitename')),
|
'T_INDEX' => sprintf(trans('messages.FORUM_INDEX'), config('tp.sitename')),
|
||||||
|
|
||||||
'IS_GUEST' => IS_GUEST,
|
'IS_GUEST' => IS_GUEST,
|
||||||
'IS_USER' => IS_USER,
|
'IS_USER' => IS_USER,
|
||||||
|
@ -134,8 +134,8 @@ $template->assign_vars(array(
|
||||||
'FORUM_PATH' => FORUM_PATH,
|
'FORUM_PATH' => FORUM_PATH,
|
||||||
'FULL_URL' => FULL_URL,
|
'FULL_URL' => FULL_URL,
|
||||||
|
|
||||||
'CURRENT_TIME' => sprintf($lang['CURRENT_TIME'], bb_date(TIMENOW, config('tp.last_visit_date_format'), false)),
|
'CURRENT_TIME' => sprintf(trans('messages.CURRENT_TIME'), bb_date(TIMENOW, config('tp.last_visit_date_format'), false)),
|
||||||
'S_TIMEZONE' => preg_replace('/\(.*?\)/', '', sprintf($lang['ALL_TIMES'], $lang['TZ'][str_replace(',', '.', (float)config('tp.board_timezone'))])),
|
'S_TIMEZONE' => preg_replace('/\(.*?\)/', '', sprintf(trans('messages.ALL_TIMES'), trans('messages.TZ.' . str_replace(',', '.', (float)config('tp.board_timezone'))))),
|
||||||
'BOARD_TIMEZONE' => config('tp.board_timezone'),
|
'BOARD_TIMEZONE' => config('tp.board_timezone'),
|
||||||
|
|
||||||
'PM_INFO' => $pm_info,
|
'PM_INFO' => $pm_info,
|
||||||
|
@ -208,7 +208,7 @@ $template->assign_vars(array(
|
||||||
'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5",
|
'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5",
|
||||||
'U_WATCHED_TOPICS' => 'profile.php?mode=watch',
|
'U_WATCHED_TOPICS' => 'profile.php?mode=watch',
|
||||||
|
|
||||||
/** TODO: конфигурация используемая в шаблонах, избавиться */
|
/** TODO: конфигурация, используемая в шаблонах, избавиться */
|
||||||
'CFG_GS_ENABLED' => config('tracker.gold_silver_enabled'),
|
'CFG_GS_ENABLED' => config('tracker.gold_silver_enabled'),
|
||||||
'CFG_UAU' => config('tp.user_agreement_url'),
|
'CFG_UAU' => config('tp.user_agreement_url'),
|
||||||
'CFG_CHU' => config('tp.copyright_holders_url'),
|
'CFG_CHU' => config('tp.copyright_holders_url'),
|
||||||
|
@ -245,6 +245,11 @@ $template->assign_vars(array(
|
||||||
'CFG_TP_RD' => config('tp.tp_release_date'),
|
'CFG_TP_RD' => config('tp.tp_release_date'),
|
||||||
'CFG_TP_CN' => config('tp.tp_release_codename'),
|
'CFG_TP_CN' => config('tp.tp_release_codename'),
|
||||||
'CFG_TP_VER' => config('tp.tp_version'),
|
'CFG_TP_VER' => config('tp.tp_version'),
|
||||||
|
|
||||||
|
/** TODO: подмененные языковые, используемые в шаблонах, избавиться */
|
||||||
|
'LNG_GENDER_O' => trans('messages.GENDER_SELECT.0'),
|
||||||
|
'LNG_GENDER_1' => trans('messages.GENDER_SELECT.1'),
|
||||||
|
'LNG_GENDER_2' => trans('messages.GENDER_SELECT.2'),
|
||||||
));
|
));
|
||||||
|
|
||||||
if (!empty(config('page.show_torhelp.' . BB_SCRIPT)) && !empty($userdata['torhelp'])) {
|
if (!empty(config('page.show_torhelp.' . BB_SCRIPT)) && !empty($userdata['torhelp'])) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ $edit_tpl_mode = ($can_edit_tpl && !empty($_REQUEST['edit_tpl']));
|
||||||
$sql = "SELECT forum_name, allow_reg_tracker, forum_tpl_id FROM " . BB_FORUMS . " WHERE forum_id = $forum_id LIMIT 1";
|
$sql = "SELECT forum_name, allow_reg_tracker, forum_tpl_id FROM " . BB_FORUMS . " WHERE forum_id = $forum_id LIMIT 1";
|
||||||
|
|
||||||
if (!$forum_id || !$f_data = OLD_DB()->fetch_row($sql)) {
|
if (!$forum_id || !$f_data = OLD_DB()->fetch_row($sql)) {
|
||||||
bb_die($lang['FORUM_NOT_EXIST']);
|
bb_die(trans('messages.FORUM_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
// tpl_data
|
// tpl_data
|
||||||
$tpl_data = array();
|
$tpl_data = array();
|
||||||
|
@ -31,7 +31,7 @@ if (!$f_data['forum_tpl_id'] || !$tpl_data = OLD_DB()->fetch_row($sql)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGE_TITLE' => $lang['NEW_RELEASE'],
|
'PAGE_TITLE' => trans('messages.NEW_RELEASE'),
|
||||||
'FORUM_NAME' => $f_data['forum_name'],
|
'FORUM_NAME' => $f_data['forum_name'],
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'TPL_FORM_ACTION' => POSTING_URL . "?mode=newtopic&f=$forum_id",
|
'TPL_FORM_ACTION' => POSTING_URL . "?mode=newtopic&f=$forum_id",
|
||||||
|
|
|
@ -30,7 +30,7 @@ $show_dl_buttons = ($dl_topic && config('tp.bt_show_dl_list_buttons'));
|
||||||
// link to clear DL-List
|
// link to clear DL-List
|
||||||
$template->assign_vars(array('S_DL_DELETE' => false));
|
$template->assign_vars(array('S_DL_DELETE' => false));
|
||||||
if (($is_auth['auth_mod']) && ($t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL)) {
|
if (($is_auth['auth_mod']) && ($t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL)) {
|
||||||
$s_dl_delete = "<br /><a href=\"dl_list.php?mode=dl_delete&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'] . '">' . $lang['DL_LIST_DEL'] . '</a>';
|
$s_dl_delete = "<br /><a href=\"dl_list.php?mode=dl_delete&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'] . '">' . trans('messages.DL_LIST_DEL') . '</a>';
|
||||||
$template->assign_vars(array('S_DL_DELETE' => $s_dl_delete));
|
$template->assign_vars(array('S_DL_DELETE' => $s_dl_delete));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ if ($show_dl_list) {
|
||||||
$dl_cat[$i] = "<span class=$desc>" . $dl_cat[$i] . '</span>';
|
$dl_cat[$i] = "<span class=$desc>" . $dl_cat[$i] . '</span>';
|
||||||
|
|
||||||
$template->assign_block_vars('dl_users.users_row', array(
|
$template->assign_block_vars('dl_users.users_row', array(
|
||||||
'DL_OPTION_NAME' => $lang[strtoupper($desc)],
|
'DL_OPTION_NAME' => trans('messages.' . strtoupper($desc)),
|
||||||
'DL_OPTION_USERS' => $dl_cat[$i],
|
'DL_OPTION_USERS' => $dl_cat[$i],
|
||||||
'DL_COUNT' => $dl_count[$i],
|
'DL_COUNT' => $dl_count[$i],
|
||||||
'DL_USERS_DIV_STYLE' => $dl_users_div_style,
|
'DL_USERS_DIV_STYLE' => $dl_users_div_style,
|
||||||
|
@ -93,7 +93,7 @@ if ($show_dl_list) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$template->assign_block_vars('dl_counts.count_row', array(
|
$template->assign_block_vars('dl_counts.count_row', array(
|
||||||
'DL_OPTION_NAME' => $lang[strtoupper($desc)],
|
'DL_OPTION_NAME' => trans('messages.' . strtoupper($desc)),
|
||||||
'DL_OPTION_USERS' => $dl_count[$i],
|
'DL_OPTION_USERS' => $dl_count[$i],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ if (!($result = OLD_DB()->sql_query($sql))) {
|
||||||
|
|
||||||
if ($row = OLD_DB()->sql_fetchrow($result)) {
|
if ($row = OLD_DB()->sql_fetchrow($result)) {
|
||||||
if ($row['user_active'] && trim($row['user_actkey']) == '') {
|
if ($row['user_active'] && trim($row['user_actkey']) == '') {
|
||||||
bb_die($lang['ALREADY_ACTIVATED']);
|
bb_die(trans('messages.ALREADY_ACTIVATED'));
|
||||||
} elseif ((trim($row['user_actkey']) == trim($_GET['act_key'])) && (trim($row['user_actkey']) != '')) {
|
} elseif ((trim($row['user_actkey']) == trim($_GET['act_key'])) && (trim($row['user_actkey']) != '')) {
|
||||||
$sql_update_pass = ($row['user_newpasswd'] != '') ? ", user_password = '" . md5(md5($row['user_newpasswd'])) . "', user_newpasswd = ''" : '';
|
$sql_update_pass = ($row['user_newpasswd'] != '') ? ", user_password = '" . md5(md5($row['user_newpasswd'])) . "', user_newpasswd = ''" : '';
|
||||||
|
|
||||||
|
@ -35,11 +35,11 @@ if ($row = OLD_DB()->sql_fetchrow($result)) {
|
||||||
bb_die('Could not update users table');
|
bb_die('Could not update users table');
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = ($sql_update_pass == '') ? $lang['ACCOUNT_ACTIVE'] : $lang['PASSWORD_ACTIVATED'];
|
$message = ($sql_update_pass == '') ? trans('messages.ACCOUNT_ACTIVE') : trans('messages.PASSWORD_ACTIVATED');
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['WRONG_ACTIVATION']);
|
bb_die(trans('messages.WRONG_ACTIVATION'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_SUCH_USER']);
|
bb_die(trans('messages.NO_SUCH_USER'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ if (config('tp.seed_bonus_enabled') && config('tp.bonus_upload') && config('tp.b
|
||||||
$upload_row = unserialize(config('tp.bonus_upload'));
|
$upload_row = unserialize(config('tp.bonus_upload'));
|
||||||
$price_row = unserialize(config('tp.bonus_upload_price'));
|
$price_row = unserialize(config('tp.bonus_upload_price'));
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['EXCHANGE_NOT']);
|
bb_die(trans('messages.EXCHANGE_NOT'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['bonus_id'])) {
|
if (isset($_POST['bonus_id'])) {
|
||||||
|
@ -38,7 +38,7 @@ if (isset($_POST['bonus_id'])) {
|
||||||
if ($userdata['user_points'] < $points) {
|
if ($userdata['user_points'] < $points) {
|
||||||
meta_refresh('index.php', 5);
|
meta_refresh('index.php', 5);
|
||||||
|
|
||||||
$message = $lang['BONUS_NOT_SUCCES'] . '<br /><br /><a href="' . BONUS_URL . '">' . $lang['BONUS_RETURN'] . '</a><br /><br /><a href="' . PROFILE_URL . $userdata['user_id'] . '">' . $lang['RETURN_PROFILE'] . '</a><br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="index.php">', '</a>');
|
$message = trans('messages.BONUS_NOT_SUCCES') . '<br /><br /><a href="' . BONUS_URL . '">' . trans('messages.BONUS_RETURN') . '</a><br /><br /><a href="' . PROFILE_URL . $userdata['user_id'] . '">' . trans('messages.RETURN_PROFILE') . '</a><br /><br />' . sprintf(trans('messages.CLICK_RETURN_INDEX'), '<a href="index.php">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
}
|
}
|
||||||
|
@ -55,16 +55,16 @@ if (isset($_POST['bonus_id'])) {
|
||||||
cache_rm_user_sessions($user_id);
|
cache_rm_user_sessions($user_id);
|
||||||
meta_refresh(BONUS_URL, 5);
|
meta_refresh(BONUS_URL, 5);
|
||||||
|
|
||||||
$message = sprintf($lang['BONUS_SUCCES'], humn_size($upload_row[$id] * 1024 * 1024 * 1024));
|
$message = sprintf(trans('messages.BONUS_SUCCES'), humn_size($upload_row[$id] * 1024 * 1024 * 1024));
|
||||||
$message .= '<br /><br /><a href="' . BONUS_URL . '">' . $lang['BONUS_RETURN'] . '</a><br /><br /><a href="' . PROFILE_URL . $userdata['user_id'] . '">' . $lang['RETURN_PROFILE'] . '</a><br /><br />' . sprintf($lang['CLICK_RETURN_INDEX'], '<a href="index.php">', '</a>');
|
$message .= '<br /><br /><a href="' . BONUS_URL . '">' . trans('messages.BONUS_RETURN') . '</a><br /><br /><a href="' . PROFILE_URL . $userdata['user_id'] . '">' . trans('messages.RETURN_PROFILE') . '</a><br /><br />' . sprintf(trans('messages.CLICK_RETURN_INDEX'), '<a href="index.php">', '</a>');
|
||||||
|
|
||||||
bb_die($message);
|
bb_die($message);
|
||||||
} else {
|
} else {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_USER_PROFILE' => PROFILE_URL . $user_id,
|
'U_USER_PROFILE' => PROFILE_URL . $user_id,
|
||||||
'S_MODE_ACTION' => 'profile.php?mode=bonus',
|
'S_MODE_ACTION' => 'profile.php?mode=bonus',
|
||||||
'PAGE_TITLE' => $lang['EXCHANGE_BONUS'],
|
'PAGE_TITLE' => trans('messages.EXCHANGE_BONUS'),
|
||||||
'MY_BONUS' => sprintf($lang['MY_BONUS'], $user_points),
|
'MY_BONUS' => sprintf(trans('messages.MY_BONUS'), $user_points),
|
||||||
));
|
));
|
||||||
|
|
||||||
foreach ($price_row as $i => $price) {
|
foreach ($price_row as $i => $price) {
|
||||||
|
@ -76,8 +76,8 @@ if (isset($_POST['bonus_id'])) {
|
||||||
$template->assign_block_vars('bonus_upload', array(
|
$template->assign_block_vars('bonus_upload', array(
|
||||||
'ROW_CLASS' => !($i % 2) ? 'row2' : 'row1',
|
'ROW_CLASS' => !($i % 2) ? 'row2' : 'row1',
|
||||||
'ID' => $i,
|
'ID' => $i,
|
||||||
'DESC' => sprintf($lang['BONUS_UPLOAD_DESC'], humn_size($upload_row[$i] * 1024 * 1024 * 1024)),
|
'DESC' => sprintf(trans('messages.BONUS_UPLOAD_DESC'), humn_size($upload_row[$i] * 1024 * 1024 * 1024)),
|
||||||
'PRICE' => sprintf($lang['BONUS_UPLOAD_PRICE'], $class, sprintf('%.2f', $price)),
|
'PRICE' => sprintf(trans('messages.BONUS_UPLOAD_PRICE'), $class, sprintf('%.2f', $price)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ set_die_append_msg();
|
||||||
if (!empty($_GET[POST_USERS_URL]) || !empty($_POST[POST_USERS_URL])) {
|
if (!empty($_GET[POST_USERS_URL]) || !empty($_POST[POST_USERS_URL])) {
|
||||||
$user_id = (!empty($_GET[POST_USERS_URL])) ? (int)$_GET[POST_USERS_URL] : (int)$_POST[POST_USERS_URL];
|
$user_id = (!empty($_GET[POST_USERS_URL])) ? (int)$_GET[POST_USERS_URL] : (int)$_POST[POST_USERS_URL];
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NO_USER_SPECIFIED']);
|
bb_die(trans('messages.NO_USER_SPECIFIED'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$userdata['session_logged_in']) {
|
if (!$userdata['session_logged_in']) {
|
||||||
|
@ -46,10 +46,10 @@ if ($row = OLD_DB()->fetch_row($sql)) {
|
||||||
$message = trim(html_entity_decode($_POST['message']));
|
$message = trim(html_entity_decode($_POST['message']));
|
||||||
|
|
||||||
if (!$subject) {
|
if (!$subject) {
|
||||||
$errors[] = $lang['EMPTY_SUBJECT_EMAIL'];
|
$errors[] = trans('messages.EMPTY_SUBJECT_EMAIL');
|
||||||
}
|
}
|
||||||
if (!$message) {
|
if (!$message) {
|
||||||
$errors[] = $lang['EMPTY_MESSAGE_EMAIL'];
|
$errors[] = trans('messages.EMPTY_MESSAGE_EMAIL');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$errors) {
|
if (!$errors) {
|
||||||
|
@ -70,7 +70,7 @@ if ($row = OLD_DB()->fetch_row($sql)) {
|
||||||
|
|
||||||
$emailer->send();
|
$emailer->send();
|
||||||
|
|
||||||
bb_die($lang['EMAIL_SENT']);
|
bb_die(trans('messages.EMAIL_SENT'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,5 +84,5 @@ if ($row = OLD_DB()->fetch_row($sql)) {
|
||||||
print_page('usercp_email.tpl');
|
print_page('usercp_email.tpl');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['USER_NOT_EXIST']);
|
bb_die(trans('messages.USER_NOT_EXIST'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,17 +56,17 @@ switch ($mode) {
|
||||||
// Ограничение по ip
|
// Ограничение по ip
|
||||||
if (config('tp.unique_ip')) {
|
if (config('tp.unique_ip')) {
|
||||||
if ($users = OLD_DB()->fetch_row("SELECT user_id, username FROM " . BB_USERS . " WHERE user_reg_ip = '" . USER_IP . "' LIMIT 1")) {
|
if ($users = OLD_DB()->fetch_row("SELECT user_id, username FROM " . BB_USERS . " WHERE user_reg_ip = '" . USER_IP . "' LIMIT 1")) {
|
||||||
bb_die(sprintf($lang['ALREADY_REG_IP'], '<a href="' . PROFILE_URL . $users['user_id'] . '"><b>' . $users['username'] . '</b></a>', config('tp.tech_admin_email')));
|
bb_die(sprintf(trans('messages.ALREADY_REG_IP'), '<a href="' . PROFILE_URL . $users['user_id'] . '"><b>' . $users['username'] . '</b></a>', config('tp.tech_admin_email')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Отключение регистрации
|
// Отключение регистрации
|
||||||
if (config('tp.new_user_reg_disabled') || (config('tp.reg_email_activation') && !config('email.enabled'))) {
|
if (config('tp.new_user_reg_disabled') || (config('tp.reg_email_activation') && !config('email.enabled'))) {
|
||||||
bb_die($lang['NEW_USER_REG_DISABLED']);
|
bb_die(trans('messages.NEW_USER_REG_DISABLED'));
|
||||||
} // Ограничение по времени
|
} // Ограничение по времени
|
||||||
elseif (config('tp.new_user_reg_restricted')) {
|
elseif (config('tp.new_user_reg_restricted')) {
|
||||||
if (in_array(date('G'), array(0, /*1,2,3,4,5,6,7,8,11,12,13,14,15,16,*/
|
if (in_array(date('G'), array(0, /*1,2,3,4,5,6,7,8,11,12,13,14,15,16,*/
|
||||||
17, 18, 19, 20, 21, 22, 23))) {
|
17, 18, 19, 20, 21, 22, 23))) {
|
||||||
bb_die($lang['REGISTERED_IN_TIME']);
|
bb_die(trans('messages.REGISTERED_IN_TIME'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ switch ($mode) {
|
||||||
'user_password' => '',
|
'user_password' => '',
|
||||||
'user_email' => '',
|
'user_email' => '',
|
||||||
'user_timezone' => config('tp.board_timezone'),
|
'user_timezone' => config('tp.board_timezone'),
|
||||||
'user_lang' => config('tp.default_lang'),
|
'user_lang' => config('app.locale'),
|
||||||
'user_opt' => 0,
|
'user_opt' => 0,
|
||||||
'avatar_ext_id' => 0,
|
'avatar_ext_id' => 0,
|
||||||
);
|
);
|
||||||
|
@ -143,7 +143,7 @@ switch ($mode) {
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
";
|
";
|
||||||
if (!$pr_data = OLD_DB()->fetch_row($sql)) {
|
if (!$pr_data = OLD_DB()->fetch_row($sql)) {
|
||||||
bb_die($lang['PROFILE_NOT_FOUND']);
|
bb_die(trans('messages.PROFILE_NOT_FOUND'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ $need_captcha = ($mode == 'register' && !IS_ADMIN && !config('tp.captcha.disable
|
||||||
|
|
||||||
if ($submit) {
|
if ($submit) {
|
||||||
if ($need_captcha && !bb_captcha('check')) {
|
if ($need_captcha && !bb_captcha('check')) {
|
||||||
$errors[] = $lang['CAPTCHA_WRONG'];
|
$errors[] = trans('messages.CAPTCHA_WRONG');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,25 +208,25 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
// пароль для гостя и при смене пароля юзером
|
// пароль для гостя и при смене пароля юзером
|
||||||
if (!empty($new_pass)) {
|
if (!empty($new_pass)) {
|
||||||
if (mb_strlen($new_pass, 'UTF-8') > 20) {
|
if (mb_strlen($new_pass, 'UTF-8') > 20) {
|
||||||
$errors[] = sprintf($lang['CHOOSE_PASS_ERR_MAX'], 20);
|
$errors[] = sprintf(trans('messages.CHOOSE_PASS_ERR_MAX'), 20);
|
||||||
} elseif (mb_strlen($new_pass, 'UTF-8') < 4) {
|
} elseif (mb_strlen($new_pass, 'UTF-8') < 4) {
|
||||||
$errors[] = sprintf($lang['CHOOSE_PASS_ERR_MIN'], 4);
|
$errors[] = sprintf(trans('messages.CHOOSE_PASS_ERR_MIN'), 4);
|
||||||
} elseif ($new_pass != $cfm_pass) {
|
} elseif ($new_pass != $cfm_pass) {
|
||||||
$errors[] = $lang['CHOOSE_PASS_ERR'];
|
$errors[] = trans('messages.CHOOSE_PASS_ERR');
|
||||||
}
|
}
|
||||||
$db_data['user_password'] = md5(md5($new_pass));
|
$db_data['user_password'] = md5(md5($new_pass));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mode == 'register') {
|
if ($mode == 'register') {
|
||||||
if (empty($new_pass)) {
|
if (empty($new_pass)) {
|
||||||
$errors[] = $lang['CHOOSE_PASS'];
|
$errors[] = trans('messages.CHOOSE_PASS');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!empty($cur_pass)) {
|
if (!empty($cur_pass)) {
|
||||||
$cur_pass_valid = ($pr_data['user_password'] === md5(md5($cur_pass)));
|
$cur_pass_valid = ($pr_data['user_password'] === md5(md5($cur_pass)));
|
||||||
}
|
}
|
||||||
if (!empty($new_pass) && !$cur_pass_valid) {
|
if (!empty($new_pass) && !$cur_pass_valid) {
|
||||||
$errors[] = $lang['CHOOSE_PASS_FAILED'];
|
$errors[] = trans('messages.CHOOSE_PASS_FAILED');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
if ($submit) {
|
if ($submit) {
|
||||||
if ($mode == 'register') {
|
if ($mode == 'register') {
|
||||||
if (empty($email)) {
|
if (empty($email)) {
|
||||||
$errors[] = $lang['CHOOSE_E_MAIL'];
|
$errors[] = trans('messages.CHOOSE_E_MAIL');
|
||||||
}
|
}
|
||||||
if (!$errors and $err = validate_email($email)) {
|
if (!$errors and $err = validate_email($email)) {
|
||||||
$errors[] = $err;
|
$errors[] = $err;
|
||||||
|
@ -250,7 +250,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
// если смена мейла юзером
|
// если смена мейла юзером
|
||||||
|
|
||||||
if (!$cur_pass_valid) {
|
if (!$cur_pass_valid) {
|
||||||
$errors[] = $lang['CONFIRM_PASSWORD_EXPLAIN'];
|
$errors[] = trans('messages.CONFIRM_PASSWORD_EXPLAIN');
|
||||||
}
|
}
|
||||||
if (!$errors and $err = validate_email($email)) {
|
if (!$errors and $err = validate_email($email)) {
|
||||||
$errors[] = $err;
|
$errors[] = $err;
|
||||||
|
@ -282,7 +282,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
case 'user_timezone':
|
case 'user_timezone':
|
||||||
$user_timezone = isset($_POST['user_timezone']) ? (int)$_POST['user_timezone'] : $pr_data['user_timezone'];
|
$user_timezone = isset($_POST['user_timezone']) ? (int)$_POST['user_timezone'] : $pr_data['user_timezone'];
|
||||||
if ($submit && ($user_timezone != $pr_data['user_timezone'] || $mode == 'register')) {
|
if ($submit && ($user_timezone != $pr_data['user_timezone'] || $mode == 'register')) {
|
||||||
if (isset($lang['TZ'][$user_timezone])) {
|
if (trans('messages.TZ.' . $user_timezone) !== 'messages.TZ.' . $user_timezone) {
|
||||||
$pr_data['user_timezone'] = $user_timezone;
|
$pr_data['user_timezone'] = $user_timezone;
|
||||||
$db_data['user_timezone'] = $user_timezone;
|
$db_data['user_timezone'] = $user_timezone;
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$pr_data['user_gender'] = $user_gender;
|
$pr_data['user_gender'] = $user_gender;
|
||||||
$db_data['user_gender'] = $user_gender;
|
$db_data['user_gender'] = $user_gender;
|
||||||
}
|
}
|
||||||
$tp_data['USER_GENDER'] = build_select('user_gender', array_flip($lang['GENDER_SELECT']), $pr_data['user_gender']);
|
$tp_data['USER_GENDER'] = build_select('user_gender', array_flip(trans('messages.GENDER_SELECT')), $pr_data['user_gender']);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -312,11 +312,11 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
|
|
||||||
if (!empty($birthday_date['year'])) {
|
if (!empty($birthday_date['year'])) {
|
||||||
if (strtotime($user_birthday) >= TIMENOW) {
|
if (strtotime($user_birthday) >= TIMENOW) {
|
||||||
$errors[] = $lang['WRONG_BIRTHDAY_FORMAT'];
|
$errors[] = trans('messages.WRONG_BIRTHDAY_FORMAT');
|
||||||
} elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] > config('tp.birthday_max_age')) {
|
} elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] > config('tp.birthday_max_age')) {
|
||||||
$errors[] = sprintf($lang['BIRTHDAY_TO_HIGH'], config('tp.birthday_max_age'));
|
$errors[] = sprintf(trans('messages.BIRTHDAY_TO_HIGH'), config('tp.birthday_max_age'));
|
||||||
} elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] < config('tp.birthday_min_age')) {
|
} elseif (bb_date(TIMENOW, 'Y', false) - $birthday_date['year'] < config('tp.birthday_min_age')) {
|
||||||
$errors[] = sprintf($lang['BIRTHDAY_TO_LOW'], config('tp.birthday_min_age'));
|
$errors[] = sprintf(trans('messages.BIRTHDAY_TO_LOW'), config('tp.birthday_min_age'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$db_data['user_icq'] = (string)$icq;
|
$db_data['user_icq'] = (string)$icq;
|
||||||
} else {
|
} else {
|
||||||
$pr_data['user_icq'] = '';
|
$pr_data['user_icq'] = '';
|
||||||
$errors[] = htmlCHR($lang['ICQ_ERROR']);
|
$errors[] = htmlCHR(trans('messages.ICQ_ERROR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tp_data['USER_ICQ'] = $pr_data['user_icq'];
|
$tp_data['USER_ICQ'] = $pr_data['user_icq'];
|
||||||
|
@ -410,7 +410,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$db_data['user_website'] = (string)$website;
|
$db_data['user_website'] = (string)$website;
|
||||||
} else {
|
} else {
|
||||||
$pr_data['user_website'] = '';
|
$pr_data['user_website'] = '';
|
||||||
$errors[] = htmlCHR($lang['WEBSITE_ERROR']);
|
$errors[] = htmlCHR(trans('messages.WEBSITE_ERROR'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tp_data['USER_WEBSITE'] = $pr_data['user_website'];
|
$tp_data['USER_WEBSITE'] = $pr_data['user_website'];
|
||||||
|
@ -438,9 +438,9 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$sig = prepare_message($sig);
|
$sig = prepare_message($sig);
|
||||||
|
|
||||||
if (mb_strlen($sig, 'UTF-8') > config('tp.max_sig_chars')) {
|
if (mb_strlen($sig, 'UTF-8') > config('tp.max_sig_chars')) {
|
||||||
$errors[] = $lang['SIGNATURE_TOO_LONG'];
|
$errors[] = trans('messages.SIGNATURE_TOO_LONG');
|
||||||
} elseif (preg_match('#<(a|b|i|u|table|tr|td|img) #i', $sig) || preg_match('#(href|src|target|title)=#i', $sig)) {
|
} elseif (preg_match('#<(a|b|i|u|table|tr|td|img) #i', $sig) || preg_match('#(href|src|target|title)=#i', $sig)) {
|
||||||
$errors[] = $lang['SIGNATURE_ERROR_HTML'];
|
$errors[] = trans('messages.SIGNATURE_ERROR_HTML');
|
||||||
}
|
}
|
||||||
|
|
||||||
$pr_data['user_sig'] = $sig;
|
$pr_data['user_sig'] = $sig;
|
||||||
|
@ -482,7 +482,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$skype = isset($_POST['user_skype']) ? (string)$_POST['user_skype'] : $pr_data['user_skype'];
|
$skype = isset($_POST['user_skype']) ? (string)$_POST['user_skype'] : $pr_data['user_skype'];
|
||||||
if ($submit && $skype != $pr_data['user_skype']) {
|
if ($submit && $skype != $pr_data['user_skype']) {
|
||||||
if ($skype != '' && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $skype)) {
|
if ($skype != '' && !preg_match("#^[a-zA-Z0-9_.\-@,]{6,32}$#", $skype)) {
|
||||||
$errors[] = $lang['SKYPE_ERROR'];
|
$errors[] = trans('messages.SKYPE_ERROR');
|
||||||
}
|
}
|
||||||
$pr_data['user_skype'] = $skype;
|
$pr_data['user_skype'] = $skype;
|
||||||
$db_data['user_skype'] = (string)$skype;
|
$db_data['user_skype'] = (string)$skype;
|
||||||
|
@ -497,7 +497,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
||||||
$twitter = isset($_POST['user_twitter']) ? (string)$_POST['user_twitter'] : $pr_data['user_twitter'];
|
$twitter = isset($_POST['user_twitter']) ? (string)$_POST['user_twitter'] : $pr_data['user_twitter'];
|
||||||
if ($submit && $twitter != $pr_data['user_twitter']) {
|
if ($submit && $twitter != $pr_data['user_twitter']) {
|
||||||
if ($twitter != '' && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $twitter)) {
|
if ($twitter != '' && !preg_match("#^[a-zA-Z0-9_]{1,15}$#", $twitter)) {
|
||||||
$errors[] = $lang['TWITTER_ERROR'];
|
$errors[] = trans('messages.TWITTER_ERROR');
|
||||||
}
|
}
|
||||||
$pr_data['user_twitter'] = $twitter;
|
$pr_data['user_twitter'] = $twitter;
|
||||||
$db_data['user_twitter'] = (string)$twitter;
|
$db_data['user_twitter'] = (string)$twitter;
|
||||||
|
@ -563,15 +563,15 @@ if ($submit && !$errors) {
|
||||||
|
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
set_pr_die_append_msg($new_user_id);
|
set_pr_die_append_msg($new_user_id);
|
||||||
$message = $lang['ACCOUNT_ADDED'];
|
$message = trans('messages.ACCOUNT_ADDED');
|
||||||
} else {
|
} else {
|
||||||
if (config('tp.reg_email_activation')) {
|
if (config('tp.reg_email_activation')) {
|
||||||
$message = $lang['ACCOUNT_INACTIVE'];
|
$message = trans('messages.ACCOUNT_INACTIVE');
|
||||||
$email_subject = sprintf($lang['EMAILER_SUBJECT']['USER_WELCOME_INACTIVE'], config('tp.sitename'));
|
$email_subject = sprintf(trans('messages.EMAILER_SUBJECT.USER_WELCOME_INACTIVE'), config('tp.sitename'));
|
||||||
$email_template = 'user_welcome_inactive';
|
$email_template = 'user_welcome_inactive';
|
||||||
} else {
|
} else {
|
||||||
$message = $lang['ACCOUNT_ADDED'];
|
$message = trans('messages.ACCOUNT_ADDED');
|
||||||
$email_subject = sprintf($lang['EMAILER_SUBJECT']['USER_WELCOME'], config('tp.sitename'));
|
$email_subject = sprintf(trans('messages.EMAILER_SUBJECT.USER_WELCOME'), config('tp.sitename'));
|
||||||
$email_template = 'user_welcome';
|
$email_template = 'user_welcome';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ if ($submit && !$errors) {
|
||||||
$emailer->set_template($email_template, $user_lang);
|
$emailer->set_template($email_template, $user_lang);
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
'SITENAME' => config('tp.sitename'),
|
'SITENAME' => config('tp.sitename'),
|
||||||
'WELCOME_MSG' => sprintf($lang['WELCOME_SUBJECT'], config('tp.sitename')),
|
'WELCOME_MSG' => sprintf(trans('messages.WELCOME_SUBJECT'), config('tp.sitename')),
|
||||||
'USERNAME' => html_entity_decode($username),
|
'USERNAME' => html_entity_decode($username),
|
||||||
'PASSWORD' => $new_pass,
|
'PASSWORD' => $new_pass,
|
||||||
'U_ACTIVATE' => make_url('profile.php?mode=activate&' . POST_USERS_URL . '=' . $new_user_id . '&act_key=' . $db_data['user_actkey'])
|
'U_ACTIVATE' => make_url('profile.php?mode=activate&' . POST_USERS_URL . '=' . $new_user_id . '&act_key=' . $db_data['user_actkey'])
|
||||||
|
@ -614,7 +614,7 @@ if ($submit && !$errors) {
|
||||||
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
$emailer->set_from([config('tp.board_email') => config('tp.sitename')]);
|
||||||
$emailer->set_to([$email => $username]);
|
$emailer->set_to([$email => $username]);
|
||||||
$emailer->set_subject($subject);
|
$emailer->set_subject($subject);
|
||||||
$emailer->set_subject($lang['EMAILER_SUBJECT']['USER_ACTIVATE']);
|
$emailer->set_subject(trans('messages.EMAILER_SUBJECT.USER_ACTIVATE'));
|
||||||
|
|
||||||
$emailer->set_template('user_activate', $pr_data['user_lang']);
|
$emailer->set_template('user_activate', $pr_data['user_lang']);
|
||||||
$emailer->assign_vars(array(
|
$emailer->assign_vars(array(
|
||||||
|
@ -625,11 +625,11 @@ if ($submit && !$errors) {
|
||||||
|
|
||||||
$emailer->send();
|
$emailer->send();
|
||||||
|
|
||||||
$message = $lang['PROFILE_UPDATED_INACTIVE'];
|
$message = trans('messages.PROFILE_UPDATED_INACTIVE');
|
||||||
$user->session_end();
|
$user->session_end();
|
||||||
} else {
|
} else {
|
||||||
meta_refresh('index.php', 10);
|
meta_refresh('index.php', 10);
|
||||||
$message = $lang['PROFILE_UPDATED'];
|
$message = trans('messages.PROFILE_UPDATED');
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_args = OLD_DB()->build_array('UPDATE', $db_data);
|
$sql_args = OLD_DB()->build_array('UPDATE', $db_data);
|
||||||
|
@ -645,15 +645,15 @@ if ($submit && !$errors) {
|
||||||
cache_rm_user_sessions($pr_data['user_id']);
|
cache_rm_user_sessions($pr_data['user_id']);
|
||||||
|
|
||||||
if ($adm_edit) {
|
if ($adm_edit) {
|
||||||
bb_die($lang['PROFILE_USER'] . ' <b>' . profile_url($pr_data) . '</b> ' . $lang['GOOD_UPDATE']);
|
bb_die(trans('messages.PROFILE_USER') . ' <b>' . profile_url($pr_data) . '</b> ' . trans('messages.GOOD_UPDATE'));
|
||||||
} elseif (!$pr_data['user_active']) {
|
} elseif (!$pr_data['user_active']) {
|
||||||
bb_die($lang['PROFILE_UPDATED_INACTIVE']);
|
bb_die(trans('messages.PROFILE_UPDATED_INACTIVE'));
|
||||||
} else {
|
} else {
|
||||||
meta_refresh('index.php', 10);
|
meta_refresh('index.php', 10);
|
||||||
bb_die($lang['PROFILE_UPDATED']);
|
bb_die(trans('messages.PROFILE_UPDATED'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bb_die($lang['NOTHING_HAS_CHANGED']);
|
bb_die(trans('messages.NOTHING_HAS_CHANGED'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -661,7 +661,7 @@ if ($submit && !$errors) {
|
||||||
$template->assign_vars($tp_data);
|
$template->assign_vars($tp_data);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGE_TITLE' => ($mode == 'editprofile') ? $lang['EDIT_PROFILE'] . ($adm_edit ? " :: {$pr_data['username']}" : '') : $lang['REGISTER'],
|
'PAGE_TITLE' => ($mode == 'editprofile') ? trans('messages.EDIT_PROFILE') . ($adm_edit ? " :: {$pr_data['username']}" : '') : trans('messages.REGISTER'),
|
||||||
'SHOW_REG_AGREEMENT' => ($mode == 'register' && !IS_ADMIN),
|
'SHOW_REG_AGREEMENT' => ($mode == 'register' && !IS_ADMIN),
|
||||||
'ERROR_MESSAGE' => ($errors) ? implode('<br />', array_unique($errors)) : '',
|
'ERROR_MESSAGE' => ($errors) ? implode('<br />', array_unique($errors)) : '',
|
||||||
'MODE' => $mode,
|
'MODE' => $mode,
|
||||||
|
@ -674,12 +674,12 @@ $template->assign_vars(array(
|
||||||
'TIMEZONE_SELECT' => tz_select($pr_data['user_timezone'], 'user_timezone'),
|
'TIMEZONE_SELECT' => tz_select($pr_data['user_timezone'], 'user_timezone'),
|
||||||
'USER_TIMEZONE' => $pr_data['user_timezone'],
|
'USER_TIMEZONE' => $pr_data['user_timezone'],
|
||||||
|
|
||||||
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], config('tp.avatars.max_width'), config('tp.avatars.max_height'), (round(config('tp.avatars.max_size') / 1024))),
|
'AVATAR_EXPLAIN' => sprintf(trans('messages.AVATAR_EXPLAIN'), config('tp.avatars.max_width'), config('tp.avatars.max_height'), (round(config('tp.avatars.max_size') / 1024))),
|
||||||
'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'),
|
'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'),
|
||||||
'AVATAR_DIS_EXPLAIN' => sprintf($lang['AVATAR_DISABLE'], config('tp.terms_and_conditions_url')),
|
'AVATAR_DIS_EXPLAIN' => sprintf(trans('messages.AVATAR_DISABLE'), config('tp.terms_and_conditions_url')),
|
||||||
'AVATAR_IMG' => get_avatar($pr_data['user_id'], $pr_data['avatar_ext_id'], !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar')),
|
'AVATAR_IMG' => get_avatar($pr_data['user_id'], $pr_data['avatar_ext_id'], !bf($pr_data['user_opt'], 'user_opt', 'dis_avatar')),
|
||||||
|
|
||||||
'SIGNATURE_EXPLAIN' => sprintf($lang['SIGNATURE_EXPLAIN'], config('tp.max_sig_chars')),
|
'SIGNATURE_EXPLAIN' => sprintf(trans('messages.SIGNATURE_EXPLAIN'), config('tp.max_sig_chars')),
|
||||||
'SIG_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_sig'),
|
'SIG_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_sig'),
|
||||||
|
|
||||||
'PR_USER_ID' => $pr_data['user_id'],
|
'PR_USER_ID' => $pr_data['user_id'],
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue