Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 8,026 through 8,050 (of 32,519 total)
  • Author
    Search Results
  • #165949

    In reply to: Add/Change User roles

    Robkk
    Moderator

    this is great. thanks Robkk. Just one question… Do I put this into the bbpress.php file in the bbpress folder?

    No. Also the bbpress.php file should be in the root of your theme.

    I added it here: wp-content/plugins/bbpress/templates/default/bbpress

    Just checking if that is correct?

    Don’t mess with any core files.

    Okay so I put the above code in here and it seems to work:

    plugins > bbpress > includes > users

    Again, just checking if that is correct?

    Don’t mess with any core files.

    Here, I forgot I did this a while back. Add this to your functions.php file in your child theme.

    function rk_show_role_classes($classes) {
        $replyid = bbp_get_reply_author_id();
        $bbp_get_role = bbp_get_user_display_role($replyid);
        $bbp_display_role = strtolower($bbp_get_role);
    	  
      
    	$classes[] = $bbp_display_role;
    	return $classes;
    }
    add_filter( 'bbp_get_topic_class','rk_show_role_classes' );
    add_filter( 'bbp_get_reply_class','rk_show_role_classes' );

    Do the CSS I said before for the above code.

    It would be something like this but for each role.

    .ambassador .bbp-author-role {
      background-color: blue;
    }

    And if you do not need custom roles but instead just role names, lets say for each role it would be like this.

    Keymaster -> Ambassador
    Moderator -> Team Member
    Participant -> Community Member

    You can just change the role names using this function. Add it to your child themes functions.php file. And rename My Custom Role to what you want.

    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
    function ntwb_bbpress_custom_role_names() {
    	return array(
    		// Keymaster
    		bbp_get_keymaster_role() => array(
    			'name'         => 'My Custom Keymaster Role Name',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    		),
    		// Moderator
    		bbp_get_moderator_role() => array(
    			'name'         => 'My Custom Moderator Role Name',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
    		),
    		// Participant
    		bbp_get_participant_role() => array(
    			'name'         => 'My Custom Participant Role Name',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
    		),
    		// Spectator
    		bbp_get_spectator_role() => array(
    			'name'         => 'My Custom Spectator Role Name',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
    		),
    		// Blocked
    		bbp_get_blocked_role() => array(
    			'name'         => 'My Custom Blocked Role Name',
    			'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
    		)
    	);
    }

    Oh and quit trying to copy Ultimate Members site, try to have a unique website.

    Brovashift
    Participant

    Hi Robkk,

    Thanks for getting back to me re my login/reg issue.

    The plugin you sent looks good, but ideally Id like to handle the login/registration natively.

    I have added the bbp-login / bbp-register on a single page, which works to some extent, looks kinda basic. But its not contained in a nice neat pop-up box like here in bbpress’s sub-header bar.

    More importantly, there is no Logout! Do I need another shortcode for that? [bbp-logout] maybe?

    Thanks for your help

    Rob

    vcb
    Participant

    Why does the forum only show up when I update it manually via backend?
    Anyone any idea what this could be?

    I’ve tried different roles; Moderator + Keymaster. Still getting the same result, everything does work – beside showing it in the frontend.Tho, after updating the forum within the backend it shows up in the frontend.

    Thanks.

    
    // Create FORUM Entry object
    	  $my_forum = array(
    		'post_title'    => 'title',
    		'post_content'  => 'test',
    		'post_status'   => 'private',
    		'post_author'   => $_POST['post_author'], //also tried admin '1',
    		'post_type' => 'forum',
    		'post_parent' => '123'	// parent forum
    	  );
    	  // Insert the post into the database
    	  $page_id = wp_insert_post( $my_forum );
      
    
    
    #165930

    In reply to: Add/Change User roles

    sbskamey
    Participant

    Okay so I put the above code in here and it seems to work:

    plugins > bbpress > includes > users

    Again, just checking if that is correct?

    Now to change the background colours, god that’s gonna take me another 2 days! :p

    Robkk
    Moderator

    Hmm that seems like a peice of code that has been posted on these forums before. Hopefully other users do not come across the same issue.

    I am glad that you resolved your own issue though. 🙂

    Are you using the WP Admin No show plugin? This is a plugin I usually recommend for users to use instead.

    #165914
    Robkk
    Moderator

    copy form-anonymous.php in your child theme and remove this in the file.

    <p>
      <label for="bbp_anonymous_website"><?php esc_html_e( 'Website:', 'bbpress' ); ?></label><br />
        <input type="text" id="bbp_anonymous_website" value="<?php bbp_author_url(); ?>" size="40" name="bbp_anonymous_website" />
    </p>
    CraftyMc
    Participant

    I debugged my site and found the culprit, it would appear my site didn’t like my custom function,

    function baw_no_admin_access()
    {
    if( !current_user_can( 'administrator' ) ) {
    wp_redirect( home_url() );
    }
    }
    add_action( 'admin_init', 'baw_no_admin_access', 1 );

    Iv’e now removed it and use a plugin to block access to the dashboard. 🙂

    Robkk
    Moderator

    Try some troubleshooting it could be your theme conflicting with bbPress. Try a default theme temporarily to see if is in fact bbPress causing the issue with any scripts.

    Troubleshooting

    Contact the theme author if it just your theme, and see if they have a fix for users that want to use bbPress.

    The debug information you got is explained here.

    bbp_setup_current_user was called incorrectly

    Robkk
    Moderator

    Any plugin that hooks into the default WordPress registration and adds special fields should add fields also to the bbPress registration form.

    A plugin like this could add extra fields.

    https://wordpress.org/plugins/cimy-user-extra-fields/

    This site uses the [bbp-login] shortcode and there is a message on the registration page that says this site uses the same registration details as WordPress.org.

    Brovashift
    Participant

    Hi all,

    Just setting up my new forum using the latest versions of wordpress and bbpress, but Im having trouble handling user registration.

    Ive used the forum login widget to handle logins in my sidebar, but im not happy with registration. I created a new page called registration and added the shortcode [bbp-register]. But this is really basic and not what a am looking for at all, unless its possible to edit it somehow, something I am fairly sure cannot be done to a shortcode?

    Does anyone have any suggestion as to what login and registration plugins are good to use? Or anyone know what this bbpress site uses to handle its login and registrations, that looks good handling both functions in one tidy box in a single area.

    Thanks for you help in advance.

    🙂

    CraftyMc
    Participant

    Hello, I’m having some issues with bbpress, when i activate the plugin all the ajax / jquery features fail to work i.e add to watchlist button, posts, maps, and anything that uses scripts to load.

    Has anyone experianced this or know the cause, I enabled debug and it gives me this error, not sure if it’s linked, Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /wp-includes/functions.php on line 3622

    At the moment I cannot use the plugin as my site uses a lot of scripts to load the features.

    Let me know if you’re able to help. Thanks

    #165899
    Robkk
    Moderator

    What troubleshooting did you already do? Did you already do the plugin and theme troubleshooting?

    Troubleshooting

    Also sometimes it may not necessarily be a caching plugin, it could also be other thing caching your site, like cloudflare, hosting server cache, something like that.

    You can always test your sites theme/plugins on a test server.

    #165880

    In reply to: bbpress not logout

    W-P-Zar
    Participant

    the add_filter( ‘logout_url’, ‘bbp_logout_url’, 2, 2 );

    filter bbp_logout_url in logout_url

    function bbp_logout_url() call apply_filters inside the function

    so

    if remove_filter remove the filter but it is already apply

    it’s like that???

    precarious resolved

    my own plugin or in function.php

    add_filter( 'logout_url', 'my_logout_page', 10, 2 );
    function my_logout_page( $logout_url, $redirect ) {
        	$logout_url = str_replace('%3Floggedout%3Dtrue', '', $logout_url);
    	return $logout_url;
    }
    #165870

    In reply to: bbpress not logout

    Robkk
    Moderator

    I get that you are sorry for your English haha you don’t have to keep telling me 🙂

    Okay try adding this to your child themes function.php file to see if this helps solve your issue, but try just logging out from the WordPress Toolbar only for now.

    remove_filter( 'logout_url', 'bbp_logout_url' );

    #165855
    Robkk
    Moderator

    Use this custom CSS to make the forums full-width.

    .bbpress #content {
      width: 100%;
    }
    Robkk
    Moderator

    This is what is causing the issue.

    .bbp-reply-content p {
        margin: 0px;
        padding: 0px;
    }

    You can do this instead.

    .bbp-reply-content p {
        margin: 0px 0px 10px;
        padding: 0px;
    }
    #165843
    Robkk
    Moderator

    Do some troubleshooting. It could be cache, your permalinks need to be refreshed, etc.

    Troubleshooting

    Navigation Links Return 404s Errors

    #165840

    In reply to: Install problem

    Robkk
    Moderator

    bbPress does not create any database tables it used WordPress’s tables.

    Stored Database Data

    Install WP Admin No Show to disable users from accessing the WordPress backend.

    Troubleshoot for missing pages.

    Troubleshooting

    #165837
    Robkk
    Moderator

    is it possible to make the “Forum” dropdown menu a required field, and to require that in that drop down users choose a forum and not be able to choose “no forums” (which currently shows as the the default option).

    I will create a trac ticket for this later today. It might be best for it to be required and for the default text to be “choose forum” instead.

    You can create a button to your new topic page easily by using the text widget provided from WordPress, and adding this simple HTML.

    <a href="http://yoursite.com/new-topic" class="button">New Topic</a>

    #165836

    In reply to: Add/Change User roles

    Robkk
    Moderator

    Create new roles with custom capabilities.

    Custom Capabilities

    TO have individual colors for each role, there is a function that might help. I think you need to create a varialbe to pass the bbp_get_user_display_role() with the id of the user in the reply author bbp_get_reply_author_id() to get the specific user role of the reply author then pass the user role name into $classes. You might also need to use strtolower() to make the class in your code lowercase.

    
    function my_reply_class($classes) {
    	$classes[] = 'test-class';
    	return $classes;
    }
    add_filter( 'bbp_get_reply_class','my_reply_class' );

    After all that, all you would need to do is add this CSS.

    .myrole .bbp-author-role {
      background-color: blue;
    }
    #165832

    In reply to: WP_DEBUG errors

    Robkk
    Moderator

    Not really a bbPress issue, bbPress just spits out the information. Read this codex guide explaining the issue.

    bbp_setup_current_user was called incorrectly

    #165831
    Robkk
    Moderator

    This sounds exactly like your other topic here…and the other one you also created.

    HELP PLEASE NEW TO BBPRESS

    It is most likely a cache issue on your end. Make sure you have WP-Super-Cache set up correctly and that the cache refreshes when a new post is published or updated.

    Clear all cache files when a post or page is published or updated.

    I saw this message on your forums page source code that is why I know you are using that specific plugin.

    <!-- Dynamic page generated in 1.073 seconds. -->
    <!-- Cached page generated by WP-Super-Cache on 2015-08-25 19:54:03 -->
    
    <!-- super cache -->

    Also do not post multiple topics of the same issue, just update your original topic.

    #165823
    boriskamp1991
    Participant

    Hi guys, I get these errors, any ideas?
    Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /Users/boriskamp/Documents/Local Websites/MSM/wp-includes/functions.php on line 3622

    Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /Users/boriskamp/Documents/Local Websites/MSM/wp-includes/functions.php on line 3622

    thanks!

    #165819
    geog272
    Participant

    Hi there, I am wondering this as well — using the short code [bbp-topic-form] is it possible to make the “Forum” dropdown menu a required field, and to require that in that drop down users choose a forum and not be able to choose “no forums” (which currently shows as the the default option).

    #165795

    In reply to: Custom freshness links

    Robkk
    Moderator

    @inget should have used this.

    .forum-archive li.bbp-forum-freshness {
        display: none;
    }
    
    .forum-archive li.bbp-forum-info {
        width: 77%;
    }
    


    @markburgess

    Do you have an incorrect freshness date on your forum archive?? Plus that ticket you linked to is bbpress.org specific, that is why you see the compenent being Site – bbPress.org and that the pictures are of bbpress.org.

Viewing 25 results - 8,026 through 8,050 (of 32,519 total)
Skip to toolbar