Hit a block here… how do I hook into the function where a user clicks on the favourite button, and make that do something to the database? Using bp_activity_action_mark_favorite? bp_activity_add_user_favorite?

Tried them both, with no results… I know I’m doing something wrong here, but my knowledge of PHP/mySQL is mostly trial and error… (a lot of the latter)

@ousep — I don’t have a bp-custom.php file (WPMU? I’m using single-user WP), but I put your function in my child theme functions.php file, and it did something, though it didn’t quite work.

It did not output a count of favorites next to the Favorites button in the Profile sub-nav bar (oddly, such a favorite count does is being displayed in the site-wide Activity stream navigation, however), which is what it should do, but it did output either a “(1)” or a “(2)” just to the right of the “Remove Favorite” button in each of the Favorites listed in Profile –> Activity (Personal) and Profile –> Activity — Favorites. It also posted a “(1)” or a “(2)” just to the right of the “Remove Favorite” button in Activity –> All Members and Activity — Favorites.

Ok, I get it. I added “favorites” to your code, so now it displays “(2) favorites” instead of just “(2)”, to give it a little more meaning for users. Any way to add a conditional line to your function so that if there is one favorite, it will display “(1) favorite” (singular) and if there are two or more, it will display “(x) favorites” (plural)? If this is too nitpicky, or if the favorites plugin in development supercedes all of this, then no worries, I can live without it.

The other “Favorites” display issue I’m trying to solve is to get the Profile sub-nave to display the Favorites count like it does in the activity stream. Right now, they differ in their displays, like this:

I’ve been sidetracked by a couple of other things that needed my attention, so I haven’t been able to make it do what I’d really like it to do, ie: show the number within the favorite link, like it shows in the reply link:

[Reply (12)] [Favorite (23)].

For consistency.

And the other issue of updating the number on clicking the link.

And, showing the users who’ve favourited the activity.

About the other issue, I’ve been trying to find the source of those links, too… Not much luck with that, yet.

@ousep: Thanks for all your work on this, I really appreciate it. The new tweak works great, but if you ever get around to getting the count inline — [Favorite (23)] — I’ll be looking forward to it here.