Buddies

This module enables users to have buddies/friends/followers just like in many popular social networks and blogging systems.

The users are able to add/remove others as their friends. The lists of friends added by user and also who added him can be displayed.

Also, you can have “enemies” along with friends - for fun or for something useful.

The module is using standard database table, so it’s 100% compatible with Buddies/Blocked list that can be found under Personal messages in user’s Control Panel.

Tags

{exp:buddies:add}

{exp:buddies:add subject_id="{segment_3}" object_id="{segment_4}" type="buddy" report="full"} Add a member as buddy of another member (follow someone).

subject_id (required) - member_id of user who wants to add a buddy (follow someone). Can use {logged_in_member_id}.
object_id (required) - member_id of the user to be added as buddy (followed). Can use {logged_in_member_id}.
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead
return_type (optional) - type of message returned when add is complete. Can be string (default) or bool (true or false). This parameter has power only if 'report' is set to 'short'
report (optional) - defines the way to show success or error messages. Possible values: full(using system message template), short (display only message text) or off (no message shown)

{exp:buddies:remove}

{exp:buddies:remove subject_id="{segment_3}" object_id="{segment_4}" type="buddy" report="full"} Remove a member from buddies of another member (stop following).

subject_id (required) - member_id of user who wants to remove a buddy (stop following someone). Can use {logged_in_member_id}.
object_id (required) - member_id of the user to be remove as buddy (unfollowed). Can use {logged_in_member_id}.
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead
return_type (optional) - type of message returned when add is complete. Can be string (default) or bool (true or false). This parameter has power only if 'report' is set to 'short'
report (optional) - defines the way to show success or error messages. Possible values: full(using system message template), short (display only message text) or off (no message shown)

{exp:buddies:check}

{exp:buddies:check subject_id="{segment_3}" object_id="{segment_4}"}
Member {segment_3} is not following {segment_4}
{if no_results}
Member {segment_3} is following {segment_4}
{/if}
{/exp:buddies:check}
Check whether check whether user subject_id has added as a buddy (or following) user object_id.
Does not return any variables, but the code inside is displayed only if the object member IS NOT buddy of subject.

subject_id (required) - 'active' member_id (who acted). Can use {logged_in_member_id}.
object_id (required) - 'passive' member_id (on whom was action). Can use {logged_in_member_id}.
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead

{exp:buddies:check_reverse}

{exp:buddies:check_reverse subject_id="{segment_3}" object_id="{segment_4}"}
Member {segment_3} is not followed by {segment_4}
{if no_results}
Member {segment_3} followed by {segment_4}
{/if}
{/exp:buddies:check}
Check whether check whether user subject_id has been added as a buddy (or followed) by user object_id.
Does not return any variables, but the code inside is displayed only if the subject member IS NOT buddy of object.

subject_id (required) - 'active' member_id (who acted). Can use {logged_in_member_id}.
object_id (required) - 'passive' member_id (on whom was action). Can use {logged_in_member_id}.
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead

{exp:buddies:total}

{exp:buddies:total subject_id="{segment_3}" type="buddy" report="full"} Show total number of buddies added by user (that he's following)

subject_id (required) - member_id of user who has budies
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead
report (optional) - defines the way to show error messages (applies to errors only). Possible values: full(using system message template), short (display only message text) or off (no message shown)

Variables returned:
{count} - number of buddies/followers
{buddy_count} - synonym for above

{exp:buddies:total_reverse}

{exp:buddies:total_reverse subject_id="{segment_3}" type="buddy" report="full"} Show total number of people who added user as buddy (followers)

subject_id (required) - member_id of user who has been added as buddy
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead
report (optional) - defines the way to show error messages (applies to errors only). Possible values: full(using system message template), short (display only message text) or off (no message shown)

Variables returned:
{count} - number of buddies/followings
{buddy_count} - synonym for above

{exp:buddies:display}

{exp:buddies:display subject_id="{segment_3}" limit="20" type="buddy" report="full"}
{username}
{screen_name}
{buddy_avatar_filename}
... any other member data
{/exp:buddies:display}
Display the list of buddies added by user (the ones he's following)

subject_id (required) - member_id of user who has budies
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead
limit (optional) - Number of buddy members to display. Shows all by default.
report (optional) - defines the way to show error messages (applies to errors only). Possible values: full(using system message template), short (display only message text) or off (no message shown)

Variables returned:
All standard and custom member profile fields
Alternative syntax - all standard and custom member profile fields prefixed with buddy_ ({buddy_member_id}, {buddy_custom_field_name} etc.)

{exp:buddies:display_reverse}

{exp:buddies:display_reverse subject_id="{segment_3}" limit="20" type="buddy" report="full"}
{username}
{screen_name}
{buddy_avatar_filename}
... any other member data
{/exp:buddies:display_reverse}
Display the list of members who added user as buddy (his followers)

subject_id (required) - member_id of user who has budies
type (optional) - Defaults to ‘buddy’ but you can set it to ‘blocked’ to work with blocked members instead
limit (optional) - Number of buddy members to display. Shows all by default.
report (optional) - defines the way to show error messages (applies to errors only). Possible values: full(using system message template), short (display only message text) or off (no message shown)

Variables returned:
All standard and custom member profile fields
Alternative syntax - all standard and custom member profile fields prefixed with buddy_ ({buddy_member_id}, {buddy_custom_field_name} etc.)

Changelog

Top of page