Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'notification user id'

Viewing 25 results - 576 through 600 (of 1,091 total)
  • Author
    Search Results
  • Oken
    Participant

    Hi!

    I’ve been trying to display the total number of buddypress notifications in front end of my website. I’ve been using code from a topic that addressed a few of my concerns. It uses the code from the buddypress admin bar:

    http://wordpress.stackexchange.com/questions/84072/show-buddypress-notification-in-the-frontend

    It works fine, except that it only displays the total amount of notifications in 2 groups for messages, and friend request. So it doesn’t display any number greater then 2.

    https://dl.dropboxusercontent.com/u/8411723/front-end.png

    What I want is a way to display the notification count number shown in the member’s profile menu that shows the total amount of notifications individually:

    https://dl.dropboxusercontent.com/u/8411723/notifications.png

    If someone knows a way to display this specific number count outside the profile, I’d greatly appreciate any advice.

    Thank you in advance!

    Conor "DUNKYMONKEY"
    Participant

    Hi I am developing a new site for a client. I’m trying to crate a sidebar for logged in users with their avatar, username, notifications and the Buddypress pages. I’m trying to add the avatar with the code below:

    <?php
    $userid = bp_loggedin_user_id();
    $avatarurl = bp_core_fetch_avatar( array( ‘item_id’ => $userid, ‘html’ => false ) );
    echo $avatarurl;
    ?>

    This works on Buddypress profile page but no other page, is there anything I need to include in the header. This is a personal theme not the Buddypress default. I’m using WordPress 3.8.1 and Buddypress 1.9.2. The site is beta.hyperjake.com

    Thanks for your help
    Conor

    Conor "DUNKYMONKEY"
    Participant

    Hi I am developing a new site for a client. I’m trying to crate a sidebar for logged in users with their avatar, username, notifications and the Buddypress pages. I’m trying to add the avatar with the code below:

    <?php
    $userid = bp_loggedin_user_id();
    $avatarurl = bp_core_fetch_avatar( array( ‘item_id’ => $userid, ‘html’ => false ) );
    echo $avatarurl;
    ?>

    This works on Buddypress profile page but no other page, is there anything I need to include in the header. This is a personal theme not the Buddypress defult.

    Thanks for your help
    Conor

    #177847
    e1900
    Participant

    Wordpress 3.8.1 bo 1.9.1

    Hi,
    I have spent hours trying to figure this out. My objective is to allow the user to change their online notification settings but disable the settings>general tab whilst leaving the settings>email menu tab in tact, or disable the output of “change email” and “change password” so it doesn’t show at all on the font end under settings>general.

    I do not want users to be able to change their passwords or email address through buddypress as I am using formidable pro for my registration for the site.

    Is it just a case of editing out a few lines of code or do I need a php script to put in my theme functions.php?

    regards

    Tearstone
    Participant

    I ran into an issue where I loaded BuddyPress and BBPress at the same time. I performed a conversion from vBulletin to WordPress and it went swimmingly well. However, over the past couple of weeks, my users have reported they have received anywhere from 20-50 emails a day with retroactive notifications about posts they were quoted on years ago. After two weeks of trying to figure out a solution, I came across this plug-in which I really feel needs to be apart of the core functionality of BuddyPress. I say that, because I found a lot of threads that were started and attempts at controlling notifications that did not seem to have a lot of traction.

    http://wordpress.org/plugins/buddypress-notifications-manager/

    This diamond in the rough of a mod not only controls the default notifications set for users, but retroactively updated all the existing user accounts. I am happy to report that I all of these notifications have stopped and I am not upsetting my user base.

    #177242
    Henry Wright
    Moderator

    @xwafflecakes since BP 1.9, you should have dedicated notifications pages at members/username/notifications/ and members/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() );

    aboudard
    Participant

    Ok, 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

    #176855
    Marcella
    Participant

    I have this code

    <?php if(!bp_is_user_messages() || !bp_is_user_notifications() || !bp_is_user_settings()) : ?>
    	<?php bp_get_template_part('members/single/member-header'); ?>
    <?php endif; ?>

    Which works as intended with the first part !bp_is_user_messages().

    However it ignores !bp_is_user_notification() and !bp_is_user_settings() and renders the member header.

    I’d prefer the member header to be visible on all other pages minus messages, notifications and settings.

    Any ideas how to achieve this?

    brinkingyellows
    Participant

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

    That’s about all the plugins that I have active that play a heavy part in Buddypress or are loosely connected to it.

    Justin
    Participant

    I am helping a nonprofit I support by building a site totally built on Buddypress: http://parishcollective.org/beta

    We are allowing users to create a profile with minimal information (via Social Login) but we want to keep the user role at ‘subscriber’ until they fill out the required profile fields. At that point, we need to be notified that they updated their info so an admin can check their info and up their role to ‘contributor.’ (It gives them access to creating blog posts and other things)

    Initially I started with something basic from this post: http://buddypress.org/support/topic/notification-on-profile-update-2/

    However, wp_mail() is conflicting with something in our site and causing a fatal error.

    So I’ve been attempting to add a user meta key (when a user updates their profile) that can be queried in the backend in a custom admin menu so the users with completed profiles can be displayed.

    Here was the adapted code based on the post above:

    
    
    function my_update_profile_mark() {
    $user_ID = get_current_user_id();
    $power_level = 9000;
    add_user_meta( $user_ID, '_level_of_power', $power_level);
    }
    add_action( ‘xprofile_updated_profile’, ‘my_update_profile_mark’ );
    
    

    If I understand the ‘xprofile_updated_profile’ hook correctly, it should just fire anytime any field is updated on a profile, right?

    From there I planned to experiment with something like this based on the Force Profile Update plugin to make the function fire when the profile is totally updated:

    function my_update_profile_mark() {
    
                            global $wpdb;
    
    			$bp_prefix = bp_core_get_table_prefix();
    			$xprofile_fields = $wpdb->get_results("SELECT count(*) AS empty_fields_count FROM {$bp_prefix}bp_xprofile_fields WHERE parent_id = 0 AND is_required = 1 AND id NOT IN (SELECT field_id FROM {$bp_prefix}bp_xprofile_data WHERE user_id = {$user_id} AND valueIS NOT NULL AND value` != '')");
    
    			foreach ($xprofile_fields as $field) 
    			{
    				if ($field->empty_fields_count > 0)	
    				{
                                      $user_ID = get_current_user_id();
                                      $power_level = 9000;
                                      add_user_meta( $user_ID, '_level_of_power', $power_level);
                                    }
    add_action( ‘xprofile_updated_profile’, ‘my_update_profile_mark’ );
    

    I’m a pretty new to programming and I don’t totally understand all the code here, but I’m trying hard to make something work here. Any ideas/guidance?

    I also realize this solution, even if it worked, would update the meta key ‘_level_of_power’ to the specified value “9000” every time the user updated their profile after their profiles were filled out. But that’s an annoyance we can live with for now. Not knowing the user is ready to be upgraded wouldn’t work at all for the site. Any help would be appreciated. 🙁

    Jeremy
    Participant

    Hi I am using WP 3.8 with the Thesis theme and Buddypress 1.91.

    Buddypress was working fine with the Thesis Theme on version 1.7-1.8 with the addition of the awesome theme compatability, but when I upgraded to 1.91 it no longer works.

    I get some output basically this:

    Jeremy Francis – Online Design Specialist”>Jeremy Francis – Online Design Specialist
    @jeremy active 2 seconds ago ActivityProfileSites 2Notifications 0Messages 0Friends 0Groups 0Settings PersonalMentionsFavoritesFriendsGroups Show: Everything Updates Posts Comments Friendships New Groups Group Memberships What’s new, Jeremy? Sorry, there was no activity found. Please try a different filter.

    But it is pure text inside a <p> tag and there are no links at all.

    Here is a link to my site: http://sendasites.com/members/jeremy/

    it is in development so there are no links on the site to the buddypress compnents but I use standard naming for the other pages, the other pages ie http://sendasites.com/register/ http://sendasites.com/user-groups/ http://sendasites.com/activity-2/ etc.

    I can confirm that it worked in version 1.8 I rolled back the plugin and everything worked just fine.

    #176416

    Team, 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 –>

    #176078
    arwenmckenzie
    Participant

    I’m trying to hide two tabs in the user profiles (notification and forums) using css with no such luck. Anybody out there having the solution for my problem?

    #176044
    Nate
    Participant

    Hi all,
    Just upgraded to the latest versions of WP, BP and bbP. When I click the thread link under “Notifications,” users receive the following error:

    
    Fatal error: Call to undefined function bp_core_mark_notifications_by_item_id() in /home/content/37/9672937/html/wp-content/plugins/bbpress/includes/extend/buddypress/notifications.php on line 140

    Any ideas?

    #175974
    Henry
    Member

    @macpresss

    Looks 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 ...
    }
    Shmoo
    Participant

    I’ve made a custom Notification Loop inside the header of my site that should of course only be visible for logged-in users + only the notifications-list of the current loggedin_user_id.

    This is what I made, first I check if user_is_logged in -> if TRUE start the has_notifications Loop of the user_id => loggedin_user_id.

    Everything seems to work fine but I’m not very convinced I did this the correct way.

    
    <?php if ( is_user_logged_in() ): ?>
    <?php if ( bp_has_notifications( array( 'user_id' => bp_loggedin_user_id() ) ) ): ?>
    
    ... here I've got the loop stuff ...
    
    <?php endif; ?>
    <?php endif; ?>
    
    #175916
    mauryg
    Participant

    I have the legacy forums set up on my site, http://barronsquare.org. I want to move up to bbPress. I especially want the “Follow this topic” notifications and reply ‘threading’.

    • Running WP v3.7.1, BP v1.9, Suffusion child theme with Suffusion BuddyPress Pack
    • ‘Public’ portion visible to users who are not members
    • ‘Private’ portion for members only.
    • “All Residents” GROUP with auto join for all MEMBERS with forums.
    • Several other smaller sub-groups with forums.
    • Forums are not public.

    Tried the upgrade to bbPress 2.2 (with Suffusion bbPress Pack) on my WAMP localserver version of site and had all kinds of problems migrating content, etc. Many of the data ‘repair’ functions failed. I could not get the ‘threaded replies to work. Eventually got the forums to mostly work, but still have questions.

    1. Would I be better with a ‘site-wide’ forum rather than the private All Residents group?
    2. Can I make a site-wide forum private?
    3. How do I modify the formatting of the forum postings?
    4. Where do I look to troubleshoot the ‘threading’ function?

    Happy Holidays to all.

    Maury

    airsid
    Participant

    Thanks @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.patch​

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

    #175570
    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_user or my_core_get_notifications_for_user

    Saves conflicts from happening 🙂

    #175554
    Rocio Valdivia
    Participant

    Hi guys! I have a WP 3.7.1 and BP 1.8.1 and I have created the following function in my functions.php to retrieve the number of notifications of the current user. The function has one parametrer $type_notification that can be: ‘new_message’, ‘group_invite’ or ‘friendship_request’.

    The function works quite well, but the point is that with that function in functions.php, the BP ajax doesn’t work. For example: the search box in members or the members list pagination. If I delete this function from functions.php, the members pagination, etc. works fine again.

    Does anyone know why is this happening? or an alternative function that I can use for this porpouse that doens’t break the ajax?

    Thanks in advance! 🙂

    Rocío Valdivia

    /**
     * Get notifications for a specific user
     */
    function buddyboss_childtheme_core_get_notifications_for_user( $type_notification ) {
    	global $bp;
    	
    	$user_id = $bp->loggedin_user->id;
    
    	$notifications         = BP_Core_Notification::get_all_for_user( $user_id );
    	$grouped_notifications = array(); // Notification groups
    	$renderable            = array(); // Renderable notifications
    
    	// Group notifications by component and component_action and provide totals
    	for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) {
    		$notification = $notifications[$i];
    		$grouped_notifications[$notification->component_name][$notification->component_action][] = $notification;
    	}
    	
    	if($type_notification == 'new_message'):
    		$number_notifications = count($grouped_notifications['messages']['new_message']);
    	elseif($type_notification == 'group_invite'):
    		$number_notifications = count($grouped_notifications['groups']['group_invite']);
    	elseif($type_notification == 'friendship_request'):
    		$number_notifications = count($grouped_notifications['friends']['friendship_request']);
    	endif;
    
    	return $number_notifications;
    }
    
    #175341
    modemlooper
    Moderator

    You 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>';
            }
    
        } 
    ?>
    Cassey’s Designs
    Participant

    Hiyya,

    Firstly.. My Info :
    WordPress Version 3.7.1
    BuddyPress Version 1.8.1
    Site : duffitness.com/coachportal/ – this site is private and only accessible by registered coaches, however I have attached an image of the title I am referring to.

    Okay, so I can activate new accounts with Google Chrome, Firefox, Opera and Safari but IE(8) redirects to login without activating…
    I can have users go to the activate page and enter the activation key but that is not very user friendly.
    I do receive this message when other browsers activate, but they do still activate the account…
    “Warning: unserialize() expects parameter 1 to be string, array given in /”mysitedirectory removed for privacy”/wp-content/plugins/buddypress-notifications-manager/loader.php on line 77”
    I did locate the source of this warning and I have attached a screenshot of the code…

    warning message

    However, Upon disabling the notifications manager plugin I found that this is not the source of the problem. I now get no errors with any of the other browsers but IE redirects to log in without completing the activation process when a user clicks the link from their email and then returns the error…
    “ERROR: Your account has not been activated. Check your email for the activation link.”
    …when attempting to log in.

    Thanks for any insight into this problem… (Go figure it’d be IE that decides to be difficult, lol)
    Cassey

    #174932
    Andrea Fercia
    Participant

    hi @jigesh
    yes you’re right also @nacin says in his post “You should instead the query 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
    Andrea

    #174704
    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>

Viewing 25 results - 576 through 600 (of 1,091 total)
Skip to toolbar