List of members/users Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
4 posters

    List of members/users

    Fildragon
    Fildragon
    New Member


    Posts : 21
    Reputation : 1
    Language : english

    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
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    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.
    Fildragon
    Fildragon
    New Member


    Posts : 21
    Reputation : 1
    Language : english

    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.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    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.
    Fildragon
    Fildragon
    New Member


    Posts : 21
    Reputation : 1
    Language : english

    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.
    Kyo Panda
    Kyo Panda
    Forumember


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

    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/
    Fildragon
    Fildragon
    New Member


    Posts : 21
    Reputation : 1
    Language : english

    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
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19324
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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
    Fildragon
    Fildragon
    New Member


    Posts : 21
    Reputation : 1
    Language : english

    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.
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19324
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

    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