Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 4,301 through 4,325 (of 32,522 total)
  • Author
    Search Results
  • #193504
    favog
    Participant

    We have a BBPress forum that is behind a membership site, and we give them the capability of subscribing to threads. Our problem is that if a person stops subscribing they no longer have access to the site, and therefore have no way of unsubscribing from a topic.

    Is there a way that we can generate a script/link to force an automatic unsubscribe from all topics when removing the user? Even if we need to manually create the link, it would be an improvement.

    I can generate code if necessary-just don’t know where to start.

    Thanks,
    Bob

    #193496
    matty19901
    Participant

    FYI I’m using version 4.9.6 of wordpress and version 2.5.14 of bbPress.

    I added custom code to my theme functions.php page to add customized roles for bbPress. The roles show up when I edit users and want to change their roles, but when I go to save it, they just default back to a participant role. How can I fix this? Here is the code I used below:

    /* bbPress Custom Roles */
    function add_custom_role( $bbp_roles ) {
     
    
    $bbp_roles['my_custom_role2'] = array(
    'name' => 'Producer',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role3'] = array(
    'name' => 'Engineer',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role4'] = array(
    'name' => 'Songwriter',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles['my_custom_role5'] = array(
    'name' => 'Staff',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
    );
    $moderator = bbp_get_moderator_role() ;
    $bbp_roles[$moderator] = array(
    'name' => 'Moderator',
    'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() ) // the same capabilities as keymaster
    );
    $keymaster = bbp_get_keymaster_role() ;
    $bbp_roles[$keymaster] = array(
    'name' => 'Chief Executive Officer',
    'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster
    );
    $apprentice = bbp_get_participant_role() ;
    $bbp_roles[$apprentice] = array(
    'name' => 'Member',
    'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'add_custom_role', 1 );
    #193491
    Helmuts
    Participant

    @michent1 – thank you – your updated version + the original shortcode by op works as a charm (had some issues with the original one).

    #193487
    pigpotato
    Participant

    I fixed it like this.

    1. make css folder in wordpress>wp-content>theme>[mytheme]
    2. cp wordpress>wp-content>plugins>bbpress>templates>default>css>bbpress.css wordpress>wp-content>theme>[mytheme]>css
    3. add these code lines in the css file.
    #bbpress-forums fieldset.bbp-form input[id=bbp_anonymous_email]{ display: none; }
    4. cp wordpress>wp-content>plugins>bbpress>templates>default>bbpress>form-anonymous.php wordpress>wp-content>theme>[mytheme]>bbpress
    5. fix any email address in email textfield. Edit the form-anonymous.php
    <input type=”text” id=”bbp_anonymous_email” value=”guest@guest.com” ….

    #193464
    Tradewind25
    Participant

    Robin,

    Apologies for the late response – I have been away for a while.

    I’m happy to say that your revised css code does that job nicely!

    Many thanks,
    Geoff

    #193443
    only4gamers
    Participant

    Is anyone know what is the code to display last reply by: username in topics?

    ohmygod88
    Participant

    Hi guys,

    May I know why is language code missing bbPress search page URL? I have a multi language website using Polylang and everything works except for the bbPress function. It only returns the English data instead of the Chinese data.

    Anyone know the solution to fix this?

    #193363
    AdventureRidingNZ
    Participant

    array(‘post’, ‘page’, 'release')

    #193362
    andreasyeah
    Participant

    ok got it! since i am not that much into codes,

    could you please tell me where i have to add the post type if the post type is “release” for example:

    /** Only process for post types we specify */
    if( !in_array( $post->post_type, apply_filters( ‘bbppt_eligible_post_types’, array( ‘post’, ‘page’ ) ) ) ) {
    return;

    thank you very much for your help 😉

    #193359
    AdventureRidingNZ
    Participant

    In one of the topics for posts files there is a statement that defines what post types it works for.

    Updated: in index.php look for

    /** Only process for post types we specify */
    		if( !in_array( $post->post_type

    and you can add your custom post types in there

    #193354
    jomo
    Participant

    after some difficulty I came up with a solution, which allows a standard menu item linking to eg:
    forums/users/current

    If a request is made to http://mysite/forums/users/current, the user name “current” is detected and replaced with the current user id, or, if the user is not logged in, redirect to login screen:

    
    /*
     * attempt to handle generic request for current user
     *
     * if the url is passed as forums/users/current/
     * this function detects that the permalink has been set to bbp_user=current
     * and
     *  - if the user is logged on, the query is changed to the current user
     *  - if the user is not logged on, the user is redirected to login screen
     *
     */
    function ink_bbp_request_current_user( $query_vars ) {
    	if ( isset( $query_vars[ 'bbp_user' ] ) ) {
    		switch ( $query_vars[ 'bbp_user' ] ) {
    			case 'current':
    				if ( get_current_user_id() ) {
    					$query_vars[ 'bbp_user' ] = bbp_get_current_user_name();
    				} else {
    					auth_redirect();
    				}
    		}
    	}
    	return $query_vars;
    }
    
    add_filter( 'bbp_request', 'ink_bbp_request_current_user', 10, 1 );
    
    #193338
    MBV
    Participant

    So this is what I understand from this thread so far, to provide clarity moving forwards:

    1. Dynamic reply box that opens next to post replying to in forum is actually already a feature of bbpress, but not for BuddyPress group forums.
    2. Some themes seem to not engage this functionality and the way to fix that is to copy the reply.js file into a folder called js that is at the root of child theme.
    3. It works with visual editor

    So the only problem is that it does not work for Buddypress Group forums. However, @robkk mentioned, earlier in this thread, a patch he made. But he has not been active on these forums for over a year.

    https://bbpress.trac.wordpress.org/ticket/2974
    It is pretty easy to workaround this issue as well, since all you have to do is enqueue the javascript with a different conditional or enqueue it sitewide, but doing it sitewide might cause another issue somewhere.
    Here I just added a bbpress-functions.php file to a twentysixteen child theme. I edited out the conditional causing the issues with groups. You can test this on my test site as well.
    You would have to remove the file later if the trac tickets patch I linked to is committed and you are using version 2.6 of bbPress, so that you can have the file enqueued on the pages where it is needed.
    https://cloudup.com/czqFBqJE8TE

    The trac ticket he mention seems to be resolved yet it’s not working for BP group forums. The link to the code on cloudup is broken.

    So that’s the summary of where we are at on this thread… the big question is, does anyone have any insight or can help with enabling the dynamic reply box to BP group forums topics?

    #193332
    Tommy White
    Participant

    Where would I find information on changing the CODE /CODE button in bbpress to act like the wordpress CODE insert?

    In other words in bbpress clicking the CODE button gives you`
    in WordPress clicking the CODE button gives you < code > < /code >

    I’m having an issue with a plugin since it handles how my CODEs are displayed and one or the other is broke pending which settings I use.

    I hope that makes sense..

    #193257
    Robin W
    Moderator

    may or may not work – but try

    .avatar {
    display : none ;
    }
    
    #bbpress-forums div.bbp-topic-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar {
    	display : block !important
    }
    

    The original turns it off, and the second turns it on again for topics and replies

    #193255
    Robin W
    Moderator

    in your custom css area try adding

    .avatar {
    display : none ;
    }
    #193253

    In reply to: Paginated content

    I found this code for WordPress but it doesnt seem to work:

    function cor_rel_next_prev_pagination() {
    global $paged;
    if ( get_previous_posts_link() ) { ?>
    <link rel="prev" href="<?php echo get_pagenum_link( $paged - 1 ); ?>">
    <?php
    }
    if ( get_next_posts_link() ) { ?>
    <link rel="next" href="<?php echo get_pagenum_link( $paged + 1 ); ?>">
    <?php
    }
    }
    remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
    add_action('wp_head', 'cor_rel_next_prev_pagination');

    Is there a way to make it work?

    Thank you.

    #193154
    erichamm1996
    Participant

    Thank you MBV!
    I inserted the CSS below, and it worked!

    .comment-list .edit-link, .reply {
    	position: relative;
    	right: 0px;
    	top: 0px;
    }
    #193153
    cloe22
    Participant

    Hi there,

    I have been using wordpress for the last year. In October I took over the completion of a site for a company I am working for. I set up a forum on the website using bbpress. All has worked fine until recently. Yesterday my boss pointed out an error on the forums page. See error here

    I began trying to fix it by remaking the page, using different shortcodes and changing/refreshing settings. All my other shortcodes that I’m using on my website are working fine, and when I use a shortcode for a different plugin in the same place on this page, it works fine. The shortcode I have been using is [bbp-forum-index]. I don’t know what caused it to stop working, as I have not installed any new plugins since before it has stopped working.

    WordPress 4.9.6 running Sydney theme.

    #193150
    MBV
    Participant

    It’s because you have this conflicting CSS in your stylesheet, line 3023

    .comment-list .edit-link, .reply {
        position: absolute;
        right: 20px;
        top: 22px;
    }
    yso1
    Participant

    Fixed it myself. Extending on benklocek s code, and also translating, added to themes functions.php

    function my_custom_roles( $role, $user_id ) {
    if( $role == ‘Keymaster’ )
    return ‘Sjef’;

    if( $role == ‘Spectator’ )
    return ‘Observator’;

    if( $role == ‘Blocked’ )
    return ‘Utestengt’;

    if( $role == ‘Participant’ )
    return ‘Deltager’;

    return $role;
    }

    add_filter( ‘bbp_get_user_display_role’, ‘my_custom_roles’, 10, 2 );

    Peace!

    #193134

    In reply to: Widgets

    tyrsdei
    Participant

    https://pastebin.com/e2PaK55d

    This is how I’ve converted/copied it so far… Not exactly sure how I would add classes so I can tweak the output via css. I’m a PHP novice. And did I modify all the right fields? I looked at Creating a widget tutorials and modified what i think to be the appropriate code

    #193133

    In reply to: Widgets

    tyrsdei
    Participant

    https://bbpress.org/forums/topic/where-is-the-code-for-the-bbpress-widgets/ finally found answer here, for location.
    Best suggestion is probably to make my own plugin that adds the widget, right?

    #193132

    Topic: Widgets

    in forum Plugins
    tyrsdei
    Participant

    Hi, I’d like to make a custom widget with the default bbpress forum list widget as a code starting point. Where would I locate these, and where should I place them once I make it? Should i turn it into a personal plugin so i can use it on other sites if I wish?

    It’s just that the default one is meant for a side bar, and I want one for under my header on my main page.

    #193105
    MBV
    Participant

    How did you guys enable ajax for buddypress group forum?
    That link to https://cloudup.com/czqFBqJE8TE is expired so I can’t see the code that was edited. Are you able to add it again here?

    #193099
    EGF
    Participant

    I was able to resolve the issue by adding a conditional statement to check for bbpress search results using bbp_is_search_results(). The theme i’m using doesn’t play well with bbPress

    <?php if ( !bbp_is_search_results() ) : ?>	
        
       <?php endif;?>	
Viewing 25 results - 4,301 through 4,325 (of 32,522 total)
Skip to toolbar