Esempio n. 1
0
/**
 * Delete the user settings of the current user.
 *
 * @package bbPress
 * @subpackage Meta
 * @since 1.0
 */
function bb_delete_all_user_settings()
{
    if (!($user = bb_get_current_user())) {
        return;
    }
    bb_delete_usermeta($user->ID, 'bb_user_settings');
    setcookie('bb-user-settings-' . $user->ID, ' ', time() - 31536000, $bb->cookiepath);
}
Esempio n. 2
0
function bb_fermion($user_id, $topic_id = 0)
{
    global $bbdb;
    $user_id = (int) $user_id;
    $topic_id = (int) $topic_id;
    if (!$topic_id) {
        bb_delete_usermeta($user_id, 'is_bozo');
    } else {
        $topic = get_topic($topic_id);
        $user = bb_get_user($user_id);
        if (--$topic->bozos[$user_id] < 1) {
            unset($topic->bozos[$user_id]);
        }
        bb_update_topicmeta($topic_id, 'bozos', $topic->bozos);
        if (--$user->bozo_topics[$topic_id] < 1) {
            unset($user->bozo_topics[$topic_id]);
        }
        bb_update_usermeta($user_id, $bbdb->prefix . 'bozo_topics', $user->bozo_topics);
    }
}