Friends 1.x

Legacy documentation for Friends 1.x.

The Friends:Status_Delete function allows users to permanently delete one of their statuses. Simply link with the status ID in the URI to the template with the Friends:Status_Delete function code in it, or submit a POST form.

{exp:friends:status_delete} content {/exp:friends:status_delete}

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 a status ID.

status_id=

status_id="{segment_3}"

The Friends:Status_Delete loop automatically grabs the status ID from the URI, but this parameter is available to use, should you be doing something advanced.

Variables

The following variables are available for use:

friends_message

{friends_message}

This variable will output the success message or any errors upon loading the Friends:Status_Delete template.

Conditionals

The following conditionals are available for use:

failure

{if failure}
    Error!
{/if}

This conditional shows its contents if the request action DOES NOT execute successfully.

success

{if success}
    Successful!
{/if}

This conditional shows its contents if the request action executes successfully.

Examples

The following code should be a complete example for using this function:

{exp:friends:status_delete}

    {if success}
        <h3>Successful!</h3>
    {/if}
    {if failure}
        <h3>Error!</h3>
    {/if}

    <p>{friends_message}</p>

{/exp:friends:status_delete}

Setup

To implement this feature into a template, your code would look something like this:

<h3>Your Statuses</h3>

<ul>
{exp:friends:status
    member_id="CURRENT_USER"
    limit="5"
}
    <li>
        {friends_status} (on {friends_status_date format="%F %j, %Y"})
        <small>
            <a href="{path='friends/delete_status'}/{friends_status_id}/">delete?</a>
        </small>
    </li>
    {if friends_no_results}
        <li>You currently have no status updates.</li>
    {/if}
{/exp:friends:status}
</ul>