1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Post rating variables?

Discussion in 'XenForo Questions and Support' started by Tsugaga, Feb 20, 2013.

  1. Tsugaga

    Tsugaga Member

    Not that great with(php?) variables. When a user posts you can see their likes. I want this to be replaced with their positive rating count. What do I replace "$user.like_count" with?
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Shelley likes this.
  3. Tsugaga

    Tsugaga Member

    I'm not licenced. I am super admin on a forum and do a bunch of work on it, the owner is greatman(he has a black penguin avy atm) and he is licensed. Obviously I cant log onto his account and post, and he is too busy to be bothered to post my questions here for me. I would really like my question to be answered. I can just go to random xf help sites but I posted it here because you seem to know everything about it(you answered almost every question I have searched for on other topics). Please just help me out. You can ask a mod or someone to verify greatman? If it's really that big of a deal.
     
  4. oman

    oman Well-Known Member

    If greatman is licensed, you can get him to associate your username with his license. To be able to get support, you must have or be associated with a license.
     
  5. oman

    oman Well-Known Member

    Also - may I ask: what "random xf help sites" are you going to?
     
  6. Tsugaga

    Tsugaga Member

    Eh he said he has to renew his licence. The question I am asking is about the rating system, which is an add-on, and he could have only downloaded it if he was premium so...
     
  7. Brandon Sheley

    Brandon Sheley Well-Known Member

    He should still be able to add you, and there are warez sites so your last statement doesn't really prove anything.
     
  8. Tsugaga

    Tsugaga Member

    No it says he needs an active licence.

    XenForo - Error
    You must have at least one up-to-date license to access this page.


    Edit: He renewed his licence and associated me with his account. The link provided by Jake doesn't work though because I haven't purchased the licence. How do I verify that I am associated with his account?
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Your account is showing as licensed now. Thanks.

    What do you mean by "positive rating count"? XenForo only has likes built-in.
     
  10. oman

    oman Well-Known Member

  11. Tsugaga

    Tsugaga Member

    I use the post rating add-on. The ratings are created and each one is set as positive, negative, or neutral.

    This is a bit from the message_user_info template

    Code:
        <xen:if is="@messageShowTotalLikes">
    <dl class="pairsInline">
    <dt>{xen:phrase likes_received}:</dt>
    <dd>{xen:number $user.like_count}</dd>
    </dl>      
    
    This makes it so when a user posts in a topic, it shows their likes in the area under their avatar. I want it to show total positive ratings instead of just likes. To do this I have to replace "$user.like_count" with something.

    This is used to display a users positive, neutral, and negative ratings in the visitor panel:

    Code:
    <xen:require css="dark_postrating.css" />
    <dl class="pairsJustified">
    <dt>{xen:phrase dark_ratings}:</dt> 
    <dd><xen:if is="{$postrating_enabled_ratings.positive}"><span class="dark_postrating_positive">{$postrating_ratings_total.positive}</span><xen:if is="{$postrating_enabled_ratings.neutral} || {$postrating_enabled_ratings.negative}">/</xen:if></xen:if><xen:if is="{$postrating_enabled_ratings.neutral}"><span class="dark_postrating_neutral">{$postrating_ratings_total.neutral}</span><xen:if is="{$postrating_enabled_ratings.negative}">/</xen:if></xen:if><xen:if is="{$postrating_enabled_ratings.negative}"><span class="dark_postrating_negative">{$postrating_ratings_total.negative}</span></xen:if></dd></dl>
    
    I tried replacing "$user.like_count" with "$user.postrating_ratings_total.positive", "$postrating_ratings_total.positive", and similar things but it doesn't work.
     
  12. Luke F

    Luke F Well-Known Member

    There's a couple of existing options for this - see the 'message elements' section of style properties
     
    Jake Bunce and Tsugaga like this.
  13. Tsugaga

    Tsugaga Member

    Oh cool, thanks! Any way to set where I want it? It is automatically put under all the other things defined in the message_user_info template bit i'd like to put it in the spot that I want.
     
  14. Luke F

    Luke F Well-Known Member

    Move the closing </xen:hook> of message_user_info_extra in template message_user_info up to where you want the post ratings bit inserted, and pray another addon doesn't rely on the correct position
     
    Jake Bunce and Tsugaga like this.
  15. Tsugaga

    Tsugaga Member

    Ah thanks a lot Luke, I should have just messaged you in the first place xD
     
  16. Ernest L. Defoe

    Ernest L. Defoe Well-Known Member

    Probably would have been a good idea since Luke is the one who created the addon in question. ;)
     

Share This Page