Search Results for 'notification user id'
-
AuthorSearch Results
-
December 24, 2016 at 11:54 am #262362
dekoningalex
ParticipantHi i really want to do this too, but i am new to Php.
This is all the code in my header.php
<!doctype html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php wp_site_icon(); ?> <?php $id = get_queried_object_id(); $page_scroll = (get_post_meta($id, 'page_scroll', true) == 'on' ? 'page_scroll' : ''); $snap_scroll = (get_post_meta($id, 'snap_scroll', true) == 'on' ? 'snap_scroll' : ''); $rev_slider_alias = get_post_meta($id, 'rev_slider_alias', true); $smooth_scroll = (ot_get_option('smooth_scroll') != 'off' ? 'smooth_scroll' : ''); $header_style = (get_post_meta($id, 'header_style', true) ? get_post_meta($id, 'header_style', true) : ot_get_option('header_style', 'style1')); ?> <?php $class = array(); array_push($class, $page_scroll); if(!empty($snap_scroll)) { array_push($class, 'snap'); } array_push($class, $smooth_scroll); ?> <?php /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. */ wp_head(); ?> </head> <body <?php body_class($class); ?> data-themeurl="<?php echo THB_THEME_ROOT; ?>"> <div id="wrapper" class="open"> <!-- Start Mobile Menu --> <?php do_action( 'thb_mobile_menu' ); ?> <!-- End Mobile Menu --> <!-- Start Quick Cart --> <?php do_action( 'thb_side_cart' ); ?> <!-- End Quick Cart --> <!-- Start Content Container --> <section id="content-container"> <!-- Start Content Click Capture --> <div class="click-capture"></div> <!-- End Content Click Capture --> <?php if (thb_accountpage_notloggedin()) { get_template_part( 'inc/header/subheader' ); get_template_part( 'inc/header/'.$header_style ); } ?> <?php if (is_page() && $rev_slider_alias) {?> <?php $rev_slider_white = get_post_meta($id, 'rev_slider_white', true); ?> <div id="home-slider" class="<?php echo esc_attr($rev_slider_white); ?>"> <?php if (function_exists('putRevSlider')) { putRevSlider($rev_slider_alias); } else { _e('Please Install & Activate Revolution Slider', 'bronx'); }?> </div> <?php } ?> <div role="main" class="<?php echo esc_attr($snap_scroll); ?>"> <?php if(!empty($snap_scroll)) { ?><div class="ai-dotted ai-indicator"><span class="ai-inner1"></span><span class="ai-inner2"></span><span class="ai-inner3"></span></div><?php } ?>Where do i add the from your example in the code?
<div id="testid"><?php echo bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ); ?></div>I already added the css to the childs theme style.css and added the three php snippers for correctly placing the bubbles as well, this is the only part i don’t understand so far.
Thanks
December 14, 2016 at 4:20 pm #262087danbp
ParticipantBuddyPress doesn’t handle likes. That’s 3rd party plugin territory.
If Super Socializer has a notification option for BP users who doesn’t work, the solution is on the plugin author side.If you think you can get a BP notification because somebody liked a post with help of Super Socializer, and there is no BP specific option in the plugin, i guess it is not possible.
Would be great to see more details about your statement: (Heateor) say that it is an issue in BP. Can you share a link to the discussion ?
Did you asked yourself for this issue on their support ? Your name doesn’t appear.
dunnjust
ParticipantThank you for your help.
4. I’d like to keep the right part of the Admin bar because it provides notifications and other important user functionalities. The Left part is what I’d like to remove. The WordPress Logo and Site Title give users access to the dashboard. I don’t think that plugin allows for this.
November 23, 2016 at 2:25 am #261279dev grl
ParticipantAny idea how I can get an email notification to the user who signs up after they’ve been manually approved in the backend? As of now it doesn’t automatically tell them when the admin activates them
November 16, 2016 at 3:06 am #261057In reply to: Bp custom Menu
livingflame
ParticipantHi @danbp
Me again.First look at this:
// Add Count Near Nav Menu function my_counter_nav_menu($menu) { if ( ! is_user_logged_in() ) { return $menu; } $user_id = bp_loggedin_user_id(); $user_url = bp_loggedin_user_domain(); $notify_url = $user_url . bp_get_notifications_slug() . '/'; ob_start(); ?> <li><a href="<?php echo $notify_url ?>">Notificaciones <span class="my_bubble"> <?php echo bp_notifications_get_unread_notification_count( $user_id );?></span> </a></li> <?php $menu_items = ob_get_clean(); $menu = $menu . $menu_items; return $menu; } add_filter( 'wp_nav_menu_items', 'my_counter_nav_menu' );This is a modification of your code for show notifications bubbles in Main Menu.
Okey, it works but, I dont want this line: <?php echo $notify_url ?>”>Notificaciones
I want to get bubbles for Buddypress-Nav-Menu. You know, Dashboard / Menus / Buddypress. Here you have buddypress links: profile, messages, etc. but, if you add “messages”, appear without counter. So, I want counter for these…
October 28, 2016 at 4:44 pm #260512In reply to: how to add new members
danbp
ParticipantHi,
did you activate the user ?
or have you omit to uncheck Send User Notification ?If you’re doing this just to test BP with some content, use better BP Default Data
October 28, 2016 at 6:32 am #260483maccast
ParticipantDid a ticket get opened for this because I’m seeing a similar, possibly related bug. Basically I’m seeing
bp_get_loggedin_user_nav()return the correct menu item, but the messages, notification, and friends counts that are displayed are for the “displayed” user.October 20, 2016 at 8:24 pm #260083In reply to: Bp custom Menu
livingflame
ParticipantRESOLVED! Thanks @sbrajesh
CODE :::::::: Put this Code Inside your function.php ChildTheme
//Add Count Near Nav Menu With Bubble function my_counter_nav_menu($menu) { if ( ! is_user_logged_in() ) { return $menu; } $user_id = bp_loggedin_user_id(); $user_url = bp_loggedin_user_domain(); $msg_url = $user_url . bp_get_messages_slug() . '/'; $notify_url = $user_url . bp_get_notifications_slug() . '/'; ob_start(); ?> <li><a>">Messages <span class="my_bubble_notify"><?php echo bp_get_total_unread_messages_count( $user_id );?></span> </a></li> <li><a>">Notifications <span class="my_bubble_notify"> <?php echo bp_notifications_get_unread_notification_count( $user_id );?></span> </a></li> <?php $menu_items = ob_get_clean(); $menu = $menu . $menu_items; return $menu; } add_filter( 'wp_nav_menu_items', 'my_counter_nav_menu' );––––––––––––
CSS::::: Put this Code Inside your style.css ChildTheme.my_bubble_notify {
border-radius: 25%;
border: 1px solid #ccc;
background: #eee;
color: #6c6c6c;
display: inline;
margin-left: 1px;
padding: 2px 6px;
text-align: center;
vertical-align: center;
font-size: small;
}October 14, 2016 at 5:14 pm #259839In reply to: Change Colors on Buddypress Notifications !
antoinegdln4
ParticipantMy question is “How can i include this code
$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 = ‘‘ . $count . ‘‘;(who can get the class [and color] i want) to my previous code…. ”
Thanks !October 9, 2016 at 7:41 pm #259656In reply to: Admin bar icons do not display on some devices
giuseppecuttone
ParticipantI will be your savior,
for same rasons, wordpress decided not show admin bar like default in mobile.
It is so,maybe, because when user log in in mobile device, a lot of menu will be showed… really I dont know why…
But if you dont have this problem, and want show admin bar for log in an log out users, you must add in CSS the following codec:@media screen and (max-width:782px) { #wpadminbar { display:block; } html { position:absolute; top:-46px; } }The codec where say html position absolute is for delete noise black bar located in the up side zone.
If you want, you can also show the notification icon (I think it is named budlle notification) into the admin mar, adding the following codec in CSS zone:/* Show only default top level items */ #wp-toolbar > ul > li { display: block; }I have gone mad to find the solution, but now we have it.
If you dont want show menu in admin bar to the suscriptors, colaborator and authors, you can use the AG CUSTOM ADMIN plugin. It hide them and help you in a clean design. (you can also hide wordpress logo, and so much things…)Now, I have only a litlle / big problem:
the drop down menu, when I click in the “notification icon” in the admin bar, is not showed correctly… It is showed from the “notification icon” to the right zone, so in mobiles user can red the title of the notification.
The solution is show the dropdown menu from the “notification icon” to the left zone. So, also in mobiles users can red the title of the notification.
Can you help me for to make that?
I have helped you, now I hope someone can help me 😉
Thank for your support and have funnySeptember 27, 2016 at 7:17 pm #259180In reply to: BuddyPress Favorites in
Humiges
ParticipantDear @danbp
thank you for your kind reply.
Sorry, I’m not sure I exactly understand what do you mean.
I definitely don’t want to complicated things (if it sounded like that)… as you said, I would like to keep the Favorite in user profile – however, I don’t need people to favorite their statuses (I actually removed that with CSS) – I wish to have it in blogs – so when for example Mike post a blog “Awesome BuddyPress 😉 ” I can press Favorite – this means I’ld collect favorite blogs and see them in my profile anytime in the future 😉
This is also cool, because the notifications are there… I love this features… they are just not in the right place for me 😉Thank you very much for your help 🙂
September 15, 2016 at 4:07 pm #258761In reply to: Error 404 for non logged in users
tizianopitisci
ParticipantI would like to have on my website the same solution of buddydev.com. See this examples please:
BUDDYPRESS: https://buddypress.org/members/tizianopitisci/notifications/
BUDDYDEV: https://buddydev.com/members/tizianopitisci/notifications/In buddydev users:
1. Recive a notification by email with a link inside;
2. Follow the link;
3. Make the log-in;
4. Access the private areaI wuold like to have the same solution. Do you think is possible?
Thanks for your help
TizianoSeptember 14, 2016 at 10:59 pm #258729In reply to: Avatar Upload ‘Wrong Size’ Message Is Wrong
dsnic
ParticipantHi all,
As @danbp suggested, I’ve looked at the file: bp-core/bp-core-avatars.php
The full avatar size is indeed set to 150×150 by default there, as @imath has said.If the others in this thread facing the same problem are using the Kleo or Sweet Date theme, then you’ll find the default 580×580 avatar size set in this file: wp-content/plugins/bp-custom.php
The problem, however, is that even when the image being uploaded is a lot bigger than 580×580, the error notification still appears.
For now, I’ve temporarily “solved” the problem by commenting out the code mentioned by @danbp so the error notification doesn’t appear. This kinda works because the site will still accept the uploaded photo despite the error notification. At least this way there’s no error notification to confuse users.
However, this is probably not the correct way to solve this issue. Can someone please help with a more elegant solution?
September 13, 2016 at 1:52 am #258674kmligue
ParticipantI installed https://wordpress.org/plugins/postman-smtp/ on my WP (v 4.6) + BuddyPress (v 2.6.2) site, then configured it to use my Gmail account’s SMTP server settings.
The emails sent by the site uses the SMTP settings when:
– A member registers and PMPRo (https://tl.wordpress.org/plugins/paid-memberships-pro/) sends out an email confirmation
– Emails sent using the plugin (https://wordpress.org/plugins/email-users/)(I can see these sent emails in the “Sent” folder of my Gmail account.)
However, when BuddyPress sends out an email (e.g. email notification for friend request, etc.), it seems to ignore the SMTP server settings I have configured. Instead, it uses the server’s default.
How do I make BuddyPress email notifications send using my Gmail SMTP server settings?
September 11, 2016 at 12:47 pm #258630In reply to: [Resolved] Error 404 – Page Not Found
danbp
ParticipantHi,
the logout link is redirected to the same page. If you’re on your profile notifications screen, which is only intended for you, it is normal that when you logout from there, you’re redirected to a page not found message. Notifications is even private and not public.
The solution is to redirect to an always public part of the site on logout.
Add this snippet to child-theme’s functions.php
//* Redirect WordPress Logout to Home Page add_action( 'wp_logout', create_function( '', 'wp_redirect( home_url() ); exit();' ) );Advice 1: use preferably the login widget, so the user stays on the same page where he attempt to login instead to be redirected to that boring wp-login page.
Advice 2: on the Home (which is the member directory), you have all BP pages listed at the bottom. Remove them ! You certainly don’t need to give access to account activation or register page to your visitors…
September 5, 2016 at 4:46 pm #258410In reply to: How to Change the From Email for Activation
steigw
ParticipantIt’s a staging site that doesn’t have public access, but I can put the code and info in here. Here is the complete code of the functions.php in the child theme. maybe I just put it all together wrong.
<?php function nisarg_enqueue_styles() { $parent_style = 'nisarg-style'; wp_enqueue_style( 'bootstrap', get_template_directory_uri().'/css/bootstrap.css' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/font-awesome/css/font-awesome.min.css' ); wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'nisarg-child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ) ); } add_action( 'wp_enqueue_scripts', 'nisarg_enqueue_styles' ); ?> <?php function custom_wp_mail_from( $email ) { $handle = ‘accounts’; $find = 'http://'; $replace = ''; $link = get_bloginfo( 'url' ); $domain = str_replace( $find, $replace, $link ); return $handle . '@' . $domain ; } add_filter( 'wp_mail_from', 'custom_wp_mail_from' ); ?>The email link is:http://mydomain.com/activate/JA0BvkK1Q0DND10SYegdOtkTMemhGUF0/
When I click on it immediately, I get all this:
Fatal error: Uncaught exception ‘phpmailerException’ with message ‘Invalid address: ‘accounts’@mydomain.com’ in /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/class-phpmailer.php:946 Stack trace: #0 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/pluggable.php(352): PHPMailer->setFrom(‘\xE2\x80\x98accounts\xE2\x80\x99@…’, ‘WordPress’) #1 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/pluggable.php(1726): wp_mail(‘webmaster@arlin…’, ‘[My Dev Sit…’, ‘New user regist…’) #2 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-content/plugins/buddypress/bp-members/bp-members-functions.php(2031): wp_new_user_notification(18) #3 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-content/plugins/buddypress/bp-members/bp-members-screens.php(364): bp_core_activate_signup(‘JA0BvkK1Q0DND10…’) #4 [internal function]: bp_core_screen_activation(”) #5 /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/plugin.php(524): cal in /homepages/25/d283441938/htdocs/clickandbuilds/staging/wp-includes/class-phpmailer.php on line 946
If I wait a while, then I get the normal webpage and it says “invalid activation key”. I don’t understand the significance of an immediate click on the link in the email vs. waiting a few more seconds, but it definitely matters.
September 3, 2016 at 5:01 pm #258342In reply to: [Resolved] Member Menu Alterations
Fantacular Designs
ParticipantMy brilliant husband is my coder… He figured out how to define the default component, and saved the day. I hope this helps others.
define( 'BP_DEFAULT_COMPONENT', 'profile' ); function bpfr_hide_tabs() { global $bp; if ( bp_is_user() && !is_super_admin() ) { bp_core_remove_nav_item( 'activity'); bp_core_remove_nav_item( 'notifications'); bp_core_remove_nav_item( 'messages' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'settings' ); } } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );September 1, 2016 at 1:16 am #258234In reply to: [Resolved] Member Menu Alterations
Fantacular Designs
ParticipantI also attempted to add them individually…
function bpfr_hide_tabs() { global $bp; if ( bp_is_user() && !is_super_admin() ) { bp_core_remove_nav_item( 'activity' ); bp_core_remove_nav_item( 'notifications' ); bp_core_remove_nav_item( 'messages' ); bp_core_remove_nav_item( 'groups' ); bp_core_remove_nav_item( 'forums' ); bp_core_remove_nav_item( 'settings' ); } } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );I’ve noticed some changes require us to repeat ourselves, while others allow us to list changes within one line of code. Haven’t deciphered this anomaly just yet.
September 1, 2016 at 1:02 am #258232In reply to: [Resolved] Member Menu Alterations
Fantacular Designs
ParticipantI placed the following code in the bp-custom.php which was found under the wp-content -> plugins.
function bpfr_hide_tabs() { global $bp; if ( bp_is_user() && !is_super_admin() ) { bp_core_remove_nav_item( 'notifications', 'activity', 'groups', 'messages', 'forums', 'settings'); } } add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );It breaks my site, shuts it down. From what I’ve read, I am supposed to specify what tab is open when opening a profile. Otherwise, browsers don’t know what to display since default is “Activity” and I’m removing it… Can someone please tell me where I went wrong? I appreciate the help!
August 23, 2016 at 11:17 am #257925In reply to: How to – Chapters and other blog question
Humiges
ParticipantHey @buddycore,
thanks for your reply.
Sorry, I’ll try 😉
1, Well, we have users (buddypress) they post their stories from front end – using social articles plugin. Sometime, their stories have chapters… so, it would be nice to link them somehow. I didn’t find the way to do that, so I thought I would try it here — maybe a bit of brainstorming 😉2, In regards of the images – I know lots of site have problems with copyrights, so I would like to control the images by allowing only selection from library.
3, allow buddypress users to follow certain blog posts – so, when it’s edited or commented they receive notification? – — I hope this one is clear 😉
Thanks a lot 🙂
August 14, 2016 at 8:31 am #257597In reply to: Broken translation in some tabs
danbp
ParticipantDon’t hack core files. (never !) Which language do you use ?
Where have you done this ?
I’ve took a look at the files and found out that the working ones are using__( "Foo %s", "buddypress" )and the wrong ones are using_x( "Foo %s", "Blah blah blah", "buddypress" ).Actually all BP strings are working. If you need custom translation, you have to do that in po/mo and to use preferably the original strings. For example, if you build a template and want to use the notification count on it, you copy the original string to your work. If you don’t do that, you nedd 2 po/mo ! One for BP and one for your custom work. Which is certainly not the best and easiest solution.
The notification count is defined in wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notification-component.php
The counter itself is inside a span and is defined separately.
/* translators: %s: Unread notification count for the current user */ _x( 'Notifications %s', 'Profile screen nav', 'buddypress' ), sprintf( '<span class="%s">%s</span>',The bla bla bla part you mention is a comment for translators who indicates him the context. This comment appears in the pot file like: Notification %s [Profile screen nav]
That’s BP’s default coding. You haven’t to modify this. Use it as is.
If you have difficulty to translate such a string, you have to check your theme or any custom function you added (by hand or another plugin).
The corresponding custom string should reflect the original one as gettext function wouldn’t translate a string which is not identic.
__( "Foo %s", "buddypress" )and_x( "Foo %s", "Blah blah blah", "buddypress" )are both working, and do technicaly the same thing (foo = something) which let you modify “foo” in both case, but as the original string is_x( "Foo %s", "Blah blah blah", "buddypress" ),you couldn’t replace it with__( "Foo %s", "buddypress" ). It is the translation prefix (_x or __) which is the important thing here.Hope to be clear. And you’re right, unfortunately your changes will be overwriten at next BP update as you hacked core files.
July 17, 2016 at 10:32 pm #256722In reply to: bp custom notifications proper guide
ah72king
ParticipantI found a solution that can help
<?php // For Custom Notification // Registering Custom Componet function custom_filter_notifications_get_registered_components( $component_names = array() ) { // Force $component_names to be an array if ( ! is_array( $component_names ) ) { $component_names = array(); } // Add 'custom' component to registered components array array_push( $component_names, 'custom' ); // Return component's with 'custom' appended return $component_names; } add_filter( 'bp_notifications_get_registered_components', 'custom_filter_notifications_get_registered_components' ); // Formatting custom with respect to action function bp_custom_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { //$item_id this your id which you can use to get your respected data $data = get_my_values_custom_function($item_id); // this is custom function it depend on your needs and data $custom_title = $data->title; $custom_link = $data->link; $custom_text = $data->text; // New custom notifications if ( 'custom_action' === $action ) { // WordPress Toolbar if ( 'string' === $format ) { $return = apply_filters( 'custom_filter','Your custom notification for <a href="'.$custom_link.'">'.$custom_title.'</a> ', $custom_text, $custom_link ); // Deprecated BuddyBar } else { $return = apply_filters( 'custom_filter', array( 'text' => $custom_text, 'link' => $custom_link ), $custom_link, (int) $total_items, $custom_text, $custom_title ); } return $return; } } add_filter( 'bp_notifications_get_notifications_for_user', 'bp_custom_format_buddypress_notifications', 10, 5 ); // Adding custom Notification in DB function bp_custom_notification( $item_id, $author_id ) { if ( bp_is_active( 'notifications' ) ) { // if notification is active from admin panel // if notification is active from admin panel bp_notifications_add_notification function to add notification into database bp_notifications_add_notification( array( 'user_id' => $author_id, // User to whom notification has to be send 'item_id' => $item_id, // Id of thing you want to show it can be item_id or post or custom post or anything 'component_name' => 'custom', // component that we registered 'component_action' => 'custom_action', // Our Custom Action 'date_notified' => bp_core_current_time(), // current time 'is_new' => 1, // It say that is new notification ) ); } } add_action( 'custom_hooks', 'bp_custom_notification', 10, 2); /** * custom_hooks is action name which will be call by do_action() function * bp_custom_notification your function name * 10 is priority number * 2 is number of parameter */ /**** * Now Where to call custom_hooks and how */ do_action('custom_hooks', $item_id, $author_id ); /**** * place it where you want to call this action and pass parameter */July 11, 2016 at 9:16 pm #256502socialc
Participant<?php echo bp_notifications_get_unread_notification_count(bp_loggedin_user_id()); ?>You can build your own menu using this inside to show the count.
July 4, 2016 at 3:20 pm #255772doubleF
ParticipantHello @shanebp,
I’ve changed the
secondary_item_idwith :get_current_user_id()And it’s the same issue, notification is created but doesn’t seem to be assigned to any profile :/
Thanks for the help.
July 4, 2016 at 2:28 pm #255769shanebp
Moderator'secondary_item_id'should be the user id of the person creating the notification.
That might be the problem. -
AuthorSearch Results