Get the number of followers and following in user relationship I have created a relationship Followers which can be reciprocated using the user relationship module. Now user A's relationship is something like:
Followers(Them to you):  User B, User C, User D
Followers(You to them): User D

Now i want to create a view which only shows the number of followers and following:
Follower: 3
Following: 1

I went about to create the view (Views 3, Drupal7) but was not able to do. Didnt get any filters or relationships regarding this. Also, tried using the Views Cal but am not clear. Would appreciate any help.

Thanks 

Edit:

Apologies for not being clear.

I created a view of type Users. Then i added a relationship (this is the part where i am not sure if i am correct or not). I tried with all the available relationships pertaining to this such as User relationships: 

 User relationships: Requestee user
 User relationships: Requestee user is current user 
 User relationships: Requester user
 User relationships: Requester user is current user
 User relationships: RTID


(i tried individually all of them and various combinations of them as well)

Then under Others i clicked yes for Use Aggregates and when asked for the grouping function ("Group type"), i selected "Count and unchecked the label in the configure field screen, so that it only shows the number.

I also added a filter that the user is logged in. However, it just shows me the number of relationships of different users who have requested the current one.

Edit 2:

Found this thread: http://drupal.org/node/809476. However its for Drupal 6..., am trying to implement it for 7. lets see...if you have any pointers i would be grateful...will keep you posted

Edit 3:

Based on the above thread i wrote the following code into a custom block.

&lt;?php
global $user;
$user_id = $user-&gt;uid;
$params = array("requestee_id" =&gt; $user_id, 'rtid' =&gt; 3);
$count = user_relationships_load($params, array("count" =&gt; TRUE));
echo $user_id;
echo $count;
?&gt;


I just printed out the user id to check if correct user or not and it prints the correct user. However, count prints 0. Why is that? 

Edit 4: 

I think i am on the right way using http://drupal.org/node/203396. However there are some fixes there. The correct code is: 

&lt;?php
global $user;
$requests = user_relationships_load($param = array("approved" =&gt; 1, "user" =&gt; $user-&gt;uid), $options = array(), $reset = FALSE);
$requestcount = count($requests);
echo  $requestcount;
?&gt;


This displays the total number of approved relationships. Now i want only the followers type relationship number. Looking into that. If anyone has any suggestions would appreciate them. Will keep you all posted

Edit5:  

And now i am stuck. Whatever i try to do i am only getting the total number of relationships. I just want the number of followers(them to you) in one block and then using that, i hope, i will be able to get number of following(you to them). Would appreciate any help.

Thanks
The following function works for me to display the count of friends a user have:

function mymodule_user_friends_count ($user) {
  $count = user_relationships_load(
    array("user" =&gt; $user-&gt;uid, 'approved' =&gt; 1, "name"=&gt;'Friend'), 
    array('count' =&gt; TRUE));
  return $count;
}


Notice I only count approved friends and only relationships of type 'Friend'