Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
blustic Posted January 21, 2023 Posted January 21, 2023 Hello, A moderator flagged a few accounts as SPAMMERS making all their posts hidden. The problem is that some of the users have >1000 posts and they're not spammer, they probably had access to their accounts because of passwords leaks on the internet. Now I'm searching for a way to restore all the hidden posts/responses for these users, even if its through an SQL code, that would help us a lot. I don't even understand that such an option doesn't exist yet. Thanks in advance.
Richard Arch Posted January 21, 2023 Posted January 21, 2023 (edited) Check what settings have been used for spammers. ACP > Members > Content Moderation > Spam Prevention, Flagging Spammers tab then adjust the settings not to delete content. You don't want that happening. The only way back from deletion would be a selected restore from a recent database backup and I bet you can guess how I know... Edited January 21, 2023 by Richard Arch
Jim M Posted January 21, 2023 Posted January 21, 2023 There is no undo for hiding a user's content, there would only be manual. This is why we recommend using the "Flag as Spammer" button cautiously and only providing it to those who do so.
Solution Adriano Faria Posted January 21, 2023 Solution Posted January 21, 2023 54 minutes ago, FGS said: Now I'm searching for a way to restore all the hidden posts/responses for these users, even if its through an SQL code, that would help us a lot. You can run the following query in your PHPMyAdmin (your host panel: update forums_posts set queued = 0 WHERE queued = 2 AND author_id = XXX; where XXX is the member_id. After that, hide and unhide any post just to update the cache so then it will dismiss the pending notice in the index/forum view. DO AT YOUR OWN RISK. SeNioR- and blustic 1 1
Jim M Posted January 21, 2023 Posted January 21, 2023 If you do wish to update manually via SQL, as mentioned by Adriano, it is at your own risk and please take a backup of your database before 🙂 . Adriano Faria and blustic 2
blustic Posted January 22, 2023 Author Posted January 22, 2023 6 hours ago, Adriano Faria said: You can run the following query in your PHPMyAdmin (your host panel: update forums_posts set queued = 0 WHERE queued = 2 AND author_id = XXX; where XXX is the member_id. After that, hide and unhide any post just to update the cache so then it will dismiss the pending notice in the index/forum view. DO AT YOUR OWN RISK. Thank YOU ! Will try this soon and let you know. There shouldn't be a problem. 6 hours ago, Jim M said: If you do wish to update manually via SQL, as mentioned by Adriano, it is at your own risk and please take a backup of your database before 🙂 . No worries, backups are made daily 🙂
blustic Posted January 22, 2023 Author Posted January 22, 2023 Update: So I've made a test and the code you mentionned wasn't enough because it's not restoring the topics the users created and the responses made to their topics are also hidden by Invision. I've investigated more and found out that I had to do these additional steps to restore the topics created by the user and the responses : Find all the posts created by the user inside the "forums_topics" table (starter_id = user ID) and update the "approved" from "-1" to "1" ; Update all the responses inside the table "forums_posts" from "queued" = "2" to "0" where "topic_id" = "TOPIC_IDS_FOUND_IN_STEP_1". I had to create a small PHP script to update them correctly, as the number is huge and was too lazy to update them one by one. For those searching the SQL queries : As mentionned by @Jim M don't forget to create a backup of your database before trying any modification and if you don't know what you're doing, don't do it 🙂 ! UPDATE forums_posts SET queued = 0 WHERE queued = 2 AND author_id = XXX; UPDATE forums_posts SET queued = 0 WHERE queued = -1 AND author_id = XXX; afterwards : UPDATE forums_topics SET approved = 1 WHERE approved = -1 AND starter_id = XXX; and finally : UPDATE forums_posts SET queued = 0 WHERE queued = 2 AND topic_id = XXX; Thanks again for your help, you can now tag this topic as fixed.
Adriano Faria Posted January 22, 2023 Posted January 22, 2023 (edited) 6 hours ago, FGS said: So I've made a test and the code you mentionned wasn't enough because it's not restoring the topics the users created and the responses made to their topics are also hidden by Invision. Yes, that’s the problem when you are used to technical terms: you take it to the letter. As you said “posts”, I showed you how to it with posts. Anyway, glad you figured it out. Edited January 22, 2023 by Adriano Faria blustic 1
Richard Arch Posted January 23, 2023 Posted January 23, 2023 Likewise, you may need to update records in these tables: calendar_event_comments core_rc_comments gallery_album_comments gallery_comments
Recommended Posts