Jump to content

How to get followers and following members


Go to solution Solved by ReyDev,

Recommended Posts

46 minutes ago, Adriano Faria said:

you can probably try: $member-> followers().

thanks a lot , works for followers. what about the following, i also want to fetch the members who follow a specific member. I took a look at `\IPS\Member` class and found this method. 

public function following( $app, $area, $id )
	{
		//
	}

I have no idea if it works for the following members or not.

Link to comment
Share on other sites

	/**
	 * Following
	 *
	 * @param	string	$app	Application key
	 * @param	string	$area	Area
	 * @param	int		$id		Item ID
	 * @return	bool
	 */

this method just returns a bool value. checks if a member follow the current member or not. I didn't find other method that returns the following members list!!

Link to comment
Share on other sites

  • Solution
14 minutes ago, Adriano Faria said:

Then make a query!

I did!
 

for followers :

\IPS\Db::i()->select( 'follow_member_id', 'core_follow', [ 'follow_app=? AND follow_area=? AND follow_rel_id=?', 'core', 'member', \IPS\Member::loggedIn()->member_id ] )


for following :

\IPS\Db::i()->select( 'follow_rel_id', 'core_follow', [ 'follow_app=? AND follow_area=? AND follow_member_id=?', 'core', 'member', \IPS\Member::loggedIn()->member_id ] )


 maybe helps someone!

Edited by ReyDev
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...