Re: How to use rating 'stars' in article summaries

ladyofdragons <[email protected]> Mon, 13 Oct 2003 19:04:05 -0400
Newsgroups gmane.comp.cms.xaraya.knowledge-base
Organization xaraya.com
Message-ID <[email protected]>
On Mon, 13 Oct 2003 18:42:10 -0400, ladyofdragons 
<[email protected]> wrote:

wouldn't ya know I figure out a mistake AFTER I post.  the code should be:

<!-- this shows full stars -->
<xar:for start="$i = 1" test="$i le ($rating/20)" iter="$i++">
  <img src="modules/ratings/xarimages/rate_full.gif" alt="star" />
</xar:for>
<!-- this shows the half star if there is one-->
<xar:if condition="($rating % 20) ge 5">
  <img src="modules/ratings/xarimages/rate_half.gif" alt="half star" />
  <!-- this part is optional, to always show the total spacing of stars. - - 
>
  <xar:for start="$i = 4" test="$i gt ($rating/20)" iter="$i--">
    <img src="modules/ratings/xarimages/rate_none.gif" alt="star" />
  </xar:for>
  <!-- end optional blank stars-->
<xar:else />
  <!-- this part is optional, to always show the total spacing of stars. - - 
>
  <xar:if condition="$rating lt 100">
  <xar:for start="$i = 5" test="$i gt ($rating/20)" iter="$i--">
    <img src="modules/ratings/xarimages/rate_none.gif" alt="star" />
  </xar:for>
</xar:if>
<!-- end optional blank stars-->

there was an error before where it showed an extra blank star if there was 
a half star.



-- 
- Ladyofdragons