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.

How can i active thousands of users at once?

5 posters

Go down

In progress How can i active thousands of users at once?

Post by jooda September 18th 2019, 12:30 pm

Hi

I was ill and away, but now im back on my forum after many years, I have alot of user accounts I need to activate. Is there a way I can mass activate all accounts?

There is over 1000 pages of inactive users I need to activate
https://prnt.sc/p7oqdo
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by skouliki September 18th 2019, 12:50 pm

hello

you have a check all option

How can i active thousands of users at once? Scre1250
skouliki
skouliki
Manager
Manager

Female Posts : 15167
Reputation : 1696
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 18th 2019, 12:58 pm

skouliki wrote:hello

you have a check all option

How can i active thousands of users at once? Scre1250


I tried that but it doesn’t check all the users, only the users on the page, and I have over 1000 pages..
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by skouliki September 18th 2019, 1:01 pm

you can not check all pages just all users per page
skouliki
skouliki
Manager
Manager

Female Posts : 15167
Reputation : 1696
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 18th 2019, 2:16 pm

skouliki wrote:you can not check all pages just all users per page

Thats the issue, having to go through 1000 pages will take AGES, as one page takes like 10-20 seconds thats why I was wondering if someone could maybe just mass approve everyone for me, via the backend?
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jucarese September 18th 2019, 2:49 pm

It is not possible otherwise, if you'll be out of the forum in a while , put the method of activation by the user, so that everyone does, from your email,because if the system detects that you do not connect in a while, stops the automatic activation members and you must run it yourself.
jucarese
jucarese
Hyperactive

Male Posts : 2457
Reputation : 116
Language : spanish
Location : SSF Admin

http://asistencia.foroactivo.com/u23082

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 18th 2019, 2:54 pm

Yes I saw, thats why I am hoping a staff member can maybe do it for me
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Guest September 18th 2019, 3:44 pm

I can make a script that would activate all of the users for you. It would still take quite a lot of time, but definitely not as much as doing it manually. Let me know if you want that.
avatar
Guest
Guest


Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 18th 2019, 3:51 pm

sure that would be awesome
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 19th 2019, 11:33 am

That would be awesome if you can do it
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 19th 2019, 11:33 am

Occultist wrote:I can make a script that would activate all of the users for you. It would still take quite a lot of time, but definitely not as much as doing it manually. Let me know if you want that.

that would be awesome if you can do it
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Guest September 19th 2019, 1:27 pm

I'll work on it this evening. I'll probably post the code in the Community coding zone and will edit this post adding the link.
avatar
Guest
Guest


Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by SLGray September 19th 2019, 8:17 pm

jooda wrote:sure that would be awesome

jooda wrote:That would be awesome if you can do it

jooda wrote:
Occultist wrote:I can make a script that would activate all of the users for you. It would still take quite a lot of time, but definitely not as much as doing it manually. Let me know if you want that.

that would be awesome if you can do it
Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!
Please read our forum rules:  ESF General Rules


How can i active thousands of users at once? 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 : 51506
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Guest September 19th 2019, 8:27 pm

Occultist wrote:I'll work on it this evening. I'll probably post the code in the Community coding zone and will edit this post adding the link.
Update:I overestimated my coding abilities. This may take a little more
avatar
Guest
Guest


Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Guest September 20th 2019, 7:30 pm

Does anybody know how many inactive users do you need to have to go over a page? I created 21 accounts to test things and still don't have a new page Sad

Edit:Looks like I didn't need to create that many accounts. The code below should activate any number of users. The time that it takes to activate them depends on the number of users and on how well the forumotion backend works.
Code:
function post(url, data, callback){
var http=new XMLHttpRequest();
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange=function(){
if(http.readyState==4 && http.status==200){
callback();
};
};
http.send(data);
};
var l=location;
var low=1, hi=10000, data="";
for(var i=low;i<=hi;i++){
data+="selected_usr[]="+i+"&";
}
data+="active_users=Activate";
post(l, data, function(){alert("Done");})
To run this code, you will need to go to the Inactive users part of your Admin Panel, press F12 to access the Dev Tools, then switch to the Console in the menu on top of the Dev Tools. After doing this, paste the code in the console and press Enter. A a dialog box saying
Code:
Done
will be displayed when everything is finished. After that, refresh the page to make sure there are no more inactive users.

Before running the code though, you may need to make some modifications on line 13. The first number is the first user id that the code should try to activate. This can be safely left as 1. The second number is the last user id that will be activated. Trying to activate an already active users may affect the speed of the process, but there shouldn't be any other issue. For a start, you can leave everything as is to see if the code actually works as it should.

The code should also show a dialog box if any errors appear. I couldn't test that part though, because no errors appeared after I introduced it Laughing One issue I can think of is the max_execution_time configuration item in php, which may prevent a php script for running for too long. In our case, it may prevent the code from activating too many users at the same time. If that happens, we will have to split the users up in groups. That shouldn't be a big issue though.

I will probably post this code in the coding zone after tidying it up a bit and fixing any issue that may appear.

Edit 2:The error reporting seems to not work. Well, let's hope we won't need it for now
avatar
Guest
Guest


Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by SLGray September 21st 2019, 7:28 am

