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

Username Styling in Last Message area - get data needed via addon?

Discussion in 'XenForo Development Discussions' started by lasertits, Jun 16, 2012.

  1. lasertits

    lasertits Active Member

    I know this has been asked a few times before and Mike said it wasn't possible as is as the data isn't available there, but is this not possible via an addon some how? I've searched a few different queries and haven't found any threads with an answer or solution to this.

    I just have simple color styling like most, and I feel the one place it's missing on the forum is in the last message area on the discussion list. Is there a way to pull the usergroup username styling and have it show so long as the last message area template is modified to use xen:username and rich="true" or xen:helper richUserName, or whatever works?

    If this were possible I'm sure many board owners would utilize it. Curious if anyone has any ideas and/or can point me in the right direction.

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The display_style_group_id value is needed for rich usernames. That value is stored in the xf_user table. The problem is that the full user record is not made available for the last poster. Your addon would have to modify the query to join the user record for the last poster. I think you need to extend this function (for last poster in the forum list):

    EsKuel, bubbl3 and lasertits like this.
  3. bubbl3

    bubbl3 Active Member

    Anyone developed something for this?
  4. EsKuel

    EsKuel Member

    Thanks Jake, that helped me and I succeed to show the richusername on the board index.
    It work for all my forums but not for sub-forums in a category like this :

    - Forum 1 (works)
    - Category 1
    - Forum 2 (dont works)

    I extend getExtraForumDataForNodes to get the display_style_group_id, so I get it in the variable $forum in the template node_forum_level_2 and so it's not working in the template node_category_level_2 :/

    I searched in almost all Models files but I'm a bit lost because it's my first "addon".
    So if somebody can help me or know the function to extend, I'll be very thankful :)
    bubbl3 likes this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You will have to define getExtraDataForNodes for the category handler:


    Refer to the forum handler for reference:

    bubbl3 likes this.
  6. EsKuel

    EsKuel Member

    Thanks !
    I read that we can't extend NodeHandler so I need to overwrite XenForo_NodeHandler_Category with my own handler ?
    bubbl3 likes this.
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    bubbl3 likes this.
  8. bubbl3

    bubbl3 Active Member

    I can't wait for you to release this, good job :)
  9. EsKuel

    EsKuel Member

    Well, all is working now as you can see here -http://forum.kaldun.fr
    I don't edit XenForo_NodeHandler_Category but XenForo_NodeHandler_Abstract, the problem is I really don't know how to overwrite it, actually I edit directly the Xenforo file (that's baaad).
    So I'll read the forum to find a way :)
    bubbl3 likes this.
  10. bubbl3

    bubbl3 Active Member

    Meantime could you tell me what you edited please?

Share This Page