Friends 1.x

Legacy documentation for Friends 1.x.

The Friends:Profile_Comment_Delete function allows the author of the comment, the owner of the profile wall, or any Super Admin to permanently delete any of the applicable wall comments. Simply link with the comment ID in the URI to the template with the Friends:Profile_Comment_Delete function code in it, or submit a POST form.

{exp:friends:profile_comment_delete} content {/exp:friends:profile_comment_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 comment ID.

comment_id=

comment_id="{segment_3}"

The Friends:Profile_Comment_Delete loop automatically grabs the comment 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:Profile_Comment_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:profile_comment_delete
    comment_id="{segment_3}"
}

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

    <p>{friends_message}</p>

{/exp:friends:profile_comment_delete}

Setup

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

<h3>Comments on this Profile</h3>

<ul>
{exp:friends:profile_wall
    friend_id="{segment_3}"
    limit="25"
}
    <li class="wall">
        {if logged_in_member_id == segment_3 OR
            logged_in_group_id == "1"
        }
            <small style="float:right;">
                <a href="{path='friends/delete_profile_comment'}/{friends_comment_id}/">(delete)</a>
            </small>
        {/if}
        {friends_comment}<br/>
        By:
        {if logged_in_member_id == friends_member_id}
            <b>You</b>
        {if:else}
            <a href="{path='friends/profile'}/{friends_member_id}/">
                {friends_screen_name}
            </a>
        {/if}
        on {friends_entry_date format="%F %j, %Y at %h:%i %a"}
    </li>
    {if friends_no_results}
        <li>There are currently no comments for this profile.</li>
    {/if}
{/exp:friends:profile_wall}
</ul>