The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

List of members/users

4 posters

Go down

Solved List of members/users

Post by Fildragon March 16th 2017, 8:16 am

Is there any way to get an array with all the registered users on the forum that I can loop through in javascript. I need to create a list of users with just the usernames, both those logged in and not logged in.


Last edited by Fildragon on April 6th 2017, 7:01 am; edited 1 time in total
Fildragon
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by SLGray March 16th 2017, 8:27 am

Do you mean like the memberlist?


List of members/users Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: List of members/users

Post by Fildragon March 16th 2017, 8:35 am

I am trying to create a user base for RumbleTalk chat. They have an api which allows creation of users from an existing userbase. For this I need an array with all the member names of the forum. Seen we have over 400 members on our forum this is a huge task to do manually. So I was wondering if there is a variable I can use, like as an example _userdata.username (which returns the active users name) but which returns the full list of members (just the names). Or a work around to achieve this.
Fildragon
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by SLGray March 16th 2017, 8:52 am

Maybe this will give you an example: http://fmdesign.forumotion.com/t1124-_userdata-usergroup ?


List of members/users Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51453
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: List of members/users

Post by Fildragon March 16th 2017, 3:39 pm

No that didn't help. Still not understanding how to get a memberlist.
Fildragon
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by Kyo Panda March 30th 2017, 2:30 pm

I know that this topic is kinda dead, but if you (or anyone) wants the code:

Code:
/*globals jQuery*/
 
/**
 * Retrieves a list of all usernames and outputs it in the browser console.
 *
 * You must run it in the /memberlist page through the browser console.
 *
 * @author Kyo Panda
 * @see <a href="http://ajuda.forumeiros.com">Fórum dos Fóruns</a>
 * @license MIT
 */
 
(function($) {
   'use strict';
   
   var config = {
      /**
       * How many members pages should the script fetch?
       *    Set it to -1 to fetch all pages.
       */
      limit: 5,
      
      /**
       * How long, in milliseconds, should the script wait before
       * fetching a new page?
       *    It's recommended to set it above 3000 to avoid FA request
       *    throttling.
       */
      wait: 3000
   };
   
   $(function() {
      var last = ~~$('.pagination a:last')
         .prev()
         .attr('href')
         .split('start=')
         .pop()
         .split('&')
         .shift()
      ;
      
      var index = 0;
      
      var end = config.limit > -1 ?
         Math.min(config.limit, last / 30 + 1) : last / 30 + 1;
         
      var users = [];
      var promises = [];
      
      var done = function() {
         $.when.apply(null, promises).then(function() {
            console.log('["' + users.join('", "') + '"]');
         });
      };
      
      var interval = setInterval(function() {         
         console.log('Loading page', index / 30 + 1, 'of', end);
         
         var promise = $.get('/memberlist', {
            change_version: 'modernbb',
            mode: 'joined',
            start: index,
         }, function(context) {
            $('.avatar-mini', context).each(function() {
               users.push($(this).text().trim());
            });
         });
         
         promises.push(promise);
         
         if (index === (end - 1) * 30) {
            clearInterval(interval);
            done();
         }
         
         index += 30;
      }, config.wait);
   });
}(jQuery));

Further instructions are in the code. o/
Kyo Panda
Kyo Panda
Forumember

Male Posts : 33
Reputation : 19
Language : Portuguese, English
Location : Brazil

http://pt.rpgmaker.io

Back to top Go down

Solved Re: List of members/users

Post by Fildragon March 30th 2017, 8:50 pm

no thx, I had found a work around but this might help too
Fildragon
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by Ape March 30th 2017, 10:49 pm

@Fildragon is this now solved?

If yes please tell us how you did this and then mark your thread as solved so we can lock it


List of members/users Left1212List of members/users Center11List of members/users Right112
List of members/users Ape_b110
List of members/users Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: List of members/users

Post by Fildragon April 6th 2017, 7:02 am

I don't know why, but I mark the topics as solved and it doesn't get accepted. Then I come back and see it is not marked as solved. I used the current active user to create their own chat login. Was not the best solution but it works.
Fildragon
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by Ape April 6th 2017, 3:27 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


List of members/users Left1212List of members/users Center11List of members/users Right112
List of members/users Ape_b110
List of members/users Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19075
Reputation : 1988
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

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