How to Show Followers and Followed?

3 years 4 months ago #321596 by Aless76
How to Show Followers and Followed? was created by Aless76
Dear Joomlaolis staff,

I configured connections with "NO mutual consent" and "NO cross connection".

In this way every user can be "followed" and can "follow" someone else.

Now I'm trying to show separately in a module (with CB Content module) both the number of "followed users" and the number of "followers".

Using the formula:

[cb:userdata field="connections" user="#displayedOrMe" /]

I manage to show "followed" users, but I don't know how to show the "followers" of a specific user.

I tried to use the field "follow" but it doesn't work (I didn't find any tutorial about it).

So the question is: Is there any way to count and show the followers of a specific user?

Can you help me? Thanks in advance!

Aless76

Please Log in to join the conversation.

3 years 4 months ago #321603 by krileon
Replied by krileon on topic How to Show Followers and Followed?
The connections field only shows the number of users you are directly connected to. To see how many are directly connected to you (so the other way around) you'll need to use CB Query Field to query for that information. Example as follows.

Query:
SELECT COUNT(*) FROM `#__comprofiler_members` WHERE `memberid` = '[user_id]'
Output: Single Row
Columns: Single Column

In the _comprofiler_members database table memberid is the user referenceid is connected to.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.175 seconds

Facebook Twitter LinkedIn