FM Themes
Welcome to FM Themes
where you can share your punBB, phpBB 2, Invision, & phpBB 3 themes for Forumotion forums.

You are viewing the forum as a guest, so you will not be able to use the full forum. To use all the features of the forum, you need to log in or create a FREE account by registering.

Adding Groups Column To Memberlist

View previous topic View next topic Go down

Solved Adding Groups Column To Memberlist

Post by SLGray on Tue Apr 28, 2015 5:21 pm

I have been trying to add the groups column to the memberlist, but the information does not appear unless you sorted the list by groups.  The column appears with no information.  I tried to modify the memberlist template.


Last edited by SLGray on Wed May 06, 2015 1:38 pm; edited 1 time in total

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by brandon_g on Wed Apr 29, 2015 7:18 am

Is this for FMThemes? May you provide a screenshot and/or link to the topic or tutorial you saw this in?

brandon_g
Coder

Reputation : 67
Points : 2255
Posts : 497

View user profile http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Wed Apr 29, 2015 9:58 pm

It is for FM Themes.  I have not used a tutorial.

I was going to post a tutorial about it.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by brandon_g on Wed Apr 29, 2015 10:07 pm

Well what is the code(s) for it?

brandon_g
Coder

Reputation : 67
Points : 2255
Posts : 497

View user profile http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by JScript on Thu Apr 30, 2015 11:39 am

[You must be registered and logged in to see this link.]

Hello, see if the code below help you on something:
Code:

jQuery(function() {
   // Reads the label of the groups in the index...
   $.get('/', function(data) {
      var isSortbyGrp = location.search.indexOf('groups');
      if (isSortbyGrp == -1) {
         jQuery('th.tcl.memberlist').after('<th class="tc2">Usergroups</th>');
      }
      var aGroup = jQuery('#onlinelist p:last', data),
         oTarget = jQuery('td.tcl.avatar-mini'),
         oThis = null,
         color = null;

      for (i = 0, len = oTarget.length; i < len; i++) {
         oThis = jQuery(oTarget[i]);

         color = oThis.find('.gen span:last').attr('style');
         if (color !== undefined) {
            if (isSortbyGrp == -1) {
               oThis.after('<td class="tc2">' + aGroup.find('a[style="' + color.replace(':', ': ') + '"]').prop('outerHTML') + '</td>');
            } else {
               oThis.next().html(aGroup.find('a[style="' + color.replace(':', ': ') + '"]').prop('outerHTML'));
            }
         } else {
            if (isSortbyGrp == -1) {
               oThis.after('<td class="tc2">Members</td>');
            }
         }
      }
      //}).done(function(data) {
   });
});

Result: [You must be registered and logged in to see this link.]

The code is only a sketch, it can become much better and available to all versions in a single JavaScript for example.

So long,

JS

JScript
Tutor

Reputation : 2
Points : 306
Posts : 15

View user profile

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Thu Apr 30, 2015 6:45 pm

Thanks @"JScript " .

It did add the column and groups.  There is an issue when you sort by groups.  It does not group them together.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by JScript on Thu Apr 30, 2015 7:22 pm

[You must be registered and logged in to see this link.] wrote:(...)There is an issue when you sort by groups.  It does not group them together.  
I confess, I did not understand very well!

You refer to it: [You must be registered and logged in to see this link.] ?

Could you explain better?

JS

JScript
Tutor

Reputation : 2
Points : 306
Posts : 15

View user profile

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Thu Apr 30, 2015 8:39 pm

[You must be registered and logged in to see this link.] wrote:
[You must be registered and logged in to see this link.] wrote:(...)There is an issue when you sort by groups.  It does not group them together.  
I confess, I did not understand very well!

You refer to it: [You must be registered and logged in to see this link.] ?

Could you explain better?

JS
Ok.  When I tested it, it went like this:

Administrator
VIP Member
Administrator
Member

When I used the sort option.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Sat May 02, 2015 3:51 pm

I just tested it again.  I notice why it looks messed up.  The reason why is that if you are in more than one group, you are listed in all groups.

Is there a way to remove the group option in the sort dropdown menu?

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by JScript on Tue May 05, 2015 8:39 am

[You must be registered and logged in to see this link.] wrote:Is there a way to remove the group option in the sort dropdown menu?
Yes!

Add this:
Code:
jQuery('option[value="groups"]').remove();

JS

JScript
Tutor

Reputation : 2
Points : 306
Posts : 15

View user profile

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Tue May 05, 2015 11:21 pm

It does not remove it.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by JScript on Wed May 06, 2015 5:54 am

[You must be registered and logged in to see this link.] wrote:It does not remove it.
Of course yes!
I do not know how you used the line of code, but try to change the current code for this:
Code:

jQuery(function() {
   if (location.pathname == "/memberlist") {
      jQuery('option[value="groups"]').remove();
      // Reads the label of the groups in the index...
      $.get('/', function(data) {
         var isSortbyGrp = location.search.indexOf('groups');
         if (isSortbyGrp == -1) {
            jQuery('th.tcl.memberlist').after('<th class="tc2">Usergroups</th>');
         }
         var aGroup = jQuery('#onlinelist p:last', data),
            oTarget = jQuery('td.tcl.avatar-mini'),
            oThis = null,
            color = null;

         for (i = 0, len = oTarget.length; i < len; i++) {
            oThis = jQuery(oTarget[i]);

            color = oThis.find('.gen span:last').attr('style');
            if (color !== undefined) {
               if (isSortbyGrp == -1) {
                  oThis.after('<td class="tc2">' + aGroup.find('a[style="' + color.replace(':', ': ') + '"]').prop('outerHTML') + '</td>');
               } else {
                  oThis.next().html(aGroup.find('a[style="' + color.replace(':', ': ') + '"]').prop('outerHTML'));
               }
            } else {
               if (isSortbyGrp == -1) {
                  oThis.after('<td class="tc2">Members</td>');
               }
            }
         }
         //}).done(function(data) {
      });
   }
});

JS

JScript
Tutor

Reputation : 2
Points : 306
Posts : 15

View user profile

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Wed May 06, 2015 1:37 pm

Thanks [You must be registered and logged in to see this link.] . It works perfectly now.

Topic solved and archived

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Solved Re: Adding Groups Column To Memberlist

Post by SLGray on Sat Jul 11, 2015 9:44 pm

[You must be registered and logged in to see this link.]

Please create a tutorial for this coding.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum