User selectable pagination

NodeBB Development
  • For those who prefer traditional pagination you can now enable it from user/settings page. You can select the number of posts/topics per page too. It only works for category and topic views for now but we may extend it over to /recent /unread /popular in the future.

  • Appreciate it 🙂

  • @baris,

    Very nice! However, this brings up an interesting situation. Does the pagination setting in the ACP take precedence over the user pagination setting? And will there be an option in the pagination settings page in the ACP that will make it possible for the admin to override the user-specific setting?

  • It is the other way around user setting takes precedence over admin setting. If the user didn't select anything the admin setting is used.

  • @baris

    But don't you think it'd be better that the admin be one that enable users to have the privilege of being able to choose whether to use pagination or infinite scrolling. I think the ultimate decision should the admin's, rather than users.

  • What I think is more important than the decision whether users are allowed to use pagination or not is letting the admin set a maximum value for per-page entries therefor users cannot exceed the bandwidth in large topics by setting posts per page to 99999999 or whatever.

    Also nice would be sth. like a mix of pagination and ininite scrolling by enabling infinite scroll for each page, therefor you can easily paginate to the last page (in many circumstances nice to have) and within each page you appreciate infinite (until the pages end or even update the navigation to sth. like 1 | 5 | 6-8 | 9 | 42) scrolling

  • I agree with the max limit. As for infinite scroll vs. pagination - at least for me - feels very much like a user preference thing rather than something to impose on your users

  • Issue: the URL with pagination shows sth. like ?page=5. With user-defined page-sizes it's the wrong behavior since the users may want to share specific pages. you may change it to sth. like ?posts=20-40

    Btw: A reference-anchor for each post would be great too 🙂

  • Yeah, gets very confusing once you factor in page #s and such. I'd prefer the "posts per page" and "topics per page" options remain admin-only, while allowing users to toggle between pagination and infinite scrolling.

    A "hybrid" pagination+infinite scrolling would be nice as well, so you can get the best of both worlds.


Suggested Topics


  • 0 Votes
    4 Posts
    1k Views

    @baris would be nice to have the pagination component build as a plugin. That way people could just use the same hooks at the actual component and modify or implement different ways of pagination.

    I think that if i would want to build a different way of pagination (lets say, use a lib for that) even if i use the same hook for pagination socket.on('event:new_post', onNewPost); , because the pagination code still present in the core of nodebb, that code would execute anyway, so even if i use my own code to paginate, the core code would execute, even it would not needed at all.

    I think it should not be difficult to migrate the pagination mechanism to a plugin, as it was made for the composer. Or maybe the bast majority of the core code should still present but a few new hooks should be created.

    Powerfull and more usefull IMO.

  • 0 Votes
    3 Posts
    2k Views

    Those userrs are stored in groups with special names, here are the names assuming the category id is 1.

    cid:1:privileges:find
    cid:1:privileges:read
    cid:1:privileges:topics:create
    cid:1:privileges:topics:reply

    You can get the user ids from these groups by.

    Groups.getMembers('cid:1:privileges:find', 0, -1, callback); This will give you all the user ids that have the find permission for category 1.

    If you want to get their basic info like username picture slug so you can show user icons you can just use Groups.getMemberUsers('cid:1:privileges:find', 0, -1, calllback);

  • 0 Votes
    2 Posts
    1k Views

    @trevor I think they recently implemented that when a user is deleted/banned, that their socket get closed. Or words to that effect. Don't quote me on that though.

  • 0 Votes
    6 Posts
    2k Views

    👍 Glad to hear it. #933 for latest updates.

  • 0 Votes
    3 Posts
    2k Views

    @julian

    I think Latest Users means, or should mean, the same thing as Verified Users. In other words, if an account has not been verified, it's never listed under Latest Users.

    Along those lines, an option that will allow the admin to enable auto-purging (auto-deleting) user accounts that have not been verified after X number of days would be nice, too.