Update to Member List - New Click Options


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Update to Member List - New Click Options

FYI,

Have updated our memberlist :

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

Code:
$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.
# 2  
Update:

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

Code:
 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:

Code:
&showall=1

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


or

Code:
&showall=2

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


Examples:

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 Smilie
# 3  
Update:

I added this jQuery to the memberlist HTML page:

Code:
$(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.

Image

This started out as a Vue.js project, but I ended up doing it in jQuery and not Vue, LOL
# 4  
Update: Made small change. To click on "Change Memberlist View" to toggle through the three different views - see image below:

Image

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.
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Update to Posts - Member Info Icon and Badge
Neo
Hey, Upgrade (step 1) the posts, by putting a "user info" icon in the top right and making it so it toggles the user info. The user info icon has a badge which shows the number of posts. I will have to dig around in the code more to get the total posts thanks and other badges working; but...... What is on Your Mind?
22
What is on Your Mind?
Update to Navbar - Member Info and Avatars
Neo
Hey, I moved the user information in the top right on the navbar to side panel and replace it with a clickable avatar image. If you have an avatar, you will see your avatar and if you don't you will see some default one (will change it to something better later). If you have any notification...... What is on Your Mind?
53
What is on Your Mind?

Featured Tech Videos