Difference between revisions of "Rating System"
From TMM Wiki
Jump to navigationJump to searchm |
(No difference)
|
Revision as of 15:43, 17 December 2008
The CARMA rating system has three variables associated with the rating system are:
- $carma_gal.rating.average - the average rating by all the members who have voted on this gallery
- $carma_gal.rating.my - the rating given to this gallery by the current member
- $carma_gal.rating.votes - the number of votes that have been made for this gallery
Example
An example of code that can be used for ratings:
{if $carma_gal.rating.my} You Rated This Gallery {if $carma_gal.rating.my == 8}an{else}a{/if} {$carma_gal.rating.my} {else} <form action="rating.php" method="GET" id=vote name=vote> <input type="hidden" name="id" value="{$carma_gal.galid}"> <input type="hidden" name="type" value="gal"> <select name="rating"> <option value="1">1 - Worst</option> <option value="2">2 - Bad</option> <option value="3" selected>3 - Average</option> <option value="4">4 - Good</option> <option value="5">5 - Best</option> </select> <INPUT id=vote type=submit value=Vote name=vote> </FORM> {/if}
An example of code for actor ratings:
{if $actor.rating.my} You Rated This Actor {if $actor.rating.my == 8}an{else}a{/if} {$actor.rating.my} {else} <form action="rating.php" method="GET" id=vote name=vote> <input type="hidden" name="actorid" value="{$actor.actorid}"> <input type="hidden" name="type" value="actor"> <select name="rating"> <option value="1">1 - Worst</option> <option value="2">2 - Bad</option> <option value="3" selected>3 - Average</option> <option value="4">4 - Good</option> <option value="5">5 - Best</option> </select> <INPUT id=vote type=submit value=Vote name=vote> </FORM> {/if}