Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'toolbar'

Viewing 25 results - 1 through 25 (of 732 total)
  • Author
    Search Results
  • #259158
    Profile photo of danbp
    danbp
    Moderator

    Hallo @mmirlach,

    I’ve activated the toolbar bubble in the settings… What are you talking about ? Such a setting doesn’t exist in BuddyPress.

    You can get any css information you need for this by:
    – right click on the page where you see this bubble and check the source code
    or
    – use Firebug or a similar tool.

    #259144
    Profile photo of mmirlach
    mmirlach
    Participant

    Hi, I’m using Buddypress on my website gaming-universe.de
    I’ve activated the toolbar bubble in the settings but it’s a very small red number in a blue circle, so it’s difficult to see what it says.

    Where can I change the style of the toolbar bubble? I did not find any CSS variables to do so.

    Profile photo of Anth0ny167
    Antonio
    Participant

    I created many custom notifications on my theme, such as notification on post comments, but after a post is commented and the notification is sent, the listing of posts and of other custom post types display a 404 page.

    This happens only on the listing page of posts, not on the single post pages.

    I really hope in an help.

    This is my code:

    add_action( 'bp_setup_globals', 'my_app_register_blog_notification' );
    
    /**
    * Register component
    */
    function my_app_register_blog_notification() {
    	// Register component manually into buddypress() singleton
    	buddypress()->my_app_blog = new stdClass;
    	// Add notification callback function
    	buddypress()->my_app_blog->notification_callback = 'my_app_blog_format_notifications';
    
    	// Now register components into active components array
    	buddypress()->active_components['my_app_blog'] = 1;
    }
    
    	
    
    /**
    * Format the notification content
    */
    function my_app_blog_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    	if ( ! ('my_app_blog_like' === $action || 'my_app_blog_comment' === $action)) {
    		return $action;
    	}
    
    	$post_title = get_the_title( $item_id );
    
    	if ('my_app_blog_comment' === $action) {
    		$custom_title = sprintf( esc_html__( 'New comment received', 'my_app' ), $post_title );
    		$custom_link  = get_permalink( $item_id );
    		if ( (int) $total_items > 1 ) {
    			$custom_text  = sprintf( esc_html__( 'You received "%1$s" new comments', 'my_app' ), $total_items );
    			$custom_link = bp_get_notifications_permalink();
    		} else {
    			$custom_text  = sprintf( esc_html__( 'Your post "%1$s" received a new comment', 'my_app' ), $post_title );
    		}
    
    	}
    
    	// WordPress Toolbar
    	if ( 'string' === $format ) {
    		$message = (!empty($custom_link)) ? '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>' : $custom_text;
    		$return = apply_filters( 'my_app_wiki_like_format', $message, $custom_text, $custom_link );
    
    		// Deprecated BuddyBar
    	} else {
    		$return = apply_filters( 'my_app_wiki_like_format', array(
    			'text' => $custom_text,
    			'link' => $custom_link
    		), $custom_link, (int) $total_items, $custom_text, $custom_title );
    	}
    
    	return $return;
    
    }	
    
    add_action('comment_post','my_app_comment_notification',10,2);
    
    /*
    * Send the notification after comment inserting
    */
    function my_app_comment_notification($comment_id, $comment_approved) {
    
    	if( 1 === $comment_approved ){
    		$comment_object = get_comment($comment_id);
    		$post_type = get_post_type($comment_object->comment_post_ID);
    		$current_user_id = get_current_user_id();
    
    		if($post_type == 'post') {
    			$post_object = get_post($comment_object->comment_post_ID);
    
    			if(my_app_is_notification_enabled_blog_comment()) {
    
    				bp_notifications_add_notification( array(
    					'user_id'           => $post_object->post_author,
    					'item_id'           => $comment_object->comment_post_ID,
    					'secondary_item_id' => $current_user_id,
    					'component_name'    => 'my_app_blog',
    					'component_action'  => 'my_app_blog_comment',
    					'date_notified'     => bp_core_current_time(),
    					'is_new'            => 1,
    				) );
    			}
    
    		}
    
    	}
    }
    #258649
    Profile photo of danbp
    danbp
    Moderator

    Hi,

    appart it is a wordpress related question, you can use CSS.

    Try this rule; goes to child-theme style.css

    div.wp-editor-container div.quicktags-toolbar {
    	background-color: red!important;
    }

    You can find good tuts on the web for more details.

    #258645
    Profile photo of karmatiger
    karmatiger
    Participant

    In the profile edit, if a field has been selected as multiline text input in the backend Buddypress places a wp editor on the frontend. But it has the light grey toolbar / white content area styling of the backend post creation form.

    But my profile has a dark colour scheme and I’d like to style the wp editor to match. How can this be done?

    #258554
    Profile photo of bigkahunaburger
    bigkahunaburger
    Participant

    @jbboro3 Oh wait that is the code just for the tinymce. I’m trying to remember if I ever had the rich text editor working for comments.

    Here is the code I was using for what’s new (its modified slightly for the plugin I posted above):

    
    function bpfr_whats_new_tiny_editor() {
    		$dwqa_tinymce_css = apply_filters( 'dwqa_editor_style', DWQA_URI . 'templates/assets/css/editor-style.css' );
    		$toolbar1 = apply_filters( 'dwqa_tinymce_toolbar1', 'bold,italic,underline,|,' . 'bullist,numlist,blockquote,|,' . 'link,unlink,|,' . 'image,code,|,'. 'spellchecker,fullscreen,dwqaCodeEmbed,|,' );
    wp_editor(
    	isset( $_GET['r'] ) ? '@' . esc_attr( $_GET['r'] ) : '',
    	'whats-new',
    	
    	array(
    		'textarea_name' => 'whats-new',
    		'editor_class'  => 'whats-new-mce',
    		'editor_height' => 200,
    		'media_buttons' => false, 
    		'quicktags' => false,
    		'tinymce' => array(
    						'toolbar1' => $toolbar1,
    						'toolbar2'   => '',
    						'content_css' => $dwqa_tinymce_css
    				)
    
    	)
    );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );

    I need to do some digging too see if I have something for the rich editor in comments. I tired so many different things trying to get it working I forgot where I left off.

    #258521
    Profile photo of danbp
    danbp
    Moderator

    Hi !

    unable to recreate this issue on a standart install and 2016 activated.

    This button comes only up on Group Directory: All Groups | My Groups | Create Group and not when you’re inside an existing group (where you see Send invites).

    There is another button for this on the WP Toolbar > Usermenu > Groups > Create Group
    And both are displayed correctly on Twenty Sixteen.

    Within buddypress.css default file, there is no specific rule for it.
    In case of, button’s ID on BuddyMenu is #group-create-nav

    For now,
    – is group creation allowed for all users (see in BP options) ?
    – do you see the button in the usermenu (top right corner) and does it work ?

    No idea what’s your issue, but i don’t believe it is BuddyPress. Maybe a plugin or a JS issue. Difficult to say more without a live URL. 😉

    #258323
    Profile photo of danbp
    danbp
    Moderator

    Hi,

    On your Toolbar you have the correct link to the correct register page !
    http://www.nyfertility.org/register/ (which is not blank at all !) 😉

    Note that WP/BP use mostly php files. Searching for file-name.html brings generally nothing else as blank pages.

    When you create a page or use one of BP pages, edit the page and get the permalink (underneath the page title), so you be sure to have the correct path to it.

    Other advice ? 🙂 Hum… read the documentation!

    #258209
    Profile photo of danbp
    danbp
    Moderator

    Hi,

    bp’s Usermenu is added to wp_admin_menu on the Toolbar, under Howdy. This BP menu ID is “my-account”.

    When you’re on a profile page, you see also these items in the Buddymenu, below the profile header cover.

    Some working examples here:
    Remove an item from Usermenu

    Remove an item from Buddymenu

    Since 2.6, BuddyPress use a navigation API. See here for many use case.

    Read also WP codex about admin bar menus.

    Where to put BuddyPress custom code ?
    Usually into bp-custom.php. This file is to BP code what a child theme is to a theme: a safe place with high priority where nothing get to loose when an update occurs !

    Child’s functions.php should be reserved to whatever you need for the theme itself.
    That said, it can happen(rarely) that some custom code won’t work from within bp-custom. In this case, feel free to remove it from bp-custom and give it a try inside child’s functions.php.

    As novice, you’re invited to read BP and WP codex if you want to customize.

    #257869
    Profile photo of Anth0ny167
    Antonio
    Participant

    Hi guys, I created a custom notification that is added when an user receive a like on a custom post type.

    All good unitl now, but I noticed that if the post receive 2 likes, from 2 different users, the user receive only the first notification and not the second one.

    Any help would be really appreciated.

    
    //Component declaration
    if(!function_exists('my_custom_register_wiki_notification')) {
    	function my_custom_register_wiki_notification() {
    		// Register component manually into buddypress() singleton
    		buddypress()->my_custom_wiki = new stdClass;
    		// Add notification callback function
    		buddypress()->my_custom_wiki->notification_callback = 'my_custom_wiki_like_format_notifications';
    
    		// Now register components into active components array
    		buddypress()->active_components['my_custom_wiki'] = 1;
    	}
    };
    
    //Notification format declaration
    if(!function_exists('my_custom_wiki_like_format_notifications')) {
    	function my_custom_wiki_like_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
    
    		// New custom notifications
    		if ( 'my_custom_wiki_like' === $action ) {
    
    			$wiki_post = get_post( $item_id );
    			$post_title = get_the_title( $item_id );
    
    			$custom_title = sprintf( esc_html__( 'Your post "%1$s" received a like', 'my_custom' ), $post_title );
    			$custom_text  = sprintf( esc_html__( 'Your post "%1$s" received a like', 'my_custom' ), $post_title );
    			$custom_link  = get_permalink( $item_id );
    
    			// WordPress Toolbar
    			if ( 'string' === $format ) {
    				$return = apply_filters( 'my_custom_wiki_like_format', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_title ) . '">' . esc_html( $custom_text ) . '</a>', $custom_text, $custom_link );
    
    				// Deprecated BuddyBar
    			} else {
    				$return = apply_filters( 'my_custom_wiki_like_format', array(
    					'text' => $custom_text,
    					'link' => $custom_link
    				), $custom_link, (int) $total_items, $custom_text, $custom_title );
    			}
    
    			return $return;
    
    		}
    
    		return $action;
    
    	}
    }
    
    //Function that add the notification when like is triggered
    function my_custom_add_like() {
      //...
      //...
    
      if(my_custom_is_wiki_like_notification_enabled()) {
    		        bp_notifications_add_notification( array(
    			        'user_id'           => $post_object->post_author,
    			        'item_id'           => $post_id,
    			        'secondary_item_id' => get_current_user_id(),
    			        'component_name'    => 'my_custom_wiki',
    			        'component_action'  => 'my_custom_wiki_like',
    			        'date_notified'     => bp_core_current_time(),
    			        'is_new'            => 1,
    		        ) );
    	        }
      
    }
    
    Profile photo of danbp
    danbp
    Moderator

    Profiles are handled on the mandatory BP members page.
    And yes you’re supposed to go to your-site/members/USERNAME/profile/ via the usermenu which is in the top-right corner of the toolbar (like on this forum) or from any profile, via the buddynav.

    Glad you got it !

    FYI, see eventl. here:
    https://buddypress.org/support/topic/add-dynamic-menu-link/#post-242555

    #257467
    Profile photo of Georgio
    Georgio
    Participant

    Finally I could resolve the problem after reading this article

    This developer suggests creating a plugin. The result is a link with a dashicon but it is not responsive. To make it responsive (show on mobile), I added in the css file of the plugin a snippet I fould elsewhere:

    @media screen and (max-width: 782px) {
    		  #wpadminbar li#wp-admin-bar-XXX {
    					display: block;
    		  }
    }

    Replace XXX with your id

    #257341

    In reply to: Activity Visual Editor

    Profile photo of bigkahunaburger
    bigkahunaburger
    Participant

    Here is my code:

    function bpfr_whats_new_tiny_editor() {
    wp_editor(
    	isset( $_GET['r'] ) ? '@' . esc_attr( $_GET['r'] ) : '',
    	'whats-new',
    	array(
    		'textarea_name' => 'whats-new',
    		'editor_class'  => 'whats-new-mce',
    		'editor_height' => 200,
    		'media_buttons' => false, 
    		'quicktags' => false,
    		'tinymce' => array(
    			'toolbar1' => 'bold,italic,underline,|,blockquote,|,bullist,numlist,|,link,unlink,|,spellchecker,|,undo,redo',
    			'toolbar2' => ''
    		)
    	)
    );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );
    <div id="whats-new-textarea">		
       <?php do_action( 'whats_new_textarea' ); ?>				
    </div>
    #257159
    Profile photo of maxlinux2000
    maxlinux2000
    Participant

    Hi all,

    I’m new here. a big hello to the community!!

    I’m tring to hacking an external WP plugin in order to works with buddypress.
    The Plugin is WP Mobile Menu

    My idea is to add some buttons in the header to this plugin, in order to make easy for the user open some useful page, like Activity, Profile an so on.

    Actually Is working just fine, with this code:

    $current_user = wp_get_current_user();
    // Profile
    $output .= '<div id="toolbar-profile" onclick="location.reload();location.href=\'http://example.org/members/';
    $output .= $current_user->user_login;
    $output .=   '\'"></div>';

    …but…but… if the username contain a dot character, buddypress transform the dot in ‘-‘ so pressing the button above, the user obtain a 404 page… and some users of mine, are using a email address as username.

    So I’m trying to modify my code so, but it doesn’t work at all.

    global $bp;
    $userlink = get_bp_loggedinuser_link();
    // Profile
    $output .= '<div id="toolbar-profile" onclick="location.reload();location.href=\'http://example.org/members/';
    $output .= $userlink->user_login;
    $output .=   '\'"></div>';
    

    Someone know ho to import the bp_loggedinuser_link() variable in a external WP plugin?
    (it’s not a 3th part buddypress plugin)

    regards
    MaX

    #256972
    Profile photo of khappamj
    khappamj
    Participant

    What are the PHP file templates that have to
    edit in moving the toolbar?

    #256952
    Profile photo of danbp
    danbp
    Moderator

    dashboard > BuddyPress > settings > options > Main Settings and check
    Toolbar [] Show the Toolbar for logged out users

    If it still doesn’t work, check your theme settings.
    You could also test with Twenty Sixteen and see if there is a difference.

    #256944
    Profile photo of rezza72
    rezza72
    Participant

    hi
    There was no problem with toolbar and was previously displayed. But it does not show.
    I mean, from the toolbar, it is a bar for login and registration.

    #256722
    Profile photo of ah72king
    ah72king
    Participant

    I found a solution that can help

    
    <?php
    // For Custom Notification 
    // Registering Custom Componet 
    function custom_filter_notifications_get_registered_components( $component_names = array() ) {
     
        // Force $component_names to be an array
        if ( ! is_array( $component_names ) ) {
            $component_names = array();
        }
    
        // Add 'custom' component to registered components array
        array_push( $component_names, 'custom' );
     
        // Return component's with 'custom' appended
        return $component_names;
    }
    add_filter( 'bp_notifications_get_registered_components', 'custom_filter_notifications_get_registered_components' );
    
    // Formatting custom with respect to action
    function bp_custom_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
     		
     		//$item_id this your id which you can use to get your respected data
        	$data  = get_my_values_custom_function($item_id); // this is custom function it depend on your needs and data
        	$custom_title = $data->title;
        	$custom_link  = $data->link;
        	$custom_text  = $data->text;
    
        // New custom notifications
        if ( 'custom_action' === $action ) {
            
            // WordPress Toolbar
            if ( 'string' === $format ) {
                $return = apply_filters( 'custom_filter','Your custom notification for <a href="'.$custom_link.'">'.$custom_title.'</a> ', $custom_text, $custom_link );
     
            // Deprecated BuddyBar
            } else {
                $return = apply_filters( 'custom_filter', array(
                    'text' => $custom_text,
                    'link' => $custom_link
                ), $custom_link, (int) $total_items, $custom_text, $custom_title );
            }
            
            return $return;
            
        }
       
    }
    add_filter( 'bp_notifications_get_notifications_for_user', 'bp_custom_format_buddypress_notifications', 10, 5 );
    
    // Adding custom Notification in DB 
    function bp_custom_notification( $item_id, $author_id ) {
    
        if ( bp_is_active( 'notifications' ) ) {   // if notification is active from admin panel
        	// if notification is active from admin panel bp_notifications_add_notification function to add notification into database
            bp_notifications_add_notification( array(                        
                'user_id'           => $author_id, // User to whom notification has to be send
                'item_id'           => $item_id,  // Id of thing you want to show it can be item_id or post or custom post or anything
                'component_name'    => 'custom', //  component that we registered
                'component_action'  => 'custom_action', // Our Custom Action 
                'date_notified'     => bp_core_current_time(), // current time
                'is_new'            => 1, // It say that is new notification
            ) );
        }
    }
    add_action( 'custom_hooks', 'bp_custom_notification', 10, 2);
    /**
    * custom_hooks is action name which will be call by do_action() function
    * bp_custom_notification your function name
    * 10 is priority number
    * 2 is number of parameter 
    */
    
    /****
    * Now Where to call custom_hooks and how 
    */
    
    do_action('custom_hooks', $item_id, $author_id );
    
    /****
    * place it where you want to call this action and pass parameter
    */ 
    
    Profile photo of Jeremy Pry
    Jeremy Pry
    Participant

    Under certain circumstances, there is an infinite loop inside the bp_legacy_theme_new_activity_comment() function. Specifically, when all of the secondary_item_id fields are zero, the $parent_id will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.

    This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/

    For information:

    • WordPress 4.5.3
    • BuddyPress 2.6.1.1
    • Single site install in web root
    • There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
    • We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
    • The core BuddyPress files have not been modified to my knowledge.
    • The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
    • The live site is http://www.lifeofdad.com/

    I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned bp_legacy_theme_new_activity_comment() function.

    My specific concern is this loop:

    
    	// Load the new activity item into the $activities_template global.
    	bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id );
    
    	// Swap the current comment with the activity item we just loaded.
    	if ( isset( $activities_template->activities[0] ) ) {
    		$activities_template->activity = new stdClass();
    		$activities_template->activity->id              = $activities_template->activities[0]->item_id;
    		$activities_template->activity->current_comment = $activities_template->activities[0];
    
    		// Because the whole tree has not been loaded, we manually
    		// determine depth.
    		$depth = 1;
    		$parent_id = (int) $activities_template->activities[0]->secondary_item_id;
    		while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) {
    			$depth++;
    			$p_obj = new BP_Activity_Activity( $parent_id );
    			$parent_id = (int) $p_obj->secondary_item_id;
    		}
    		$activities_template->activity->current_comment->depth = $depth;
    	}
    

    I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.

    I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.

    I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.

    
    +--------------------------------------+--------+-----------+---------+
    | name                                 | status | update    | version |
    +--------------------------------------+--------+-----------+---------+
    | akismet                              | active | none      | 3.1.11  |
    | all-in-one-seo-pack                  | active | available | 2.3.7   |
    | appbuddy                             | active | available | 2.0.7   |
    | appcamera                            | active | available | 2.0.0   |
    | appfbconnect                         | active | none      | 2.3.0   |
    | apppresser                           | active | none      | 2.5.0   |
    | apppush                              | active | available | 2.1.0   |
    | appshare                             | active | none      | 2.1.0   |
    | appswiper                            | active | available | 2.2.1   |
    | bp-profile-search                    | active | none      | 4.5.2   |
    | buddypress                           | active | none      | 2.6.1.1 |
    | buddypress-activity-plus             | active | none      | 1.6.4   |
    | bp-moderation                        | active | none      | 0.1.7   |
    | buddypress-nocaptcha-register-box    | active | none      | 1.1.3   |
    | buddypress-toolbar                   | active | none      | 1.6.0   |
    | buddypress-wall                      | active | none      | 0.9.4   |
    | buddypress-xprofile-image-field      | active | none      | 2.0.1   |
    | category-posts                       | active | none      | 4.6.1   |
    | contact-form-7                       | active | none      | 4.4.2   |
    | contact-form-7-to-database-extension | active | none      | 2.10.20 |
    | cubell-themes-functionality          | active | none      | 3.1     |
    | envato-wordpress-toolkit             | active | none      | 1.7.3   |
    | hashbuddy                            | active | none      | 1.5.2   |
    | login-with-ajax                      | active | none      | 3.1.6   |
    | mailchimp-for-wp                     | active | none      | 3.1.11  |
    | nav-menu-roles                       | active | none      | 1.8.2   |
    | nextend-facebook-connect             | active | none      | 1.5.9   |
    | buddypress-media                     | active | none      | 4.0.4   |
    | vine-embed                           | active | none      | 0.2     |
    | wds-lod-automatic-friends            | active | none      | 0.1.0   |
    | wds-lod-base                         | active | none      | 0.1.0   |
    | wds-lod-bp                           | active | none      | 0.1.0   |
    | wds-lod-post-types                   | active | none      | 0.1.0   |
    | wds-lod-widgets                      | active | none      | 0.1.0   |
    | wordpress-importer                   | active | none      | 0.6.1   |
    +--------------------------------------+--------+-----------+---------+
    
    #256497
    Profile photo of phucitol
    phucitol
    Participant

    Thanks so much for your response. I reread that post (which is what I based my code on) and I do realize I made some changes. For example removing:

    // deactivation of the visual tab, so user can't play with template styles
    add_filter ( 'user_can_richedit' , create_function ( '$a' , 'return false;' ) , 50 );

    and using:

    'tinymce'=> array(
                     'toolbar1'=> 'bold,italic,underline,strikethrough,forecolor',
                     'toolbar2' => 'bullist,numlist,link,unlink,undo,redo'
                           )

    instead of

    'quicktags' => array(
    		'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close')

    Without those changes I can’t get the rich text editor that I require. Did you mean by “It’s explained here” that making the visual editor work in this context is not possible?

    Profile photo of phucitol
    phucitol
    Participant

    Hello,

    I created a custom form-post.php so I could use wp_editor to customize the tinymce buttons I wanted to show. This is my code for that:

    function bpfr_whats_new_tiny_editor() {
    
    	// building the what's new textarea
    	if ( isset( $_GET['r'] ) ) :
    	$content = esc_textarea( $_GET['r'] ); 
    	endif;
    
    	// adding tinymce tools
    	$editor_id = 'whats-new';
    		$settings = array('textarea_name' => 'description',
                     'quicktags' => false,
                     'editor_class' => 'bp-suggestions',
                     'media_buttons' => false,
                     'teeny' => false,
                     'textarea_rows' => 5,
                     'tinymce'=> array(
                     'toolbar1'=> 'bold,italic,underline,strikethrough,forecolor',
                     'toolbar2' => 'bullist,numlist,link,unlink,undo,redo'
                           ));	
    	
    	// get the editor	
    	wp_editor( $content, $editor_id, $settings );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );
    		<div id="whats-new-textarea">
    			<?php do_action( 'whats_new_textarea' ); ?>
    		</div>

    My issue is that when I click in to the textarea (which is of course in an iframe) the “post update” button does not appear as it normally should. Suggestions?

    #256416
    Profile photo of danbp
    danbp
    Moderator

    Do you mean also that members can’t access to their profile settings when they are on their profile page ?

    The BP usermenu on the Toolbar, under Howdy (top right) mimics the usermenu of the BuddyBar which is on each profile.

    Have you enabled Extended Profiles ?

    Or use this snippet to login redirect your users to their profile.

    ps: i removed your site url as it is locked to public – which doesn’t help no one to help you.

    #255992
    Profile photo of danbp
    danbp
    Moderator

    hi @javierllinas

    You can use something like this (add to bp-custom.php or child theme’s functions.php)

    BuddyPress usermenu usage: remove_node(‘$id-$nav-$subnav’)

    /* remove items from Toolbar Usermenu (top-right) */
    function bpex_admin_bar_remove_this(){
    global $wp_admin_bar;
    	$wp_admin_bar->remove_node('my-account-forums-favorites');
    	$wp_admin_bar->remove_node('my-account-messages-starred');
            // etc...
    }
    add_action('wp_before_admin_bar_render','bpex_admin_bar_remove_this');

    Reference

    #255336
    Profile photo of danbp
    danbp
    Moderator

    @daltontastic,

    color buttons are TinyMCE tools and not html tags. The only way to get them would be to use the editor toolbar.

    Here a scenario you could use:
    – create a child-theme and add post-form.php to it (copy from bp-templates/bp-legacy/buddyPress/activity/post-form.php).
    Result: your-child-theme/buddypress/activity/post-form.php

    In that file, go to line:40 where textarea start.
    Inser this action hook:

    <?php if ( bp_is_groups_component() ) : ?>
    	<?php do_action( 'blablabla' ); ?>
    <?php endif ?>

    Then add this <?php if ( ! bp_is_groups_component() ) : ?>
    <textarea class="bp-suggestions"......bla...bla...</textarea>
    and add <?php endif ?> after the textarea closing tag.

    This contionnals will show a custom area for the desired group and prevent update area to appear on all other groups home pages.

    So if a user is member of different groups, he will get a texteditor for group_id 13 and the normal update area on all others.

    The custom template is ready. Now the fonctions we need.

    Open bp-custom.php (or create it) and paste in those snippets.

    Adding the texteditor:

    function bpfr_whats_new_tiny_editor() {
    	// deactivation of the visual tab, so user can't play with style tools
    //add_filter ( 'user_can_richedit' , create_function ( '$a' , 'return false;' ) , 50 );
    
    $content = "";
    
    	// building the what's new textarea
    	if ( isset( $_GET['r'] ) ) :
    	$content = esc_textarea( $_GET['r'] ); 
    	endif;
    
    	// adding tinymce tools
    	$editor_id = 'whats-new';
    
    	$settings = array( 
    			'textarea_name' => 'whats-new', 
    			'teeny' => false, 
    			'media_buttons' => true, 
    			'drag_drop_upload' => true, 
    			'quicktags' => array(
    			'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'
    		));	 
    	
    	// get the editor	
    	wp_editor( $content, $editor_id, $settings );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );

    A simple function who add the original textarea for users who are group members, but not allowed to rich edit.

    function my_textarea() { ?>
    			<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
    				<?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?>
    			><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
    <?php
    }

    And the last one, where you set up the group allowed to publish updates using edit tools.

    function trotro() {
    
    if ( bp_is_groups_component() ) :
    
    $check = groups_is_user_member( bp_loggedin_user_id(), bp_get_group_id() );
    $check_group = bp_get_group_id(); 
    
    	if ($check != 0 && $check_group == 21 && 'leon' == bp_current_item() ){
    		echo 'Wow! You can rich edit in this group.';
    			bpfr_whats_new_tiny_editor();
    	} else {
    		echo 'Sorry, you cannot rich edit in this group';
    		my_textarea();
    	}
    
    endif;
    }
    add_action( 'blablabla', 'trotro' );

    Now, any member which is part of the group leon, group id 23 can publish updates and use the color picker and all other things which are on the edit bar.

    Only thing you have to do is to adjust leon and id to your rules.

    Successfully tested on 2.6 and 2016.

    May this help you to go further with your BuddyPress project. 🙂

    Profile photo of RobertL4807
    RobertL4807
    Participant

    Can I have BuddyPress running at MySite.com but also seamlessly have a blog at podcast.mysite.com where logged in members can comment on podcast posts and see their profile avatar in the main toolbar?
    In other words, podcast.mysite.com would recognize a user/member who is logged in at mysite.com.

    Much appreciated.

    Robert

Viewing 25 results - 1 through 25 (of 732 total)
Skip to toolbar