I would be very careful activating all the accounts at once.  There could be duplicate accounts, people you do not want on your forum, etc.  I know that it seems a lot to do, but you really should look at each account separately.  Or you could create an notice that you were gone for a long time and ask everyone to register again.  Then you can just delete the accounts in the inactive list.


How can i active thousands of users at once? 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 : 51506
Reputation : 3519
Language : English
Location : United States

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

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Guest September 21st 2019, 10:12 am

@SLGray is right. Also, if you set the boundaries incorrectly, users that you have deactivated yourself for various reasons will be reactivated. It doesn't seem to do anything to banned users though, which is good.
avatar
Guest
Guest


Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Thierri002 September 22nd 2019, 8:50 am

jooda wrote:Hi

I was ill and away, but now im back on my forum transfert after many years, I have alot of user accounts I need to activate. Is there a way I can mass activate all accounts?

There is over 1000 pages of inactive users I need to activate
Hello!
This is a good article because there are many tips and also many advices that will be very useful for me.
Thierri002
Thierri002
New Member

Posts : 1
Reputation : 1
Language : french

http://www.navette-paris-aeroport.com/

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by skouliki September 22nd 2019, 10:24 am

Thierri002 wrote:
Hello!
This is a good article because there are many tips and also many advices that will be very useful for me.

Please dont hijack someone else thread, only post in support topics if you can offer a solution or give advice.
skouliki
skouliki
Manager
Manager

Female Posts : 15167
Reputation : 1696
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by jooda September 23rd 2019, 7:34 pm

Occultist wrote:Does anybody know how many inactive users do you need to have to go over a page? I created 21 accounts to test things and still don't have a new page Sad

Edit:Looks like I didn't need to create that many accounts. The code below should activate any number of users. The time that it takes to activate them depends on the number of users and on how well the forumotion backend works.
Code:
function post(url, data, callback){
var http=new XMLHttpRequest();
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange=function(){
if(http.readyState==4 && http.status==200){
callback();
};
};
http.send(data);
};
var l=location;
var low=1, hi=10000, data="";
for(var i=low;i<=hi;i++){
data+="selected_usr[]="+i+"&";
}
data+="active_users=Activate";
post(l, data, function(){alert("Done");})
To run this code, you will need to go to the Inactive users part of your Admin Panel, press F12 to access the Dev Tools, then switch to the Console in the menu on top of the Dev Tools. After doing this, paste the code in the console and press Enter. A a dialog box saying
Code:
Done
will be displayed when everything is finished. After that, refresh the page to make sure there are no more inactive users.

Before running the code though, you may need to make some modifications on line 13. The first number is the first user id that the code should try to activate. This can be safely left as 1. The second number is the last user id that will be activated. Trying to activate an already active users may affect the speed of the process, but there shouldn't be any other issue. For a start, you can leave everything as is to see if the code actually works as it should.

The code should also show a dialog box if any errors appear. I couldn't test that part though, because no errors appeared after I introduced it Laughing One issue I can think of is the max_execution_time configuration item in php, which may prevent a php script for running for too long. In our case, it may prevent the code from activating too many users at the same time. If that happens, we will have to split the users up in groups. That shouldn't be a big issue though.

I will probably post this code in the coding zone after tidying it up a bit and fixing any issue that may appear.

Edit 2:The error reporting seems to not work. Well, let's hope we won't need it for now

Hi

Just tried to test this. I pasted it in the console and it just says done thats it. When I refresh nothing has happened
avatar
jooda
Forumember

Posts : 126
Reputation : 0
Language : English

Back to top Go down

In progress Re: How can i active thousands of users at once?

Post by Guest September 24th 2019, 8:05 pm

I suppose that the number of accounts that can get activated at once is limited. My code attempts to activate all accounts from low to hi(I think that's how I named the variables). On my test forum with around 20 inactive accounts, it works flawlessly, but on your forum it attempts to activate already-active accounts(because we start at 1) and fails to do anything because there's either a forumotion imposed limit, or a PHP $_POST variable limit. Either way, I have an idea on how to solve this, which I will work on probably tomorrow evening.

In the meantime, see if this has any effect:
Code:
function post(url, data, callback){
var http=new XMLHttpRequest();
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange=function(){
if(http.readyState==4 && http.status==200){
callback();
};
};
http.send(data);
};
var l=location;
var low=parseInt(document.querySelector("[name='selected_usr[]']").value), hi=low+100, data="";
for(var i=low;i<=hi;i++){
data+="selected_usr[]="+i+"&";
}
data+="active_users=Activeaza";
post(l, data, function(){alert("Done");})
If it doesn't, try this one:
Code:
function post(url, data, callback){
var http=new XMLHttpRequest();
http.open('POST', url, true);
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.onreadystatechange=function(){
if(http.readyState==4 && http.status==200){
callback();
};
};
http.send(data);
};
var l=location;
var low=parseInt(document.querySelector("[name='selected_usr[]']").value), hi=low+10, data="";
for(var i=low;i<=hi;i++){
data+="selected_usr[]="+i+"&";
}
data+="active_users=Activeaza";
post(l, data, function(){alert("Done");})
I would test it myself, but you seem to have more inactive users that I do Razz
avatar
Guest
Guest


Back to top Go down

Back to top

- Similar topics

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