diff --git a/pkg/controller/forum/forum.go b/pkg/controller/forum/forum.go index d3be6cb..5661935 100644 --- a/pkg/controller/forum/forum.go +++ b/pkg/controller/forum/forum.go @@ -66,8 +66,10 @@ func Forum() http.HandlerFunc { return } - // Inject pinned threads on top. - threads = append(pinned, threads...) + // Inject pinned threads on top of the first page. + if pager.Page == 1 { + threads = append(pinned, threads...) + } // Map the statistics (replies, views) of these threads. threadMap := models.MapThreadStatistics(threads) diff --git a/pkg/models/user.go b/pkg/models/user.go index c5f53bc..6e93485 100644 --- a/pkg/models/user.go +++ b/pkg/models/user.go @@ -343,13 +343,13 @@ func SearchUsers(user *User, search *UserSearch, pager *Pagination) ([]*User, er } if len(blockedUserIDs) > 0 { - wheres = append(wheres, "id NOT IN ?") + wheres = append(wheres, "users.id NOT IN ?") placeholders = append(placeholders, blockedUserIDs) } if search.Username != "" { ilike := "%" + strings.TrimSpace(strings.ToLower(search.Username)) + "%" - wheres = append(wheres, "(username LIKE ? OR name ILIKE ?)") + wheres = append(wheres, "(users.username LIKE ? OR users.name ILIKE ?)") placeholders = append(placeholders, ilike, ilike) }