Search Results for 'notification user id'
-
AuthorSearch Results
-
April 22, 2013 at 8:04 pm #162380
David Cavins
KeymasterHi Modemlooper-
My theme is a child theme of Twenty Twelve, so my style.css declares Template: twentytwelve.
I followed your suggestion then took it a step farther and included slightly modified version of the js setup functions from the template pack in my `functions.php` file. I’ll post them here in case somebody else has the same problem I’m having:
`function bp_support_theme_setup() {
global $bp;// Load the default BuddyPress AJAX functions if it isn’t explicitly disabled or if it isn’t already included in a custom theme
if ( ! function_exists( ‘bp_dtheme_ajax_querystring’ ) )
require_once( BP_PLUGIN_DIR . ‘/bp-themes/bp-default/_inc/ajax.php’ );// Let’s tell BP that we support it!
add_theme_support( ‘buddypress’ );if ( ! is_admin() ) {
// 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’ ) ) {
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’, ‘bp_support_theme_setup’, 11 );/**
* Enqueues BuddyPress JS and related AJAX functions
*
* @since 1.2
*/
function bp_support_enqueue_scripts() {// 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_all’ => __( ‘Show all’, ‘buddypress’ ),
‘comments’ => __( ‘comments’, ‘buddypress’ ),
‘close’ => __( ‘Close’, ‘buddypress’ )
);// BP 1.5+
if ( version_compare( BP_VERSION, ‘1.3’, ‘>’ ) ) {
// Bump this when changes are made to bust cache
$version = ‘20120412’;$params[‘view’] = __( ‘View’, ‘buddypress’ );
$params[‘mark_as_fav’] = __( ‘Favorite’, ‘buddypress’ );
$params[‘remove_fav’] = __( ‘Remove Favorite’, ‘buddypress’ );
}
// BP 1.2.x
else {
$version = ‘20110729’;if ( bp_displayed_user_id() )
$params[‘mention_explain’] = sprintf( __( “%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.”, ‘buddypress’ ), ‘@’ . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) );
}// Enqueue the global JS – Ajax will not work without it
wp_enqueue_script( ‘dtheme-ajax-js’, BP_PLUGIN_URL . ‘/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );// Localize the JS strings
wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
}
add_action( ‘wp_enqueue_scripts’, ‘bp_support_enqueue_scripts’ );
`Which is identical to installing the template pack only for the JS, I think. Everything’s working as expected, so I think we can consider this problem resolved. Thanks for your attention, Hugo and Modemlooper.
-David
April 13, 2013 at 9:03 pm #161570In reply to: Create private membership site with BuddyPress
angslycke
Participant@modemlooper Revisiting this thread. I’m still looking to change the activation e-mail to go to the site admin instead, and even though this should be fairly easy I must be missing something. The code should be something like this, right?
`
function my_redirect_activation_email()
{
return get_site_option( ‘admin_email’ );
}
add_filter(‘bp_core_activation_signup_user_notification_to’, ‘my_redirect_activation_email’);
`Added this to my custom-functions.php but can’t seem to get it to work, WordPress stills sends the e-mail with the activation link to the new user instead. Any ideas? Thanks!
April 13, 2013 at 2:34 pm #161538In reply to: Users can't post in Forum
zaghareet
ParticipantSorry, I didn’t get an email notification that there was a reply.
Yes, I did that and it didn’t change anything. Any other ideas?
April 12, 2013 at 6:44 pm #161446In reply to: Forum Users Support
tocia_pivot
ParticipantI need some help this issue as it is still going on. And we are willing to hire someone to resolve this issue. We have installed SB but that sends two notifications. Then we deactivated but the notifications that is going out doesn’t provide a new user with a password. we’ve tried short coding it to no avail. We need some assistance from someone with the now how to fix this new subscriber notification issue we’re having. Someone with the now how, please email tocia@pivot-media.com – we are willing to pay for your service!
Thanks
April 12, 2013 at 1:26 pm #161416In reply to: [Resolved] User error mention
Marcio batista
ParticipantHello, same problem here.
How to fix?Error on line 95:
“Warning: sprintf() [function.sprintf]: Too few arguments in /home/ninstitu/public_html/trevinhodasorte.com.br/comunidade/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php on line 95”The action itself works, but why the error appears?
Why the error?
Remove the notification is not enough, everyone needs to do, much work. It is no longer so easy to fix?
See the full archive here: http://pastebin.com/R4P5DGbgThankful!
April 10, 2013 at 4:25 pm #161070In reply to: [Resolved] Add image to the adminbar/toolbar/
LePasi
Participant@Chouf1 Thanks, i know for sure how to change css of an element, but i have to create this element at first …
and the code i was looking for is :
` $wp_toolbar->add_node(array(
‘id’ => ‘bp-notifications’,
‘title’ => __(‘‘),
‘href’ => bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/notices/’,
/*’meta’ => array(‘class’ => ‘notifications’)*/
)); `
thanks to @bp-help , this is how to add a picture.Am i right, with the code above, there will be a div with the id bp-notification and a image will be place into it ? Is there a way to just create a div with a certain id and then control the image via background (css) ?
I added the code and right now my code in this section (bp-member-adminbar.php) is this:
Pastebin CodeTHE RESULT is … the toolbar disappeard. 🙁
March 24, 2013 at 8:33 pm #157638Hugo Ashmore
Participant@bphelp all the further requirements you want to add can be found in the various core files, I know no better than you at this stage and would have to be reading through those files to identify what functions, variables etc I had to work with to achieve what I wanted, I did something similar to this a while back for custom WP pages dragging user data out, the only way I managed that was by studying the core files.
Without wanting to sound harsh 🙂 it’s down to you to finish now, the bits like avatars shouldn’t be too hard to figure now you’ve got this far.
When it’s finished get it placed on the WP plugin repo.
March 23, 2013 at 4:52 pm #157557bp-help
Participant@hnla Okay I added this and it places the count under the title. Now all I need to do is:
1.) Add name of person sending friend request and messages beside the count as well as the greeting.
Example: You have 1 friend request from USER1, You have 2 messages from USER22.) Add avatar of person sending the friend request or message to to left in the drop-down notification.
If you or anyone else can help on that it will be great.
For anyone who would like to use this I packaged it as a plugin here:
https://github.com/bphelp/custom_toolbar
If you would like to help with the code I can add you as a contributor. Thanks everyone!March 23, 2013 at 1:26 pm #157544In reply to: How to turn off e-mails in 1.7 beta 2
Paul Wong-Gibbs
KeymasterAssuming the Settings component is active, users can turn off notifications inside their profiles.
March 23, 2013 at 12:56 pm #157540Hugo Ashmore
Participantnow having to write this a second time as bp decided I wasn’t logged in for some odd reason after I submitted so this is brief.
Watch your syntax, don’t wrap those functions in strings, ‘;’ line terminations in an array ought not to be there. You don’t need or want to echo out those functions at this point simply pass the function through so simply the ‘get’ function.
This is a working example of two:
<code>
$wp_toolbar->add_node(array(
‘parent’ => ‘user-friends’,
‘id’ => ‘friend-requests’,
‘title’ => ‘ Friend Requests ‘,
‘href’ => bp_loggedin_user_domain() . bp_get_friends_slug() . ‘/requests/’,
‘meta’ => array(‘html’ => ‘<span>’ . bp_friend_get_total_requests_count( bp_loggedin_user_id() ) . ‘</span>’ )
));</code>
<code>
$wp_toolbar->add_node(array(
‘parent’ => ‘user-messages’,
‘id’ => ‘messages’,
‘title’ => ‘ Messages ‘,
‘href’ => bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/view/’,
‘meta’ => array(‘html’ => ‘<span>’ . bp_get_total_unread_messages_count(bp_loggedin_user_id() . ‘</span>’ ) )
));</code>
This isn’t ideal but all I can see to work with in add_node() but there may be better approaches, and to get this working I mainly had to study the code page to see how the ‘meta’ was handled.March 17, 2013 at 10:20 pm #156639bp-help
Participant@chouf1 with your help and hnla’s I have this working but even with the above examples in how to get the counts in a drop down I am not certain how to do this. Where do I place:
echo bp_friend_get_total_requests_count( $user_id );
echo bp_get_total_unread_messages_count($name );
echo count($notifications);
In the code because it either fires off an error or it actually echo’s the code. What am I doing wrong? Thanks again for all your help! 🙂
`
function custom_toolbar($wp_toolbar) {
global $wp_admin_bar;if ( is_user_logged_in() ) {
$wp_toolbar->add_node(array(
‘id’ => ‘bp-notifications’,
‘title’ => __(‘‘),
‘href’ => bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/notices/’,
/*’meta’ => array(‘class’ => ‘notifications’)*/
));$wp_toolbar->add_node(array(
‘id’ => ‘user-friends’,
‘title’ => __(‘‘),
‘href’ => bp_loggedin_user_domain() . bp_get_friends_slug() . ‘/requests/’,
/*’meta’ => array(‘class’ => ‘menupop’)*/
) );$wp_toolbar->add_node(array(
‘id’ => ‘user-messages’,
‘title’ => __(‘‘),
‘href’ => bp_loggedin_user_domain() . bp_get_messages_slug() . ‘/view/’,
/*’meta’ => array(‘class’ => ‘menupop’)*/
) );
}
}
add_action(‘admin_bar_menu’, ‘custom_toolbar’, 999);
`March 17, 2013 at 6:07 am #156590In reply to: [Resolved] How to add images to a custom toolbar?
bp-help
ParticipantI made some changes now all the icons link to the pages but I need help to show the drop down menu for each individual notification. Here is what I have so far and I really am not certain of the id of each type of notification! Thanks in advance!
function custom_toolbar($wp_toolbar) { global $wp_admin_bar; if ( is_user_logged_in() ) { $wp_toolbar->add_node(array( 'id' => 'bp-notifications', 'title' => __('<img src="http://localhost/mydev/wp-content/plugins/custom-toolbar/_inc/images/notifications.png" /> '), 'href' => bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices/', /*'meta' => array('class' => 'notifications')*/ )); $wp_toolbar->add_node(array( 'id' => 'user-friends', 'title' => __('<img src="http://localhost/mydev/wp-content/plugins/custom-toolbar/_inc/images/friends.png" />'), 'href' => bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/', /*'meta' => array('class' => 'menupop')*/ ) ); $wp_toolbar->add_node(array( 'id' => 'user-messages', 'title' => __('<img src="http://localhost/mydev/wp-content/plugins/custom-toolbar/_inc/images/messages.png" />'), 'href' => bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/', /*'meta' => array('class' => 'menupop')*/ ) ); } } add_action('admin_bar_menu', 'custom_toolbar', 999);
March 16, 2013 at 6:01 pm #156560In reply to: [Resolved] How to add images to a custom toolbar?
bp-help
ParticipantOkay with this code I got all links to work. Thanks @chouf1 for helping. Now I just need the get the friend requests and messages to have a drop down to display when there is a message. If anyone has a better idea I am totally open to suggestions. I would like to get this working like facebooks if possible. Also I was wondering in the below code how can I get the images loaded dynamically from plugins /images folder I created? Thanks again!
function custom_toolbar($wp_toolbar) {
global $wp_admin_bar;if ( is_user_logged_in() ) {
$wp_toolbar->add_node(array(
'id' => 'bp-notifications',
'title' => __(''),
'meta' => array('class' => 'notifications')
));$wp_toolbar->add_node(array(
'id' => 'friends-requests',
'title' =>__(''),
'href' => bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/',
) );$wp_toolbar->add_node(array(
'id' => 'messages-inbox',
'title' => __(''),
'href' => bp_loggedin_user_domain() . bp_get_messages_slug() . '/view/',
) );
}
}
add_action('admin_bar_menu', 'custom_toolbar', 999);March 14, 2013 at 9:55 pm #156420danbpfr
Participanthere’re the 3 counter. Their names are explicit enough i guess to see the right place where to use 😉
echo bp_friend_get_total_requests_count( $user_id );
echo bp_get_total_unread_messages_count($name );
echo count($notifications);
March 2, 2013 at 9:31 am #154863Slava Abakumov
ModeratorUse a plugin Welcome Pack by Paul Gibbs and enable there emails editing. You will be able to edit all email that are sent to users.
February 28, 2013 at 5:14 pm #154713In reply to: naijaping.com – social network site
funmi omoba
Participant@naijaping, what a good job. Please can you share some of your code with us.
1 how to have a notification menu like urs friend request, message etc.
Or better still if you can give me ur child theme. I dont mind to pay some quid.
Awaiting ur reply.
Thanks2 how did you get auto loadmore working.
3 also online / offline user icon.
February 27, 2013 at 8:27 am #154600bp-help
Participant@medemlooper It just does not work, is there an error in the syntax, did you forget the add action below the function? Just curious because I can not get it to work. I wish there was an easier way to do this because It would be awesome. Please help I am stuck and I have done just about everything I know to do to get this going!
February 27, 2013 at 1:18 am #154585bp-help
Participant@modemlooper I used the code you supplied on gethub and I put it in my child themes functions.php between opening and closing php tags. Then I placed bp_notification_badge() within opening and closing php tags in the header.php just under the div id=”header” and nothing shows up at all. What have I done wrong?
February 26, 2013 at 11:47 pm #154577bp-help
Participant@modemlooper I am interested in using this too! Just for clarification would you place the function in the link you provided https://gist.github.com/modemlooper/5042788 in functions.php in my child theme then edit the header.php and then add as a li item in the menu or somewhere else in the header.php? Then style it in the style.css. Thank you!
February 25, 2013 at 10:36 pm #154085Andres Felipe
ParticipantHi, that is just what I (and think a lot of us) need. Nothing yet about the widget code?
P.S: In this moment I’m using BuddyBar widget (https://wordpress.org/extend/plugins/buddybar-widget/) plugin is not as good as @naijaping code but do its job. A god thing about this plugin is than give You a Log in form and after log in, it changes to something like @naijaping widget.
February 20, 2013 at 9:05 pm #153546In reply to: Send user notification when activity is deleted
David Hunt
ParticipantOkay, phew, it wasn’t as serious as I first thought. This now won’t send an email if the content is empty (which is, apparently, the case when a user is being deleted):
`function pa_send_notification_email( $args ) {
// If current user deletes his/her own activity, do nothing
if (($args[‘user_id’] != bp_loggedin_user_id())) {
$ud = get_userdata($args[‘user_id’]);
$to = $ud->user_email;
// Build the message
if (($to) && ($to != ”)) {
global $wpdb;
$content = $wpdb->get_var( $wpdb->prepare( “SELECT content FROM “.$wpdb->prefix.”bp_activity WHERE id = %d;”, $args[‘id’] ) );
if ($content != ”) {
$subject = ‘Your post has been removed’;
$message = ‘A moderator has removed your post. If you want to know why, please forward this message to the moderation team.
‘;
$message .= ‘Removed content:
‘;$message .= wpautop( $content );
$message .= ”;//Send email
wp_mail($to, $subject, $message, ‘content-type: text/html’ );
}
}
}
}
add_action( ‘bp_before_activity_delete’, ‘pa_send_notification_email’);`February 20, 2013 at 8:51 pm #153544In reply to: Send user notification when activity is deleted
David Hunt
ParticipantHmm, the situation is not as dire as I thought. I did more testing and it appears that, when I delete a user who as posted multiple times, my function only sends one notification email to the user — but the SQL query is empty (as we might expect). So I think all I need to do is put a check in to see whether the deleted “content” is empty or not, and if it is, don’t send the email.
I’ll keep updating this thread with my findings in case it’s useful to anyone!
February 20, 2013 at 8:27 pm #153540In reply to: Send user notification when activity is deleted
David Hunt
ParticipantRevisiting this thread with a new issue!
My function has been working well, except I’ve recently discovered a small flaw: if an administrator deletes a user, then the user receives an email informing him or her that his activity has been removed for each and every thing he or she has ever posted! For a prolific user, that could be hundreds or thousands of emails. Not good!
This is by virtue of the user-delete process — it appears as though BuddyPress deletes each activity individually, and then WordPress deletes the user account.
For reference, my function is:
`function pa_send_notification_email( $args ) {
// If current user deletes his/her own activity, do nothing
// otherwise construct and send email
if ($args[‘user_id’] != bp_loggedin_user_id()) {
$ud = get_userdata($args[‘user_id’]);
$to = $ud->user_email;
// Build the message
if (($to) && ($to != ”)) {
$subject = ‘Your post has been removed’;
$message = ‘A moderator has removed your post. If you want to know why, please forward this message to the moderation team.
‘;
$message .= ‘Removed content:
‘;
global $wpdb;
$message .= wpautop( $wpdb->get_var( $wpdb->prepare( “SELECT content FROM “.$wpdb->prefix.”bp_activity WHERE id = %d;”, $args[‘id’] ) ) );
$message .= ”;//Send email
wp_mail($to, $subject, $message, ‘content-type: text/html’ );
}
}
}
add_action( ‘bp_before_activity_delete’, ‘pa_send_notification_email’);`So what I think I need is an extra check in my function, to make sure we are not about to delete the user. I’ve thought about a secondary function to hook into the `delete_user` action to set a global variable, and then checking for this variable in my `pa_send_notification_email()` function.
But I am not sure how to go about this. Does anyone have any thoughts?
February 19, 2013 at 8:10 pm #153451In reply to: Testing BP 1.7b1 and having some issues
philipt18
ParticipantI’m using Buddypress Social from WPMU.
I switched to BP Default and:
– didn’t see the double avatar in the Activity list
– same problem with updating my profile
– same problem trying to create a GroupFor the first issue, of confirming a friend, it was a little more complicated. I used Safari which was logged into antoher user account to accept friendship. It worked normally. I then went to the Friends list, and cancelled the friendship. I’m not sure why the friend was still listed there, but I took advantage of that and clicked on the Add Friend button. It loaded a new page that said:
Are you sure you want to do this?
and then a link that said:
Please try again.
which links back to my Friends page, which this time was blank. In any case, the combination of ‘Are you sure…’ and ‘Please try again.’ seems out of place.
I then went to the Members page, and clicked Add Friend again. I then went to the Members page using my admin account (the account I requested friendship of) and it listed the members including the account I requested from – and next to that name it had a button labeled ‘Cancel Friend Request’ which seems backwards. However, I noticed two notifications in the top menu, one which said the user had accepted my friendship request, and another saying the user had requested my friendship. I selected the second one and was taken to the Requests page. I clicked Accept and it seemed to work normally.
Hope that’s all clear…
February 18, 2013 at 8:16 pm #153369In reply to: Activity Favorite Notification
Keith Kelly
ParticipantI did check out some of the “like” plugins, but most of them hadn’t been maintained or didn’t work properly. I was hoping to tailor a core feature to work in a similar, simple way. So far I think what I have done works great, but just need to incorporate notifications.
I still think that it wold be useful if a user was notified when someone favorited their activity.
-
AuthorSearch Results