Update to Member List - New Click Options

bits, credits, discussions, forum administration, jquery, list, memberlist, memberlist.php, update

Thread Tools Search this Thread
# 1  
Old 11-15-2018
Update to Member List - New Click Options


Have updated our memberlist :


$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  
Old 11-15-2018

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         }
 378         // added next line by neo 15 Nov 2018
 379         if($_REQUEST['showall'] < '1')
 380            $condition .= ' AND credits > 0';

So, you can simply add:


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



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


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  
Old 11-16-2018

I added this jQuery to the memberlist HTML page:

$(function() {
  $("a#memberlisttitle").click(function() {
    var n = localStorage.getItem("mlstate");
    if (n === null) {
      n = 0;
    if (n > 2) n = 0;
    localStorage.setItem("mlstate", n);
    if (n == 0)
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30"
    else if (n == 1)
        href: "/members/list/?order=DESC&sort=lastvisit&pp=30&showall=1"
    else if (n == 2)
        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
# 4  
Old 11-17-2018
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.

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 What is on Your Mind? 22 07-24-2018 12:23 AM
Update to Navbar - Member Info and Avatars Neo What is on Your Mind? 53 07-19-2018 12:43 PM
List of 'if -f' options - AIX / Korn Shell Grueben UNIX for Dummies Questions & Answers 5 02-01-2012 11:07 AM
grep option to print the first match of each member of a list? yifangt Shell Programming and Scripting 5 11-29-2011 12:46 PM
How to Right Click On Laptop N-Training OS X (Apple) 2 12-17-2010 09:56 PM
Left click select,right click copy new2ss UNIX for Dummies Questions & Answers 1 06-11-2007 12:00 PM