Skip to:
Content
Pages
Categories
Search
Top
Bottom

Activity Favorite Notification

  • Avatar of Fanoop
    Keith Kelly
    Participant

    @fanoop

    I was hoping there is a way to send a user a notification email (and show in the notifications bar) when a user favorites a an activity or activity comment.

    I searched the web, but was unable to find any documentation on this. I am looking to use the favorite just as Facebook would use a “like”.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Avatar of Fanoop
    Keith Kelly
    Participant

    @fanoop

    Any feedback?

    Avatar of transmission
    transmission
    Participant

    @transmission

    I am also interested in this if anyone has any ideas? As I understand it at the moment marking something as favorite just adds it to a list on your profile?

    Avatar of artifex223
    artifex223
    Participant

    @artifex223

    Yeah, Favorites is more of a personal bookmarking sort of feature. I believe there are plugins available that will replicate the Facebook “Like” functionality, although I haven’t used any of them myself.

    Avatar of Fanoop
    Keith Kelly
    Participant

    @fanoop

    I did check out some of the “like” plugins, but most of them hadn’t been maintained or didn’t work properly. I was hoping to tailor a core feature to work in a similar, simple way. So far I think what I have done works great, but just need to incorporate notifications.

    I still think that it wold be useful if a user was notified when someone favorited their activity.

    Avatar of godavid33
    godavid33
    Participant

    @godavid33

    I know this is a very old thread, but here’s some useful code for solving this problem (put it in functions.php) in case someone else stumbles upon it

    
    add_action("bp_activity_add_user_favorite","favorite_notification", 10, 2);
    
    function favorite_notification( $activity_id, $user_id = 0){
    
    	$activities = bp_activity_get_specific( array( 'activity_ids' => $activity_id) );
    
    	bp_core_add_notification( $activity_id, $activities["activities"][0]->user_id, "notifier", "<a href='".get_site_url()."/activity/p/$activity_id'>New Like!</a>" ) ;
    }
    
    Avatar of kurtye
    kurtye
    Participant

    @kurtye

    @godavid33 where i use this code? bp-functions?

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.