BuddyBoss Home – Web Support Forums Themes BuddyBoss theme Add the user thumb next to the "add a post" textfield in the activity page?

  • This topic has 14 replies, 2 contibutors, and was last updated 9 years ago by Anonymous.
Viewing 15 posts - 1 through 15 (of 15 total)
  • Question

    #54149
    @karlos

    hello,

    Great theme!

    How can I add the user thumb next to the “add a post” textfield in the activity page?
    Please see screenshot I am attaching.

    Can it be added to the lists of requests so it comes by default in the theme?

    Thank you!

    Answers

    #54177

    Anonymous
    @

    Hi @karlos, Thanks for your input we will consider it, I will add it to our suggestion list
    Regards

    #54178
    @karlos

    How can I add it?

    #54179
    @karlos

    It looks nice. i think it is better seeing their photo it encourages user to actually do leave a comment.

    #54266
    @karlos

    Any update?

    #54291

    Anonymous
    @

    Hi @karlos, add these to custom css

    
    #buddypress form#whats-new-form #whats-new-avatar {
        display: block !important;
        float: left;
        padding-right: 10px;
    }
    #buddypress form#whats-new-form p.activity-greeting {
        margin: 10px 0 10px!important;
    }
    

    Regards
    Varun Dubey

    #54302
    @karlos

    Wow looks much better!

    It would be great to have the thumb actually next to the text box, instead of the salutation message. Li this:
    http://buddyboss.clusterinteracti.netdna-cdn.com/wp-content/uploads/2015/12/request.png

    Right now it is displaying like this:
    https://www.oigente.com/baul-volatil/screen.png

    Can you share the css code for that please?

    Thank you!

    #54337
    @karlos

    Hello!

    Any update?

    Thank you!

    #54396

    Anonymous
    @

    Create a new file with name post-form.php
    at path
    buddyboss-child/buddypress/activity/post-form.php

    It will allow you to override the Avatar div
    Most of area whats-new-textarea is controled by BuddyPress JS and other BuddyPress specific js thus adding new div inside it may cause functionality issue

    
    
    <?php
    /**
     * BuddyPress - Activity Post Form
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    
    <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
    
    	<?php
    
    	/**
    	 * Fires before the activity post form.
    	 *
    	 * @since 1.2.0
    	 */
    	do_action( 'bp_before_activity_post_form' ); ?>
    
    	<div id="whats-new-avatar">
    		<a href="<?php echo bp_loggedin_user_domain(); ?>">
    			<?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
    		</a>
    	</div>
    
    	<p class="activity-greeting"><?php if ( bp_is_group() )
    		printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    	else
    		printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    	?></p>
    
    	<div id="whats-new-content">
    		<div id="whats-new-textarea">
    			<label for="whats-new" class="bp-screen-reader-text"><?php _e( 'Post what\'s new', 'buddypress' ); ?></label>
    			<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>
    		</div>
    
    		<div id="whats-new-options">
    			<div id="whats-new-submit">
    				<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" />
    			</div>
    
    			<?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
    
    				<div id="whats-new-post-in-box">
    
    					<?php _e( 'Post in', 'buddypress' ); ?>:
    
    					<label for="whats-new-post-in" class="bp-screen-reader-text"><?php _e( 'Post in', 'buddypress' ); ?></label>
    					<select id="whats-new-post-in" name="whats-new-post-in">
    						<option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
    
    						<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) :
    							while ( bp_groups() ) : bp_the_group(); ?>
    
    								<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
    
    							<?php endwhile;
    						endif; ?>
    
    					</select>
    				</div>
    				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    
    			<?php elseif ( bp_is_group_activity() ) : ?>
    
    				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    				<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
    
    			<?php endif; ?>
    
    			<?php
    
    			/**
    			 * Fires at the end of the activity post form markup.
    			 *
    			 * @since 1.2.0
    			 */
    			do_action( 'bp_activity_post_form_options' ); ?>
    
    		</div><!-- #whats-new-options -->
    	</div><!-- #whats-new-content -->
    
    	<?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
    	<?php
    
    	/**
    	 * Fires after the activity post form.
    	 *
    	 * @since 1.2.0
    	 */
    	do_action( 'bp_after_activity_post_form' ); ?>
    
    </form><!-- #whats-new-form -->
    
    

    Regards

    #54398
    @karlos

    Hello,

    I added the file with the code to the child theme and still nothing changed. Please see screenshot.

    In addition, there is not such a file post-form.php in the parent theme
    at path
    buddyboss/buddypress/activity/post-form.php

    Plese help.

    Thank you

    #54411

    Anonymous
    @

    yes, it is not available in parent theme
    and it still need customization of Avatar div

    
    <div id="whats-new-avatar">
    		<a href="<?php echo bp_loggedin_user_domain(); ?>">
    			<?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
    		</a>
    	</div>
    

    inside the content area div
    Just moving Avatar div inside the content are div will not work properly
    It will also need additional custom work.

    Please wait couple of days i will work on it and will provide complete solution with css.

    Regards

    #54437
    @karlos

    Thank you!

    #54566

    Anonymous
    @

    Hi @karlos

    buddyboss-child/buddypress/activity/post-form.php

    
    <?php
    /**
     * BuddyPress - Activity Post Form
     *
     * @package BuddyPress
     * @subpackage bp-legacy
     */
    
    ?>
    
    <form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
    
    	<?php
    
    	/**
    	 * Fires before the activity post form.
    	 *
    	 * @since 1.2.0
    	 */
    	do_action( 'bp_before_activity_post_form' ); ?>
    
    	<div id="whats-new-avatar">
    		<a href="<?php echo bp_loggedin_user_domain(); ?>">
    			<?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
    		</a>
    	</div>
    
    	<p class="activity-greeting"><?php if ( bp_is_group() )
    		printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    	else
    		printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname( bp_get_loggedin_user_fullname() ) );
    	?>
    
    	<div id="whats-new-content">
    	<div id="whats-new-avatar">
    		<a href="<?php echo bp_loggedin_user_domain(); ?>">
    			<?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
    		</a>
    	</div>
    		<div id="whats-new-textarea">
    			<label for="whats-new" class="bp-screen-reader-text"><?php _e( 'Post what\'s new', 'buddypress' ); ?></label>
    			<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>
    		</div>
    
    		<div id="whats-new-options">
    			<div id="whats-new-submit">
    				<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php esc_attr_e( 'Post Update', 'buddypress' ); ?>" />
    			</div>
    
    			<?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
    
    				<div id="whats-new-post-in-box">
    
    					<?php _e( 'Post in', 'buddypress' ); ?>:
    
    					<label for="whats-new-post-in" class="bp-screen-reader-text"><?php _e( 'Post in', 'buddypress' ); ?></label>
    					<select id="whats-new-post-in" name="whats-new-post-in">
    						<option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
    
    						<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0&update_meta_cache=0' ) ) :
    							while ( bp_groups() ) : bp_the_group(); ?>
    
    								<option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
    
    							<?php endwhile;
    						endif; ?>
    
    					</select>
    				</div>
    				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    
    			<?php elseif ( bp_is_group_activity() ) : ?>
    
    				<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
    				<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
    
    			<?php endif; ?>
    
    			<?php
    
    			/**
    			 * Fires at the end of the activity post form markup.
    			 *
    			 * @since 1.2.0
    			 */
    			do_action( 'bp_activity_post_form_options' ); ?>
    
    		</div><!-- #whats-new-options -->
    	</div><!-- #whats-new-content -->
    
    	<?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
    	<?php
    
    	/**
    	 * Fires after the activity post form.
    	 *
    	 * @since 1.2.0
    	 */
    	do_action( 'bp_after_activity_post_form' ); ?>
    
    </form><!-- #whats-new-form -->
    

    Along with custom css

    
    #buddypress form#whats-new-form #whats-new-avatar {
        display: block !important;
        float: left;
        padding-right: 10px;
    }
    #buddypress form#whats-new-form p.activity-greeting {
        margin: 10px 0 10px!important;
    }
    #buddypress form#whats-new-form p.activity-greeting{
    float:none!important;
    }
    #whats-new-textarea {
      float: left;
      width: 90%;
    }
    #whats-new-form{
    overflow:hidden;
    }
    #whats-new-options{
    float:left;
    width:100%;
    }
    @media screen and (max-width:529px){
    #whats-new-textarea {
        width: 78%;
    }
      #buddypress form#whats-new-form #whats-new-avatar{
      width:auto;
      }
    }
    
    

    It will work.

    Regards

    #54580
    @karlos

    Hello!

    Thank you it worked!

    But just fyi it worked only with the css code. If using buddyboss-child/buddypress/activity/post-form.php
    it displays 2 avatars. So I went ahead and took it out and it works fine only with the css.

    Cheers

    #54605

    Anonymous
    @

    Okay great 🙂

Viewing 15 posts - 1 through 15 (of 15 total)
  • The question ‘Add the user thumb next to the "add a post" textfield in the activity page?’ is closed to new replies.