ExpressionEngine Add-ons

Rating:Reporting_Allowed template tag

The Rating:Reporting_Allowed tag is basically a conditional that allows/disallows your visitors to report ratings/reviews they find offensive or inappropriate. In the Rating control panel area, you can configure which member groups can report ratings, and how many reports are necessary to quarantine a rating. You would normally create Reporting links that link to the template with the Rating:Report function, and surround the link with the conditionals available within the Rating:Reporting_Allowed tag.

{exp:rating:reporting_allowed} content {/exp:rating:reporting_allowed}

Parameters

The following parameters are available for use:

rating_id

rating_id="{rating_id}"

This parameter is required to use this tag. You would usually pull a rating ID from the Rating:Entries loop, but you could also do this through the URI, or through an embedded template.

Conditionals

The following conditionals are available for use:

failure

{if failure}{/if}

This conditional will show its contents if the user viewing the page is NOT allowed to report ratings/reviews.

success

{if success}{/if}

This conditional will show its contents if the user viewing the page is allowed to report ratings/reviews.

Examples

The following is an example of the Rating:Reporting_Allowed feature in use within a Rating:Entries loop (where it needs to be), assuming you’re on a Single Entry View template:

{exp:channel:entries require_entry="yes"}
    <h2>{title}</h2>
    <p>{body}</p>
{/exp:channel:entries}

<h3>Ratings for this Entry:</h3>
{exp:rating:entries
    limit="10"
}

    {if screen_name}
        <p>
            <a href="{path='user/profile'}/{member_id}/">{screen_name}</a>
        </p>
        {if avatar}
            <img src="{avatar_url}" width="{avatar_width}" height="{avatar_height}" />
        {/if}
    {if:else}
        <p>{name} (Guest)</p>
    {/if}
        <p>{stars}{rating}{/stars}</p>
        <p>Submitted on {rating_date format="%F %j, %Y at %g:%i %a"}</p>
        <p>{review}</p>

    {exp:rating:reporting_allowed rating_id="{rating_id}"}
        {if success}
            <p>
                <a href="{path='rating/report'}/{rating_id}/">
                    Flag this review as Spam / Offensive?
                </a>
            </p>
        {/if}
        {if failure}
            <p>
                You are not allowed to flag reviews.
            </p>
        {/if}
    {/exp:rating:reporting_allowed}

{/exp:rating:entries}