1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to clear all user statuses?

Discussion in 'Troubleshooting and Problems' started by Joshua, Apr 27, 2012.

  1. Joshua

    Joshua Active Member

    I recently (today) imported my forum from vB4 to xF and when I went to add a Recent Status Sidebar add-on for xF I found that there were a few spam statuses from vB that were imported. Is there a way to safely clear all user statuses and begin anew? I'm comfortable with executing SQL commands if that's what it takes to do it without any hiccups...

    Thanks in advance!
  2. Carlos

    Carlos Well-Known Member

    This would be a nice addition, but make it only for spam. It would not be fair to other users who have been posting good statuses.
  3. Matthew2D

    Matthew2D Well-Known Member

    I don't know of any way to do that. Though, since you said a few, I don't think it would take very long to remove them yourself. ;) Just edit the user individually.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Run these queries to clear all user statuses:

    TRUNCATE TABLE xf_user_status;
    UPDATE xf_user_profile
    SET status = '', status_date = 0, status_profile_post_id = 0;
    TeflonDon, Joshua and Blue like this.
  5. Joshua

    Joshua Active Member

    Thanks Jake. I tried your SQL commands but I'm still getting the following error

    Server Error
    Undefined offset: 10445
    XenForo_Application::handlePhpError() in RCBD/RecentStatus/Model/StatusList.php at line 108
    RCBD_RecentStatus_Model_StatusList::getStatusArray() in RCBD/RecentStatus/Controller/Public.php at line 15
    RCBD_RecentStatus_Controller_Public->actionIndex() in XenForo/FrontController.php at line 310
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    XenForo_FrontController->run() in /home/apistogr/public_html/forum/index.php at line 13
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That is from an addon, but looking at the code it appears that you may have some orphaned profile posts. Try running this query to delete any orphaned profile posts:

    DELETE pp.*
    FROM xf_profile_post AS pp
    LEFT JOIN xf_user AS u ON (u.user_id = pp.user_id)
    WHERE pp.user_id = pp.profile_user_id
    AND u.user_id IS NULL;
    This is just a guess as I don't have access to your forum.
    TheVisitors likes this.
  7. Adam Howard

    Adam Howard Well-Known Member

    ^^ This worked for me, but I will add 1 more thing needed.

    Doing this is only 1/2 the job. The 2nd half is easy.... Post 1 status on your profile.

    Error gone. ;)

    I found this out when deleting a bunch of members off of my test site (mistakenly deleted the test site, so imported the main site and needed to remove them from the test site).
  8. Thronk

    Thronk Member

    Hello, re opening this thread as I have a member that posted insults in his status and I tried the above to remove it without any progress. I've searched the database for this entry and removed it, but it still remains.
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page