• 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?

lasertits

Active member
#1
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.

Thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
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):

XenForo_Model_Forum::getExtraForumDataForNodes
 
#4
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):

XenForo_Model_Forum::getExtraForumDataForNodes

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 :

Board
- 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 :)
 

Jake Bunce

XenForo moderator
Staff member
#5
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 :

Board
- 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 :)
You will have to define getExtraDataForNodes for the category handler:

XenForo_NodeHandler_Category

Refer to the forum handler for reference:

XenForo_NodeHandler_Forum
 

bubbl3

Active member
#8
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 :

Board
- 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 :)
I can't wait for you to release this, good job :)
 
#9
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

Active member
#10
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 :)
Meantime could you tell me what you edited please?