WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Follow
Notification Issue (5 posts)

  1. anindyaray
    Member
    Posted 3 years ago #

      I'm Using:
      WP 3.0.1
      BP 1.2.5.2
      BuddyPress Followers 1.0

    now lets come to the point ... there is an issue with notification system, and I have found the same in Buddypress.org too ...

    Suppose there are two person ; Person A and Person B

    Person B wants to follow Person A , hence click on follow , a notification is sent to Person A , that somebody is following Person A ...

    In the mean time Person A is not logged in to buddypress so didn't got the notification .... but in this due course Person B has stopped following Person A ....

    Thing should happen is the notofication to Person A become null and void and should be shown in Person A's Profile....

    What happening is ! Person A is still getting the notification and as there is nobody following Person A , the

      notification stays for ever and naggs the user

    ...

    This is a very good plugin and I think only this

      notification issue is becoming an obstacle to use it in live buddypress website

    Hope a solution canbe found very soon.
    Many many Thanks to the developer ...

    .

  2. anindyaray
    Member
    Posted 3 years ago #

    and also after un-installing the plugin , database entries are not getting deleted

  3. haxxxton
    Member
    Posted 3 years ago #

    sorry to revive an old thread,

    but has anyone found a solution to this?

    I think the key lies in doing a $wpdb-> call and delete the notification when Person A clicks the unfollow link,

    however finding where the function that handles the link is proving to be extremely difficult.

    It appears AJAX loads some of the follow data in bp-follow.js, but given this is javascript it isnt very helpful for implementing a PHP call

    the URL link that actions the unfollow is of the format:
    http://MYDOMAIN.com/members/PERSON-B/followers/stop/?_wpnonce=d709dd4867

    any help with this would be great

  4. haxxxton
    Member
    Posted 3 years ago #

    I just managed to fix this issue :D HUZZAH!!

    you just have to add some code to bp-follow.php

    find the function called bp_follow_stop_following.. for me it is near line 495.

    add the following line

    unnotify();

    above the line

    do_action( 'bp_follow_stop_following', &$follow );

    then paste the following under the bp_follow_stop_following function

    function unnotify(){
    	global $bp;
    	global $wpdb;
    	$user_id = $bp->displayed_user->id;
    	$item_id = $bp->loggedin_user->id;
    	$notification = $wpdb->get_col("SELECT id FROM <code>wp_bp_notifications</code> WHERE component_name='follow' AND item_id='".$item_id."' AND user_id ='".$user_id."'");
    	if($notification[0] == ""){
    
    	}else{
    		$wpdb->query( $wpdb->prepare("DELETE FROM <code>wp_bp_notifications</code> WHERE id = '".$notification[0]."'"));
    	}	
    
    	bp_core_redirect( wp_get_referer() );
    }

    This now removes unread notifications about that follow from the followee when the user unfollows him..

    haxxxton (to the rescue)

  5. imwarrior
    Member
    Posted 3 years ago #

    sorry to go bit off topic.. is there a way apart from following user i can add follow to my post tags or categories..so that whenever a post in added in say tag xyz user get a notfication or activity in his profile..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic