The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

List of members/users

View previous topic View next topic Go down

Solved List of members/users

Post by Fildragon on 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
avatar
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

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

Do you mean like the memberlist?


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

avatar
SLGray
Administrator
Administrator

Male Posts : 41179
Reputation : 2816
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Solved Re: List of members/users

Post by Fildragon on 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.
avatar
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

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

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


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

avatar
SLGray
Administrator
Administrator

Male Posts : 41179
Reputation : 2816
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Solved Re: List of members/users

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

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

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by Kyo Panda on 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/
avatar
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 on March 30th 2017, 8:50 pm

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

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by APE on 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



avatar
APE
Manager
Manager

Male Posts : 11299
Reputation : 1083
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

Solved Re: List of members/users

Post by Fildragon on 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.
avatar
Fildragon
New Member

Posts : 21
Reputation : 1
Language : english

Back to top Go down

Solved Re: List of members/users

Post by APE on April 6th 2017, 3:27 pm

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



avatar
APE
Manager
Manager

Male Posts : 11299
Reputation : 1083
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

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

Back to top Go down

View previous topic View next topic Back to top


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