ExpressionEngine Add-ons

Rating:Report template tag

Rating:Report is an automated function that allows your visitors to report ratings/reviews they find offensive or inappropriate by clicking a link you provide for them. The link will point to a template that has this function in it and will display a message to the user depending on the success or failure of the action. In the Rating module CP, you can configure which member groups can report ratings, and how many reports are necessary to quarantine a rating. You would usually link to this template with the Rating:Reporting_Allowed function.

{exp:rating:report} content {/exp:rating:report}

Parameters

The following parameters are available for use:

rating_id

{rating_id}

This parameter tells the Rating module which rating/review will receive the report vote. This is a required parameter.

Variables

The following variables are available for use:

message

{message}

This variable will output the appropriate message generated by the Rating module depending on the outcome of the report action.

Conditionals

The following conditionals are available for use:

failure

{if failure}{/if}

This conditional will show its contents if the report action fails for any reason.

success

{if success}{/if}

This conditional will show its contents if the report action succeeds.

Examples

Below is a complete example as to how the Rating:Report template should look, assuming you’re grabbing the rating ID from the 3rd segment of the URI:

{exp:rating:report rating_id="{segment_3}"}

    {if success}
        <h2>Report successful!</h2>
    {/if}
    {if failure}
        <h2>Report failed.</h2>
    {/if}
    <p>{message}</p>

{/exp:rating:report}