Fixed formatting

This commit is contained in:
Roman Kelesidis 2023-08-10 13:35:32 +07:00
parent 0a7ddbe8ad
commit 990cf7c5c7
24 changed files with 85 additions and 85 deletions

View File

@ -9,7 +9,7 @@ require('./pagestart.php');
if ($bb_cfg['emailer_disabled']) if ($bb_cfg['emailer_disabled'])
{ {
bb_die($lang['EMAILER_DISABLED']); bb_die($lang['EMAILER_DISABLED']);
} }
@set_time_limit(1200); @set_time_limit(1200);

View File

@ -111,7 +111,7 @@ class ajax_common
*/ */
function exec() function exec()
{ {
global $lang, $bb_cfg; global $lang, $bb_cfg;
// Exit if we already have errors // Exit if we already have errors
if (!empty($this->response['error_code'])) if (!empty($this->response['error_code']))
@ -122,8 +122,8 @@ class ajax_common
// Check that requested action is valid // Check that requested action is valid
$action = $this->action; $action = $this->action;
// Action params // Action params
$action_params = null; $action_params = null;
if (!$action || !is_string($action)) if (!$action || !is_string($action))
{ {
@ -134,21 +134,21 @@ class ajax_common
$this->ajax_die('invalid action: ' . $action); $this->ajax_die('invalid action: ' . $action);
} }
// 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 ($bb_cfg['board_disable'] || file_exists(BB_DISABLED)) if ($bb_cfg['board_disable'] || file_exists(BB_DISABLED))
{ {
if ($action_params[AJAX_ALWAYS_ACTIVE] !== true) if ($action_params[AJAX_ALWAYS_ACTIVE] !== true)
{ {
if ($bb_cfg['board_disable']) if ($bb_cfg['board_disable'])
{ {
$this->ajax_die($lang['BOARD_DISABLE']); $this->ajax_die($lang['BOARD_DISABLE']);
} }
elseif (file_exists(BB_DISABLED)) elseif (file_exists(BB_DISABLED))
{ {
$this->ajax_die($lang['BOARD_DISABLE_CRON']); $this->ajax_die($lang['BOARD_DISABLE_CRON']);
} }
} }
} }
// Auth check // Auth check
switch ($action_params[AJAX_AUTH]) switch ($action_params[AJAX_AUTH])

View File

@ -73,7 +73,7 @@ define('BOT_UID', -746);
function sqlite3_escape_string ($str) function sqlite3_escape_string ($str)
{ {
return SQLite3::escapeString($str); return SQLite3::escapeString($str);
} }
/** /**

View File

@ -14,14 +14,14 @@ switch($mode)
'stats', 'stats',
)); ));
$users = array(); $users = array();
$stats = $datastore->get('stats'); $stats = $datastore->get('stats');
if ($stats['birthday_week_list']) if ($stats['birthday_week_list'])
{ {
foreach($stats['birthday_week_list'] as $week) foreach($stats['birthday_week_list'] as $week)
{ {
$users[] = profile_url($week) .' <span class="small">('. birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) .')</span>'; $users[] = profile_url($week) .' <span class="small">('. birthday_age(date('Y-m-d', strtotime('-1 year', strtotime($week['user_birthday'])))) .')</span>';
} }
$html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $users)); $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $users));
} }
@ -33,14 +33,14 @@ switch($mode)
'stats', 'stats',
)); ));
$users = array(); $users = array();
$stats = $datastore->get('stats'); $stats = $datastore->get('stats');
if ($stats['birthday_today_list']) if ($stats['birthday_today_list'])
{ {
foreach($stats['birthday_today_list'] as $today) foreach($stats['birthday_today_list'] as $today)
{ {
$users[] = profile_url($today) .' <span class="small">('. birthday_age($today['user_birthday']) .')</span>'; $users[] = profile_url($today) .' <span class="small">('. birthday_age($today['user_birthday']) .')</span>';
} }
$html = $lang['BIRTHDAY_TODAY'] . join(', ', $users); $html = $lang['BIRTHDAY_TODAY'] . join(', ', $users);
} }
@ -131,8 +131,8 @@ switch($mode)
'; ';
break; break;
default: default:
$this->ajax_die('Invalid mode'); $this->ajax_die('Invalid mode');
} }
$this->response['html'] = $html; $this->response['html'] = $html;

View File

@ -111,9 +111,9 @@ switch ($mode)
break; break;
default: default:
$this->ajax_die('Invalid mode'); $this->ajax_die('Invalid mode');
} }
$this->response['mode'] = $mode; $this->response['mode'] = $mode;

View File

@ -79,9 +79,9 @@ switch ($mode)
break; break;
default: default:
$this->ajax_die('Invalid mode'); $this->ajax_die('Invalid mode');
} }
$this->response['mode'] = $mode; $this->response['mode'] = $mode;

View File

@ -130,6 +130,6 @@ switch ($mode)
'; ';
break; break;
default: default:
$this->ajax_die('Invalid mode'); $this->ajax_die('Invalid mode');
} }

View File

@ -27,19 +27,19 @@ switch ($mode)
foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link) foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link)
{ {
if ($map->send_url($source_link, $map_link)) if ($map->send_url($source_link, $map_link))
{ {
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . '&nbsp;' . $source_name . ' : <span style="color: green;">' . $lang['SITEMAP_SENT'] . '</span>'; $html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . '&nbsp;' . $source_name . ' : <span style="color: green;">' . $lang['SITEMAP_SENT'] . '</span>';
} }
else else
{ {
$html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . '&nbsp;' . $source_name . ' : <span style="color: red;">' . $lang['SITEMAP_ERROR'] . '</span> URL: <a href="' . $source_link . urlencode($map_link) . '" target="_blank">' . $source_link . $map_link . '</a>'; $html .= '<br />' . $lang['SITEMAP_NOTIFY_SEARCH'] . '&nbsp;' . $source_name . ' : <span style="color: red;">' . $lang['SITEMAP_ERROR'] . '</span> URL: <a href="' . $source_link . urlencode($map_link) . '" target="_blank">' . $source_link . $map_link . '</a>';
} }
} }
break; break;
default: default:
$this->ajax_die('Invalid mode'); $this->ajax_die('Invalid mode');
} }
$this->response['html'] = $html; $this->response['html'] = $html;

View File

@ -67,8 +67,8 @@ switch($mode)
} }
break; break;
default: default:
$this->ajax_die('Invalid mode'); $this->ajax_die('Invalid mode');
} }
$this->response['html'] = $html; $this->response['html'] = $html;

View File

@ -218,11 +218,11 @@ $bb_cfg['charset'] = 'utf8'; // page charset
if (isset($bb_cfg['default_lang']) && file_exists(LANG_ROOT_DIR . $bb_cfg['default_lang'] .'/')) if (isset($bb_cfg['default_lang']) && file_exists(LANG_ROOT_DIR . $bb_cfg['default_lang'] .'/'))
{ {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . $bb_cfg['default_lang'] .'/'; $bb_cfg['default_lang_dir'] = LANG_ROOT_DIR . $bb_cfg['default_lang'] .'/';
} }
else else
{ {
$bb_cfg['default_lang_dir'] = LANG_ROOT_DIR .'en/'; $bb_cfg['default_lang_dir'] = LANG_ROOT_DIR .'en/';
} }
$bb_cfg['lang'] = array( $bb_cfg['lang'] = array(

View File

@ -23,10 +23,10 @@ class cache_sqlite extends cache_common
function cache_sqlite ($cfg, $prefix = null) function cache_sqlite ($cfg, $prefix = null)
{ {
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die("Error: {$this->db->engine} extension not installed"); die("Error: {$this->db->engine} extension not installed");
} }
$this->cfg = array_merge($this->cfg, $cfg); $this->cfg = array_merge($this->cfg, $cfg);
$this->db = new sqlite_common($this->cfg); $this->db = new sqlite_common($this->cfg);
@ -113,10 +113,10 @@ class cache_sqlite extends cache_common
return ($result) ? $this->db->changes() : 0; return ($result) ? $this->db->changes() : 0;
} }
function is_installed () function is_installed ()
{ {
return class_exists('SQLite3'); return class_exists('SQLite3');
} }
} }
class sqlite_common extends cache_common class sqlite_common extends cache_common

View File

@ -85,7 +85,7 @@ class CACHES
$this->ref[$cache_name] =& $this->obj[$cache_name]; $this->ref[$cache_name] =& $this->obj[$cache_name];
break; break;
case 'filecache': case 'filecache':
default: //filecache default: //filecache
if (!isset($this->obj[$cache_name])) if (!isset($this->obj[$cache_name]))
{ {

View File

@ -13,6 +13,6 @@ if (@file_exists(SITEMAP_DIR. 'sitemap.xml'))
foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link) foreach ($bb_cfg['sitemap_sending'] as $source_name => $source_link)
{ {
$map->send_url($source_link, $map_link); $map->send_url($source_link, $map_link);
} }
} }

View File

@ -22,10 +22,10 @@ class datastore_sqlite extends datastore_common
function datastore_sqlite ($cfg, $prefix = null) function datastore_sqlite ($cfg, $prefix = null)
{ {
if (!$this->is_installed()) if (!$this->is_installed())
{ {
die("Error: {$this->engine} extension not installed"); die("Error: {$this->engine} extension not installed");
} }
$this->cfg = array_merge($this->cfg, $cfg); $this->cfg = array_merge($this->cfg, $cfg);
$this->db = new sqlite_common($this->cfg); $this->db = new sqlite_common($this->cfg);
@ -69,8 +69,8 @@ class datastore_sqlite extends datastore_common
$this->db->debug('stop'); $this->db->debug('stop');
} }
function is_installed () function is_installed ()
{ {
return class_exists('SQLite3'); return class_exists('SQLite3');
} }
} }

View File

@ -1240,12 +1240,12 @@ function show_bt_userdata ($user_id)
{ {
global $lang, $template; global $lang, $template;
if (!$btu = get_bt_userdata($user_id)) if (!$btu = get_bt_userdata($user_id))
{ {
require(INC_DIR .'functions_torrent.php'); require(INC_DIR .'functions_torrent.php');
generate_passkey($user_id, true); generate_passkey($user_id, true);
$btu = get_bt_userdata($user_id); $btu = get_bt_userdata($user_id);
} }
$template->assign_vars(array( $template->assign_vars(array(
'SHOW_BT_USERDATA' => true, 'SHOW_BT_USERDATA' => true,

View File

@ -207,7 +207,7 @@ $bb_cfg['tor_icons'] = array(
TOR_CHECKING => '<span class="tor-icon tor-checking">%</span>', TOR_CHECKING => '<span class="tor-icon tor-checking">%</span>',
TOR_TMP => '<span class="tor-icon tor-dup">T</span>', TOR_TMP => '<span class="tor-icon tor-dup">T</span>',
TOR_PREMOD => '<span class="tor-icon tor-dup">&#8719;</span>', TOR_PREMOD => '<span class="tor-icon tor-dup">&#8719;</span>',
TOR_REPLENISH => '<span class="tor-icon tor-dup">R</span>', TOR_REPLENISH => '<span class="tor-icon tor-dup">R</span>',
); );
// Запрет на скачивание // Запрет на скачивание

View File

@ -6,11 +6,11 @@ global $bb_cfg, $userdata, $template, $DBS, $lang;
if (!empty($template)) if (!empty($template))
{ {
$birthday_tp = ((string)bb_date(TIMENOW, 'd.m', false) === '04.04') ? '&nbsp;|&nbsp;&#127881;&#127856;&#128154;' : null; $birthday_tp = ((string)bb_date(TIMENOW, 'd.m', false) === '04.04') ? '&nbsp;|&nbsp;&#127881;&#127856;&#128154;' : null;
$template->assign_vars(array( $template->assign_vars(array(
'SIMPLE_FOOTER' => !empty($gen_simple_header), 'SIMPLE_FOOTER' => !empty($gen_simple_header),
'POWERED' => 'Powered by <a target="_blank" href="https://torrentpier.com">TorrentPier II</a> &copy; 2005-' . date('Y') . $birthday_tp, 'POWERED' => 'Powered by <a target="_blank" href="https://torrentpier.com">TorrentPier II</a> &copy; 2005-' . date('Y') . $birthday_tp,
'SHOW_ADMIN_LINK' => (IS_ADMIN && !defined('IN_ADMIN')), 'SHOW_ADMIN_LINK' => (IS_ADMIN && !defined('IN_ADMIN')),
'ADMIN_LINK_HREF' => "admin/index.php", 'ADMIN_LINK_HREF' => "admin/index.php",
)); ));

View File

@ -67,9 +67,9 @@ if ($sql_log)
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function fixSqlLog() { function fixSqlLog() {
if ($("#sqlLog").height() > 400) { if ($("#sqlLog").height() > 400) {
$("#sqlLog").height(400); $("#sqlLog").height(400);
} }
} }
$(document).ready(fixSqlLog); $(document).ready(fixSqlLog);
</script> </script>

View File

@ -356,7 +356,7 @@ foreach ($profile_fields as $field => $can_edit)
} }
} }
$pr_data['user_birthday'] = $db_data['user_birthday'] = !empty($user_birthday) ? $user_birthday : null; $pr_data['user_birthday'] = $db_data['user_birthday'] = !empty($user_birthday) ? $user_birthday : null;
} }
$tp_data['USER_BIRTHDAY'] = $pr_data['user_birthday']; $tp_data['USER_BIRTHDAY'] = $pr_data['user_birthday'];
break; break;

View File

@ -1094,7 +1094,7 @@ $lang['TOR_STATUS_NAME'] = array(
TOR_CHECKING => 'verified', TOR_CHECKING => 'verified',
TOR_TMP => 'temporary', TOR_TMP => 'temporary',
TOR_PREMOD => 'pre-moderation', TOR_PREMOD => 'pre-moderation',
TOR_REPLENISH => 'replenish', TOR_REPLENISH => 'replenish',
); );
$lang['TOR_STATUS_FAILED'] = 'Such status does not exist!'; $lang['TOR_STATUS_FAILED'] = 'Such status does not exist!';
$lang['TORRENT_FAILED'] = 'Distribution was not found!'; $lang['TORRENT_FAILED'] = 'Distribution was not found!';

View File

@ -1094,7 +1094,7 @@ $lang['TOR_STATUS_NAME'] = array(
TOR_CHECKING => 'проверяется', TOR_CHECKING => 'проверяется',
TOR_TMP => 'временная', TOR_TMP => 'временная',
TOR_PREMOD => 'премодерация', TOR_PREMOD => 'премодерация',
TOR_REPLENISH => 'пополняемая', TOR_REPLENISH => 'пополняемая',
); );
$lang['TOR_STATUS_FAILED'] = 'Такого статуса не существует!'; $lang['TOR_STATUS_FAILED'] = 'Такого статуса не существует!';
$lang['TORRENT_FAILED'] = 'Раздача не найдена!'; $lang['TORRENT_FAILED'] = 'Раздача не найдена!';

View File

@ -1094,7 +1094,7 @@ $lang['TOR_STATUS_NAME'] = array(
TOR_CHECKING => 'перевіряється', TOR_CHECKING => 'перевіряється',
TOR_TMP => 'тимчасова', TOR_TMP => 'тимчасова',
TOR_PREMOD => 'премодерація', TOR_PREMOD => 'премодерація',
TOR_REPLENISH => 'поповнювана', TOR_REPLENISH => 'поповнювана',
); );
$lang['TOR_STATUS_FAILED'] = 'Такого статусу не існує!'; $lang['TOR_STATUS_FAILED'] = 'Такого статусу не існує!';
$lang['TORRENT_FAILED'] = 'Роздача не знайдено!'; $lang['TORRENT_FAILED'] = 'Роздача не знайдено!';

View File

@ -190,10 +190,10 @@ if ($result = DB()->fetch_rowset($sql))
$www = $lang['NOSELECT']; $www = $lang['NOSELECT'];
} }
if(!$from) if(!$from)
{ {
$from = $lang['NOSELECT']; $from = $lang['NOSELECT'];
} }
$row_class = !($i % 2) ? 'row1' : 'row2'; $row_class = !($i % 2) ? 'row1' : 'row2';
$template->assign_block_vars('memberrow', array( $template->assign_block_vars('memberrow', array(

View File

@ -894,7 +894,7 @@ else if ( $submit || $refresh || $mode != '' )
{ {
if ( !empty($_POST['username']) ) if ( !empty($_POST['username']) )
{ {
$to_userdata = get_userdata($_POST['username']); $to_userdata = get_userdata($_POST['username']);
if (!$to_userdata || $to_userdata['user_id'] == GUEST_UID) if (!$to_userdata || $to_userdata['user_id'] == GUEST_UID)
{ {