List of members/users
4 posters
Page 1 of 1
List of members/users
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- New Member
- Posts : 21
Reputation : 1
Language : english
Re: List of members/users
Do you mean like the memberlist?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: List of members/users
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- New Member
- Posts : 21
Reputation : 1
Language : english
Re: List of members/users
Maybe this will give you an example: http://fmdesign.forumotion.com/t1124-_userdata-usergroup ?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: List of members/users
No that didn't help. Still not understanding how to get a memberlist.
Fildragon- New Member
- Posts : 21
Reputation : 1
Language : english
Re: List of members/users
I know that this topic is kinda dead, but if you (or anyone) wants the code:
Further instructions are in the code. o/
- 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/
Re: List of members/users
no thx, I had found a work around but this might help too
Fildragon- New Member
- Posts : 21
Reputation : 1
Language : english
Re: List of members/users
@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
If yes please tell us how you did this and then mark your thread as solved so we can lock it
Re: List of members/users
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- New Member
- Posts : 21
Reputation : 1
Language : english
Re: List of members/users
Problem solved & topic archived.
|
Similar topics
» list of the users who are looking
» Users seeing there own list of topics ????
» Chatbox - users list fail
» The online users list (IPs and time cut-off)
» The list of users that have never visited forum
» Users seeing there own list of topics ????
» Chatbox - users list fail
» The online users list (IPs and time cut-off)
» The list of users that have never visited forum
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum