mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Added ability to view "Watching topics" of other people's (Admins) (#1336)
* Added ability to view "Watching topics" of other people's (For admins only) * Update CHANGELOG.md
This commit is contained in:
parent
3e92b105ad
commit
f154d706f8
6 changed files with 15 additions and 4 deletions
|
@ -6,6 +6,7 @@
|
|||
**Merged pull requests:**
|
||||
|
||||
- Release 2.4.1 🦉 ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky))
|
||||
- Added ability to view "Watching topics" of other people's (For admins only) [\#1336](https://github.com/torrentpier/torrentpier/pull/1336) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Added `bt_announce_url` autofill [\#1331](https://github.com/torrentpier/torrentpier/pull/1331) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Added "Random release" button in tracker.php [\#1334](https://github.com/torrentpier/torrentpier/pull/1334) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Added support for fastly cdn [\#1327](https://github.com/torrentpier/torrentpier/pull/1327) ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky))
|
||||
|
|
|
@ -755,7 +755,7 @@ function get_username($user_id)
|
|||
return $usernames;
|
||||
}
|
||||
|
||||
$row = DB()->fetch_row("SELECT username FROM " . BB_USERS . " WHERE user_id = $user_id LIMIT 1");
|
||||
$row = DB()->fetch_row("SELECT username FROM " . BB_USERS . " WHERE user_id = '" . DB()->escape($user_id) . "' LIMIT 1");
|
||||
return $row['username'];
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,17 @@ $page_cfg['include_bbcode_js'] = true;
|
|||
|
||||
$tracking_topics = get_tracks('topic');
|
||||
$user_id = $userdata['user_id'];
|
||||
if (isset($_GET['uid'])) {
|
||||
if (get_username($_GET['uid'])) {
|
||||
if ($_GET['uid'] == $userdata['user_id'] || IS_ADMIN) {
|
||||
$user_id = DB()->escape($_GET['uid']);
|
||||
} else {
|
||||
bb_die($lang['NOT_AUTHORISED']);
|
||||
}
|
||||
} else {
|
||||
bb_die($lang['USER_NOT_EXIST']);
|
||||
}
|
||||
}
|
||||
$start = isset($_GET['start']) ? abs((int)$_GET['start']) : 0;
|
||||
$per_page = $bb_cfg['topics_per_page'];
|
||||
|
||||
|
|
|
@ -1584,7 +1584,7 @@ $lang['DEL_LIST_INFO'] = 'To delete an order from the list, click on the icon to
|
|||
|
||||
// Watched topics
|
||||
$lang['WATCHED_TOPICS'] = 'Watched topics';
|
||||
$lang['NO_WATCHED_TOPICS'] = 'You are not watching any topics';
|
||||
$lang['NO_WATCHED_TOPICS'] = 'No watching any topics';
|
||||
|
||||
// set_die_append_msg
|
||||
$lang['INDEX_RETURN'] = 'Back to home page';
|
||||
|
|
|
@ -377,7 +377,7 @@ ajax.callback.index_data = function(data) {
|
|||
[ <a href="{U_SEARCH_USER}" class="med">{L_SEARCH_USER_POSTS}</a> ]
|
||||
[ <a href="{U_SEARCH_TOPICS}" class="med">{L_SEARCH_USER_TOPICS}</a> ]
|
||||
[ <a href="{U_SEARCH_RELEASES}" class="med">{L_SEARCH_RELEASES}</a> ]
|
||||
<!-- IF PROFILE_USER -->[ <a href="{U_WATCHED_TOPICS}" class="med">{L_WATCHED_TOPICS}</a> ]<!-- ENDIF -->
|
||||
<!-- IF PROFILE_USER || IS_ADMIN -->[ <a href="{U_WATCHED_TOPICS}&uid={PROFILE_USER_ID}" class="med">{L_WATCHED_TOPICS}</a> ]<!-- ENDIF -->
|
||||
[ <a title="{L_ATOM_SUBSCRIBE}" href="#" onclick="return post2url('feed.php', {mode: 'get_feed_url', type: 'u', id: {PROFILE_USER_ID}})">{FEED_IMG}</a> ]
|
||||
</p>
|
||||
</td>
|
||||
|
|
|
@ -301,7 +301,6 @@ if (isset($_GET[$user_releases_key])) {
|
|||
if (isset($_GET['random_release'])) {
|
||||
if ($random_release = DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE tor_status NOT IN(" . implode(', ', array_keys($bb_cfg['tor_frozen'])) . ") ORDER BY RAND() LIMIT 1")) {
|
||||
redirect(TOPIC_URL . $random_release['topic_id']);
|
||||
unset($random_release);
|
||||
} else {
|
||||
bb_die($lang['NO_MATCH']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue