bbPress

Simple, Fast, Elegant

bbPress support forums » Installation

User-editable Custom Titles

(7 posts)
  • Started 1 year ago by citizenkeith
  • Latest reply from citizenkeith
  • This topic is not resolved
  1. citizenkeith
    Member

    I have a small site that needs very little moderation. I'd like for my users to have the power to change their own Custom Title, instead of sending me a Private Message with a request.

    I can't figure out how to make that change, though. Any ideas?

    Posted 1 year ago #
  2. You need to write a plugin that will be called on a hook in the profile, where it adds to the associative array $profile_info_keys an entry with key 'bb_title' - I think. To see how to do that, look at some other plugin that adds fields to the profile info thingy.

    Posted 1 year ago #
  3. citizenkeith
    Member

    Well, I don't know the first thing about writing plugins, so if somebody can help out, I'd appreciate it. :)

    Posted 1 year ago #
  4. in functions.php find function get_profile_admin_keys() {, and move $bb_table_prefix . 'title' => array(0, __('User Title')) from that function's array to function get_profile_info_keys()

    Posted 3 months ago #
  5. citizenkeith
    Member

    Hmm.... not sure to how to change that code without getting errors (I'm running 0.9.0.1 on this particular forum).

    function get_profile_info_keys() {
    	return apply_filters(
    		'get_profile_info_keys',
    		array('user_email' => array(1, __('Email')), 'user_url' => array(0, __('Website')), 'from' => array(0, __('Location')), 'occ' => array(0, __('Occupation')), 'interest' => array(0, __('Interests')))
    	);
    }
    
    function get_profile_admin_keys() {
    	global $bbdb;
    	return apply_filters(
    		'get_profile_admin_keys',
    		array($bbdb->prefix . 'title' => array(0, __('Custom Title')))
    	);
    }
    Posted 3 months ago #
  6. Do just like parabolart said. You should paste the text inside the () after the array for get_profile_admin_keys and separate it from the other ones with a comma.

    Posted 3 months ago #
  7. citizenkeith
    Member

    I think I need a little help with this one. I'm running 0.9.0.2 now.

    Here's the section in functions.php:

    function get_profile_info_keys() {
    	return apply_filters( 'get_profile_info_keys', array(
    		'user_email' => array(1, __('Email')),
    		'user_url' => array(0, __('Website')),
    		'from' => array(0, __('Location')),
    		'occ' => array(0, __('Occupation')),
    		'interest' => array(0, __('Interests')),
    	) );
    }
    
    function get_profile_admin_keys() {
    	global $bbdb;
    	return apply_filters( 'get_profile_admin_keys', array(
    		$bbdb->prefix . 'title' => array(0, __('Custom Title'))
    	) );
    }

    So if I move that section up to get_profile_info_keys, it should look like this, correct?

    function get_profile_info_keys() {
    	global $bbdb;
    	return apply_filters( 'get_profile_info_keys', array(
    		'user_email' => array(1, __('Email')),
    		'user_url' => array(0, __('Website')),
    		'from' => array(0, __('Location')),
    		'occ' => array(0, __('Occupation')),
    		'interest' => array(0, __('Interests')),
    		$bbdb->prefix . 'title' => array(0, __('Custom Title')),
    	) );
    }

    That pretty much removes everything from get_profile_admin_keys, so do I just take that entire section out?

    Thanks for the helping hand...

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.