Search Results for 'notification user id'
-
AuthorSearch Results
-
March 6, 2014 at 1:35 pm #179369
In reply to: Notification count in dynamic menu
danbp
ParticipantHi @transmission,
this is not the solution, but an example for your inspiration.
The below shows how the notification counter can be moved/implemented on the toolbar./* moving the notification counter from right to left */ remove_action( 'admin_bar_menu', 'bp_members_admin_bar_notifications_menu', 90 ); function bpfr_notification_ontheleft() { global $wp_admin_bar; if ( !is_user_logged_in() ) return false; $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' ); $count = !empty( $notifications ) ? count( $notifications ) : 0; $alert_class = (int) $count > 0 ? 'pending-count alert' : 'count no-alert'; $menu_title = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . $count . '</span>'; // Add the top-level Notifications button $wp_admin_bar->add_menu( array( /*'parent' => 'top-secondary',*/ // this is the original position 'id' => 'bp-notifications', 'title' => $menu_title, 'href' => bp_loggedin_user_domain(), ) ); if ( !empty( $notifications ) ) { foreach ( (array) $notifications as $notification ) { $wp_admin_bar->add_menu( array( 'parent' => 'bp-notifications', 'id' => 'notification-' . $notification->id, 'title' => $notification->content, 'href' => $notification->href ) ); } } else { $wp_admin_bar->add_menu( array( 'parent' => 'bp-notifications', 'id' => 'no-notifications', 'title' => __( 'No new notifications', 'buddypress' ), 'href' => bp_loggedin_user_domain() ) ); } return; } add_action( 'admin_bar_menu', 'bpfr_notification_ontheleft',30); /* other position # are 10, 20, 40, 50, 60, 70, 80, 90 */In your case, you also have to check this Codex page. And possibly do some research here.
March 5, 2014 at 5:52 pm #179339In reply to: Theme + Amount of Plugins = Broken Menus
BlinkyBill01
ParticipantOk, set up a throw-away account.
URL: http://slamfans.com/wp/members/demouser01/
Login: demouser01
Pass: demo123On that demouser01 profile page, you should see where the Achievements link is forced to a second line but it’s still following the CSS positioning. If you visit another member page, you don’t see that error. I’m assuming that’s because you don’t see the Notifications link on other members profiles.
I’m trying to remember how I did it on another Buddypress site where I was able to force all of the plugin links, like Achievements, into a second line so that the first line remains with all of the default links. I did that about 2-3 years ago and that since has since floated away into the aether. So dunno if it’s even possible anymore with recent changes to Buddypress.
Hope there’s a solution to be had. (But thinking about it, it would be awesome if there was a plugin that could me made for custom WP themes that would allow you to position links in the order and places you’d like.)
Thanks!
February 14, 2014 at 9:47 am #178384Henry Wright
ModeratorHi @oken
In BP 1.9 + you can now do
echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );January 20, 2014 at 12:17 am #177242In reply to: Show notification bubble somewhere else
Henry Wright
Moderator@xwafflecakes since BP 1.9, you should have dedicated notifications pages at
members/username/notifications/andmembers/username/notifications/read/Do these help?
Regarding the notifications ‘bubble’ in the admin bar – you can output the number of notifications a user has like this
echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );January 17, 2014 at 2:21 pm #177085aboudard
ParticipantOk, sorry, I didn’t read the whole topic !
Here is the solution for those who still have this double display on their notification TAB :
– Check that you do have Buddypress 1.9.1
– Seek in your child theme the file : /members/single/home.php
– Copy this code in it (say line 70 or close, you will see the same kind of code) :elseif ( bp_is_user_notifications() ) : locate_template( array( 'members/single/notifications.php' ), true );It does work, whatever your /settings/notification.php is customized.
Enjoy.Alain
January 10, 2014 at 8:46 pm #176732brinkingyellows
ParticipantHi @r-a-y. Here are the plugins I am currently using on the site.
Network Activated:
Advanced Responsive Video Embedder
Anti-Splog
Are You a Human
bbPress
bbPress – Report Content
bbPress Enable TinyMCE Visual Tab
bbpress Simple View Counts
BP Profile Search
BuddyPress Activity Plus – (I did deactivate this after the 1.9.1 update but nothing changed)
BuddyPress Avatar Bubble
BuddyPress Follow
BuddyPress Group Calendar
BuddyPress Groups Extras
Buddypress Social
BuddyPress Toolbar
BuddyPress Twitter
Buddypress Xprofile Custom Fields Type
GD bbPress Toolbox
Group Forum Crumbs
rtMedia for WordPress, BuddyPress and bbPress
User Activity
WP User Avatar—-
Single Site Actived
Amazon Product In a Post Plugin
BuddyMenu
BuddyPress Notifications Widget
Really simple Facebook Twitter share buttonsThat’s about all the plugins that I have active that play a heavy part in Buddypress or are loosely connected to it.
January 4, 2014 at 7:53 pm #176416In reply to: 'Notifications' Tab appeared in profile?
brucedongcai@gmail.com
ParticipantTeam, please help! where should I add the following code in home.php file? what do you mean about the end of loop? Thank you!
elseif ( bp_is_user_notifications() ) :
bp_get_template_part( ‘members/single/notifications’ );here is home.php
———–
<div id=”item-body”><?php do_action( ‘bp_before_member_body’ );
if ( bp_is_user_activity() || !bp_current_component() ) :
locate_template( array( ‘members/single/activity.php’ ), true );elseif ( bp_is_user_blogs() ) :
locate_template( array( ‘members/single/blogs.php’ ), true );elseif ( bp_is_user_friends() ) :
locate_template( array( ‘members/single/friends.php’ ), true );elseif ( bp_is_user_groups() ) :
locate_template( array( ‘members/single/groups.php’ ), true );elseif ( bp_is_user_messages() ) :
locate_template( array( ‘members/single/messages.php’ ), true );elseif ( bp_is_user_profile() ) :
locate_template( array( ‘members/single/profile.php’ ), true );elseif ( bp_is_user_forums() ) :
locate_template( array( ‘members/single/forums.php’ ), true );elseif ( bp_is_user_settings() ) :
locate_template( array( ‘members/single/settings.php’ ), true );// If nothing sticks, load a generic template
else :
locate_template( array( ‘members/single/plugins.php’ ), true );endif;
do_action( ‘bp_after_member_body’ ); ?>
</div><!– #item-body –>
December 23, 2013 at 10:59 am #175974Henry
MemberLooks solid to me. If you wanted to condense the code into two lines you could use the logical operator
&&e.g.
if ( bp_has_notifications( 'user_id=' . bp_loggedin_user_id() ) && is_user_logged_in() ) { // ... here I've got the loop stuff ... }You could also append this bit which will let you output something to logged in users having no notifications:
else { // ... no notifications ... }December 20, 2013 at 9:11 am #175836airsid
ParticipantThanks @mercime for your quick answer.
But i’m a french novice and i’m not understanding very well what to do in the https://buddypress.trac.wordpress.org/ticket/5299 topic.Should I install thos patches:
5299.01.patch and 5299.02.patchor should I follow indications in lastest johnjamesjacoby’s comment:
In 7689:
Notifications:
Add templates and parts for bp-default theme. Also modify home.php to include notifications.php.or should I do the both ?
Sorry for asking but no access to notfications is important for my users 😉
Alos do you have an idea when the next update will be released ?
Thanks.December 16, 2013 at 12:26 pm #175570In reply to: function that breaks the BP AJAX
Henry
Member@_dorsvenabili when adding custom functions to functions.php it might be a good idea to add a prefix to all of your function names. As you can see buddyboss has done it with
buddyboss_childtheme_.You could have used
dorsvenabili_core_get_notifications_for_userormy_core_get_notifications_for_userSaves conflicts from happening 🙂
December 9, 2013 at 11:48 pm #175341In reply to: [Resolved] Notifications Include
modemlooper
ModeratorYou would need to add some sort of css to style the output
<?php if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ) ) { if ( $notifications ) { echo '<div id="notifications-header"><ul>'; for ( $i = 0; $i < count($notifications); $i++ ) { $badge = count($notifications); echo '<li>'.$notifications[$i].'</li>'; } echo '</ul></div>'; echo '<span id="notifications-badge">'.$badge.'</span>'; } } ?>November 28, 2013 at 12:58 pm #174932In reply to: bp live notification plugin
Andrea Fercia
Participanthi @jigesh
yes you’re right also @nacin says in his post “You should insteadthequery directly, as there are no inputs”.
So as long as you don’t have user inputs to sanitize, you’re safe.Btw the latest version 1.0.4 of the plugin already solved this, keeping prepare and correctly passing at least 1 argument on both cases (there are 2 query with $wpdb->prepare).
Note the plugin still passes $list_ids directly in the first case and “1” in the second case so that it’s just a workaround to avoid the PHP warning.
If you want to keep $wpdb->prepare just to be super-safe, and pass all parameters to prepare, it’s doable with something like this:remove brackets from:
$list_ids="(".join(",", $notification_ids).")";and change it in
$list_ids = join( ",", $notification_ids);so the first query become:
$wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id in (%s) AND is_new = %d", $list_ids, 1) );and change the second query:
$wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND is_new = %d", $user_id, 1 ) );regards
AndreaNovember 24, 2013 at 12:30 am #174704In reply to: Buddypress on Mobile / Hide admin access
mattg123
Participant@pjbursnall yeah that code replicates the notification element only (the only part that is somewhat confusing to replicate) you place the code in the plugins directory in bp-custom.php you may have to create the file yourself.
http://stackoverflow.com/questions/9953482/how-to-make-a-pure-css-based-dropdown-menu – shows you how to create a drop down menu, https://codex.wordpress.org/Function_Reference/get_currentuserinfo get the current users info so you can create links to their profile pages, etc.
Just a note, to add the notifcations to your custom bar your code will look something like
<li><?php bp_notification_badge(); ?></li>November 24, 2013 at 12:09 am #174702In reply to: Buddypress on Mobile / Hide admin access
mattg123
Participant@pjbursnall Personally I think buddypress should disable admin access anyway as most users don’t want it but that is neither here nor there. Recreating the admin bar is pretty easy, you need to know some css, html and a few bp functions to get the current users details like username etc, as for the notifications @modemlooper or @mercime posted this a while back (my apologies for not remembering which).
function bp_notification_badge() { if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id() ); if ( empty($notifications)) { echo '<li class="li-first" id="li-first-right"><a href="' . get_home_url() . '/members/' . $current_user->user_login . '"><span class="circle-zero">0</span></a><ul class="second-level" id="second-level-right"><li class="li-second"><a href="' . get_home_url() . '/members/' . $current_user->user_login . '">No new notifications!</a></li></ul></li>'; } else { echo '<ul class="second-level" id="second-level-right">'; $counter = 0; for ( $i = 0; $i < count($notifications); $i++ ) { $badge = count($notifications); echo '<li class="li-third">'.$notifications[$i].'</li>'; } echo '</ul>'; echo '<a href="' . get_home_url() . '/members/' . $current_user->user_login . '"><span class="circle-badge">'.$badge.'</span></a>'; } } }As for actually disabling the admin bar + backend that can be done with a plugin, plenty of them just google.
November 15, 2013 at 10:18 am #174261In reply to: Notification to user after saving profile changes
applegateian
ParticipantThanks @henrywright-1
It doesn’t seem to make any difference. As I said, my change-avatar page does show a notification, but I just checked change-avatar.php and that doesn’t have
<?php do_action( 'template_notices' ); ?>in it either, so I’m not sure how it’s working.Any ideas?
November 13, 2013 at 4:01 am #174165In reply to: Remove User Activations
olumi_day
ParticipantThank you for the prompt response. In my haste, I ended up using this plugin: ( http://www.timersys.com/plugins-wordpress/bp-disable-activation-reloaded ) although it wasn’t the ideal choice since I’m already using a lot of plugins.
I will definitely try this code out although the “Check Your Email to Activate Your Account” notification could still pose a problem. It just sounds like the kind of thing that wouldn’t bother me at first but then I would quickly become nitpicky about. Either way, I’m happy to just have a nice, easy way to override the activation email without the use of a plugin.
I do wonder if the users that had already registered prior to me using this override will be able to now log in just fine without still needing the activation email. I did a few test runs using the plugin I mentioned above and found that users who registered prior still needed the activation code to log in.
Finally, the help tour is a custom plugin built on top of twitter’s bootstrap 3 framework. I found the code for it here: http://bootstraptour.com/
It was very easy to install and only worked because the theme I’m currently using is built on the bootstrap framework.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?
October 8, 2013 at 4:43 am #172457protechs2
ParticipantI activated Twenty Thirteen theme and all appears to work ok EXCEPT after you perform different tasks within members, then at any type Click “All Members” it says “Sorry none found…” One time it displayed correctly with the 2 people that were actual members of the system — me and my 1 friend. That’s the last time I saw that display, except when you choose to sort by Last Active (the 2 appeared as active members). When I click “All Memebers” from here, it returns the 2 people in the member system (not users of the blog).
When I then clicked on Alphabetical display, it again pulled Most (not all) Users of the blog again with “Add Friend” buttons.
From there cilcking on the top menu tab “Members” returns the same thing again – the list of Most (not all) blog users with buttons.
Now, clicking on All Members” returns the same thing again – the list of Most (not all) blog users with buttons.Now to My Friends, and the one friend I chose and accepted shows. Notification (a number) showed up next to my Display Name in the Dashboard – as did the message when it arrived. It emailed these notices as well. All Cool!
If this is all normal behavior, then it’s all the problem of an OLD THEME.
Thank you for looking this over. Knowing what reality should be is as important as what is happening in real time.
🙂
October 2, 2013 at 1:58 pm #172199In reply to: Private Group Request Notification
Zane
ParticipantThanks! There it is 🙂
So there appears to be an issue with my user receiving emails from the site. I triple checked my profile email address with no luck. No messages to my spam folder or anything. Any idea’s what might cause all notifications for my admin user to be disabled?
September 19, 2013 at 9:50 am #171536In reply to: Buddypress Like – Notification Hack
minto
ParticipantThanks for pasting, @carco
Strangewise the issue remains, even with your entire script.
Still no entries for user_id in db
(which then might cause, that no notifs appear, probably?)
but “users-who-like” works again^^September 18, 2013 at 9:14 am #171478In reply to: Buddypress Like – Notification Hack
minto
Participant@carco
nice hack, as i could say intuitively! 😀but for some reason still no notifs appearing!
+ the user_id-tables in the database give 0 for all entries!thx anyway!
September 17, 2013 at 11:13 am #171420In reply to: Buddypress Like – Notification Hack
Carco
Participantfunction bp_like_check_installed() {
global $wpdb;if ( !is_site_admin() )
return false;if ( !get_site_option( ‘bp_like_settings’ ) || get_site_option( ‘bp-like-db-version’ ) )
bp_like_install();if ( get_site_option( ‘bp_like_db_version’ ) < BP_LIKE_DB_VERSION )
bp_like_install();
}
add_action( ‘admin_menu’, ‘bp_like_check_installed’ );
add_action( ‘network_admin_menu’, ‘bp_like_check_installed’ );/**
* for notifications
*/function bp_like_setup_globals() {
global $bp, $current_blog;
$bp->bp_like=new stdClass();
$bp->bp_like->id = ‘bp-like’;
$bp->bp_like->slug = ‘bp_like’;
$bp->bp_like->notification_callback = ‘bp_like_format_notifications’;
$bp->active_components[$bp->bp_like->slug] = $bp->bp_like->id;
do_action( ‘bp_like_setup_globals’ );
}
add_action( ‘bp_setup_globals’, ‘bp_like_setup_globals’ );function bp_like_format_notifications( $action, $item_id, $secondary_item_id, $total_items,$format=’string’) {
global $bp;
$glue=”;
$user_names=array();
$activity = new BP_Activity_Activity( $item_id );
$link=like_notifier_activity_get_permalink( $item_id );if($activity->user_id==$bp->loggedin_user->id){
$text=__(“your”);
$also=””;
}
else{
$text=sprintf(__(“%s’s”), bp_core_get_user_displayname ($activity->user_id));//somone’s
$also=” also”;
}$users = array_keys( bp_activity_get_meta( $item_id, ‘liked_count’ ) );
$total_user= $count=count($users);if ($count==0){
bp_core_delete_notifications_by_item_id( $bp->loggedin_user->id, $activity->id, $bp->bp_like->slug, ‘new_bp_like_’.$activity->id);
}if($count>2){
$users=array_slice($users, $count-2);
$count=$count-2;
$glue=”, “;
}else if($total_user==2)
$glue=” and “;foreach((array)$users as $id)
$user_names[]=bp_core_get_user_displayname ($id);if(!empty($user_names))
$commenting_users=join ($glue, $user_names);
else
$commenting_users=”Somebody remove it after”;if($total_user>2)
$text=$commenting_users.” and “.$count.” others”.$also.” liked on “.$text. ” post”;
else
$text=$commenting_users.$also .” liked on “.$text. ” post”;return array(‘link’=>$link,
‘text’=>$text);}
function like_notifier_activity_get_permalink( $activity_id, $activity_obj = false ) {
global $bp;if ( !$activity_obj )
$activity_obj = new BP_Activity_Activity( $activity_id );$link = bp_get_activity_directory_permalink() . ‘p/’ . $activity_obj->id . ‘/’;
return apply_filters( ‘like_notifier_activity_get_permalink’, $link );
}function like_notifier_remove_notification($activity,$has_access){
global $bp;
if($has_access)
bp_core_delete_notifications_by_item_id( $bp->loggedin_user->id, $activity->id, $bp->bp_like->slug, ‘new_bp_like_’.$activity->id);}
add_action(“bp_activity_screen_single_activity_permalink”,”like_notifier_remove_notification”,10,2);….
bp_core_add_notification( $item_id, $activity[‘activities’][0]->user_id, $bp->bp_like->slug, ‘new_bp_like_’.$item_id );
September 17, 2013 at 10:55 am #171419In reply to: Notifications on the bar broken
m1000
ParticipantOoops, that was my mistage, database user didn’t have the right to delete tables.
August 27, 2013 at 10:36 pm #170537In reply to: Is bp-friends-template.php editable?
terraling
ParticipantCase?
John sends a friend request to Lucy.
Lucy receives an email notification which invites her to check out John’s profile.
When she does she sees a ‘Cancel Friendship Request’ button. She also sees how fond John is of gerbils and she quickly hits the button, but gets an error message ‘Friendship request cannot be cancelled’.
She can’t cancel it because she didn’t initiate it.
It seems logically there might be 3 options:
1. she sees no button (likewise when John appears on the member directory list);
2. she sees a button which takes her to her friend requests page where she can accept or reject it; or,
3. she is able to accept/reject it then and there.These options become more user friendly but harder to implement.
I would have thought 1. is, ahem, fairly straightforward, and wouldn’t break anything anywhere else.
It would be helpful if check_is_friend in bp-friends-classes.php returned not just ‘pending’, ‘is_friend’, or ‘not_friends’ but differentiated ‘pending’ according to whether the current user had initiated it or not.
But now I’m getting a little out of my depth…
August 26, 2013 at 11:13 am #170427In reply to: Remove [Site Name] from email subject line
Prince Abiola Ogundipe
ParticipantThis is what i did to remove it from activation email, you can play with it to remove it from all
function fix_bp_activation_subject($subject) { return __( "Activate Your Account",'buddypress ' ); } add_filter( 'bp_core_activation_signup_user_notification_subject ','fix_bp_activation_subject');Naijaping
-
AuthorSearch Results