Kunena 7.0.4 Released

The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0

Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Solved Kunena mass delete users

More
12 years 5 months ago #151016 by mecenat
Hi
I have 35 thousand users in my forum and i would like to delete all users with 0 posts. Could you advise how to make it please?

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago - 12 years 5 months ago #151021 by sozzled
Replied by sozzled on topic Kunena mass delete users
Goodness me. That's a lot of members.

Yes, it's possible to write an SQL query, run it against your database, and then target those members and delete them.

The first thing you need to do is write a query to obtain a list of members who have zero posts. Kunena stores this information in the table _kunena_users. Using phpMyAdminthe query would look something like:
Code:
SELECT * FROM `xxxxx_users` AS Table1 INNER JOIN `xxxxx_kunena_users` AS Table2 ON Table1.id = Table2.userid WHERE Table2.posts = 0 LIMIT 0,30000
where "xxxxx" is the prefix of your Joomla table. This will give you the user IDs of those accounts that have not posted messages on your forum.

It should not take you too much trouble to convert the SELECT statement above into a DELETE statement . I'll leave you to figure out the last part for yourself. ;)

Make sure you have a good backup of your Joomla user table before you execute the DELETE, OK? After you delete the Joomla user records, run the Kunena Synch User facility.
Last edit: 12 years 5 months ago by sozzled.

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago #151043 by mecenat
Replied by mecenat on topic Kunena mass delete users

sozzled wrote: Goodness me. That's a lot of members.

Yes, it's possible to write an SQL query, run it against your database, and then target those members and delete them.

The first thing you need to do is write a query to obtain a list of members who have zero posts. Kunena stores this information in the table _kunena_users. Using phpMyAdminthe query would look something like:

Code:
SELECT * FROM `xxxxx_users` AS Table1 INNER JOIN `xxxxx_kunena_users` AS Table2 ON Table1.id = Table2.userid WHERE Table2.posts = 0 LIMIT 0,30000
where "xxxxx" is the prefix of your Joomla table. This will give you the user IDs of those accounts that have not posted messages on your forum.

It should not take you too much trouble to convert the SELECT statement above into a DELETE statement . I'll leave you to figure out the last part for yourself. ;)

Make sure you have a good backup of your Joomla user table before you execute the DELETE, OK? After you delete the Joomla user records, run the Kunena Synch User facility.


Thank you pal) This is really nice DB request)

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago #151096 by mecenat
Replied by mecenat on topic Kunena mass delete users
Hey!
For two days try to delete users, but i can not manage to make right sql query.

I do it like that
DELETE FROM xxxxx_users WHERE xxxxx_users.id = xxxxx_kunena_users.userid AND xxxxx_kunena_users.posts = 0

But i get an error #1054 - Unknown column 'xxxxx_kunena_users.userid' in 'where clause'

Please help to delete users :unsure:

Select works nice and smooth!

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago - 12 years 5 months ago #151106 by rich
Replied by rich on topic Kunena mass delete users
[strike]You can delete your users manually.

Open the table *_kunena_users
Select Number of rows: (what is the best for you)
sort by posts
mark and delete all users with 0 posts (it is slightly more work, but it works also).[/strike]

Important! Always create a backup before you make any changes to your website!
Last edit: 12 years 5 months ago by rich.

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago - 12 years 5 months ago #151110 by sozzled
Replied by sozzled on topic Kunena mass delete users
@rich: That will only delete the records in the table _kunena_users. If you use the Synchronize Users facility (Forum Tools in the backend) all the Kunena user profiles will be rebuilt from the Joomla _users table. The task is to delete the records from the _users table, perform the Synchronize Users and then the Kunena users will also be removed.

What you need to do is to open the table _users and delete those records, but the question is, which records do you need to delete?

Instead, you need to create a separate SQL DELETE query to delete records from _users.

There's no go guarantee that what I am about to propose will work (becuase I haven't tried it) but you need something like "DELETE FROM xxxxx_users WHERE (SELECT * FROM `xxxxx_users` AS Table1 INNER JOIN `xxxxx_kunena_users` AS Table2 ON Table1.id = Table2.userid WHERE Table2.posts = 0);" ... and that's just a guess.
Last edit: 12 years 5 months ago by sozzled.

Please Log in or Create an account to join the conversation.

Time to create page: 0.243 seconds