Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Can I change user preferences via mySQL?

I was exporting and importing my forum DB prior to testing 2.1 in a live situation.

Somehow, during the process, it seems that user preferences have been reset to a default option.

I've looked, but can't see any obvious table or record that holds this information.

Is it possible to change these settings globally, or does each user have to do it themselves?

I understand that you can set preferences via config.php, but that will only affect new users, afaIk.

Any help appreciated.

Comments

  • Vanilla 2 (and 2.1) store profile preferences in the User table (Preferences field). Some plugins store preferences in the UserMeta table.

    It looks like they are stored as some type of object. Maybe the encoding changed from 2.0 to 2.1?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • whu606whu606 MVP
    edited May 2013

    @hgtonight

    Thanks for that; I hadn't noticed that field.

    However, as far as I can see that field for my users in the User table is either empty or null.

  • Hmm... it has to be stored somewhere. I can keep looking lackadaisically for you. :D

    /tangent In my main community, only 3 people (of roughly 300), have changed their prefs from the defaults. This either speaks to sensible defaults, lazy users, or a difficult interface. XD

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtongiht

    Thanks.

    If you happen to come across it it would be great.

    I've asked my users to reset their preferences for now, but for future reference it would be handy if there were a global solution.

  • No luck with that, but as a workaround, if you want to set preferences for everyone:

    Use the Vanilla Porter to export your DB.

    Copy Preferences settings from config-default to config

    In 2.0.18.8:


    $Configuration['Preferences']['Email']['ConversationMessage'] = '1';
    $Configuration['Preferences']['Email']['AddedToConversation'] = '1';
    $Configuration['Preferences']['Email']['BookmarkComment'] = '1';
    $Configuration['Preferences']['Email']['WallComment'] = '0';
    $Configuration['Preferences']['Email']['ActivityComment'] = '0';
    $Configuration['Preferences']['Email']['DiscussionComment'] = '0';
    $Configuration['Preferences']['Email']['DiscussionMention'] = '0';
    $Configuration['Preferences']['Email']['CommentMention'] = '0';
    $Configuration['Preferences']['Popup']['ConversationMessage'] = '1';
    $Configuration['Preferences']['Popup']['AddedToConversation'] = '1';
    $Configuration['Preferences']['Popup']['BookmarkComment'] = '1';
    $Configuration['Preferences']['Popup']['WallComment'] = '1';
    $Configuration['Preferences']['Popup']['ActivityComment'] = '1';
    $Configuration['Preferences']['Popup']['DiscussionComment'] = '1';
    $Configuration['Preferences']['Popup']['DiscussionMention'] = '1';
    $Configuration['Preferences']['Popup']['CommentMention'] = '1';

    where 0 is off and 1 is on.

    Set them to how you want everyone's to be.

    Use Import from the Dashboard to re-import the data to your DB.

    Settings for all users should now be as per the rules in config.php

Sign In or Register to comment.