mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -07:00
Minor improvements (#1263)
This commit is contained in:
parent
7beb4afa72
commit
b16ee57faf
6 changed files with 12 additions and 7 deletions
|
@ -2175,9 +2175,9 @@ function user_birthday_icon($user_birthday, $user_id): string
|
|||
* Returns information about user ban
|
||||
*
|
||||
* @param int $userId
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
function getUserBanInfo(int $userId): array
|
||||
function getUserBanInfo(int $userId): ?array
|
||||
{
|
||||
return DB()->fetch_row("SELECT * FROM " . BB_BANLIST . " WHERE ban_userid = $userId LIMIT 1");
|
||||
}
|
||||
|
@ -2185,9 +2185,9 @@ function getUserBanInfo(int $userId): array
|
|||
/**
|
||||
* Returns information about all bans
|
||||
*
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
function getAllBans(): array
|
||||
function getAllBans(): ?array
|
||||
{
|
||||
return DB()->fetch_rowset("SELECT * FROM " . BB_BANLIST);
|
||||
}
|
||||
|
|
|
@ -397,7 +397,7 @@ $userdata =& $user->data;
|
|||
/**
|
||||
* Initial ban check
|
||||
*/
|
||||
if ($banInfo = getUserBanInfo($user->id)) {
|
||||
if ($banInfo = getUserBanInfo((int)$user->id)) {
|
||||
if (!IS_GUEST) {
|
||||
$user->session_end();
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) {
|
|||
}
|
||||
|
||||
// Ban information
|
||||
if ($banInfo = getUserBanInfo($profiledata['user_id'])) {
|
||||
if ($banInfo = getUserBanInfo((int)$profiledata['user_id'])) {
|
||||
$template->assign_block_vars('ban', [
|
||||
'IS_BANNED' => true,
|
||||
'BAN_REASON' => $banInfo['ban_reason']
|
||||
|
|
|
@ -295,7 +295,9 @@ ajax.callback.index_data = function(data) {
|
|||
<th>{L_USERNAME}:</th>
|
||||
<td id="username">
|
||||
<span class="editable bold">{USERNAME}</span>
|
||||
<!-- BEGIN ban -->
|
||||
<!-- IF ban.IS_BANNED --><b title="{L_BANNED_USERS}" style="color: red;">{L_BANNED}</b><!-- ENDIF -->
|
||||
<!-- END ban -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- IF SHOW_ROLE -->
|
||||
|
|
|
@ -361,7 +361,10 @@ function build_poll_add_form (src_el)
|
|||
<p class="nick">{postrow.POSTER_NAME} <!-- IF postrow.POSTER_AUTHOR --><sup>®</sup><!-- ENDIF --></p>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- BEGIN ban -->
|
||||
<!-- IF postrow.ban.IS_BANNED --><p class="poster-banned" title="{L_BANNED_USERS}">{L_BANNED}</p><!-- ENDIF -->
|
||||
<!-- END ban -->
|
||||
|
||||
<!-- IF postrow.POSTER_RANK --><p class="rank_txt">{postrow.POSTER_RANK}</p><!-- ENDIF -->
|
||||
<!-- IF postrow.RANK_IMAGE --><p class="rank_img">{postrow.RANK_IMAGE}</p><!-- ENDIF -->
|
||||
<!-- IF postrow.POSTER_AVATAR --><p class="avatar">{postrow.POSTER_AVATAR}</p><!-- ENDIF -->
|
||||
|
|
|
@ -736,7 +736,7 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
]);
|
||||
|
||||
// Ban information
|
||||
if ($banInfo = getUserBanInfo($poster_id)) {
|
||||
if ($banInfo = getUserBanInfo((int)$poster_id)) {
|
||||
$template->assign_block_vars('postrow.ban', [
|
||||
'IS_BANNED' => true,
|
||||
'BAN_REASON' => $banInfo['ban_reason']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue