Friends 1.x

Legacy documentation for Friends 1.x.

The Friends:Status function displays the status(es) a given member has submitted for their profile, similar to the way Facebook's status feature works. Additionally, you can use this function to display a list of all friends' statuses, excluding private status updates from non-reciprocal friends.

{exp:friends:status} content {/exp:friends:status}

Parameters

The following parameters are available for use:

dynamic=

dynamic="off"

This parameter is available to stop the loop from looking into the URI for an ID of any type.

limit=

limit="10"

This parameter allows you to set a limit of the amount of status history you'd like to show up for a given member. The default is 10.

member_id=

member_id="{segment_3}"

This parameter allows you to view status(es) for a specific member by specifying their member ID. You can hardcode a member ID, pass it through an embed, grab it from the URI, or specify CURRENT_USER to display the status of the currently logged in user. If neither this or the username parameter is specified, the Status loop will display a list of statuses for the currently logged in users' reciprocal friends.

offset=

offset="1"

This parameter allows you to skip the first specified amount of statuses from displaying. You would typically use this parameter if you'd like to display a list of all status history, but exclude the most current one from the list.

paginate=

paginate="both"

This parameter allows you to control where the pagination will display. Options are top, bottom, or both. Used in conjunction with the friends_paginate variable pair.

username=

username="{segment_3}"

This parameter allows you to view status(es) for a specific member by specifying their username. You can hardcode a username, pass it through an embed, grab it from the URI, or specify CURRENT_USER to display the status of the currently logged in user. If neither this or the 'member_id parameter is specified, the Status loop will display a list of statuses for the currently logged in users' reciprocal friends.

Variables

All standard and custom member fields and usual Friends variables are available for use here. Additionally, these exist as well:

friends_count

{friends_count}

This variable outputs the display order number for each result in the list of statuses.

friends_status

{friends_status}

This variable will output status(es) a given member has submitted.

friends_status_date

{friends_status_date format="%F %j, %Y"}

This variable displays the date the member submitted a given status.

friends_switch

{friends_switch="one|two"}

This variable allows you to switch a CSS class back and forth for all outputed results.

friends_total_results

{friends_total_results}

This variable outputs the total amount of results outputted in your list.

Variable Pairs

The following variable pairs are available for use:

friends_paginate

{friends_paginate}
    Page {friends_current_page} of {friends_total_pages} pages
    {friends_pagination_links}
{/friends_paginate}

Pagination is available for this tag and works just like regular pagination, but each variable is prepended with friends_. Used in conjunction with the paginate parameter.

Conditionals

The following conditionals are available for use:

if friends_no_results

{if friends_no_results}
    Sorry, no results were found.
{/if} `

This conditional evaluates to true and displays it's contents when there are no results found for this tag.

Examples

Displaying Current and Previous Statuses for a given User

The following example will display the current status of a member as well as a list of all previous 10 statuses in the history, assuming the Member ID is in the 3rd segment of the URI:

<ul>
{exp:friends:status
    member_id="{segment_3}"
    limit="1"
}
    <li class="large">
        {friends_screen_name} {friends_status}
    </li>
{/exp:friends:status}
</ul>

<h3>Previous Statuses:</h3>
<ul>
{exp:friends:status
    member_id="{segment_3}"
    offset="1"
    limit="10"
}
    <li class="{friends_switch="one|two"}">
        {friends_screen_name} {friends_status}
        ({friends_status_date format="%F %j, %Y"})
    </li>
{/exp:friends:status}
</ul>

Displaying a List of All Friends Statuses

The following example will display a list of the statuses from all friends for the currently logged in user (excluding private status updates from non-reciprocal friends):

<h3>All Friends’ Statuses:</h3>

<ul>
{exp:friends:status
    limit="25"
}
    <li class="{friends_switch="one|two"}">
        {friends_screen_name}: {friends_status}
        ({friends_status_date format="%F %j, %Y"})
    </li>
{/exp:friends:status}
</ul>