Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 251 through 275 (of 768 total)
  • Author
    Search Results
  • #262777
    Dono12
    Participant

    @djpaul and @danbp How can I turn these Notification hacks into apply_filter functions for the bp/wp admin bar menu to display with font awesome for bp-custom or functions.php?

    <div class="site-header-user-notifcations">
    <a href="<?php global $current_user; echo home_url() . '/members/' . $current_user->user_login . '/notifications/'; ?>"><i class="fa fa-bell-o" aria-hidden="true"></i></a> 
    
    <?php
    $count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
    if ( $count > 0 ) {
    echo '<div class="site-header-user-notifcations-bubble">'; echo $count; echo '</div>';  
    } else {
    }
    ?>
    </div>
    <div class="site-header-user-notifcations">
    <a href="<?php global $current_user; echo home_url() . '/members/' . $current_user->user_login . '/friends/requests/'; ?>"><i class="fa fa-users" aria-hidden="true"></i></a>
    <?php
    $count_requests = bp_friend_get_total_requests_count( bp_loggedin_user_id() );
    if ( $count_requests > 0 ) {
    echo '<div class="site-header-user-notifcations-bubble">'; echo $count_requests; echo '</div>';
    } else {
    }
    ?>
    </div>
    <div class="site-header-user-notifcations">
    <a href="<?php global $current_user; echo home_url() . '/members/' . $current_user->user_login . '/messages/'; ?>"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
    <?php
    $count_messages = bp_get_total_unread_messages_count( bp_loggedin_user_id() );
    if ( $count_messages > 0 ) {
    echo '<div class="site-header-user-notifcations-bubble">'; echo $count_messages; echo '</div>';
    } else {
    }
    ?>
    </div>
    #262657
    Jon Fergus
    Participant

    I’ve seen a dozen support questions on this topic and the answer has always been “another plugin must be redeclaring wp_mail(), so on my test site I disabled every plugin except bbpress and buddypress (and akismet) and still emails are sent in plain text.

    On my live site, the only way I can get the html emails sent is when I have the Buddypress Group Email Subscriptions plugin activated, and then, no matter what other email-related plugins I have active all buddypress emails are sent in html format.

    But, the group subscription plugin has it’s own problem: slows down page-reload when replying if too many members are subscribed to a Topic (can take up to 30 seconds for the reply to process and page to reload on our site), and we haven’t found other solutions to that. So…. we want to disable that subscription plugin, but when we do we lose the html formatted emails.

    Can someone please provide some kind of solution for this plain-text vs. html issue. Like I said, even with no other plugins active we’re still not getting html emails.

    Thanks for the help.

    Our info from our test site (when still getting plain text emails):
    WP version 4.7
    Theme Goodnews 5 Child Theme 1.0
    PHP version 5.6.29
    bbPress version 2.6-alpha-6091
    site url http://staging-nexus.universaltheosophy.com
    Active Plugins Name and Version
    – p1 Akismet 3.2
    – p3 bbPress 2.6-alpha
    – p4 BuddyPress 2.7.4

    Our info from our live site:
    WP version 4.7
    Theme Goodnews 5 Child Theme 1.0
    PHP version 5.6.29
    bbPress version 2.6-alpha-6091
    site url http://nexus.universaltheosophy.com
    Active Plugins Name and Version
    – p1 Adminimize 1.11.2
    – p2 Akismet 3.2
    – p3 All In One SEO Pack 2.3.11.1
    – p4 bbP Toolkit 1.0.6
    – p5 bbPress 2.6-alpha
    – p6 Better Notifications for WordPress 1.6
    – p7 BP Registration Options 4.3.1
    – p8 BuddyPress Group Email Subscription 3.7.0
    – p9 BuddyPress Sitewide Activity Widget 1.3.2
    – p10 BuddyPress 2.7.4
    – p11 Contact Form 7 4.6
    – p12 Google XML Sitemaps 4.0.8
    – p13 Header and Footer 2.0.3
    – p14 Random Content 1.3.1
    – p15 TinyMCE Advanced 4.4.3
    – p16 User Role Editor 4.31.1
    – p17 WP-Mail-SMTP 0.10.1

    #262441

    In reply to: delete notifications

    danbp
    Participant

    Hi @mohamedalikortli,

    thank you for the sharing, but I am afraid that your proposal is not acceptable in regard of coding best practice. I let your snippet in place, but i also warn all readers to use it, unless they know what they do.

    This forum is public and most users coming here for help are querying at first for BuddyPress related issues solution, not third party plugin tricks like the one you share here. The majority is also not very comfortable with php or even site development.
    This aspect is one of the main reason to provide usefull and safe code.
    IT IS NOT THE CASE HERE – and i wouldn’t recommand it.

    Not because it doesn’t or wouldn’t work ( and i haven’t tested it), but because it is not correctly written. Allowing such a snippet is like encouraging (and by the way perpetuating) bad practices. Hopefully you understand and agree that we don’t want this on the BuddyPress support forum.


    @sbrajesh
    ‘s BuddyPress Clear Notification plugin was last updated in march 2016, which is pretty recent. I doubt that the bug is in his plugin and i expect more a menu related issue… but this is only an expectation of mine.

    If you estimate that your workaround is helpfull for that plugin, get in touch with Brajesh or publish it on the plugin support.

    By the way, next time you publish code on this form, use the code button available on the editor toolbar to insert it properly.

    FYI about what you did wrong or not properly:
    – hacking a core file. Notification template should be used, but from inside a child-theme, not directly from bp-legacy).
    – comments should be in english (some in your example are in french)
    – your recommendation is against all WP usage:

    copy this script into ur document root where u have installed ur wordpress

    – you can add custom code via bp-custom.php. There is also no need to go to wp root, when you can do the same thing from within your child-theme.
    – why do you recall jquery ? It is already loaded when you run BP…
    – i’m not a developer, but i’m pretty sure there are other things to mention about coding.

    In regard of the script itself, BP provide much simplier way to delete notification or show a delete button: reference.
    You’re also using french in that script.

    Calling a file “test” is ok, but in that case you should provide some explanation on how to finally use your snippet. As already said, not everybody here is able to understand – and use raw code – when you provide a workaround. Providing code is fine, providing code+tutorial is always better.

    Désolé d’être sévère et rien de personnel, mais juste une mise au point nécessaire.

    [modlook] @jjj, @DJPaul, @boonebgorges, @mercime, @hnla, @shanebp, @henrywright

    #262435
    mohamedalikortli
    Participant

    if buddypress clear notifications plugin does not working for u , this is a solution how to do it ,we will add a button”clear all notifications” in the notifications nav menu , first we will edit a php script called test.php wich contain this code

    <?php
    
    	 function clear_all_notifications() {
    		 require_once( 'wp-load.php' ); //put correct absolute path for this file
    
    $id = get_current_user_id();
    		 
    		 
    		// on se connecte à MySQL 
    $db = mysql_connect('localhost', 'user', 'password'); //replace user and password
    mysql_select_db('name of database',$db); 
    $requete = 'SELECT * FROM prefix_bp_notifications WHERE user_id='. $id ; // verify the name of table here prefix_bp_notifications can be wp_bp_notifications
    $sql = 'DELETE FROM prefix_bp_notifications WHERE user_id ='. $id ; // verify the name of table here prefix_bp_notifications can be wp_bp_notifications
    $reponse = mysql_query($requete);
    $resultat = mysql_num_rows($reponse);
    if($resultat > 0){ 
    $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); 		
    		
         
    	 
    mysql_close(); 	 
    		
    		echo "Notifications supprimees";
    }
    else {
    	echo $resultat ;
    
    		echo "pas de notifications";
    mysql_close();
    }  
        }
    	
    	clear_all_notifications();
    	?>
    
    copy this script into ur document root where u have installed ur wordpress
    
    then add this code to wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php  under <?php bp_get_options_nav(); ?> line 13
    
    <li id="notifications-my-notifications-personal-li" class="current selected"> 
    		<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
        <script type = "text/javascript">
    function myAjax () {
    $.ajax( { type : 'POST',
              data : { },
              url  : 'ur website adresse/test.php',              // <=== CALL THE PHP FUNCTION HERE.
              success: function ( data ) {
                return 1;               // <=== VALUE RETURNED FROM FUNCTION.
              },
              error: function (  ) {
                return 1;
              }
            });
    }
    
    //function execute_del(){
    	//myAjax();
    	//window.location.reload();
    	
    //}
        </script>
    	<button onclick="myAjax();window.location.reload();">delete all notifications</button> <!-- BUTTON CALL PHP FUNCTION -->
    	
    	</li>

    that’s all 🙂

    dekoningalex
    Participant

    Hi 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

    Jon Fergus
    Participant

    So we’re using the “BuddyPress Group Email Subscription” plugin, and are experiencing a bottleneck when members submit a reply to a topic within a BP group. It can take 15-30 seconds for the reply to finish, from the moment of clicking “reply” to page reload.

    Looks like this is because the reply doesn’t finish posting until all notification emails are composed and sent. There’s a plugin to solve this for bbpress (AsynCRONous bbPress Subscriptions), but nothing I can find to solve the problem when it’s the BP email sending routine that’s being used.

    Does anyone have a solution to eliminate the slow reply issue here? We want to continue using the subscriptions plugin for several other reasons, so eliminating it isn’t the solution we’re looking for.

    Thanks for the help.

    Plugin we’re using: https://wordpress.org/plugins/buddypress-group-email-subscription/

    Other info:

    WP version 4.7
    PHP version 5.6.28

    Active Plugins
    – p1 Adminimize 1.11.2
    – p2 Akismet 3.2
    – p3 All In One SEO Pack 2.3.11.1
    – p4 bbP Toolkit 1.0.6
    – p5 bbPress 2.6-alpha
    – p6 Better Notifications for WordPress 1.6
    – p7 BP Registration Options 4.3.0
    – p8 BuddyPress Group Email Subscription 3.7.0
    – p9 BuddyPress Sitewide Activity Widget 1.3.2
    – p10 BuddyPress 2.7.3
    – p11 Contact Form 7 4.6
    – p12 Goodnews Shortcodes editor 1.0
    – p13 Google XML Sitemaps 4.0.8
    – p14 Header and Footer 2.0.3
    – p15 TinyMCE Advanced 4.4.1
    – p16 User Role Editor 4.31
    – p17 WP-Mail-SMTP 0.10.1
    – p18 WP Super Cache 1.4.8

    #262257
    mohamedalikortli
    Participant

    i want to know how to redirect all the notification of buddy press for a specific url , not the default url like site.com/memberes/id-user/notification-id/…. because when i click on a specific notification i get only empty page .thks

    danbp
    Participant

    @cofindrs,

    BuddyPress 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.

    #261344

    In reply to: BP Issues

    dunnjust
    Participant

    Thank 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.

    #261279
    dev grl
    Participant

    Any 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

    #261057

    In reply to: Bp custom Menu

    livingflame
    Participant

    Hi @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…

    #260850
    esavvides
    Participant

    WP version: 4.6.1
    BP version: 2.7.2

    Hi all. I’m surprised this solution isn’t easy to find as it seems like a lot of people would want to do this, but I guess most themes have it already. I’m trying to integrate BP into a theme that isn’t BP compatible. It works but isn’t styled for it.

    I moved the user navigation menu from the admin bar to the header so I could get rid of the admin bar altogether. Everything works except the Profile menu item isn’t showing the sub-menu. All the links are under Settings so I could just remove the Profile item. I just don’t know where the code is. I believe it’s pulling from ‘bp_nav_menu’ but I don’t know which file to tweak. Could you tell me where to look?

    Also, the main issue is the styling. I can’t seem to find the CSS code to modify the navigation menu. I’ve been messing with it but a few things I can’t seem to find.

    The code I used was from answer #2 on this link. (#1 didn’t seem to work as well.)

    http://stackoverflow.com/questions/31812132/buddypress-display-notification-and-profile-in-header-instead-of-wp-admin-bar

    The php code was fine but the CSS code was kind of a mess and needs a lot of padding and alignment adjustments. Mainly, could you tell me two things…

    1. Where do you add the alignment so the menu items are flush left?

    2. Which section is the styling for the individual menu items (Activity/Profile/etc.) in the dropdown? Thought I found it but the code doesn’t seem to be appearing.

    I know we’re supposed to post the link to our site but the menu only shows when you’re logged in and I’m still working on it so I prefer not to post it.

    Also, I’m not a programmer. I can use Firebug and tweak php code and CSS but I’m still learning a lot of the stuff you guys probably know really well. If I sound stupid, well, in a lot of things I am. 🙂

    Thanks for any help.

    mattrea
    Participant

    Hi, I have previously been asked to set my site up so that buddyprerss members’ profiles can not be found by search engines. They want theme to only be accessible by visiting the site. I have put a robots file on my site (see below) but am still getting profiles appearing in searches – please can you tell me if there is anything I need to add to the file. Thanks, Matt.

    User-agent: *
    Disallow: */activity/p/*
    Disallow: /docs/
    Disallow: *send-invites*
    Disallow: */groups/*members*
    Disallow: */groups/*media*
    Disallow: *widget-title*
    Disallow: *members/*activity*
    Disallow: *members/*notifications*
    Disallow: *members/*friends*
    Disallow: *members/*groups*
    Disallow: *members/*docs*
    Disallow: *members/*media*
    Disallow: *acpage*
    Disallow: *messages*
    Disallow: *friends*
    Disallow: *settings*
    Disallow: /*/comment-page*
    Disallow: *register*
    Disallow: *login*
    Disallow: *profile*
    Disallow: *admin*
    Disallow: *includes*
    Disallow: *content*

    #260749
    kalico
    Participant

    Every time I manually create a new user on my multisite (via the admin interface) the new user instantly gets THREE “friend requests” from existing users. The minute the new user logs in after registration, they already have these three notifications waiting.

    I found one thread (3 years old) that describes something similar — but it’s related to the Invite Anyone plugin, the friend request comes from the Group Admin when a user responds to an invitation. I do use the Invite Anyone plugins, so I added this filter:

    add_filter( ‘invite_anyone_send_friend_requests_on_acceptance’, ‘__return_false’ );

    But it’s not changing anything as far as I can tell. I’m not even sure that the IA plugin is responsible. I’ve logged in as the users who are “sending” these automated friend requests, and I can’t find anything that they can do to force sending a friend request to new users.

    Any ideas at all where I should look for the cause?

    #260512

    In reply to: how to add new members

    danbp
    Participant

    Hi,

    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

    maccast
    Participant

    Did 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.

    GaryLeGrill
    Participant

    Hi
    I just installed wordpress yaost seo on my website and I got this error message.
    The error disapear whit I install buddypress.

    Could you please help pe to fix it?

    Thanks

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘bp_admin’ not found or invalid function name in /homepages/4/s654646546/htdocs/mywebsite/wp-includes/plugin.php on line 524

    Notice: bp_setup_current_user was called incorrectly. L’utilisateur actuel est en cours d’initialisation sans utiliser $wp->init() === Trace: #6 /homepages/4/s654646546/htdocs/mywebsite/wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(31): Yoast_Notification_Center->retrieve_notifications_from_storage() #7 /homepages/4/s654646546/htdocs/mywebsite/wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php(49): Yoast_Notification_Center->__construct() #8 /homepages/4/s654646546/htdocs/mywebsite/wp-content/plugins/wordpress-seo/wp-seo-main.php(399): Yoast_Notification_Center::get() #9 /homepages/4/s654646546/htdocs/mywebsite/wp-includes/plugin.php(524): load_yoast_notifications(”) #10 /homepages/4/s654646546/htdocs/mywebsite/wp-settings.php(295): do_action(‘plugins_loaded’) #11 /homepages/4/s654646546/htdocs/mywebsite/wp-config.php(100): require_once(‘/homepages/4/d1…’) #12 /homepages/4/s654646546/htdocs/mywebsite/wp-load.php(39): require_once(‘/homepages/4/d in /homepages/4/s654646546/htdocs/mywebsite/wp-includes/functions.php on line 3996s654646546

    #260083

    In reply to: Bp custom Menu

    livingflame
    Participant

    RESOLVED! 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;
    }

    #260025
    livingflame
    Participant

    I’m trying this code courtesy of @danbp , works but I can get bubbles!

    I think BP developers should include this in the next update. PLEASE!

    Examples:

    https://goo.gl/NTEoUE

    https://goo.gl/QEUSz5

    https://goo.gl/MUcBrw

    CODE:::::: Location: put in: YourChildTheme / Function.php ::::::

    //Messages and Notifi for Menu
    function my_counter_nav_menu($menu) {  
    
    $msg_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'messages/';
    $notif_url = bp_core_get_user_domain(bp_loggedin_user_id()) .'notifications/';   
          
        if (!is_user_logged_in())
            return $menu;
        else
            $notif = '
    <li><a href=" ' .$msg_url. ' ">Messages ('.  bp_get_total_unread_messages_count( bp_loggedin_user_id() ) .')</a></li>
    <li><a href=" ' .$notif_url. ' ">Notifications ('. bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) .')</a></li> 
    ';
    				
        $menu = $menu . $notif;
        return $menu;
    }
    add_filter( 'wp_nav_menu_items', 'my_counter_nav_menu' );
    #259959
    livingflame
    Participant

    I know that Buddypress is a good growing project, but, needs very Important Native (by Default) features.

    1) Buddypress Block User (allow users to block other users –– really allow to hide your info, activities, etc. for a specific @user-1 e.g, auto-unfriend, no more messages from the blocked. This feature integrated with rtMedia too).
    OR FOR NOW: Buddypress Report User (with Custom Motives, p. ej. “@user-1 is sending me hateful messages”, “@user-2 published an annoying activity”). So, Admin can to impose a Sanction for @user-1, e. eg. 7 days without Post, 15 days without Sending Messages… or Community Expulsion -–> Block, Delete, Banned Email). Admin can too, to Sent a Message (previously edited for auto ms saying: @user-1 you are banned for…. 30 days. Sincerely the Admins).

    * Buddypress CONFIRM Account immediately after Sign Up.

    A Social or Community without this Function is Nothing. PLEASE!!

    2) Buddypress Chat (too, Message Template, to read Messages in a specific page).

    3) Buddypress Message with Attachments.

    4) Buddypress Global Search.

    5) Buddypress Custom Menu with Account Alerts (e. g. https://goo.gl/reojsE ). Yes. I know, if you go to WP Menus, you can add to your Navbar or Menu – Profile, Activity, Notifications, etc. BUT WITHOUT Bubbles or Account Alerts… That is very very Impractical.

    6) Buddypress Media (yes I know, we have rtMedia, but its add-ons are very expensive. The complete pack = US$500 more or less).

    7) Buddypress Follow/er Native.

    8) Buddypress Share (from activity).

    9) Buddypress Autocomplete Fields (for a specific text area, e. g. City: New York, Fruits: Apple, etc.), Range Fields (e. g. I’m searching friends from 20 to 21). Buddypress Birthdate normal, but, with an option to show only the Age! 10) Buddypress Advance Search. With this you can create an advance Form with Fields for Show on Members Page or in a Widget.

    11) Buddypress with Ads Area (inside Activity, Groups, Members and Forums). (Optional from Buddypress Option Panel)

    12) Buddypress More Customizable. >> A button over Cover Profile for Easy Photo Change (yes, like Facebook has)… The CPanel with MORE Options… MORE Options for: Profile / Settings / Profile Visibility and PRIVACY!!

    For now is all. Thanks!


    @johnjamesjacoby


    @djpaul


    @boonebgorges


    @imath


    @mercime


    @hnla


    @tw2113

    wolfpup64
    Participant

    I posted up on this a little while ago, and danbp was a boss and helped me out, and I thought I could get it to work, but the end fix ended up unfortunately not really fixing the problem.

    I’m having difficulty with a profile tab that is supposed to link to a separate forums profile (wpForo) via a dynamic link that recognizes the displayed user’s page. danbp set me up with something like the below, I changed a bit to make it work better…

    function tab_custom_link_to_page() {
    
    	if ( bp_is_page( 'BP_MEMBERS' ) ||  bp_is_activity_component() || bp_is_profile_component () || bp_is_groups_component () || bp_is_notifications_component () || bp_is_messages_component () || bp_is_settings_component () || bp_is_following_component () || bp_is_followers_component () ) {
    		
    		$link = bp_get_root_domain() . '/community/profile/'. bp_get_displayed_user_username();
    		echo '<li><a href="'. $link .'">Community</a></li>'; 
    	}  
    }
    add_action( 'bp_member_options_nav', 'tab_custom_link_to_page', 10 );

    but I couldnt change the location of the tab, using code or BuddyBoss Reorder Tabs plugin, which is an issue because the theme I’m using (BuddyBoss Boss.) hides the tabs at the end under a clickable “…”. I spoke to someone at BuddyBoss and they told me I wouldn’t be able to move the tab unless it was registered as a “bp_core_new_nav_item( array(“, which requires an array like:

    function add_communityprofile_tab() {
    	global $bp;	
    	bp_core_new_nav_item( array(
    		'name'                  => 'Community',
    		'slug'                  => 'community',
    		'parent_url'            => $bp->displayed_user->domain,
    		'parent_slug'           => $bp->profile->slug,		
    		'position'              => 200,
    		'default_subnav_slug'   => 'community'
    	) );
    }
    add_action( 'bp_setup_nav', 'add_communityprofile_tab', 100 );

    which works fine until I have to link it, apparently I can’t use the tab array/slug thing to reach a dynamic link without the same “$bp->displayed_user->domain”. The link I’m trying to reach is currently at:

    http://localhost/wordpress/community/profile/*displayeduser*/

    from:

    http://localhost/wordpress/users/*displayeduser*/

    If nobody has any helpful suggestions otherwise, I’m thinking the best route might be to have the page

    http://localhost/wordpress/users/*displayeduser*/community/

    redirect to

    http://localhost/wordpress/community/profile/*displayeduser*/

    via a dynamic redirect…I’m trying to figure out how to do that.

    If anyone has any helpful advice it would be super appreciated. My boss wants me to take the site live this week and I think I’m just about there…aside from this huge disconnect between the two separate user profiles…not too bad for someone who has barely any idea what they’re doing. but yeah, sorry for the super long post. thanks for reading and hopefully you can throw me a line.

    – Andrew

    chtn2109
    Participant

    I am going to create a new custom notification for a user that if someone mention the user in any review with @, the related user will get a email and a new notification has been generated, this notification I created dynamically, but I get empty message showing on user profile notification area, I checked the db_table for notification as well it has proper entries as well,

    $description = apply_filters_ref_array( 'bp_notifications_get_notifications_for_user', array( $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1, 'string', $notification->component_action, $notification->component_name, $notification->id ) );

    In the above line I found that ‘bp_notifications_get_notifications_for_user’ filter return me the empty description of my notification from line no 523 in function “bp_get_the_notification_description” of file buddypress/bp-notifications/bp-notifications-template.php

    Below is my custom code for generate notification:

    
    //add new notification mention_in_comment
    function mention_in_comment_filter_notifications_publish_post_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, 'mention_in_comment' );
     
        // Return component's with 'custom' appended
        return $component_names;
    }
    add_filter( 'bp_notifications_get_registered_components', 'mention_in_comment_filter_notifications_publish_post_get_registered_components' );
    
    //show new notification text
    function bp_mention_in_comment_format_buddypress_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) {
        // New custom notifications
        if ( 'mention_in_comment_action' === $action ) {
          
            $comment_info = get_comment( $item_id );
            $author_name = ($comment_info->user_id) ? get_the_author_meta( 'display_name', $comment_info->user_id ) : $comment_info->comment_author; 
            $custom_title = $author_name. ' mentioned you in a new comment on '.get_the_title($comment_info->comment_post_ID);
            $custom_link  = get_comment_link( $comment_info->comment_ID );
            $custom_text = $author_name. ' mentioned you in a new comment: <br/>' . $comment_info->comment_content;
     
            // WordPress Toolbar
            if ( 'string' === $format ) {
                $return = apply_filters( 'mention_in_comment_filter', '' . esc_html( $custom_text ) . '', $custom_text, $custom_link );
     
            // Deprecated BuddyBar
            } else {
                $return = apply_filters( 'mention_in_comment_filter', array(
                    'text' => $custom_text,
                    'link' => $custom_link
                ), $custom_link, (int) $total_items, $custom_text, $custom_title );
            } 
            //var_dump($return);
            return "Just say hello.";        
        }    
    }
    add_filter( 'bp_notifications_get_notifications_for_user', 'bp_mention_in_comment_format_buddypress_notifications', 1, 5 );
    
     //add notification to the mentioned user
        $notification = bp_notifications_add_notification( array(
                          'user_id'           => $user_id,
                          'item_id'           => $comment->comment_ID,
                          'secondary_item_id' => $user_id,
                          'component_name'    => 'mention_in_comment',
                          'component_action'  => 'mention_in_comment_action',
                          'date_notified'     => bp_core_current_time(),
                          'is_new'            => 1) );

    Could you please let me knwo what is wrong with my code or something else, how can more debug and solve this.

    antoinegdln4
    Participant

    Sorry for the double-post. I can’t close the other…and he’s not rightful.
    I actually have this code to display the notifications on header and it works.

    I just want to know how i can get a “count” condition for the notifications, and if it’s more than 1, that’s change the class “pending-count” to “pending-count-alert”…

    Thanks by advance

    function my_nav_menu_notif_counter($menu) {      
            if (!is_user_logged_in())
        
                    return $menu;
            else
                    
                    $notif = '<li ><a class="ab-item" href="' . bp_core_get_user_domain(bp_loggedin_user_id() ) . 'notifications/">'. __('').'<span id="ab-pending-notifications" class="pending-count">'. __(''). bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ) .'</span> </a></li>';
                    $count = !empty( $notif ) ? count( $notif ) : 0;
                    $menu = $menu . $notif;
                    return $menu;
                
                
                
                    
    }
    add_filter( 'wp_nav_menu_items', 'my_nav_menu_notif_counter' );
    add_filter( 'show_admin_bar', '__return_false' );
    
    ?>
    #259839
    antoinegdln4
    Participant

    My 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 !

Viewing 25 results - 251 through 275 (of 768 total)
Skip to toolbar