This topic has 87 replies, 16 voices, and was last updated 9 years by Kieran.

  • Author

    Tagged: 

  • #14789
     JoYagusa
    Participant

    ok man thanks for the reply 🙂

    #14956
     rudik2
    Participant

    Sharmstr good job!
    I have one question. How to add before number with notification some text for example “notification”??
    Please look in my project: http://s27.postimg.org/a9p08f2ub/Bez_nazwy_7.jpg

    Regards,
    Tomasz

    #14958
     Kieran
    Participant

    You can add any text you wish before the li opens.

    Example

    return $items."MYTEXTHERE<li id='menu-bp-notifications' class='menupop'>

    #14959
     rudik2
    Participant

    THX. I see one problem. When i logout i see “number” notifications still in menu.
    How to fix it?

    #14963
     Kieran
    Participant

    I found that issue too, but a quick get around for me was just to wrap it in a if logged in

    if ( is_user_logged_in() ) { CODE_FOR_NOTIFICATIONS_HERE }

    #14965
     rudik2
    Participant

    When i wrote before <li, text is after “number” and only in number i can “click”. Text is not active. I would like to text will be befor number and active button.
    Sorry for my enlish.

    #14968
     Kieran
    Participant

    You can add it before the span then which will make it clickable (you’ll probably need a space at the end of the word too)

    #14970
     rudik2
    Participant

    Wow, working great! Thank You! One more question. How to edit number backgrund color when is 0 notification?

    #14972
     rudik2
    Participant

    Sorry for my english. Where i can edit background color (number) when is 0 notification?

    #14973
     Kieran
    Participant

    You can play around with this CSS, first is for state without anything (so, 0) and second is for state with notifications (1 +)

    #ab-pending-notifications {
    background: none repeat scroll 0 0 #ddd;
    border-radius: 10px;
    color: #FFFFFF;
    display: inline;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    text-shadow: none;
    }

    #ab-pending-notifications.alert {
    background-color: #1FB3DD;
    color: #FFFFFF;
    }

    #15556
     derekmelo
    Participant

    Hello guys, it worked very well here too, but how can I add the notification dropdown?

    Thanks guys!

    #15566
     Boblebad
    Participant

    Will this work with the Sweet Date theme as well ?

    #15567
     sharmstr
    Moderator

    @derekmelo You’d have to modify the code to loop through the notifications and echo out the “li”s for each.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #15580
     mckown
    Participant

    Here’s an update:
    Includes the word “Messages” before the bubble
    Displays just in top nav menu and for logged in users only (if you want to switch to the other menu change ‘top’ to ‘primary’

    COPY CODE
    
    add_filter('wp_nav_menu_items','add_notification_to_custom_menu', 2, 2);
    
    function add_notification_to_custom_menu( $items, $args ) {
    if ( is_user_logged_in() ) {
    if( $args->theme_location == 'top' ){
    	$notifications = bp_notifications_get_notifications_for_user( bp_loggedin_user_id() );
    	$count         = ! empty( $notifications ) ? count( $notifications ) : 0;
    	if ($count > 0 ) {
    		$alert = 'alert';
    		$pending = 'pending-count';
    	} else {
    		$alert = 'no-alert';
    		$pending = 'count';
    	}
    	return $items."<li id='menu-bp-notifications' class='menu pop'><a href='".bp_loggedin_user_domain()."notifications/'>Messages <span id='ab-pending-notifications' class='" . $pending . " " . $alert . "'>".$count."</a></li>";
    }
    }
    	return $items;
    
    }
    
    #15581
     mckown
    Participant

    still one glitch I can see .. Everything looks great in Safari but Chrome & IE are having trouble. They’re displaying the Site Title in the Nav … once the notifications are read though it goes away .. how I have no clue

    update .. and 30 seconds later it stopped doing it without me changing a single line of code .. God I hate technology LOL

    #15634
     catholicauthor
    Participant

    Hi, seems like a great addition! I tried adding to to my child functions.php, and Dreamweaver says there’s some error on line 16 (?), starting on this line ‘return $items. “<li…’

    It’s thrown me a 500; any further recommendations? I have BuddyPress Live Notification installed. Should that snippet, when added to functions.php automatically insert something in the menu?

    #15643
     sharmstr
    Moderator

    need more detail. ‘some error’ doesn’t tell us very much 🙂

    I have it working with Live Notification, but had to hack it to get it to work. Live Notification updates it in the Admin bar.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #15655
     mckown
    Participant

    the closing li is getting stripped out of the code I posted above for some reason .. just close the li on line 15 above

    #15722
     catholicauthor
    Participant

    seems to work great!

    #15736
     mckown
    Participant

    Glitch … Log in as a non-admin user on either Chrome or IE .. the styling gets thrown off if the bubble is in the top menu and the website title is printed in the menu regardless of where the notification bubble is set to.

    You will not see this glitch if you’re logged into your site as an admin … Any ideas???

    #15748
     designing
    Participant

    Hi Guys,

    I thought this was a nice little addition to the theme. So I’ve added the code followed all your instructions. Now I’m getting a complete white blank screen. Any ideas 🙂

    ThanX

    #15752
     sharmstr
    Moderator

    @mckown. I’m not having that issue. Works fine for me in all browsers and all levels of users, logged-in or not.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #15758
     sharmstr
    Moderator

    @designing It could be any number of things, but usually has something to do with either not copying the entire code OR when you copied it it put in backticks instead of single quotes.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #15762
     designing
    Participant

    Hi Sharmstr,

    Really appreciate your reply. I had to deleted the child theme to get back which wasn’t a problem, and tried it again but got the same result 🙁 So I think I better wait until the release it on a new update.

    Thanks for you help though

    Cheers

    #15929
     catholicauthor
    Participant

    Hey guys, it’s working fine, but it’s displaying to logged out users with the last notification count. Thoughts?
    http://catholicauthor.startlogic.com/journal/members/dan/

    #15930
     sharmstr
    Moderator

    You need to wrap it in a is_user_logged_in conditional check

    COPY CODE
    
    if ( is_user_logged_in() ) { CODE_FOR_NOTIFICATIONS_HERE }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #15931
     catholicauthor
    Participant

    Fantastic. Thanks!

    #15989
     Splendor
    Participant

    Hi,

    Have you updated your pastebin with all the wrap ups and so on? So i don’t take one that doesn’t work correctly..

    #15999

    Awesome idea guys, looks great. Any chance someone could help me remove the notifications from the top menu, but keep in the main menu?

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #16001

    Awesome idea guys, looks great. Any chance someone could help me remove the notifications from the top menu, but keep in the main menu?

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #16007
     Splendor
    Participant

    You have tested it now, it works fine?

    #16035

    I can get it to populate in both the top nav and main nav, but would like to remove from the main nav. Other than that, implementing and styling is very straight forward.

    #21732
     Abe
    Keymaster

    Hi guys and girls
    We implemented this functionality and it will be available in next theme version. Current version is 1.5
    I attached 2 previews, one from admin – Appearance – menus and one from the front-end

    Big thanks to @sharmstr and you other contributors

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #21735
     Abe
    Keymaster

    We are working on a live update feature right now that it will auto-refresh the count in the menu.
    Will keep you posted.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #21876
     Abe
    Keymaster

    Wohoo. We added live AJAX notifications and some other features. Check out the attach. It will be available in 1.6 coming around 15th July

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #21887
     Splendor
    Participant

    Nice stuff! 🙂

    #22339
     sandervm86
    Participant

    Very nice can’t wait till 15 th July!

    #22777
     Kieran
    Participant

    Eeee I’m chomping at the bit here – any news on 1.6 release date?

    #23011
     Abe
    Keymaster

    Sorry for the delay, coming on Tuesday

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #23551

    Is anyone else getting some funky header alignment with the new update?

    Attachments:
    You must be logged in to view attached files.
Viewing 40 posts - 41 through 80 (of 88 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?