Skip to:
Content

BuddyPress.org

Opened 14 years ago

Closed 8 years ago

#1427 closed enhancement

followers

Reported by: erich73's profile erich73 Owned by:
Milestone: Priority: major
Severity: normal Version:
Component: Friends Keywords:
Cc:

Description

why not make a feature like "followers" ?
Similar to Twitter....

Change History (7)

#1 @erich73
14 years ago

you might also want to check:

http://www.netvibes.com

#2 @johnjamesjacoby
14 years ago

Friends may evolve into something similar to this in the future, or it may be a new feature all together to integrate itself into the member lists idea.

#3 @benfremer
14 years ago

  • Owner set to benfremer
  • Status changed from new to assigned

Grabbing my first ticket. Woohoo! :)

I think I can do this in about 20 lines of a code and 3-5 copy/pastes.

Planning to make an admin option that lets people reversibly switch the relationship system from friends to followers and/or back again without altering the database schema, by changing the wording in some places from "friends" to "followers" / "following", by changing the friend requests section to "follow back" instead of "accept", and something like "not now" instead of "reject", and then using the friends table queries without requiring confirmation when returning the friends_ids to get activities from.

If people are following eachother, they are still counted as friends so far as the other dependent logic (groups and private messaging) goes.

Also planning to allow the admin section to select to show "just friends" "friends and/or following" or "just following" for the activity feeds to show.

#4 @benfremer
14 years ago

  • Owner benfremer deleted

Here is the psuedocode that should make it take like 1-2 hours to implement if you know your way around, or like 1 hour or less if you're Andy...I'm also going to un-assign this from myself as I'm waiting until the 1.2 final release before I dive into the latest code base.

Here is the pseudocode:

By changing the function get_friend_user_ids in buddypress/bp-friends/bp-friends-classes.php to not require is_confirmed on the friends check query, we can instead get a list of who the user is following. This function is called by the various feeds to pull up the activity of who your friends are. Changing it this way would pull up the activity of who you are following (whether or not they have followed / friended you back). There is also apparently a wrapper function of this in buddypress/bp-friends.php that might need to get tweaked.

An example setup would be to change it from

function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false )
to
function get_friend_user_ids( $user_id, $friend_requests_only = false, $followers_only = false, $following_only = false, $assoc_arr = false )

The "Follow" (previously "Add as Friend") button SQL logic would need to be updated so that if the person declined to follow back before, that it checks if the person is following them and updates that row that the friendship is now confirmed, rather than making another friend / follow request. It should also probably send the "SoAndSo is following you" notification / email that I don't think happens currently if friend requests are just accepted rather than initiated. Alternatively, that email notification and Request creation (in the friends panel) could be turned off if "Followers" system is turned on.

Turning the system to Following instead of Friending can be set in the admin with an option. People who follow eachother would be counted as friends.

Having an option to show Friends and/or following and/or possibly also followers feeds I think would be the ideal implementation for optionality.

Friend Request buttons would need their text optionally output different. On the requests page, the button text would change to "Follow Back" instead of "Accept", and "Not Now" instead of "Decline".

The additional feeds are just copies of the Friend activity feeds, with a different function parameter called on get_friend_user_ids depending on if it is wanting to get a list of id's the person following or followers.

Some terminology would also need to be changed in a few places (if you look for where it says "friends" for instance...etc. Also, I would like to see an option that shows "Followers" as well as who the person is "Following" where there are currently friends lists instead. Also, obviously, the tab name for those feeds would change from "My Friends", to "Following" and/or "Followers".

This doesnt' affect the table schema at all. If the followers system is switched back to a friending system, it goes back to a friends system, with people who were following eachother are back to being set as friends.

This no-tables-changing setup is also nice also because it keeps the "is_friends" function working just fine for various checks BP, like private messaging and group invitations.

#5 @benfremer
14 years ago

Sorry on some typos in there. I wrote it kind of fast, but I think it can be made sense of. If you have questions on what the sentences with missing words really should mean, please just let me know here, and I can clarify.

#6 @cnorris23
13 years ago

  • Component set to Friends
  • Keywords dev-feedback added

Is it time to start thinking about folding the followers plugin into core?

#7 @johnjamesjacoby
8 years ago

  • Keywords dev-feedback removed
  • Milestone Future Release deleted
  • Severity set to normal
  • Status changed from assigned to closed

Let's do this. Closing this to move discussion to #7133.

Note: See TracTickets for help on using tickets.