Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 5,676 through 5,700 (of 32,505 total)
  • Author
    Search Results
  • #179978

    In reply to: Fetch different avatar

    ysiggen
    Participant

    Too late to edit my reply, I’d like to point out the fact that I was looking in the wrong area for replacing the wp avatar (with the bp one) as obviously in a forum, the avatar of each reply is attached to the… reply!

    That way I added a filter on the bbp_get_reply_author_avatar method instead of the bbp_get_current_user_avatar one.

    Personally, I’m not done as I am going to track down every part of my website where the wrong avatar gets displayed (which obviously means going through the wordpress code), but that’s not a bbpress concern anymore.

    (I don’t know if there is like a “resolved” mark to give or something, but I’m all done with this topic 🙂 )

    #179976

    In reply to: Fetch different avatar

    ysiggen
    Participant

    Okay so I am coming back here as I resolved it (it was quite easy actually, I am just very new to wordpress and also php programming).

    I just had to use the bp_core_fetch_avatar() function instead of the get_avatar() one.
    So, I had to call the correct function at the correct location and that’s all. Here is what I put in my function.php :

    //Make bbpress use the buddypress avatar instead of the wp one
    function bbp_get_bp_reply_author_avatar( $reply_id = 0, $size = 40 ) {
                    $reply_id = bbp_get_reply_id( $reply_id );
                    if ( !empty( $reply_id ) ) {
                            // Check for anonymous user
                            if ( !bbp_is_reply_anonymous( $reply_id ) ) {
                                    //Below is the old line
                                    //$author_avatar = get_avatar( bbp_get_reply_author_id( $reply_id ), $size );
                                    //Below is the new line
                                    $author_avatar = bp_core_fetch_avatar( array( 'item_id' => bbp_get_reply_author_id( $reply_id) ) );
                            } else {
                                   // $author_avatar = get_avatar( get_post_meta( $reply_id, '_bbp_anonymous_email', true ), $size );
                                    $author_avatar = bp_core_fetch_avatar( array( 'item_id' => get_post_meta( $reply_id, '_bbp_anonymous_email') ) );
    
                             }
                    } else {
                            $author_avatar = '';
                    }
    
                    return $author_avatar;
            }
    add_filter('bbp_get_reply_author_avatar', 'bbp_get_bp_reply_author_avatar');
    #179974
    Jon Fergus
    Participant

    We had this patched and it was working fine, but now the issue returned. Edits to replies are now creating multiple activity feed entries and multiple notification emails.

    We’re using:
    bbpress Version 2.5.11 (with the patch to activity.php applied)
    Buddypress Version 2.7.3

    This is what we have in activity.php:

    		// Get the activity stream item, bail if it doesn't exist
            $existing = new BP_Activity_Activity( $activity_id );
     		if ( empty( $existing->component ) )
    			return null;

    Would love some help with this.

    #179972

    In reply to: bbPress like Flarum

    Master
    Participant

    1. On bbpress.php change style.min.css to style.css and open style.css and change navbar-brand and add img. Or just edit on bbpress.php line
    <a class="navbar-brand" href="<?php echo esc_url(home_url(bbp_get_root_slug())); ?>" title="<?php bloginfo('name'); ?>" data-toggle="tooltip" data-placement="bottom"><?php bloginfo('name'); ?></a>
    2. Only topic, click To front http://prntscr.com/dldaw9

    Soulstudio
    Participant

    Hi,

    I’m using my code in functions.php file to store user’s location in the database and to display it on individual user profiles.

    function user_profile_bbp_location_information()	{
    	$location=bbp_get_displayed_user_field( 'location' ) ;
    	if ( ! empty($location) ) {
    		$label1 =  $rpi_options['item1_label'] ;
    		echo "<p>" ;
    		printf ( __( 'Location : ', 'bbpress' ));
    		echo $location;
    		echo"</p>" ;
    	}
    }
    add_action ('bbp_template_after_user_profile', 'user_profile_bbp_location_information') ;

    However, I would like to display this value under avatar of each user on topic posts/replies as well. I figured out I need to edit themes/childtheme/bbpress/loop-single-reply.php file but I wasn’t able to make the values appear there.

    I know there is a plugin for that but I like to use childtheme + functions.php for whatever I can + I already have working code in place.

    Any ideas?

    Thank you!

    #179954
    Wasca
    Participant

    Hi Guys

    I’d like to hide the visual editor when a user is posting to a particular forum. Could some one point me to the code that helps me determine what forum is being viewed so I can then disable the visual editor at that point.

    Thanks

    #179951
    Robin W
    Moderator

    the code goes in your functions file

    Functions files and child themes – explained !

    If you are just after changing the name -then the style pack plugin will let you do this

    https://wordpress.org/plugins/bbp-style-pack/

    #179946
    moscomoon
    Participant

    Hey there, so I’ve seen LOADS of posts about this and the code provided to help you create custom roles that do the same as the others.

    Only issue is I don’t know HTML I am a total noob at all of this and in NO POST does it state WHERE to put the HTML code?

    Custom Capabilities

    This was the guide I was trying to follow and it gives me the following code:

    unction add_custom_role( $bbp_roles ) {

    $bbp_roles[‘my_custom_role1’] = array(
    ‘name’ => ‘name 1’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles[‘my_custom_role2’] = array(
    ‘name’ => ‘name 2’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() ) // the same capabilities as participants
    );
    $bbp_roles[‘my_custom_role3’] = array(
    ‘name’ => ‘name 3’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_keymaster_role() ) // the same capabilities as keymaster
    );
    return $bbp_roles;
    }
    add_filter( ‘bbp_get_dynamic_roles’, ‘add_custom_role’, 1 );

    Which is fine

    except it doesn’t tell me where to put it? Do I just go to Plugins>edit>bbpress/bbpress.php and stick it anywhere in that big massive box of HTML?

    #179932
    adarshmadrecha
    Participant

    I researched on the BBpress forum and also on google, I found that by using [bbp-topic-tags] shortquote, I can show visitors of my site the tags which are used in all the forums.

    But the tags appear all next to each other. Is there any way to display tag with the number of topics besides them. Also, the tags are just shown in a single line. It would be better to have a show in an unordered list. And then sorted according to the number of times topics they have been tagged to.

    #179930
    en10
    Participant

    Hello,

    Is it available for phpBB 3.1.x?

    I tried the script of @hypnoticdan but I don’t have

    http://my_phpbb_domain.com/viewtopic.php?f=1&t=2
    to:
    http://my_wordpress_domain.com/forums/topic/corresponding_topic/

    I get only a redirection from phpbb to bbpress (index to index)

    #179923
    Robin W
    Moderator
    #179920
    wrspoon
    Participant

    Wordpress Version 4.7
    bbPress Version 2.5.12

    I’m very new to all of this and I just installed and activated bbpress. I’ve searched and I cannot find instructions for connecting a menu item I created “Discussion Forums” to the actual forums. I see that there are slugs and short codes in the settings menu of the dashboard, but I can’t figure out how to make it all work.

    Please help. thanks

    #179875

    In reply to: Sort topics in a Forum

    Robin W
    Moderator

    date order:

    put this in your functions fil :

    function rew_date_topic_order( $args ) {
                    $args['orderby']='date';
                    $args['order']='DESC';  //change to ASC to put oldest at top
                    return $args;
    }
    add_filter('bbp_before_has_topics_parse_args','rew_date_topic_order');

    Functions files and child themes – explained !

    #179869

    In reply to: Prefix Recommendation

    yikesitskevin
    Participant

    Hi @deall & @robin-w,

    I found this topic by googling around because I am having an issue and I think my issue is the reason this Prefix all forum content with the Forum Root slug (Recommended) option is recommended. If you don’t prefix, you can run into URL conflict issues. For example, if your forum is on your homepage, and there is no prefix, your pagination links will be something like www.{your_site_url}.com/page/2. The problem is www.{your_site_url}.com/page may be one of your pages. Obviously you could also have a page named ‘forums’, but it’s much less likely.

    Does this explanation sound correct?

    Pascal Casier
    Moderator

    Hi Bruce,
    To change the breadcrumbs have a look here: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#4-turning-off-or-changing-breadcrumbs

    If you don’t want to do it yourself, check out plugins like ‘bbP Toolkit’ where you should be able to configure it.

    Pascal.

    Bruce
    Participant

    I found the answer here

    #179839
    BenM
    Participant

    Hi,

    If I copy/paste html content to topic content, all html tag appears in text, all quotes are converted to french quotes and content can overflow screenshot (link to full image)

    I try this below but It doens’t change anything !

    remove_filter( 'bbp_get_reply_content', 'wptexturize' , 3);
    remove_filter( 'bbp_get_topic_content', 'wptexturize', 3);

    I remove ALL plugins and I erase functions.php !

    I also try this :

    function bbp_tinymce_paste_plain_text( $plugins = array() ) {
        $plugins[] = 'paste';
        return $plugins;
    }
    add_filter( 'bbp_get_tiny_mce_plugins', 'bbp_tinymce_paste_plain_text' );

    even if I want to permit copy/paste of (filtered) html, just to try, but it doesn’t make any change.

    Do you have an idea of what happens?
    Thanks.

    #179838
    Chad R. Schulz
    Participant

    A much appreciated restructuring.

    This simplifies a lot by renaming the core roles from within both front-end and back-end user role editors.

    Love learning new code/tricks.

    Thanks,
    Chad

    inderdeepbajwa
    Participant

    I have the latest 4.7 version of WordPress and installed the latest bbPress plugin (updated 4 days ago).

    When I click on Forums->All forums, in the WP Dashboard, it shows me a full white blank page. Upon typing website.com/forums, it shows a blank page. The newly created forum link website.com/forums/forum/forum is also completely blank. I’ve tried this on two themes – Twenty Sixteen and Twenty Seventeen. Both showed blank page.

    I tried creating a new page and pasting [bbp-forum-index] but that gave me the following code as the result:
    {{ partial “head.html” . }}
    {{ partial “header.html” . }} {{ partial “sidebar.html” . }} {{ partial “post/header-cover.html” . }}
    {{ $paginator := .Paginate (where .Data.Pages “Type” “post”) }} {{ range $paginator.Pages }} {{ .Render “summary” }} {{ end }} {{ partial “pagination.html” . }}
    {{ partial “footer.html” . }}
    {{ partial “foot.html” . }}

    #179835
    Bruce
    Participant

    bbpress Version 2.5.12
    wordpress Version 4.6.1
    TwentyThirteen-Child theme

    You’ll see I don’t know what I’m doing here. What follows is what I tried.

    I put the following into my 2013 child theme:
    1. a folder titled “bbpress” which contained the following all copied from the bbpress plugin folder:
    2. a folder titled “bbpress”
    3. a folder titled “css”
    4. a folder titled “extras”
    5. a folder titled “js”
    6. a file titled “bbpress-functions.php

    I replaced the top of the bbpress.css file which was in the “css” folder with this:

     /*
    Theme Name: bbpress bbpress-child
    Theme URI: http://neighborsconnect/neighborsnation/wp-content/themes/twentythirteen-child/bbpress-child/
    Description: bbpress-child theme for bbpress
    Version: 1.0
    Author: Bruce Wilson
    Author URI: http://neighborsnation.org/
    Template: bbpress-default
    Tags: bbpress, bbpress-child
    */ 

    Then I increased the font-size for the bbpress forums from 12 px to 20px and other such changes to see if it worked.

    Surprise! Surprise! It didn’t work.

    What do I need to do to make it work?

    ~ Bruce

    #179827
    Stephen Edgar
    Keymaster

    Thanks @chadschulz is this more along the lines of what you are after?

    A quick modification of your code above, with some tweaks via https://codex.bbpress.org/custom-capabilities/

    
    function chadschulz_bbpress_customized_roles( $bbp_roles ) {
    	// Keymaster -> Captain
    	$bbp_roles['bbp_keymaster'] = array(
    		'name'         => 'Captain',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
    	);
    	// Moderator -> Commander
    	$bbp_roles['bbp_moderator'] = array(
    		'name'         => 'Commander',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
    	);
    	// Participant -> Ensign
    	$bbp_roles['bbp_participant'] = array(
    		'name'         => 'Ensign',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
    	);
    	// Spectator -> Visitor
    	$bbp_roles['bbp_spectator'] = array(
    		'name'         => 'Visitor',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
    	);
    	// Blocked -> Banned
    	$bbp_roles['bbp_blocked'] = array(
    		'name'         => 'Banned',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
    	);
    	// Lieutenant (Based on Participant role caps)
    	$bbp_roles['bbp_lieutenant'] = array(
    		'name' => 'Lieutenant',
    		'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
    	);
    	return $bbp_roles;
    }
    add_filter( 'bbp_get_dynamic_roles', 'chadschulz_bbpress_customized_roles' );
    
    #179825
    Chad R. Schulz
    Participant

    Sure,

    I’ve been going with Star Trek ranks;-)

    function my_custom_roles( $role, $user_id ) {
      if($role){
        switch ($role) {
          case 'Participant': $role = 'Ensign'; break;
          case 'Keymaster': $role = 'Captain'; break;
          case 'Moderator': $role = 'Commander'; break;
          case 'Blocked': $role = 'Banned'; break;
          case 'Spectator': $role = 'Visitor'; break;  
        }
      }
      return $role;  
    }
    add_filter( 'bbp_get_user_display_role', 'my_custom_roles', 10, 2 );
    
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called lieutenant */
        $bbp_roles['bbp_lieutenant'] = array(
            'name' => 'Lieutenant',
            'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() ),
            );
     
        return $bbp_roles;
    } 
    add_filter( 'bbp_get_dynamic_roles', 'add_new_roles',  1 );

    As I said, things are all working properly now without any issues.

    But, maybe there’s a deeper problem during the update process that might be affecting others as well.

    Anyhoo, Thanks.
    Chad

    ddlange
    Participant

    I’d like to add my thanks to @fpradmin also. The code increases the font size of all parts of the forum page. Thanks!

    johnsantina
    Participant

    Hi everyone,

    I started a gaming website and to my surprise it isn’t doing too badly. I’m hoping to grow a community around it, but am really struggling to get everything right.

    I’ve managed to get my forum posts to replace comments:

    8 Wonderful Christmas Presents For Zelda Fans

    I’ve installed a Plugin to put Register/Login/Forgot at the top of the forum, which works very well, and shows on the main forum pages too: http://www.growngaming.com/forums/forum/grown-gaming-community/?view=all

    Now, my problem is I also want to offer the option to login with social media, rather than filling in all details, etc. I’ve successfully found and fully installed/integrated a widget to do this, which fits into the sidebar perfectly. However, I’d also like this to display in the top right hand corner of the forum (on every sub-forum and topic), so that people can see that they can comment on my posts (and, thus post in the forum) very easily.

    Is it possible for me to add this to my forum? I have a shortcode for the widget and have put it into pages etc, but I cannot figure out how to have it automatically added to every page/topic in my forum.

    Thank you for your help.

Viewing 25 results - 5,676 through 5,700 (of 32,505 total)
Skip to toolbar