Search Results for 'private message button'
-
AuthorSearch Results
-
March 5, 2015 at 8:40 am #235488
In reply to: Actifity feed, Note vs message
whoaloicParticipantThank you Henry for your answers.
Note is what I call “What’s new” message in Activity Stream.
That’s why you called public message or mentions?
It’s like a tweet finally ?For private messages, I notice that user could send a message to all users so I was wondering what’s the point of Friends connexion.
I was thinking that only users who are friends could send messages.Than you for the “favorite” button trac. It looks encouraging.
February 16, 2015 at 5:07 am #234546In reply to: Private messaging user blocking/ignoring?
majecdadParticipantHey,
@shanebp as I understand it, your plugin serves as sort of a ‘blacklist’ where you can block any user in a variety of ways. Have you considered making it the other way around? Whereby ALL other users were blocked from sending a Public or Private Message *unless* the User clicked on a button that added the other user to a ‘whitelist’?If the user B clicked on a ‘Message’ button, they would be precluded from sending a message to User A unless User B had already been whitelisted by the recipient/User A. Maybe with the attempt generating a prompt to User B to submit a whitelist approval request to User A.
Maybe something like this already exists?
Something for consideration. Thoughts?
Thanks.
February 4, 2015 at 9:56 am #233545In reply to: How to get user id of activity
ARCangelGIRLParticipantThank you for your answers! Looks like that I did not describe clear what is my problem, because what I tried from you suggestions it did not work.
There is the code that I’m using to generate “Give a point” button”
function one_star_points() { if ( ! function_exists( 'mycred' ) ) return; $current_id = get_current_user_id(); $profile_id = bp_displayed_user_id(); if ( $current_id == $profile_id ) return; echo '<div class="award-star-rating-img">'; echo do_shortcode( '[mycred_send to="' . $profile_id . '" amount="1" ref="tip" log="Tipping"]Give a point[/mycred_send]' ); echo '</div>'; } add_action( 'one_star_points_button', 'one_star_points' );
To give points in user profile I used
$profile_id = bp_displayed_user_id();
To give points in forum I used$profile_user_id = bbp_get_reply_author_id();
But i bumped into a problem when I want to give points to user in activity stream. I placed the button near every activity stream entry, so the user could give a point if the like what other user posted in activity stream. I used this code
$profile_video_id = bp_get_activity_user_id();
There is no error or warning, but it’s not working, not giving points.Also I would like to give a point if I like private message answer that other user send me. I used this
$profile_message_id = bp_get_the_thread_message_sender_id() ;
, but it says that “Missing the recipient for this shortcode.”.Looks like that in the last two cases (activity stream and messages) something is wrong with indicating user id.
Any recommendations on this? I have tried many functions, but still can’t grab user ID in those last two..January 7, 2015 at 7:41 pm #231597In reply to: deleting private messages
Henry WrightModeratorWhen in doubt, back up your database! You’ve probably heard that lots of times but in situations like this where the outcome is uncertain, it is definitely worth being prudent.
searched a bit and apparently, the word on the forum-street is: there is no way to delete PM except through the DB. is that still true?
Are you referring to an individual private message, or a whole thread? There should definitely be a way to delete an entire thread via the front-end. It will depend on your theme but by default, there should be a delete button available.
November 26, 2014 at 7:48 pm #229735In reply to: Send Private Message in HTML
elpixParticipantI’ve found by myself 🙂
To send HTML private message, you must add :
[
edited – Please use the ‘code’ button when you post code.
Please note that removing that filter creates a major security risk.
It means user input WILL NOT BE SANITIZED.
So some very bad things can happen to your database.
]
remove_filter( 'messages_message_content_before_save', 'wp_filter_kses', 1);
To the bp-custom.php file.
I hope it will helps !
August 13, 2014 at 12:09 pm #186525In reply to: Change "private message link"
b2marketingParticipantThanks Henry. Will download the plugin and see if it works with some other customisations I got. It might not so that is why I am looking at doing this filter thing similar to this code I am trying to get to work.
function override_button() {
return apply_filters( ‘bp_get_send_private_message_link’, wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/compose/test/?r=’ . bp_core_get_username( bp_displayed_user_id() ) ) );}
add_filter(‘bp_get_send_private_message_link’,’override_button’);May 8, 2014 at 12:39 am #182636In reply to: Filtering bp_get_send_message_button()?
modemlooperModeratorchange whatever you want in the arguments
function filter_send_message_btn() { $args = array( 'id' => 'private_message', 'component' => 'messages', 'must_be_logged_in' => true, 'block_self' => true, 'wrapper_id' => 'send-private-message', 'link_href' => bp_get_send_private_message_link(), 'link_title' => __( 'Send a private message to this user.', 'buddypress' ), 'link_text' => __( 'Private Message', 'buddypress' ), 'link_class' => 'send-message', ); return $args; } add_filter('bp_get_send_message_button_args', 'filter_send_message_btn');
March 15, 2014 at 4:57 am #179827In reply to: Help! button "post update" is not present
PatrykParticipantI have the same thing to me and not display private message button, etc
March 5, 2014 at 8:40 pm #179350DoremdouParticipantI tried to create a shortcode to show the join/leave button using the buddypress-functions but can’t make it to work… 🙁
What am I doing wrong?I would like a shortcode like this :
[groupbutton name=”party1″]
I tried with this code for a join button only at first:
add_shortcode( 'groupbutton', 'groupbutton_check_shortcode' ); function groupbutton_check_shortcode( $attr ) { extract( shortcode_atts( array( 'name' => 'read' ), $attr ) ); $current_group_id = BP_Groups_Group::get_id_from_slug($name); $group = groups_get_group( array( 'group_id' => $current_group_id ) ); if(bp_loggedin_user_id()) { if( 'public' == $group->status ) { echo '<a id="group-' . esc_attr( $current_group_id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; } } }
I am not a developer at all so I dont understand everything but I am trying… :/
Cant figure what I am doing wrong… and why it does not display anything at all.Thank you for your help and sorry for my bad english 🙂
PS: I would like to use all cases of buttons like here on the buddypress-functions.php:
function bp_legacy_theme_ajax_joinleave_group() { // Bail if not a POST action if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; // Cast gid as integer $group_id = (int) $_POST['gid']; if ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) ) return; if ( ! $group = groups_get_group( array( 'group_id' => $group_id ) ) ) return; if ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { if ( 'public' == $group->status ) { check_ajax_referer( 'groups_join_group' ); if ( ! groups_join_group( $group->id ) ) { _e( 'Error joining group', 'buddypress' ); } else { echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; } } elseif ( 'private' == $group->status ) { // If the user has already been invited, then this is // an Accept Invitation button if ( groups_check_user_has_invite( bp_loggedin_user_id(), $group->id ) ) { check_ajax_referer( 'groups_accept_invite' ); if ( ! groups_accept_invite( bp_loggedin_user_id(), $group->id ) ) { _e( 'Error requesting membership', 'buddypress' ); } else { echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; } // Otherwise, it's a Request Membership button } else { check_ajax_referer( 'groups_request_membership' ); if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) { _e( 'Error requesting membership', 'buddypress' ); } else { echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>'; } } } } else { check_ajax_referer( 'groups_leave_group' ); if ( ! groups_leave_group( $group->id ) ) { _e( 'Error leaving group', 'buddypress' ); } elseif ( 'public' == $group->status ) { echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; } elseif ( 'private' == $group->status ) { echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>'; } } exit; } /** * Close and keep closed site wide notices from an admin in the sidebar, via a POST request. * * @return mixed String on error, void on success * @since BuddyPress (1.2) */ function bp_legacy_theme_ajax_close_notice() { // Bail if not a POST action if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; if ( ! isset( $_POST['notice_id'] ) ) { echo "-1<div id='message' class='error'><p>" . __( 'There was a problem closing the notice.', 'buddypress' ) . '</p></div>'; } else { $user_id = get_current_user_id(); $notice_ids = bp_get_user_meta( $user_id, 'closed_notices', true ); $notice_ids[] = (int) $_POST['notice_id']; bp_update_user_meta( $user_id, 'closed_notices', $notice_ids ); } exit; }
November 10, 2013 at 6:37 pm #174037In reply to: No all-in-one event calendar plug-in for Buddypress?
Marc K.ParticipantHi Seth!
Interesting, I didn’t know that you had a BP integration in place for EE. With which BP version was it compatible?
I know that the BP core developers have their hands full of work, so I won’t blame them for not taking on a complete events module in the core.
For me the question now is, which plugin takes the least effort to extend on our own. And yes, I know about your crowdfunding like offer to fund extensions to EE. But I need to meet certain deadlines and I don’t think you can guarentee a certain development until then.
BTW, isn’t the “I’ll attend’ and ‘Maybe’ a pretty simple code addition? A user presses a button which captures that users user id and writes it into a custom field of the event page. The plugin then fetches those ids and shows avatars of those people who attend.
I found an interesting tutorial (http://wp.smashingmagazine.com/2012/01/27/limiting-visibility-posts-username/) which might lead the way for my other request, specific event visibility/privacy:
1. Only friends of events creator (again, write all the user ids of the event creator into a custom field thats not visible/accessible to users and then restrict visibility of event page to those users)
2. Only invited (would require more work. First have a way to notify other users of the event by private message or BP notification. Write the user ids of those into yet another custom field, rest see above)
I am pretty much a PHP noob. But are these things really so hard to do? More than a week of work for an experienced BP developer?
November 5, 2013 at 5:16 pm #173863In reply to: Private Message button only appears sometimes
Anonymous User 13302461InactiveOK I’ll try the workarounds.
Thanks a lot for the feedback.
November 5, 2013 at 4:57 pm #173861In reply to: Private Message button only appears sometimes
Paul Wong-GibbsKeymasterHi @welshdemo
The theme’s fine. The problem is actually caused by a bug in our widgets (you’re using the Members list and the “Who’s online?” widgets). We’re tracking the bug here https://buddypress.trac.wordpress.org/ticket/5170 and currently aiming to fix it by the 2.0 release, which is probably 4 months away. If we get a fix before then, we’ll put it into a 1.9.x small release.
A workaround is to make sure that no BuddyPress widgets are rendered before the main content of the page. i.e. try moving the widgets to the right-hand column, or a widget area at the bottom of the page, or just removing the widgets.
November 5, 2013 at 4:52 pm #173859In reply to: Private Message button only appears sometimes
Paul Wong-GibbsKeymasterThis was cross-posted to https://wordpress.org/support/topic/private-message-and-button-doesnt-always-appear-empty
October 30, 2013 at 9:11 am #173600In reply to: Private Message button only appears sometimes
Anonymous User 13302461InactiveAhh yes. seems to appear every time with default template. I will go to the theme support forum and ask there. Thanks.
October 29, 2013 at 7:32 pm #173573In reply to: Private Message button only appears sometimes
shanebpModeratorSwitch to the BP default theme or a WP theme like Twenty Thirteen.
Does the problem still exist?
If not, then the problem is in your custom theme.October 29, 2013 at 6:26 pm #173567In reply to: Private Message button only appears sometimes
Amid DadgarParticipantthere should be 3 buttons (Add Friend,Public Message,private message) but as you said It just appears sometimes and I have a same problem 🙁
October 8, 2013 at 12:17 pm #172471In reply to: Private message users
chur74ParticipantThank you very much for the reply, and I understand.
On the other hand I have seen that also can send public messages, but I can not display the button to send them, just see the private message when I activate the option.
thank you.
September 30, 2013 at 9:14 pm #172062In reply to: Duplicate Avatars in Activity Stream
Uncle JimmyParticipant@Shanebp and @mercime [RESOLVED]
The following file was responsible. Comments marked !!!IMPORTANT!!! are where I made changes.
wp-content/plugins/gantry-buddypress/bpt-functions.php
<?php /** * @version 1.3 November 8, 2012 * @author RocketTheme, LLC http://www.rockettheme.com * @copyright Copyright © 2007 - 2012 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ // Sets up WordPress theme for BuddyPress support. function gantry_bp_tpack_theme_setup() { global $bp, $gantry_bp_path; // Load the default BuddyPress AJAX functions if it isn't explicitly disabled require_once( $gantry_bp_path . '/_inc/ajax.php' ); if ( !is_admin() ) { ///!!!IMPORTANT!!!/// COMMENTED OUT BY UNCLEJIMMY [[FIXED MEMBER HEADER DUPLICATE BUTTONS Friends/Public Message/Private Message]] ///!!!IMPORTANT!!!/// ///!!!IMPORTANT!!!/// [[ALSO REDUCED QUADRUPAL MESSAGES/COMMENTS/REPLIES TO DUPLICATES]] ///!!!IMPORTANT!!!/// // Register buttons for the relevant component templates // Friends button //if ( bp_is_active( 'friends' ) ) //add_action( 'bp_member_header_actions', 'bp_add_friend_button' ); // Activity button //if ( bp_is_active( 'activity' ) ) //add_action( 'bp_member_header_actions', 'bp_send_public_message_button' ); // Messages button //if ( bp_is_active( 'messages' ) ) //add_action( 'bp_member_header_actions', 'bp_send_private_message_button' ); // Group buttons if ( bp_is_active( 'groups' ) ) { ///!!!IMPORTANT!!!/// COMMENTED OUT BY UNCLEJIMMY [[FIXED DUPLICATE GROUP BUTTON Join/Leave ]] ///!!!IMPORTANT!!!/// //add_action( 'bp_group_header_actions', 'bp_group_join_button' ); add_action( 'bp_group_header_actions', 'bp_group_new_topic_button' ); add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); } // Blog button if ( bp_is_active( 'blogs' ) ) add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); } } add_action( 'after_setup_theme', 'gantry_bp_tpack_theme_setup', 11 ); // Enqueues BuddyPress JS and related AJAX functions function gantry_bp_enqueue_scripts() { // Enqueue the global JS - Ajax will not work without it wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ), bp_get_version() ); // Add words that we need to use in JS to the end of the page so they can be translated and still used. $params = array( 'my_favs' => __( 'My Favorites', 'buddypress' ), 'accepted' => __( 'Accepted', 'buddypress' ), 'rejected' => __( 'Rejected', 'buddypress' ), 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), 'show_x_comments' => __( 'Show all %d comments', 'buddypress' ), 'show_all' => __( 'Show all', 'buddypress' ), 'comments' => __( 'comments', 'buddypress' ), 'close' => __( 'Close', 'buddypress' ), 'view' => __( 'View', 'buddypress' ), 'mark_as_fav' => __( 'Favorite', 'buddypress' ), 'remove_fav' => __( 'Remove Favorite', 'buddypress' ), 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ), ); wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params ); // Maybe enqueue comment reply JS if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action('wp_enqueue_scripts', 'gantry_bp_enqueue_scripts'); // Enqueues BuddyPress basic styles function gantry_bp_enqueue_styles() { global $gantry_bp_url; // Do not enqueue CSS if it's disabled if (get_option( 'gantry_bp_disable_css' )) return; // BP 1.5+ if ( version_compare( BP_VERSION, '1.3', '>' ) ) { $stylesheet = 'bp.css'; // Bump this when changes are made to bust cache $version = '20110918'; } // Add the wireframe BP page styles wp_enqueue_style( 'bp', $gantry_bp_url . '/' . $stylesheet, array(), $version ); // Enqueue RTL styles for BP 1.5+ if ( version_compare( BP_VERSION, '1.3', '>' ) && is_rtl() ) wp_enqueue_style( 'bp-rtl', $gantry_bp_url . '/' . 'bp-rtl.css', array( 'bp' ), $version ); } add_action('wp_enqueue_scripts', 'gantry_bp_enqueue_styles'); // Gantry BuddyPress plugin doesn't use bp-default's built-in sidebar login block, // so during no access requests, we need to redirect them to wp-login for // authentication. if (!function_exists('gantry_bp_use_wplogin')) { function gantry_bp_use_wplogin() { // returning 2 will automatically use wp-login return 2; } add_filter('bp_no_access_mode', 'gantry_bp_use_wplogin' ); } // Hooks into the 'bp_get_activity_action_pre_meta' action to add secondary activity avatar support function gantry_bp_activity_secondary_avatars( $action, $activity ) { // sanity check - some older versions of BP do not utilize secondary activity avatars if ( function_exists( 'bp_get_activity_secondary_avatar' ) ) : switch ( $activity->component ) { case 'groups' : case 'friends' : // Only insert avatar if one exists if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) { $reverse_content = strrev( $action ); $position = strpos( $reverse_content, 'a<' ); $action = substr_replace( $action, $secondary_avatar, -$position - 2, 0 ); } break; } endif; return $action; } ///!!!IMPORTANT!!!/// COMMENTED OUT BY UNCLEJIMMY [[FIXED DUPLICATE AVTIVITY STREAM AVATARS]] ///!!!IMPORTANT!!!/// ///!!!IMPORTANT!!!/// [[ALSO FIXED DUPLICATE MESSAGES/COMMENTS/REPLIES]] ///!!!IMPORTANT!!!/// //add_filter('bp_get_activity_action_pre_meta', 'gantry_bp_activity_secondary_avatars', 10, 2);
Thank you for your time and attention, please let me know if I could’ve done this better.
God Bless
September 22, 2013 at 10:38 pm #171677In reply to: Two installations have failed
Eric J TParticipantSorry I didn’t include the code for that. Yes, it is in the wp functions.php file, but it is relevant to bp theme. Here is the full function that line 100 is found in. Line 100 is the third to last, which starts with “add action”.
/** * Sets up theme defaults and registers support for various WordPress and BuddyPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override bp_dtheme_setup() in a child theme, add your own bp_dtheme_setup to your child theme's * functions.php file. * * @global BuddyPress $bp The one true BuddyPress instance * @since BuddyPress (1.5) */ function bp_dtheme_setup() { // Load the AJAX functions for the theme require( get_template_directory() . '/_inc/ajax.php' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme comes with all the BuddyPress goodies add_theme_support( 'buddypress' ); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // Register buttons for the relevant component templates // Friends button if ( bp_is_active( 'friends' ) ) add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 ); // Activity button if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 ); // Messages button if ( bp_is_active( 'messages' ) ) add_action( 'bp_member_header_actions', 'bp_send_private_message_button', 20 ); // Group buttons if ( bp_is_active( 'groups' ) ) { add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); } // Blog button if ( bp_is_active( 'blogs' ) ) add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); } } add_action( 'after_setup_theme', 'bp_dtheme_setup' ); endif; if ( !function_exists( 'bp_dtheme_enqueue_scripts' ) ) :
In the first install the failed bp had been installed and working for a few days. It suddenly gave errors when I edited a css color code on line 1211 in this file and uploaded it to the server by ftp. Yeah, I know you might say I made a mistake, but I know I did it correctly. And they you might say the file got corrupted in transfer, except that the second install on godaddy had no such changes or transfers and in short order – less than an hour of use with no other plugins or style changes – gave the same final error for line 100 when I changed my public name in the buddypress members listing, at which point neither the front nor back ends were accessible.
Looking forward to your insights.
August 25, 2013 at 8:51 pm #170404In reply to: Private Message Button Label Change
funmi omobaParticipantthanks for your reply I thought as much but I think it get wiped during the plugin update.
Thanks for your input anyways.
Best Regards
August 25, 2013 at 8:41 pm #170403In reply to: Private Message Button Label Change
shanebpModeratorOpen the plugin file, find the text, replace the text
August 25, 2013 at 7:48 pm #170400In reply to: Private Message Button Label Change
funmi omobaParticipantThanks for your snippet which works great with standard buddypress message system but did not work if using BP Profile Message UX plugin, is there anyway to make it work please
https://wordpress.org/plugins/bp-profile-message-ux/
tahnks
August 25, 2013 at 5:00 pm #170392In reply to: Private Message Button Label Change
HenryMember@shanebp good point about using the bp_send_private_message_link approach. Although you would avoid double buttons by using a translation file.
August 25, 2013 at 4:44 pm #170389In reply to: Private Message Button Label Change
shanebpModerator@henrywright-1
And how would you avoid double buttons due to this call in member-header.php?
do_action( ‘bp_member_header_actions’ );
@tayenewm
Use the provided apply_filters:function tweak_button_label ( $args ) { $args[link_text] = 'Something'; return $args; } add_filter( 'bp_get_send_message_button_args', 'tweak_button_label', 1, 1 );
August 25, 2013 at 4:28 pm #170387In reply to: Private Message Button Label Change
HenryMemberactually you could make use of the
bp_send_private_message_link
function and do it like this:<a href="<?php bp_send_private_message_link() ?>" title="Private Message">Private Message</a>
You can change the “Private Message” text to whatever you like. You’d just paste the code into your theme where ever you’d like the button to appear
-
AuthorSearch Results