mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
refactor: Moved classes from Legacy
folder to src
root (#1828)
* refactor: Moved classes from `Legacy` folder to `src` root * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updated * Updater * Update Caches.php * Updater * Updater * Updater * Updater * Update Attach.php * Update Post.php * Update BBCode.php * Update SqlDb.php * Update Upload.php * Update Upload.php * Updated * Updated * Revert "Updated" This reverts commit9ecc26b048
. * Revert "Updated" This reverts commit22db50889c
. * Revert "Update Upload.php" This reverts commita6faf4191a
.
This commit is contained in:
parent
ba3ce885c8
commit
92ce77ec0e
73 changed files with 260 additions and 278 deletions
|
@ -97,7 +97,7 @@ function bbcode_tpl_compact($text)
|
|||
// prepare a posted message for entry into the database
|
||||
function prepare_message($message)
|
||||
{
|
||||
$message = \TorrentPier\Legacy\BBCode::clean_up($message);
|
||||
$message = TorrentPier\BBCode::clean_up($message);
|
||||
$message = htmlCHR($message, false, ENT_NOQUOTES);
|
||||
return $message;
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ function add_search_words($post_id, $post_message, $topic_title = '', $only_retu
|
|||
|
||||
/**
|
||||
* Dirty class removed from here since 2.2.0
|
||||
* To add new bbcodes see at src/Legacy/BBCode.php
|
||||
* To add new bbcodes see at src/BBCode.php
|
||||
*/
|
||||
|
||||
function bbcode2html($text)
|
||||
|
@ -391,7 +391,7 @@ function bbcode2html($text)
|
|||
global $bbcode, $wordCensor;
|
||||
|
||||
if (!isset($bbcode)) {
|
||||
$bbcode = new TorrentPier\Legacy\BBCode();
|
||||
$bbcode = new TorrentPier\BBCode();
|
||||
}
|
||||
$text = $wordCensor->censorString($text);
|
||||
return $bbcode->bbcode2html($text);
|
||||
|
@ -401,7 +401,7 @@ function get_words_rate($text)
|
|||
{
|
||||
static $wr = null;
|
||||
if (!isset($wr)) {
|
||||
$wr = new TorrentPier\Legacy\WordsRate();
|
||||
$wr = new TorrentPier\WordsRate();
|
||||
}
|
||||
return $wr->get_words_rate($text);
|
||||
}
|
||||
|
|
|
@ -12,9 +12,9 @@ if (!defined('BB_ROOT')) {
|
|||
}
|
||||
|
||||
// Synchronization
|
||||
\TorrentPier\Legacy\Admin\Common::sync('topic', 'all');
|
||||
\TorrentPier\Legacy\Admin\Common::sync('user_posts', 'all');
|
||||
\TorrentPier\Legacy\Admin\Common::sync_all_forums();
|
||||
\TorrentPier\Admin\Common::sync('topic', 'all');
|
||||
\TorrentPier\Admin\Common::sync('user_posts', 'all');
|
||||
\TorrentPier\Admin\Common::sync_all_forums();
|
||||
|
||||
// Cleaning bb_poll_users
|
||||
if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
|
||||
|
|
|
@ -15,6 +15,6 @@ if ($bb_cfg['prune_enable']) {
|
|||
$sql = "SELECT forum_id, prune_days FROM " . BB_FORUMS . " WHERE prune_days != 0";
|
||||
|
||||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
\TorrentPier\Legacy\Admin\Common::topic_delete('prune', $row['forum_id'], (TIMENOW - 86400 * $row['prune_days']));
|
||||
\TorrentPier\Admin\Common::topic_delete('prune', $row['forum_id'], (TIMENOW - 86400 * $row['prune_days']));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ while (true) {
|
|||
}
|
||||
|
||||
if ($prune_users = $not_activated_users + $not_active_users) {
|
||||
\TorrentPier\Legacy\Admin\Common::user_delete($prune_users);
|
||||
\TorrentPier\Admin\Common::user_delete($prune_users);
|
||||
}
|
||||
|
||||
if (count($prune_users) < $users_per_cycle) {
|
||||
|
|
|
@ -18,18 +18,18 @@ $forums_data = DB()->fetch_rowset("SELECT forum_id, allow_reg_tracker, forum_nam
|
|||
|
||||
if (is_file($bb_cfg['atom']['path'] . '/f/0.atom')) {
|
||||
if (filemtime($bb_cfg['atom']['path'] . '/f/0.atom') <= $timecheck) {
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed(0, $forums_data);
|
||||
\TorrentPier\Atom::update_forum_feed(0, $forums_data);
|
||||
}
|
||||
} else {
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed(0, $forums_data);
|
||||
\TorrentPier\Atom::update_forum_feed(0, $forums_data);
|
||||
}
|
||||
|
||||
foreach ($forums_data as $forum_data) {
|
||||
if (is_file($bb_cfg['atom']['path'] . '/f/' . $forum_data['forum_id'] . '.atom')) {
|
||||
if (filemtime($bb_cfg['atom']['path'] . '/f/' . $forum_data['forum_id'] . '.atom') <= $timecheck) {
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
\TorrentPier\Atom::update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
}
|
||||
} else {
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
\TorrentPier\Atom::update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1075,7 +1075,7 @@ function setup_style()
|
|||
}
|
||||
}
|
||||
|
||||
$template = new TorrentPier\Legacy\Template(TEMPLATES_DIR . '/' . $tpl_dir_name);
|
||||
$template = new TorrentPier\Template(TEMPLATES_DIR . '/' . $tpl_dir_name);
|
||||
$css_dir = 'styles/' . basename(TEMPLATES_DIR) . '/' . $tpl_dir_name . '/css/';
|
||||
|
||||
$template->assign_vars([
|
||||
|
@ -1342,7 +1342,7 @@ function bb_die($msg_text, $status_code = null)
|
|||
// If the header hasn't been output then do it
|
||||
if (!defined('PAGE_HEADER_SENT')) {
|
||||
if (empty($template)) {
|
||||
$template = new TorrentPier\Legacy\Template(BB_ROOT . "templates/{$bb_cfg['tpl_name']}");
|
||||
$template = new TorrentPier\Template(BB_ROOT . "templates/{$bb_cfg['tpl_name']}");
|
||||
}
|
||||
if (empty($theme)) {
|
||||
$theme = setup_style();
|
||||
|
@ -2004,12 +2004,12 @@ function update_atom($type, $id)
|
|||
{
|
||||
switch ($type) {
|
||||
case 'user':
|
||||
\TorrentPier\Legacy\Atom::update_user_feed($id, get_username($id));
|
||||
\TorrentPier\Atom::update_user_feed($id, get_username($id));
|
||||
break;
|
||||
|
||||
case 'topic':
|
||||
$topic_poster = (int)DB()->fetch_row("SELECT topic_poster FROM " . BB_TOPICS . " WHERE topic_id = $id LIMIT 1", 'topic_poster');
|
||||
\TorrentPier\Legacy\Atom::update_user_feed($topic_poster, get_username($topic_poster));
|
||||
\TorrentPier\Atom::update_user_feed($topic_poster, get_username($topic_poster));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -390,10 +390,10 @@ require_once INC_DIR . '/functions.php';
|
|||
|
||||
$bb_cfg = array_merge(bb_get_config(BB_CONFIG), $bb_cfg);
|
||||
|
||||
$log_action = new TorrentPier\Legacy\LogAction();
|
||||
$log_action = new TorrentPier\LogAction();
|
||||
$wordCensor = new TorrentPier\Censor();
|
||||
$html = new TorrentPier\Legacy\Common\Html();
|
||||
$user = new TorrentPier\Legacy\Common\User();
|
||||
$html = new \TorrentPier\Common\Html();
|
||||
$user = new \TorrentPier\Common\User();
|
||||
|
||||
$userdata =& $user->data;
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
|||
$pr_data['avatar_ext_id'] = 0;
|
||||
$db_data['avatar_ext_id'] = 0;
|
||||
} elseif (!empty($_FILES['avatar']['name']) && $bb_cfg['avatars']['up_allowed']) {
|
||||
$upload = new TorrentPier\Legacy\Common\Upload();
|
||||
$upload = new \TorrentPier\Common\Upload();
|
||||
|
||||
if ($upload->init($bb_cfg['avatars'], $_FILES['avatar'], !isset($_POST['use_monster_avatar'])) and $upload->store('avatar', $pr_data)) {
|
||||
$pr_data['avatar_ext_id'] = $upload->file_ext_id;
|
||||
|
@ -565,7 +565,7 @@ foreach ($profile_fields as $field => $can_edit) {
|
|||
}
|
||||
}
|
||||
}
|
||||
$tp_data['TEMPLATES_SELECT'] = \TorrentPier\Legacy\Select::template($pr_data['tpl_name'], 'tpl_name');
|
||||
$tp_data['TEMPLATES_SELECT'] = TorrentPier\Select::template($pr_data['tpl_name'], 'tpl_name');
|
||||
break;
|
||||
|
||||
/**
|
||||
|
@ -607,7 +607,7 @@ if ($submit && !$errors) {
|
|||
|
||||
// Generate passkey
|
||||
for ($i = 0, $max_try = 3; $i <= $max_try; $i++) {
|
||||
if (\TorrentPier\Legacy\Torrent::generate_passkey($new_user_id, true)) {
|
||||
if (TorrentPier\Torrent::generate_passkey($new_user_id, true)) {
|
||||
break;
|
||||
}
|
||||
if ($i == $max_try) {
|
||||
|
@ -722,8 +722,8 @@ $template->assign_vars([
|
|||
'INVITE_CODE' => !empty($_GET['invite']) ? htmlCHR($_GET['invite']) : '',
|
||||
'CAPTCHA_HTML' => ($need_captcha) ? bb_captcha('get') : '',
|
||||
|
||||
'LANGUAGE_SELECT' => \TorrentPier\Legacy\Select::language($pr_data['user_lang'], 'user_lang'),
|
||||
'TIMEZONE_SELECT' => \TorrentPier\Legacy\Select::timezone($pr_data['user_timezone'], 'user_timezone'),
|
||||
'LANGUAGE_SELECT' => TorrentPier\Select::language($pr_data['user_lang'], 'user_lang'),
|
||||
'TIMEZONE_SELECT' => TorrentPier\Select::timezone($pr_data['user_timezone'], 'user_timezone'),
|
||||
|
||||
'AVATAR_EXPLAIN' => sprintf($lang['AVATAR_EXPLAIN'], $bb_cfg['avatars']['max_width'], $bb_cfg['avatars']['max_height'], humn_size($bb_cfg['avatars']['max_size'])),
|
||||
'AVATAR_DISALLOWED' => bf($pr_data['user_opt'], 'user_opt', 'dis_avatar'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue