Font Awesome Ratings

Font Awesome Ratings 1.0.0

No permission to download
#27
my rating temp like this and i cant find that line for change something is wrong and i am wrong person to find it

Code:
<xen:require css="rating.css" />
<xen:if is="{$action}">
    <xen:require js="js/xenforo/rating.js" />

    <form action="{$action}" method="post" class="rating RatingWidget" {xen:if $microdata, 'itemscope="itemscope" itemtype="http://data-vocabulary.org/Rating"'}>
        <dl>
            <dt class="prompt muted">{xen:raw $prompt}</dt>
            <dd>
                <span class="ratings">
                    <button type="submit" name="rating" value="1" class="star {xen:if '{$rating} >= 1', 'Full'}{xen:if '{$rating} >= 0.5 AND {$rating} < 1', 'Half'}" title="{xen:phrase rating_1}">1</button
                    ><button type="submit" name="rating" value="2" class="star {xen:if '{$rating} >= 2', 'Full'}{xen:if '{$rating} >= 1.5 AND {$rating} < 2', 'Half'}" title="{xen:phrase rating_2}">2</button
                    ><button type="submit" name="rating" value="3" class="star {xen:if '{$rating} >= 3', 'Full'}{xen:if '{$rating} >= 2.5 AND {$rating} < 3', 'Half'}" title="{xen:phrase rating_3}">3</button
                    ><button type="submit" name="rating" value="4" class="star {xen:if '{$rating} >= 4', 'Full'}{xen:if '{$rating} >= 3.5 AND {$rating} < 4', 'Half'}" title="{xen:phrase rating_4}">4</button
                    ><button type="submit" name="rating" value="5" class="star {xen:if '{$rating} >= 5', 'Full'}{xen:if '{$rating} >= 4.5 AND {$rating} < 5', 'Half'}" title="{xen:phrase rating_5}">5</button>
                </span>
         
                <span class="RatingValue"><span class="Number" itemprop="average">{$rating}</span>/<span itemprop="best">5</span>,</span>
                <span class="Hint">{xen:raw $hint}</span>
            </dd>
        </dl>
     
        <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
    </form>
 
<xen:else />
 
    <div class="rating">
        <dl>
            <dt class="prompt muted">{xen:raw $prompt}</dt>
            <dd>     
                <span class="ratings" title="{xen:number $rating, 2}">
                    <span class="star {xen:if '{$rating} >= 1', 'Full'}{xen:if '{$rating} >= 0.5 AND {$rating} < 1', 'Half'}"></span
                    ><span class="star {xen:if '{$rating} >= 2', 'Full'}{xen:if '{$rating} >= 1.5 AND {$rating} < 2', 'Half'}"></span
                    ><span class="star {xen:if '{$rating} >= 3', 'Full'}{xen:if '{$rating} >= 2.5 AND {$rating} < 3', 'Half'}"></span
                    ><span class="star {xen:if '{$rating} >= 4', 'Full'}{xen:if '{$rating} >= 3.5 AND {$rating} < 4', 'Half'}"></span
                    ><span class="star {xen:if '{$rating} >= 5', 'Full'}{xen:if '{$rating} >= 4.5 AND {$rating} < 5', 'Half'}"></span>
                </span>
             
                <span class="RatingValue"><span class="Number" itemprop="average">{$rating}</span>/<span itemprop="best">5</span>,</span>
                <span class="Hint">{xen:raw $hint}</span>
            </dd>
        </dl> 
    </div>

</xen:if>
 

Tracy Perry

Well-known member
#28
my rating temp like this and i cant find that line for change something is wrong and i am wrong person to find it
<
A little more descriptive phrasing of what you are trying to do would be useful. Have you followed the instructions (which are very easy to do)?

Like: I'm trying to modify the thread-rating add-on to use this feature.

Then somebody can give you an example like:
Code:
<xen:require css="threadrating.css" />
<xen:include template="font_awesome_rating">
    <xen:set var="$action">{xen:if $threadrating.canRate, {xen:link threads/rate, $thread}}</xen:set>
    <xen:set var="$rating">{$thread.thread_rate_avg}</xen:set>
    <xen:set var="$prompt"></xen:set>
    <xen:set var="$hint">{xen:if '{$thread.thread_rate_count} == 1', {xen:phrase 1_vote}, {xen:phrase x_votes_plural, 'count={$thread.thread_rate_count}'}}</xen:set>
    <xen:set var="$microdata">1</xen:set>
</xen:include>
Where you can see that the
Code:
<xen:include template="rating">
was replaced with
Code:
<xen:include template="font_awesome_rating">
 
Last edited:
#29
i am trying to use font awesome ratings and i cant find this code in my rating template
<xen:include template="rating"
And replace with:
Code:
<xen:include template="font_awesome_rating"
 

Tracy Perry

Well-known member
#30
i am trying to use font awesome ratings and i cant find this code in my rating template
<xen:include template="rating"
And replace with:
Code:
<xen:include template="font_awesome_rating"
Point being... for WHAT purpose - the resource manager, the thread-rating add-on, xenMedia Gallery, ShowCase?
This doesn't replace the rating template (which is what you quoted). It enhances it. The rating template remains the same.

In my example above, that was a modification to the threadrating_rate template - you also have to add the code modification to threadrating_rate_threadlist and threadrating_rate_whorated templates.
For xenMedia Gallery it's xengallery_media_ratings.

To find where you need to replace it at you can go into the ACP -> Appearances -> Search Templates and enter the phrase <xen:include template="rating" in the "Template Contains" box and it will tell you where you need to replace it at.
 
Last edited:
#31
i want to use font awesome ratings in my forum downloaded and install it on my xenforo
i posted my code what i am seing in rating template
and i have to change this line <xen: template = "rating" include
with this
<xen: template = "font_awesome_rating include" ....

we are ok until now right ?
but i cant find this line <xen: template = "rating" include .....
i posted my rating template because of this.

what is wrong in my rating template ? i am new about this things . I posted my first post in xenforo forums i dont know how to use forums just learning and creating.
 

Tracy Perry

Well-known member
#32
what is wrong in my rating template ? i am new about this things . I posted my first post in xenforo forums i dont know how to use forums just learning and creating.
Do you have the resource manager installed? If so, THAT is the template you need to edit it for. Did you perform the search for the string to replace as I instructed?
You DO NOT - and I re-emphasize DO NOT - edit the rating template itself.
 
#33
To find where you need to replace it at you can go into the ACP -> Appearances -> Search Templates and enter the phrase <xen:include template="rating" in the "Template Contains" box and it will tell you where you need to replace it at.

cant find claimed template!!!

nevermind thank you i can fix it when i learn this :)
 

Tracy Perry

Well-known member
#34
To find where you need to replace it at you can go into the ACP -> Appearances -> Search Templates and enter the phrase <xen:include template="rating" in the "Template Contains" box and it will tell you where you need to replace it at.

cant find claimed template!!!

nevermind thank you i can fix it when i learn this :)
If doing a search does not turn up the string then it means that you are not running any add-ons that rate anything. This does NOT make it so that ratings suddenly appear. It just enhances anything that uses the ratings template. In it's shipping form, I don't think xenForo by default uses directly the ratings anywhere. It is there for add-ons to use. On a base style every reference to that string reflects back to an add-on I have installed.
If you haven't installed
Resource Manager
ShowCase
Thread Ratings
xenMedia Gallery

or an associated add-on that uses the rating system then you will not find it.
 

Chris D

XenForo developer
Staff member
#37
In theory, yes, but it's not really related to this resource.

The XenForo star ratings come from this file in your XenForo installaation:


Note the three stars, full, half and empty. Replace those with the desired icons.
 

Tracy Perry

Well-known member
#39
That's not "broken" but a style display problem.
Is this a custom style you are using (meaning either a paid for, a free downloaded or a bespoke) or is it the default.
 
Top