Remove all "Warning Points" for all my users

  • Thread starter Thread starter Deleted member 10469
  • Start date Start date
D

Deleted member 10469

Guest
Hello, I would like know how remove all Warning Points for all my user please, from xenforo or a sql line. Thanks.
 
Depending on the situation, you can't actually do it via SQL or in bulk. The warnings themselves would need to be expired/deleted via the relevant user's profile page. (The users with warnings could be identified based on the user_id values in the xf_warning table.)
 
No, there are potentially more data related to this and intertwined in other tables, so I couldn't recommend editing the DB directly.
 
I can empty xf_warning table for delete all warning without problem please ?
You should be able bulk update xf_warning.expired_date for all non-expired jobs and then run the cron task to allow all XenForo to expire the warnings.

This should clean up all warnings in bulk.
 
You do not need an add-on to remove warning link under posts (as that seems it is all the add-on does.). Revoke the necessary permission to warn posts and it will disappear.
 
You should be able bulk update xf_warning.expired_date for all non-expired jobs and then run the cron task to allow all XenForo to expire the warnings.

This should clean up all warnings in bulk.

Would you recommend executing this query to have all non-expired warning to expire?

SQL:
UPDATE `xf_warning` SET `expiry_date` = '1557878400'
 
This would be better (only change the expiry date of non-expired warnings)
SQL:
UPDATE `xf_warning` SET `expiry_date` = '1557878400' where is_expired = 0
 
  • Like
Reactions: KSA
This would be better (only change the expiry date of non-expired warnings)
SQL:
UPDATE `xf_warning` SET `expiry_date` = '1557878400' where is_expired = 0

That is better thanks for pointing that out. One more question if I may. Does expired points mean threshold will start from scratch? or will it consider points already given even if its expired? or threshold action only applies to non-expired points? XF warning system is a bit confusing.
 
It depends. Warning thresholds expire based on time or points, meaning you may still have a bunch of them hanging around.

We have it set based on time. But to avoid confusion, do you recommend doing something like:


SQL:
UPDATE `xf_warning` SET `points` = '0'
 
You'll want to skip already expired warnings, with this sort of query:

SQL:
UPDATE `xf_warning` SET `expiry_date` = 1557878400 where `expiry_date` < unix_timestamp() or is_expired = 1

I'm trying to understand this query, I'm still a bit of an SQL noob :)

From what I've been a able to gather, it looks like it's going to update warnings which either:
  1. Have an expiration date before today's date.
  2. Are already expired.
Wouldn't I want the opposite of this if I'm trying to expire all active warnings?

SQL:
UPDATE `xf_warning` SET `expiry_date` = 1679507455 where `expiry_date` > unix_timestamp() or is_expired = 0
 
Back
Top Bottom