Page 1 of 1

How to add all users with at least 1 post to a group?

Posted: Sun Dec 25, 2016 4:33 pm
by no_comment
Hi!

I need the SQL command for adding all users with at least one message to a group.
Thanks.

Regards,
DANIEL

Re: How to add all users with at least 1 post to a group?

Posted: Sun Dec 25, 2016 4:49 pm
by Ibedejo
You may consider checking Auto Groups first.

Edit:
correct URL => https://www.phpbb.com/customise/db/mod/auto_groups/ to the 3.0 MOD.

Re: How to add all users with at least 1 post to a group?

Posted: Sun Dec 25, 2016 5:10 pm
by no_comment
Ibedejo wrote:You may consider checking Auto Groups first.

Edit:
correct URL => https://www.phpbb.com/customise/db/mod/auto_groups/ to the 3.0 MOD.
Hi and thanks for the reply!

I have that MOD, but it seems to add users to the group only after new e-mail, and not the people wich have posted in the past. Only I have posted since MOD instalation, and I am the only member of the group so far.
Please, help me.
Thank you.

Regards,
DANIEL

Re: How to add all users with at least 1 post to a group?

Posted: Sun Dec 25, 2016 6:25 pm
by Ibedejo
IIRC rules were set up based on one of these parameters:
- min/max days of membership
- min/max post count
- min/max warning points

As I no longer run any 3.0 test boards it's hard to give any definite advice, sorry.
It might help re-syncing statistics in ACP > General - at least it can't hurt ;)

btw: what is it you want to achieve by adding each user to a new/separate group with the submission of their very first post?

Re: How to add all users with at least 1 post to a group?

Posted: Sun Dec 25, 2016 6:36 pm
by no_comment
Hi!

I have resynchronized statistics, but no change. :(
I do not want every user in a separate group. I want ALL USERS with at least one message in the SAME GROUP.
I need this because I want to send a mass e-mail to only 2000 users wich have posted and not all my 55.000 members as it is too much.
Are you sure there is no SQL command for doing what I want?

Regards,
DANIEL

Re: How to add all users with at least 1 post to a group?

Posted: Mon Dec 26, 2016 12:12 am
by stevemaury
Create the group. Determine its group_id by hovering over the Settings option in Manage groups and looking in the browser status bar, lower left, for the value of g= at the end of the status bar line. Then Substitute that value for X in this query:

Code: Select all

INSERT INTO phpbb_user_group (group_id, user_id, group_leader, user_pending) SELECT X, user_id, 0, 0 FROM phpbb_users WHERE user_id IN(SELECT user_id FROM phpbb_users WHERE user_lastpost_time > 0);
If your table prefix is not phpbb_, change accordingly. Back up the user_group table first. Not tested.

Re: How to add all users with at least 1 post to a group?

Posted: Mon Dec 26, 2016 12:24 am
by no_comment
Thank you, stevemaury.

The SQL query worked but not completly. It added only 1053 users to the group and not all 2327. What could be the problem?
Here is the MODs I have installed:
Hide Sub-Sub Forums on Index
Increase Forum Rules limit
Latest Topic Title 1.1.6
Instant post redirect 1.0.4
Private Message Moderation 1.5.4
Instant login redirect
BBcode Buttons and Smilies for Quick Reply 1.1.0
Login After Register 1.0.0 [3.0.5]
Display Quick Reply by default
Show quick reply to guests
Site name in e-mai from field 1.0.1
Username and Q&A in Quick Reply
Top Posters on Index 1.0.0.a [3.0.1]
Auto Groups 1.0.2 [3.0.6]

I hope this issue is resolved soon because support for v3.0 will end soon. :(
Regards,
DANIEL

Re: How to add all users with at least 1 post to a group?

Posted: Mon Dec 26, 2016 12:57 am
by stevemaury
Only thing I can think of is they had their post deleted? Because if they have no user_lastpost_time, they have no posts.

How are you determining that there are 2327 users who have at least one post?

Re: How to add all users with at least 1 post to a group?

Posted: Mon Dec 26, 2016 1:05 am
by no_comment
groups.png
Hi!

Because the MOD "Auto Groups" added 2327 users to a group on a test board on my computer (using XAMPP). But, for some reason, the same MOD did not add any users to my live board. I set the group the same way: users with minimum one post.

Regards,
DANIEL

Re: How to add all users with at least 1 post to a group?

Posted: Mon Dec 26, 2016 1:18 pm
by stevemaury
Perhaps Auto group uses some different criterion. If it works on Xampp, it should work live. You need to ask in that MODs support topic.