mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 05:13:54 -07:00
Minor improvements (#1395)
* Minor improvements * Updated * Update functions.php * Update functions.php * Update mysql.sql * Update viewtopic.php * Update CHANGELOG.md
This commit is contained in:
parent
392186c36e
commit
679d422a2a
5 changed files with 43 additions and 36 deletions
|
@ -13,7 +13,7 @@
|
||||||
- Fixed issue with poll_users cleaning at every cron job startup [\#1390](https://github.com/torrentpier/torrentpier/pull/1390) ([belomaxorka](https://github.com/belomaxorka))
|
- Fixed issue with poll_users cleaning at every cron job startup [\#1390](https://github.com/torrentpier/torrentpier/pull/1390) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Improved word censor 🤐 [\#1393](https://github.com/torrentpier/torrentpier/pull/1393) ([belomaxorka](https://github.com/belomaxorka))
|
- Improved word censor 🤐 [\#1393](https://github.com/torrentpier/torrentpier/pull/1393) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Used hashing for filenames generation [\#1385](https://github.com/torrentpier/torrentpier/pull/1385) ([belomaxorka](https://github.com/belomaxorka))
|
- Used hashing for filenames generation [\#1385](https://github.com/torrentpier/torrentpier/pull/1385) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391), [\#1394](https://github.com/torrentpier/torrentpier/pull/1394) ([belomaxorka](https://github.com/belomaxorka))
|
- Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391), [\#1394](https://github.com/torrentpier/torrentpier/pull/1394), [\#1395](https://github.com/torrentpier/torrentpier/pull/1395) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- Some bugfixes [\#1380](https://github.com/torrentpier/torrentpier/pull/1380) ([belomaxorka](https://github.com/belomaxorka))
|
- Some bugfixes [\#1380](https://github.com/torrentpier/torrentpier/pull/1380) ([belomaxorka](https://github.com/belomaxorka))
|
||||||
- New Crowdin updates [\#1384](https://github.com/torrentpier/torrentpier/pull/1384), [\#1389](https://github.com/torrentpier/torrentpier/pull/1389), [\#1392](https://github.com/torrentpier/torrentpier/pull/1392) ([Exileum](https://github.com/Exileum))
|
- New Crowdin updates [\#1384](https://github.com/torrentpier/torrentpier/pull/1384), [\#1389](https://github.com/torrentpier/torrentpier/pull/1389), [\#1392](https://github.com/torrentpier/torrentpier/pull/1392) ([Exileum](https://github.com/Exileum))
|
||||||
|
|
||||||
|
|
|
@ -548,9 +548,9 @@ VALUES ('allow_autologin', '1'),
|
||||||
('seed_bonus_points', ''),
|
('seed_bonus_points', ''),
|
||||||
('seed_bonus_tor_size', '0'),
|
('seed_bonus_tor_size', '0'),
|
||||||
('seed_bonus_user_regdate', '0'),
|
('seed_bonus_user_regdate', '0'),
|
||||||
('site_desc', 'A little text to describe your forum'),
|
('site_desc', 'Bull-powered BitTorrent tracker engine'),
|
||||||
('sitemap_time', ''),
|
('sitemap_time', ''),
|
||||||
('sitename', 'TorrentPier - Bull-powered BitTorrent tracker engine'),
|
('sitename', 'TorrentPier'),
|
||||||
('smilies_path', 'styles/images/smiles'),
|
('smilies_path', 'styles/images/smiles'),
|
||||||
('static_sitemap', ''),
|
('static_sitemap', ''),
|
||||||
('topics_per_page', '50'),
|
('topics_per_page', '50'),
|
||||||
|
|
|
@ -2187,19 +2187,28 @@ function profile_url(array $data, bool $target_blank = false): string
|
||||||
$username = $data['username'];
|
$username = $data['username'];
|
||||||
$user_rank = $data['user_rank'];
|
$user_rank = $data['user_rank'];
|
||||||
|
|
||||||
|
if (!isset($user_id)) {
|
||||||
|
throw new InvalidArgumentException('Missing argument: user_id');
|
||||||
|
}
|
||||||
|
if (!isset($username)) {
|
||||||
|
throw new InvalidArgumentException('Missing argument: username');
|
||||||
|
}
|
||||||
|
if (!isset($user_rank)) {
|
||||||
|
throw new InvalidArgumentException('Missing argument: user_rank');
|
||||||
|
}
|
||||||
|
|
||||||
if (!$ranks = $datastore->get('ranks')) {
|
if (!$ranks = $datastore->get('ranks')) {
|
||||||
$datastore->update('ranks');
|
$datastore->update('ranks');
|
||||||
$ranks = $datastore->get('ranks');
|
$ranks = $datastore->get('ranks');
|
||||||
}
|
}
|
||||||
|
|
||||||
$title = $style = '';
|
$title = '';
|
||||||
|
$style = 'colorUser';
|
||||||
if (isset($ranks[$user_rank])) {
|
if (isset($ranks[$user_rank])) {
|
||||||
$title = $ranks[$user_rank]['rank_title'];
|
$title = $ranks[$user_rank]['rank_title'];
|
||||||
$style = $ranks[$user_rank]['rank_style'];
|
if ($bb_cfg['color_nick']) {
|
||||||
}
|
$style = $ranks[$user_rank]['rank_style'];
|
||||||
|
}
|
||||||
if (empty($username)) {
|
|
||||||
$username = $lang['GUEST'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($title)) {
|
if (empty($title)) {
|
||||||
|
@ -2210,14 +2219,6 @@ function profile_url(array $data, bool $target_blank = false): string
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($style)) {
|
|
||||||
$style = 'colorUser';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$bb_cfg['color_nick']) {
|
|
||||||
$style = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
$profile = '<span title="' . $title . '" class="' . $style . '">' . $username . '</span>';
|
$profile = '<span title="' . $title . '" class="' . $style . '">' . $username . '</span>';
|
||||||
if (!in_array($user_id, explode(',', EXCLUDED_USERS))) {
|
if (!in_array($user_id, explode(',', EXCLUDED_USERS))) {
|
||||||
$target_blank = $target_blank ? ' target="_blank" ' : '';
|
$target_blank = $target_blank ? ' target="_blank" ' : '';
|
||||||
|
@ -2290,20 +2291,24 @@ function is_gold($type): string
|
||||||
case TOR_TYPE_SILVER:
|
case TOR_TYPE_SILVER:
|
||||||
$is_gold = '<img width="16" height="15" src="' . $images['icon_tor_silver'] . '" alt="' . $lang['SILVER'] . '" title="' . $lang['SILVER'] . '" /> ';
|
$is_gold = '<img width="16" height="15" src="' . $images['icon_tor_silver'] . '" alt="' . $lang['SILVER'] . '" title="' . $lang['SILVER'] . '" /> ';
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $is_gold;
|
return $is_gold;
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_atom($type, $id)
|
/**
|
||||||
|
* Update atom feed
|
||||||
|
*
|
||||||
|
* @param string $type
|
||||||
|
* @param $id
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function update_atom(string $type, $id): void
|
||||||
{
|
{
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'user':
|
case 'user':
|
||||||
\TorrentPier\Legacy\Atom::update_user_feed($id, get_username($id));
|
\TorrentPier\Legacy\Atom::update_user_feed($id, get_username($id));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'topic':
|
case 'topic':
|
||||||
$topic_poster = (int)DB()->fetch_row("SELECT topic_poster FROM " . BB_TOPICS . " WHERE topic_id = $id LIMIT 1", 'topic_poster');
|
$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\Legacy\Atom::update_user_feed($topic_poster, get_username($topic_poster));
|
||||||
|
|
|
@ -72,7 +72,7 @@ if ($show_dl_list) {
|
||||||
$dl_count[$u['user_status']] = $u['username'];
|
$dl_count[$u['user_status']] = $u['username'];
|
||||||
} else {
|
} else {
|
||||||
$u_prof_href = ($u['user_id'] == GUEST_UID) ? '#' : PROFILE_URL . $u['user_id'] . "#torrent";
|
$u_prof_href = ($u['user_id'] == GUEST_UID) ? '#' : PROFILE_URL . $u['user_id'] . "#torrent";
|
||||||
$dl_cat[$u['user_status']] .= '<nobr><a class="' . $u_link_class . '" href="' . $u_prof_href . '" title="' . $u['last_modified_dlstatus'] . '">' . profile_url(['username' => $u['username'], 'user_rank' => $u['user_rank']]) . '</a></nobr>, ';
|
$dl_cat[$u['user_status']] .= '<nobr><a class="' . $u_link_class . '" href="' . $u_prof_href . '" title="' . $u['last_modified_dlstatus'] . '">' . profile_url(['username' => $u['username'], 'user_id' => $u['user_id'], 'user_rank' => $u['user_rank']]) . '</a></nobr>, ';
|
||||||
$dl_count[$u['user_status']]++;
|
$dl_count[$u['user_status']]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -567,9 +567,6 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
$poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : '';
|
$poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : '';
|
||||||
$poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : '';
|
$poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : '';
|
||||||
$post_id = $postrow[$i]['post_id'];
|
$post_id = $postrow[$i]['post_id'];
|
||||||
$mc_type = (int)$postrow[$i]['mc_type'];
|
|
||||||
$mc_comment = $postrow[$i]['mc_comment'];
|
|
||||||
$mc_user_id = profile_url(['username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']]);
|
|
||||||
|
|
||||||
$rg_id = $postrow[$i]['poster_rg_id'] ?: 0;
|
$rg_id = $postrow[$i]['poster_rg_id'] ?: 0;
|
||||||
$rg_avatar = get_avatar(GROUP_AVATAR_MASK . $rg_id, $postrow[$i]['rg_avatar_id']);
|
$rg_avatar = get_avatar(GROUP_AVATAR_MASK . $rg_id, $postrow[$i]['rg_avatar_id']);
|
||||||
|
@ -658,13 +655,18 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
$pg_row_class = !($i % 2) ? 'row2' : 'row1';
|
$pg_row_class = !($i % 2) ? 'row2' : 'row1';
|
||||||
|
|
||||||
// Mod comment
|
// Mod comment
|
||||||
$mc_class = match ($mc_type) {
|
if ($mc_type = (int)$postrow[$i]['mc_type']) {
|
||||||
1 => 'success',
|
$mc_comment = $postrow[$i]['mc_comment'];
|
||||||
2 => 'info',
|
$mc_user_id = profile_url(['username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']]);
|
||||||
3 => 'warning',
|
|
||||||
4 => 'danger',
|
$mc_class = match ($mc_type) {
|
||||||
default => '',
|
1 => 'success',
|
||||||
};
|
2 => 'info',
|
||||||
|
3 => 'warning',
|
||||||
|
4 => 'danger',
|
||||||
|
default => '',
|
||||||
|
};
|
||||||
|
}
|
||||||
$mc_select_type = [];
|
$mc_select_type = [];
|
||||||
foreach ($lang['MC_COMMENT'] as $key => $value) {
|
foreach ($lang['MC_COMMENT'] as $key => $value) {
|
||||||
$mc_select_type[$key] = $value['type'];
|
$mc_select_type[$key] = $value['type'];
|
||||||
|
@ -711,10 +713,10 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
|
|
||||||
'POSTER_BIRTHDAY' => user_birthday_icon($postrow[$i]['user_birthday'], $postrow[$i]['user_id']),
|
'POSTER_BIRTHDAY' => user_birthday_icon($postrow[$i]['user_birthday'], $postrow[$i]['user_id']),
|
||||||
|
|
||||||
'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '',
|
'MC_COMMENT' => isset($mc_comment) ? bbcode2html($mc_comment) : '',
|
||||||
'MC_BBCODE' => $mc_type ? $mc_comment : '',
|
'MC_BBCODE' => $mc_comment ?? '',
|
||||||
'MC_CLASS' => $mc_class,
|
'MC_CLASS' => $mc_class ?? '',
|
||||||
'MC_TITLE' => sprintf($lang['MC_COMMENT'][$mc_type]['title'], $mc_user_id),
|
'MC_TITLE' => isset($mc_user_id) ? sprintf($lang['MC_COMMENT'][$mc_type]['title'], $mc_user_id) : '',
|
||||||
'MC_SELECT_TYPE' => build_select("mc_type_$post_id", array_flip($mc_select_type), $mc_type),
|
'MC_SELECT_TYPE' => build_select("mc_type_$post_id", array_flip($mc_select_type), $mc_type),
|
||||||
|
|
||||||
'RG_AVATAR' => $rg_avatar,
|
'RG_AVATAR' => $rg_avatar,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue