mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Minor improvements (#1536)
* Minor improvements * Update viewtopic_attach.tpl * Update viewtopic_attach.tpl * Update viewforum.tpl * Update viewforum.tpl * Update viewtopic.tpl * Update viewtopic.tpl * Update CHANGELOG.md * Updated * Update defines.php
This commit is contained in:
parent
97d42c599d
commit
126c75cd57
8 changed files with 29 additions and 25 deletions
|
@ -25,13 +25,17 @@ if (!$topic_id = (int)$this->request['topic_id']) {
|
|||
$this->ajax_die($lang['INVALID_TOPIC_ID']);
|
||||
}
|
||||
|
||||
if (!$poster_id = (int)$this->request['poster_id']) {
|
||||
$this->ajax_die($lang['NO_USER_ID_SPECIFIED']);
|
||||
}
|
||||
|
||||
switch ($mode) {
|
||||
case 'add':
|
||||
if (IS_GUEST) {
|
||||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
||||
}
|
||||
|
||||
if (DB()->fetch_row('SELECT poster_id FROM ' . BB_BT_TORRENTS . " WHERE topic_id = $topic_id AND poster_id = " . $userdata['user_id'])) {
|
||||
if ($poster_id == $userdata['user_id']) {
|
||||
$this->ajax_die($lang['LIKE_OWN_POST']);
|
||||
}
|
||||
|
||||
|
@ -48,14 +52,13 @@ switch ($mode) {
|
|||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
||||
}
|
||||
|
||||
$sql = DB()->fetch_rowset('SELECT u.username, u.user_rank, u.user_id, t.* FROM ' . BB_THX . ' t, ' . BB_USERS . " u WHERE t.topic_id = $topic_id AND t.user_id = u.user_id");
|
||||
|
||||
$user_list = [];
|
||||
$sql = DB()->fetch_rowset('SELECT u.username, u.user_rank, u.user_id, t.* FROM ' . BB_THX . ' t, ' . BB_USERS . " u WHERE t.topic_id = $topic_id AND t.user_id = u.user_id");
|
||||
foreach ($sql as $row) {
|
||||
$user_list[] = '<b>' . profile_url($row) . ' <i>(' . bb_date($row['time']) . ')</i></b>';
|
||||
}
|
||||
|
||||
$this->response['html'] = join(', ', $user_list) ?: $lang['NO_LIKES'];
|
||||
$this->response['html'] = implode(', ', $user_list) ?: $lang['NO_LIKES'];
|
||||
break;
|
||||
default:
|
||||
$this->ajax_die('Invalid mode: ' . $mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue