Update to Member List - New Click Options

FYI,

Have updated our memberlist :

https://www.unix.com/members/list/?order=DESC&sort=lastvisit&pp=30

$cat memberlist.php

...

 375         // added next line by neo 15 Nov 2018
 376         $condition .= ' AND credits > 0';

...

The reason for this change is insure the list contains active members (member with more than 0 credits).

Please feel free to comment in this thread if have any concerns or suggestions.

Update:

For anyone who wants to see the entire list, I added two options you can add to the query:

 370         else if ($vbulletin->options['memberlistposts'])
 371         {       // added next line by neo 15 Nov 2018
 372                  if($_REQUEST['showall'] > '1')
 373                     $condition .= ' AND posts >= 0';
 374                  else
 375                     $condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'];
 376         }
 377 
 378         // added next line by neo 15 Nov 2018
 379         if($_REQUEST['showall'] < '1')
 380            $condition .= ' AND credits > 0';

So, you can simply add:

&showall=1 

at the end of a query to see the members with more than zero posts and any amounts of bits

or

&showall=2

to see all members regardless of the number of posts or bits:

Examples:

Default:  https://www.unix.com/members/list/?order=DESC&sort=lastvisit&pp=30

Show Members with Zero Bits: https://www.unix.com/members/list/?order=DESC&sort=lastvisit&pp=30&showall=1

Show Zero Bits and Zero Posts:  https://www.unix.com/members/list/?order=DESC&sort=lastvisit&pp=30&showall=2

If you use this list frequently and want to see a button, menu or a link for the options above, please let me know.

If no one needs a menu, button or links... no reason to add them if no one needs them, obviously :wink:

Update:

I added this jQuery to the memberlist HTML page:

$(function() {
  $("a#memberlisttitle").click(function() {
    var n = localStorage.getItem("mlstate");
    if (n === null) {
      n = 0;
    }
    n++;
    if (n > 2) n = 0;
    localStorage.setItem("mlstate", n);
    if (n == 0)
      $("a#memberlisttitle").attr({
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30"
      });
    else if (n == 1)
      $("a#memberlisttitle").attr({
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30&showall=1"
      });
    else if (n == 2)
      $("a#memberlisttitle").attr({
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30&showall=2"
      });
  });
});

Originally tried doing this in view, but because the page reloads, it was easier to do in jQuery. If I changed the memberlist to load using AJAX and not reloading the page (maybe something to do in future), then Vue.js would have been the better choice.

Basically, you can click on the text in the top left corner of the list and cycle through 3 different views and if you have a view you particularly like, the value is stored in your browser localStorage so you will always have that view until you change it, even it you log out, close your browser, and log back in.

This started out as a Vue.js project, but I ended up doing it in jQuery and not Vue, LOL

Update: Made small change. To click on "Change Memberlist View" to toggle through the three different views - see image below:

As I mentioned, this feature started out as a Vue.js component-project that I converted to jQuery mostly because the page reloads so a reactive JS lib like Vue.js did not seem to add any real value and make a simple task with jQuery a bit more complex. Perhaps I am just not very talented with Vue.js yet.