Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'private message button'

Viewing 25 results - 51 through 75 (of 327 total)
  • Author
    Search Results
  • Anonymous User 16484011
    Inactive

    Hey !

    It’s not working or I can’t do properly. Can you please see my file and make a changes to delete only administrator users only show delete private message button ?

    <?php
    /**
     * BP Nouveau Messages main template.
     *
     * This template is used to inject the BuddyPress Backbone views
     * dealing with user's private messages.
     *
     * @since 3.0.0
     * @version 3.1.0
     */
    ?>
    <div class="subnav-filters filters user-subnav bp-messages-filters" id="subsubnav"></div>
    
    <div class="bp-messages-feedback"></div>
    <div class="bp-messages-content"></div>
    
    <script type="text/html" id="tmpl-bp-messages-feedback">
    	<div class="bp-feedback {{data.type}}">
    		<span class="bp-icon" aria-hidden="true"></span>
    		<p>{{{data.message}}}</p>
    	</div>
    </script>
    
    <?php
    /**
     * This view is used to inject hooks buffer
     */
    ?>
    <script type="text/html" id="tmpl-bp-messages-hook">
    	{{{data.extraContent}}}
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-form">
    	<?php bp_nouveau_messages_hook( 'before', 'compose_content' ); ?>
    
    	<label for="send-to-input"><?php esc_html_e( 'Send @Username', 'buddypress' ); ?></label>
    	<input type="text" name="send_to" class="send-to-input" id="send-to-input" />
    
    	<label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
    	<input type="text" name="subject" id="subject"/>
    
    	<div id="bp-message-content"></div>
    
    	<?php bp_nouveau_messages_hook( 'after', 'compose_content' ); ?>
    
    	<div class="submit">
    		<input type="button" id="bp-messages-send" class="button bp-primary-action" value="<?php echo esc_attr_x( 'Send', 'button', 'buddypress' ); ?>"/>
    		<input type="button" id="bp-messages-reset" class="text-button small bp-secondary-action" value="<?php echo esc_attr_x( 'Reset', 'form reset button', 'buddypress' ); ?>"/>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-editor">
    	<?php
    	// Add a temporary filter on editor buttons
    	add_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    
    	wp_editor(
    		'',
    		'message_content',
    		array(
    			'textarea_name' => 'message_content',
    			'teeny'         => false,
    			'media_buttons' => false,
    			'dfw'           => false,
    			'tinymce'       => true,
    			'quicktags'     => false,
    			'tabindex'      => '3',
    			'textarea_rows' => 5,
    		)
    	);
    
    	// Remove the temporary filter on editor buttons
    	remove_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    	?>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-paginate">
    	<# if ( 1 !== data.page ) { #>
    		<button id="bp-messages-prev-page"class="button messages-button">
    			<span class="dashicons dashicons-arrow-left"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Previous page', 'link', 'buddypress' ); ?></span>
    		</button>
    	<# } #>
    
    	<# if ( data.total_page !== data.page ) { #>
    		<button id="bp-messages-next-page"class="button messages-button">
    			<span class="dashicons dashicons-arrow-right"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Next page', 'link', 'buddypress' ); ?></span>
    		</button>
    	<# } #>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-filters">
    	<li class="user-messages-search" role="search" data-bp-search="{{data.box}}">
    		<div class="bp-search messages-search">
    			<?php bp_nouveau_message_search_form(); ?>
    		</div>
    	</li>
    	<li class="user-messages-bulk-actions"></li>
    </script>
    
    <script type="text/html" id="tmpl-bp-bulk-actions">
    	<input type="checkbox" id="user_messages_select_all" value="1"/>
    	<label for="user_messages_select_all"><?php esc_html_e( 'All Messages', 'buddypress' ); ?></label>
    	<div class="bulk-actions-wrap bp-hide">
    		<div class="bulk-actions select-wrap">
    			<label for="user-messages-bulk-actions" class="bp-screen-reader-text">
    				<?php esc_html_e( 'Select bulk action', 'buddypress' ); ?>
    			</label>
    			<select id="user-messages-bulk-actions">
    				<# for ( i in data ) { #>
    					<option value="{{data[i].value}}">{{data[i].label}}</option>
    				<# } #>
    			</select>
    			<span class="select-arrow" aria-hidden="true"></span>
    		</div>
    		<button class="messages-button bulk-apply bp-tooltip" type="submit" data-bp-tooltip="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
    			<span class="dashicons dashicons-yes" aria-hidden="true"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Apply', 'button', 'buddypress' ); ?></span>
    		</button>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-thread">
    	<div class="thread-cb">
    		<input class="message-check" type="checkbox" name="message_ids[]" id="bp-message-thread-{{data.id}}" value="{{data.id}}">
    		<label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select message:', 'buddypress' ); ?> {{data.subject}}</label>
    	</div>
    
    	<# if ( ! data.recipientsCount ) { #>
    		<div class="thread-from">
    			<a class="user-link" href="{{data.sender_link}}">
    				<img class="avatar" src="{{data.sender_avatar}}" alt="" />
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'From:', 'buddypress' ); ?></span>
    				<span class="user-name">{{data.sender_name}}</span>
    			</a>
    		</div>
    	<# } else {
    		var recipient = _.first( data.recipients );
    		#>
    		<div class="thread-to">
    			<a class="user-link" href="{{recipient.user_link}}">
    				<img class="avatar" src="{{recipient.avatar}}" alt="" />
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'To:', 'buddypress' ); ?></span>
    				<span class="user-name">{{recipient.user_name}}</span>
    			</a>
    
    			<# if ( data.toOthers ) { #>
    				<span class="num-recipients">{{data.toOthers}}</span>
    			<# } #>
    		</div>
    	<# } #>
    
    	<div class="thread-content" data-thread-id="{{data.id}}">
    		<div class="thread-subject">
    			<span class="thread-count">({{data.count}})</span>
    			<a class="subject" href="../view/{{data.id}}/">{{data.subject}}</a>
    		</div>
    		<p class="excerpt">{{data.excerpt}}</p>
    	</div>
    	<div class="thread-date">
    		<time datetime="{{data.date.toISOString()}}">{{data.display_date}}</time>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-preview">
    	<# if ( undefined !== data.content ) { #>
    
    		<h2 class="message-title preview-thread-title"><?php esc_html_e( 'Active conversation:', 'buddypress' ); ?><span class="messages-title">{{{data.subject}}}</span></h2>
    		<div class="preview-content">
    			<header class="preview-pane-header">
    
    				<# if ( undefined !== data.recipients ) { #>
    					<dl class="thread-participants">
    						<dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
    						<dd>
    							<ul class="participants-list">
    								<# for ( i in data.recipients ) { #>
    									<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
    								<# } #>
    							</ul>
    						</dd>
    					</dl>
    				<# } #>
    
    				<div class="actions">
    
    					<button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
    						<span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
    					</button>
    
    					<# if ( undefined !== data.star_link ) { #>
    
    						<# if ( false !== data.is_starred ) { #>
    							<a role="button" class="message-action-unstar bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="unstar" aria-pressed="true" data-bp-tooltip="<?php esc_attr_e( 'Unstar Conversation', 'buddypress' ); ?>">
    								<span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Conversation', 'buddypress' ); ?></span>
    							</a>
    						<# } else { #>
    							<a role="button" class="message-action-star bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="star" aria-pressed="false" data-bp-tooltip="<?php esc_attr_e( 'Star Conversation', 'buddypress' ); ?>">
    								<span class="bp-screen-reader-text"><?php esc_html_e( 'Star Conversation', 'buddypress' ); ?></span>
    							</a>
    						<# } #>
    
    					<# } #>
    
    					<a href="../view/{{data.id}}/" class="message-action-view bp-tooltip bp-icons" data-bp-action="view" data-bp-tooltip="<?php esc_attr_e( 'View full conversation and reply.', 'buddypress' ); ?>">
    						<span class="bp-screen-reader-text"><?php esc_html_e( 'View full conversation and reply.', 'buddypress' ); ?></span>
    					</a>
    
    					<# if ( data.threadOptions ) { #>
    						<span class="bp-messages-hook thread-options">
    							{{{data.threadOptions}}}
    						</span>
    					<# } #>
    				</div>
    			</header>
    
    			<div class='preview-message'>
    				{{{data.content}}}
    			</div>
    
    			<# if ( data.inboxListItem ) { #>
    				<table class="bp-messages-hook inbox-list-item">
    					<tbody>
    						<tr>{{{data.inboxListItem}}}</tr>
    					</tbody>
    				</table>
    			<# } #>
    		</div>
    	<# } #>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single-header">
    	<h2 id="message-subject" class="message-title single-thread-title">{{{data.subject}}}</h2>
    	<header class="single-message-thread-header">
    		<# if ( undefined !== data.recipients ) { #>
    			<dl class="thread-participants">
    				<dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
    				<dd>
    					<ul class="participants-list">
    						<# for ( i in data.recipients ) { #>
    							<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
    						<# } #>
    					</ul>
    				</dd>
    			</dl>
    		<# } #>
    
    		<?php if(current_user_can('manage_options')){ ?>
    			<button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
    			</button>
    		<?php }?>
    		</div>
    	</header>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single-list">
    	<div class="message-metadata">
    		<# if ( data.beforeMeta ) { #>
    			<div class="bp-messages-hook before-message-meta">{{{data.beforeMeta}}}</div>
    		<# } #>
    
    		<a href="{{data.sender_link}}" class="user-link">
    			<img class="avatar" src="{{data.sender_avatar}}" alt="" />
    			<strong>{{data.sender_name}}</strong>
    		</a>
    
    		<time datetime="{{data.date.toISOString()}}" class="activity">{{data.display_date}}</time>
    
    		<div class="actions">
    			<# if ( undefined !== data.star_link ) { #>
    
    				<button type="button" class="message-action-unstar bp-tooltip bp-icons <# if ( false === data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="unstar" data-bp-tooltip="<?php esc_attr_e( 'Unstar Message', 'buddypress' ); ?>">
    					<span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Message', 'buddypress' ); ?></span>
    				</button>
    
    				<button type="button" class="message-action-star bp-tooltip bp-icons <# if ( false !== data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="star" data-bp-tooltip="<?php esc_attr_e( 'Star Message', 'buddypress' ); ?>">
    					<span class="bp-screen-reader-text"><?php esc_html_e( 'Star Message', 'buddypress' ); ?></span>
    				</button>
    
    			<# } #>
    		</div>
    
    		<# if ( data.afterMeta ) { #>
    			<div class="bp-messages-hook after-message-meta">{{{data.afterMeta}}}</div>
    		<# } #>
    	</div>
    
    	<# if ( data.beforeContent ) { #>
    		<div class="bp-messages-hook before-message-content">{{{data.beforeContent}}}</div>
    	<# } #>
    
    	<div class="message-content">{{{data.content}}}</div>
    
    	<# if ( data.afterContent ) { #>
    		<div class="bp-messages-hook after-message-content">{{{data.afterContent}}}</div>
    	<# } #>
    
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single">
    	<?php bp_nouveau_messages_hook( 'before', 'thread_content' ); ?>
    
    	<div id="bp-message-thread-header" class="message-thread-header"></div>
    
    	<?php bp_nouveau_messages_hook( 'before', 'thread_list' ); ?>
    
    	<ul id="bp-message-thread-list"></ul>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_list' ); ?>
    
    	<?php bp_nouveau_messages_hook( 'before', 'thread_reply' ); ?>
    
    	<form id="send-reply" class="standard-form send-reply">
    		<div class="message-box">
    			<div class="message-metadata">
    
    				<?php bp_nouveau_messages_hook( 'before', 'reply_meta' ); ?>
    
    				<div class="avatar-box">
    					<?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
    
    					<strong><?php esc_html_e( 'Send a Reply', 'buddypress' ); ?></strong>
    				</div>
    
    				<?php bp_nouveau_messages_hook( 'after', 'reply_meta' ); ?>
    
    			</div><!-- .message-metadata -->
    
    			<div class="message-content">
    
    				<?php bp_nouveau_messages_hook( 'before', 'reply_box' ); ?>
    
    				<label for="message_content" class="bp-screen-reader-text"><?php _e( 'Reply to Message', 'buddypress' ); ?></label>
    				<div id="bp-message-content"></div>
    
    				<?php bp_nouveau_messages_hook( 'after', 'reply_box' ); ?>
    
    				<div class="submit">
    					<input type="submit" name="send" value="<?php echo esc_attr_x( 'Send Reply', 'button', 'buddypress' ); ?>" id="send_reply_button"/>
    				</div>
    
    			</div><!-- .message-content -->
    
    		</div><!-- .message-box -->
    	</form>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_reply' ); ?>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_content' ); ?>
    </script>
    

    Thanks

    Anonymous User 16484011
    Inactive

    Hi ! Prashant !

    Thanks for your time. But I am zero in buddypress & coding. So, As per your path I find the index file but I can’t get where can I use your above code and where can I add role name administrator ? I put my file here ! Can you please edit it for me ?

    <?php
    /**
     * BP Nouveau Messages main template.
     *
     * This template is used to inject the BuddyPress Backbone views
     * dealing with user's private messages.
     *
     * @since 3.0.0
     * @version 3.1.0
     */
    ?>
    <div class="subnav-filters filters user-subnav bp-messages-filters" id="subsubnav"></div>
    
    <div class="bp-messages-feedback"></div>
    <div class="bp-messages-content"></div>
    
    <script type="text/html" id="tmpl-bp-messages-feedback">
    	<div class="bp-feedback {{data.type}}">
    		<span class="bp-icon" aria-hidden="true"></span>
    		<p>{{{data.message}}}</p>
    	</div>
    </script>
    
    <?php
    /**
     * This view is used to inject hooks buffer
     */
    ?>
    <script type="text/html" id="tmpl-bp-messages-hook">
    	{{{data.extraContent}}}
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-form">
    	<?php bp_nouveau_messages_hook( 'before', 'compose_content' ); ?>
    
    	<label for="send-to-input"><?php esc_html_e( 'Send @Username', 'buddypress' ); ?></label>
    	<input type="text" name="send_to" class="send-to-input" id="send-to-input" />
    
    	<label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
    	<input type="text" name="subject" id="subject"/>
    
    	<div id="bp-message-content"></div>
    
    	<?php bp_nouveau_messages_hook( 'after', 'compose_content' ); ?>
    
    	<div class="submit">
    		<input type="button" id="bp-messages-send" class="button bp-primary-action" value="<?php echo esc_attr_x( 'Send', 'button', 'buddypress' ); ?>"/>
    		<input type="button" id="bp-messages-reset" class="text-button small bp-secondary-action" value="<?php echo esc_attr_x( 'Reset', 'form reset button', 'buddypress' ); ?>"/>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-editor">
    	<?php
    	// Add a temporary filter on editor buttons
    	add_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    
    	wp_editor(
    		'',
    		'message_content',
    		array(
    			'textarea_name' => 'message_content',
    			'teeny'         => false,
    			'media_buttons' => false,
    			'dfw'           => false,
    			'tinymce'       => true,
    			'quicktags'     => false,
    			'tabindex'      => '3',
    			'textarea_rows' => 5,
    		)
    	);
    
    	// Remove the temporary filter on editor buttons
    	remove_filter( 'mce_buttons', 'bp_nouveau_messages_mce_buttons', 10, 1 );
    	?>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-paginate">
    	<# if ( 1 !== data.page ) { #>
    		<button id="bp-messages-prev-page"class="button messages-button">
    			<span class="dashicons dashicons-arrow-left"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Previous page', 'link', 'buddypress' ); ?></span>
    		</button>
    	<# } #>
    
    	<# if ( data.total_page !== data.page ) { #>
    		<button id="bp-messages-next-page"class="button messages-button">
    			<span class="dashicons dashicons-arrow-right"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Next page', 'link', 'buddypress' ); ?></span>
    		</button>
    	<# } #>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-filters">
    	<li class="user-messages-search" role="search" data-bp-search="{{data.box}}">
    		<div class="bp-search messages-search">
    			<?php bp_nouveau_message_search_form(); ?>
    		</div>
    	</li>
    	<li class="user-messages-bulk-actions"></li>
    </script>
    
    <script type="text/html" id="tmpl-bp-bulk-actions">
    	<input type="checkbox" id="user_messages_select_all" value="1"/>
    	<label for="user_messages_select_all"><?php esc_html_e( 'All Messages', 'buddypress' ); ?></label>
    	<div class="bulk-actions-wrap bp-hide">
    		<div class="bulk-actions select-wrap">
    			<label for="user-messages-bulk-actions" class="bp-screen-reader-text">
    				<?php esc_html_e( 'Select bulk action', 'buddypress' ); ?>
    			</label>
    			<select id="user-messages-bulk-actions">
    				<# for ( i in data ) { #>
    					<option value="{{data[i].value}}">{{data[i].label}}</option>
    				<# } #>
    			</select>
    			<span class="select-arrow" aria-hidden="true"></span>
    		</div>
    		<button class="messages-button bulk-apply bp-tooltip" type="submit" data-bp-tooltip="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
    			<span class="dashicons dashicons-yes" aria-hidden="true"></span>
    			<span class="bp-screen-reader-text"><?php echo esc_html_x( 'Apply', 'button', 'buddypress' ); ?></span>
    		</button>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-thread">
    	<div class="thread-cb">
    		<input class="message-check" type="checkbox" name="message_ids[]" id="bp-message-thread-{{data.id}}" value="{{data.id}}">
    		<label for="bp-message-thread-{{data.id}}" class="bp-screen-reader-text"><?php esc_html_e( 'Select message:', 'buddypress' ); ?> {{data.subject}}</label>
    	</div>
    
    	<# if ( ! data.recipientsCount ) { #>
    		<div class="thread-from">
    			<a class="user-link" href="{{data.sender_link}}">
    				<img class="avatar" src="{{data.sender_avatar}}" alt="" />
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'From:', 'buddypress' ); ?></span>
    				<span class="user-name">{{data.sender_name}}</span>
    			</a>
    		</div>
    	<# } else {
    		var recipient = _.first( data.recipients );
    		#>
    		<div class="thread-to">
    			<a class="user-link" href="{{recipient.user_link}}">
    				<img class="avatar" src="{{recipient.avatar}}" alt="" />
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'To:', 'buddypress' ); ?></span>
    				<span class="user-name">{{recipient.user_name}}</span>
    			</a>
    
    			<# if ( data.toOthers ) { #>
    				<span class="num-recipients">{{data.toOthers}}</span>
    			<# } #>
    		</div>
    	<# } #>
    
    	<div class="thread-content" data-thread-id="{{data.id}}">
    		<div class="thread-subject">
    			<span class="thread-count">({{data.count}})</span>
    			<a class="subject" href="../view/{{data.id}}/">{{data.subject}}</a>
    		</div>
    		<p class="excerpt">{{data.excerpt}}</p>
    	</div>
    	<div class="thread-date">
    		<time datetime="{{data.date.toISOString()}}">{{data.display_date}}</time>
    	</div>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-preview">
    	<# if ( undefined !== data.content ) { #>
    
    		<h2 class="message-title preview-thread-title"><?php esc_html_e( 'Active conversation:', 'buddypress' ); ?><span class="messages-title">{{{data.subject}}}</span></h2>
    		<div class="preview-content">
    			<header class="preview-pane-header">
    
    				<# if ( undefined !== data.recipients ) { #>
    					<dl class="thread-participants">
    						<dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
    						<dd>
    							<ul class="participants-list">
    								<# for ( i in data.recipients ) { #>
    									<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
    								<# } #>
    							</ul>
    						</dd>
    					</dl>
    				<# } #>
    
    				<div class="actions">
    
    					<button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
    						<span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
    					</button>
    
    					<# if ( undefined !== data.star_link ) { #>
    
    						<# if ( false !== data.is_starred ) { #>
    							<a role="button" class="message-action-unstar bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="unstar" aria-pressed="true" data-bp-tooltip="<?php esc_attr_e( 'Unstar Conversation', 'buddypress' ); ?>">
    								<span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Conversation', 'buddypress' ); ?></span>
    							</a>
    						<# } else { #>
    							<a role="button" class="message-action-star bp-tooltip bp-icons" href="{{data.star_link}}" data-bp-action="star" aria-pressed="false" data-bp-tooltip="<?php esc_attr_e( 'Star Conversation', 'buddypress' ); ?>">
    								<span class="bp-screen-reader-text"><?php esc_html_e( 'Star Conversation', 'buddypress' ); ?></span>
    							</a>
    						<# } #>
    
    					<# } #>
    
    					<a href="../view/{{data.id}}/" class="message-action-view bp-tooltip bp-icons" data-bp-action="view" data-bp-tooltip="<?php esc_attr_e( 'View full conversation and reply.', 'buddypress' ); ?>">
    						<span class="bp-screen-reader-text"><?php esc_html_e( 'View full conversation and reply.', 'buddypress' ); ?></span>
    					</a>
    
    					<# if ( data.threadOptions ) { #>
    						<span class="bp-messages-hook thread-options">
    							{{{data.threadOptions}}}
    						</span>
    					<# } #>
    				</div>
    			</header>
    
    			<div class='preview-message'>
    				{{{data.content}}}
    			</div>
    
    			<# if ( data.inboxListItem ) { #>
    				<table class="bp-messages-hook inbox-list-item">
    					<tbody>
    						<tr>{{{data.inboxListItem}}}</tr>
    					</tbody>
    				</table>
    			<# } #>
    		</div>
    	<# } #>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single-header">
    	<h2 id="message-subject" class="message-title single-thread-title">{{{data.subject}}}</h2>
    	<header class="single-message-thread-header">
    		<# if ( undefined !== data.recipients ) { #>
    			<dl class="thread-participants">
    				<dt><?php esc_html_e( 'Participants:', 'buddypress' ); ?></dt>
    				<dd>
    					<ul class="participants-list">
    						<# for ( i in data.recipients ) { #>
    							<li><a href="{{data.recipients[i].user_link}}" class="bp-tooltip" data-bp-tooltip="{{data.recipients[i].user_name}}"><img class="avatar mini" src="{{data.recipients[i].avatar}}" alt="{{data.recipients[i].user_name}}" /></a></li>
    						<# } #>
    					</ul>
    				</dd>
    			</dl>
    		<# } #>
    
    		<div class="actions">
    			<button type="button" class="message-action-delete bp-tooltip bp-icons" data-bp-action="delete" data-bp-tooltip="<?php esc_attr_e( 'Delete conversation.', 'buddypress' ); ?>">
    				<span class="bp-screen-reader-text"><?php esc_html_e( 'Delete conversation.', 'buddypress' ); ?></span>
    			</button>
    		</div>
    	</header>
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single-list">
    	<div class="message-metadata">
    		<# if ( data.beforeMeta ) { #>
    			<div class="bp-messages-hook before-message-meta">{{{data.beforeMeta}}}</div>
    		<# } #>
    
    		<a href="{{data.sender_link}}" class="user-link">
    			<img class="avatar" src="{{data.sender_avatar}}" alt="" />
    			<strong>{{data.sender_name}}</strong>
    		</a>
    
    		<time datetime="{{data.date.toISOString()}}" class="activity">{{data.display_date}}</time>
    
    		<div class="actions">
    			<# if ( undefined !== data.star_link ) { #>
    
    				<button type="button" class="message-action-unstar bp-tooltip bp-icons <# if ( false === data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="unstar" data-bp-tooltip="<?php esc_attr_e( 'Unstar Message', 'buddypress' ); ?>">
    					<span class="bp-screen-reader-text"><?php esc_html_e( 'Unstar Message', 'buddypress' ); ?></span>
    				</button>
    
    				<button type="button" class="message-action-star bp-tooltip bp-icons <# if ( false !== data.is_starred ) { #>bp-hide<# } #>" data-bp-star-link="{{data.star_link}}" data-bp-action="star" data-bp-tooltip="<?php esc_attr_e( 'Star Message', 'buddypress' ); ?>">
    					<span class="bp-screen-reader-text"><?php esc_html_e( 'Star Message', 'buddypress' ); ?></span>
    				</button>
    
    			<# } #>
    		</div>
    
    		<# if ( data.afterMeta ) { #>
    			<div class="bp-messages-hook after-message-meta">{{{data.afterMeta}}}</div>
    		<# } #>
    	</div>
    
    	<# if ( data.beforeContent ) { #>
    		<div class="bp-messages-hook before-message-content">{{{data.beforeContent}}}</div>
    	<# } #>
    
    	<div class="message-content">{{{data.content}}}</div>
    
    	<# if ( data.afterContent ) { #>
    		<div class="bp-messages-hook after-message-content">{{{data.afterContent}}}</div>
    	<# } #>
    
    </script>
    
    <script type="text/html" id="tmpl-bp-messages-single">
    	<?php bp_nouveau_messages_hook( 'before', 'thread_content' ); ?>
    
    	<div id="bp-message-thread-header" class="message-thread-header"></div>
    
    	<?php bp_nouveau_messages_hook( 'before', 'thread_list' ); ?>
    
    	<ul id="bp-message-thread-list"></ul>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_list' ); ?>
    
    	<?php bp_nouveau_messages_hook( 'before', 'thread_reply' ); ?>
    
    	<form id="send-reply" class="standard-form send-reply">
    		<div class="message-box">
    			<div class="message-metadata">
    
    				<?php bp_nouveau_messages_hook( 'before', 'reply_meta' ); ?>
    
    				<div class="avatar-box">
    					<?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
    
    					<strong><?php esc_html_e( 'Send a Reply', 'buddypress' ); ?></strong>
    				</div>
    
    				<?php bp_nouveau_messages_hook( 'after', 'reply_meta' ); ?>
    
    			</div><!-- .message-metadata -->
    
    			<div class="message-content">
    
    				<?php bp_nouveau_messages_hook( 'before', 'reply_box' ); ?>
    
    				<label for="message_content" class="bp-screen-reader-text"><?php _e( 'Reply to Message', 'buddypress' ); ?></label>
    				<div id="bp-message-content"></div>
    
    				<?php bp_nouveau_messages_hook( 'after', 'reply_box' ); ?>
    
    				<div class="submit">
    					<input type="submit" name="send" value="<?php echo esc_attr_x( 'Send Reply', 'button', 'buddypress' ); ?>" id="send_reply_button"/>
    				</div>
    
    			</div><!-- .message-content -->
    
    		</div><!-- .message-box -->
    	</form>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_reply' ); ?>
    
    	<?php bp_nouveau_messages_hook( 'after', 'thread_content' ); ?>
    </script>
    

    Thanks

    Prashant Singh
    Participant
    function ps_remove_private_message_button( $button ) {
            $user = bp_displayed_user_id();
    	if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
    		if ( $role != 'your_role_here') {
    			$button = '';
    		}
    	}
         return $button;
    }
    add_filter( 'bp_get_send_message_button', 'ps_remove_private_message_button', 10 , 1 );

    Hi,

    One solution is to hide private message button from any other user roles and just leave on support user role. Please try the above-given code for the same.

    Thanks

    #276863
    starvoters1
    Participant

    I had this issue too. I just switched from the new templates back to Buddypress legacy and it is now working to click the private message button and you can start composing the message to the user immediately. It is something in the buddypress nouveau template.

    #276592

    In reply to: PM Spam

    D L
    Participant

    @prashantvatsh Thanks, I didn’t realize that every user could see the /members page and then if they click to a members profile they see the public and private messaging buttons too.

    It seems that every new registration on the site automatically becomes a Buddypress member. So then they can see the membership list and message any other user without being a member of any group.

    This isn’t good, easy for manual spammers to register and send PM spam to members.

    #276562
    heikesworld
    Participant

    Hello,
    Currently clicking the “message” button to send a private message to another user takes me to Inbox and I have to click on the “Compose” tab (Note: the text “Inbox” says active!) and remember the username that I want to sent the message to.
    https://prnt.sc/kuccn7
    https://prnt.sc/kucd2g
    SHOULD BE: Click on direct message takes me directly to compose with user name filled in.

    My theme creator said this gets fixed by updating to BuddyPress 3.2, however I did and the problem persists.
    Thank you for your help.

    #276291
    helgipetersen
    Participant

    Im building a Apartment rental site.
    And on the single apartment page I have a “Send a private message” button where people can send a private message to the person who owns the apartment and ask a questions.

    So therefor I need to automaticly add the Apartment name in the Subject of the message.

    Is it possible to make the subject within the URL something link “https://domain.com/members/user1/messages/compose/?r=user2?subject=xxxxxxxx&#8221; So the Subject is automaticly filled when people clicks the “Send a private message”

    r-a-y
    Keymaster

    Duplicate of https://buddypress.org/support/topic/private-message-button-not-working-right/

    Closing to avoid forking the discussion.

    #274732
    RT77
    Participant

    anyone? this is on buddypress profiles.. all plugins are deactivated so nothing is interfering as far as I know. When the “Private Message” Button is clicked it does not open the compose message with the user name in the title.. I think it might be a bug?

    RT77
    Participant

    Hello I think I have a bug here, ok I am on buddypress Version 3.1.0 and logged in as admin I click on a member in the members directory and it has a button for “private message”, when clicked on I am assuming it is supposed to open the compose message box with the members name in the send to field but it is not doing that for some reason. I am assuming this also because of the url link. https://www.theexample.com/members/admin/messages/compose?r=thememberid
    So is this a bug and how can I fix this if it is?

    #272468
    taskemann
    Participant

    Hi Venutis! Thank you for the tip 🙂

    But I found this code online created by a fellower named Brajesh Singh that worked very well. I just pasted it into my child theme’s functions.php

    //////////////////////////////////////////////////////////////////
    // BuddyPress send private message button
    //////////////////////////////////////////////////////////////////
    
    /**
     * Get a link to send PM to the given User.
     *
     * @param int $user_id user id.
     *
     * @return string
     */
    function buddydev_get_send_private_message_to_user_url( $user_id ) {
        return wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( $user_id ) );
    }
    
    /**
     * Shortcode [bp-pm-button username=optional_some_user_name]
     *
     * @param array $atts shortcode attributes.
     * @param string $content content.
     *
     * @return string
     */
    function buddydev_private_message_button_shortcode( $atts, $content = '' ) {
        // User is not logged in.
        if ( ! is_user_logged_in() ) {
            return '';
        }
     
        $atts = shortcode_atts( array(
            'user_id'   => '',
            'username'  => '',
            'label'     => 'Send Private Message',
        ), $atts );
     
        $user_id = absint( $atts['user_id'] );
        $user_login = $atts['username'];
     
        // if the username is given, override the user id.
        if ( $user_login ) {
            $user = get_user_by( 'login', $user_login );
            if ( ! $user ) {
                return '';
            }
            $user_id = $user->ID;
        }
     
        if ( ! $user_id ) {
            if ( ! in_the_loop() ) {
                return '';
            }
     
            $user_id = get_the_author_meta('ID' );
        }
        // do not show the PM button for the user, if it is aimed at them.
        if ( bp_loggedin_user_id() === $user_id ) {
            return '';
        }
     
        // if we are here, generate the button.
        $button = sprintf('<a href="%1$s">%2$s</a>', buddydev_get_send_private_message_to_user_url( $user_id ), $atts['label'] );
     
        return $button . $content;
    }
     
    add_shortcode( 'bp-pm-button', 'buddydev_private_message_button_shortcode' );
    #272458
    taskemann
    Participant

    Hi. I have buddypress + woocommerce + WC marketplace installed on my site running the flatsome theme. My site is a multi-vendor marketplace and I would really like to have a button or something on the single product’s page where logged in users easily can send a message to the product’s particular vendor through Buddypress’ PM system. Could someone please help me creating a shortcode that allows me to do this?

    I’ve tried to search the forum but to no help.

    Thanks.

    naomibuch
    Participant

    Hello,

    I am new to Buddypress and this is my first post, I am new to web development also, and my PhP coding is not all that great, my years as a software developer was strictly in a windows environment (vb.net and sql)

    I developed my own website and I am using Buddypress as part of my social media for users to connect with each other.

    I have spent endless hours researching a fix, and I have not been able to find anything php file that I can edit in File Manager to edit or remove the line of code.

    When a user updates an Activity, it updates in three places:

    1. The Activity Stream (which is what I want)
    2. The Member’s Profile where the Activity tab was (now removed, which is what I want)
    3. Under the Member’s profile cover, with that pesky “view link” (which I DO NOT want to show)

    And the “view link” is a bit buggy also, sometimes when a user clicks on it, it throws a 404 error, sometimes it opens up a blank page, and sometimes it opens up the recent activity that they posted in the Activity Stream.

    Also in the members directory I have a button to send the user a private message whether or not they are friends.

    When I click on a user name from the member’s directory, it take me to the compose a message like it is suppose to do, and the user name appears , but it does not save the user name in the send to box, do you have a fix for this also?

    Thank you very much, a fix to these problems are greatly appreciated.

    Naomi

    #268891
    Boone Gorges
    Keymaster

    @louisarthur – Thanks for sending me credentials. I’ve logged into your site to have a look.

    As you note in your email, there’s no href attribute on these links. It’s not clear to me how this would be the case, but I can give you a starting point for looking into it yourself. Briefly, the buttons will be built without an href if the button constructing function passes an empty link_href parameter to the BP_Button class. The functions used in the two cases are different:

    Message public: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-activity/bp-activity-template.php?marks=3090#L3079

    Message privé: https://buddypress.trac.wordpress.org/browser/tags/2.9.2/src/bp-messages/bp-messages-template.php?marks=1362#L1360

    The logic in each case is different, but since neither is showing up, I’m guessing that one of two things is happening:

    1. One of the conditional checks shared between them is failing for some reason: bp_is_my_profile(), is_user_logged_in().

    2. Something on your installation – perhaps your theme but probably a plugin (since you said Twenty Seventeen was exhibiting the problem as well) – is filtering both ‘bp_get_send_private_message_link’ and ‘bp_get_send_public_message_link’, and then incorrect returning empty strings.

    To test idea #2, you might try – if you can – searching through your codebase for those filter names.

    #268752
    louisarthur
    Participant

    Hi, currently running on latest wordpress and buddypress versions.
    My problem is that private message, public message and add friend buttons appear but are not clickable. I tried with Twenty Sixteen and the problem is still there.
    Any ideas ?
    Thanks a lot

    http://www.alumni-ferney.eu

    paksunny
    Participant

    Hi,

    I am trying to make the below two changes but tried all different solutions available on this form non worked.

    1) Make the friend tab only visible to the account owner / logged-in user.
    2) only friends can use and see the send private message button.

    Can someone guide me to getting this accomplished. Most of the privacy settings I was able to integrate through plugins.

    #268350

    In reply to: Help with this code

    livingflame
    Participant

    Okey, here is the correct code, thanks to @brajesh

    // Adding message button in members directory 
    
    function filter_message_button_link( $link ) {
    
        $link =  wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r='. bp_core_get_username( bp_get_member_user_id() ) );
    
    return $link;
    
    }
    
    function display_private_message_button() {
    
        if( is_user_logged_in() && bp_get_member_user_id() != bp_loggedin_user_id() ) {
    
            //bp_send_message_button();
            ?>
            <div id="send-private-message" class="generic-button">
    
                <div class="private-message-button generic-button" ><a href="<?php echo filter_message_button_link(); ?>" class="button small secondary radius" rel="add"><i class="icon-envelope"></i></a></div>
            </div>
    
            <?php
            add_filter('bp_get_send_private_message_link', 'filter_message_button_link', 1, 1 );
            }
    }
    add_action( 'bp_directory_members_item_last', 'display_private_message_button',9999 );
    
    
    #268216
    lofiz
    Participant

    I am trying to build a contact form that I can load on any page that would send a private message to a user. I already have the selected user/s in an array and now I would like to take that plus form data to (I’m guessing) message_new_message

    Sample HTML Form

    <form>
    <label>Subject</label>
    <input id="subjec_input" name="subject_input" type="text">
    <label>Message Body</label>
    <textarea id="body_input" name="body_input"></textarea>
    <button id="submit_btn" name="submit_btn">Submit</button>
    </form>

    How I think arguments are given to the function

    `messages_new_message( $args = array( ‘recipients’ => $user_id, ‘subject’ => $title, ‘content’ => $message );

    Any help would be appreciated. Thanks

    #268157

    In reply to: Help with this code

    livingflame
    Participant

    Help me with the code.
    I need the Message button visible only to logged in users (Just like the Add Friend button works).

    Check the code, please.

    // Adding message button in members loop
    
    function filter_message_button_link( $link ) {
    
        $link =  wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r='. bp_core_get_username( bp_get_member_user_id() ) );
    
    return $link;
    
    }
    
    function display_private_message_button() {
    
        if( bp_get_member_user_id() != bp_loggedin_user_id() ) {
    
            //bp_send_message_button();
            ?>
            <div id="send-private-message" class="generic-button">
    
                <div class="private-message-button generic-button" ><a href="<?php echo filter_message_button_link(); ?>" class="button small secondary radius" rel="add"><i class="icon-envelope"></i></a></div>
            </div>
    
            <?php
            add_filter('bp_get_send_private_message_link', 'filter_message_button_link', 1, 1 );
            }
    }
    add_action( 'bp_directory_members_item_last', 'display_private_message_button',9999 );
    
    


    @modemlooper


    @sbrajesh


    @mercime

    #267193
    livingflame
    Participant

    Hi

    @r-a-y


    @shanebp

    I have this code (example img. LINK),

    But, bp_loggedin_user_id() not work.
    The Button is visible for all. Like Add Friend Button [ + ] the Message button needs to be visible only for Logged in users.

    function filter_message_button_link( $link ) {
    
        $link =  wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r='. bp_core_get_username( bp_get_member_user_id() ) );
    
    return $link;
    
    }
    
    function display_private_message_button() {
    
        if( bp_get_member_user_id() != bp_loggedin_user_id() ) {
    
            //bp_send_message_button();
            ?>
            <div id="send-private-message" class="generic-button">
    
                <div class="private-message-button generic-button" ><a href="<?php echo filter_message_button_link(); ?>" class="button small secondary radius" rel="add"><i class="icon-envelope"></i></a></div>
            </div>
    
            <?php
            add_filter('bp_get_send_private_message_link', 'filter_message_button_link', 1, 1 );
            }
    }
    add_action( 'bp_directory_members_item_last', 'display_private_message_button',9999 );
    Shaktimaan
    Participant
    add_filter( 'bp_get_send_message_button', function( $array ) {
        if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) {
            return $array;
        } else {
            return '';
        }
    } );

    I am using the above filter to hide private message button to non friends. It works but it also hides private message button to site admins and bbpress moderators. I want site admins and bbpress moderatos (bbp_moderator) could send and receive private messages even if they are not friend.

    Any solution?

    eitayz
    Participant

    Hello,

    I’m trying to add a button so nonregistered users can contact register users from the profile page via private message.
    Saw this discussion here:
    https://buddypress.org/support/search/private+message+button/

    But nothing worked for me. My website is not in English, should it be a problem? It looks like it bp-custom.php is not recognized, tried inserting the codes to function.php as well. Nothing works…

    I’d be happy for some help here.
    Tnx

    greenhandjack
    Participant

    Hello,i want to add an “star with me” button next to the button”private message””public message””add friend”buttons in member’s profile.now the chat plugin provider has told the Api to star the chat box ,it is a The JS function:
    FlyzooApi.startChat(LocalUserId, SuccessCallback(), FailCallback()) .
    i searched a lot about it but it is too hard for me to solve this question,now i wish to get help.

    ketzita
    Participant

    While using the “Private Message” button, Buddypress is displaying my own name and profile photo (must be grabbing from members-loop, or something) at the top of the screen.

    I’d like to make a modification to change this, so that it will display the recipient’s name/photo instead. This way, my users will be looking at the person they are contacting, while entering their message, instead of looking at themselves. It will serve as a reminder of who they are writing to. (Some people forget things very quickly!)

    I’ve carefully reviewed the compose.php file, but am I even looking at the right file to make these changes?

    Whether it’s the right file or not, does anyone know exactly how I should go about making this change?

    If this sounds too complicated, then perhaps you can suggest how to add a line of text like this, right before the Subject field:

    This message is to: (Recipient’s Name)

    (That would be better than nothing!)

    #263766
    kibbles
    Participant

    first of all, i’m new to the plugin and wordpress and i am building a website with community features. feel free to tell me about some cool plugins that hook into buddypress to add functionality (i already know about bbpress).
    _____________________________________________________

    on the wordpress dashboard in settings, buddypress, components, there is an unchecked feature named “site tracking”. what is this exactly and what does it do?

    i am using the buddypress login widget. the only tabs it has are the user name and the logout button. is there a way to add more tabs to this like friends, private messages, forum topics (when bbpress is installed), etc?

    in the options menu i can enable/disable users uploading profile picture and cover picture. is there an option to limit whether they upload a photo to the site or use a url to post the photo? can i make it so that i can select stock images for user to choose their profile picture and cover picture from?

    i notice there is also support for additional community interaction like grouping and posting on group pages. is there a way for users to have their own personal mini blogs that can be viewed by other users?

    how would i go about customizing the design/layout of user profiles?

    any other advice for me?

Viewing 25 results - 51 through 75 (of 327 total)
Skip to toolbar