Accessing custom user fields on the thread list page

Zeras

Active member
Is there an easy way to gain access to specific custom user fields on the thread list (view forum) page? $user is available on the actual view thread page, but that does not appear to be the case on the thread list page. I would assume this is to avoid the extra overhead in loading user records for each thread when only a few fields are being used on the thread list page.

In this case, I really need access to the custom user fields on the thread list page. If there is an easy way of accessing those fields, I would definitely like to know.

Thanks!
 

Mike

XenForo developer
Staff member
Do you mean the fields of the thread starter? If so, you're correct; they're not loaded. You would need to look into extending XenForo_Model_Thread::prepareThreadFetchOptions() so that the xf_user_profile table is pulled in when FETCH_USER is enabled. That should make it available.
 

Zeras

Active member
Do you mean the fields of the thread starter? If so, you're correct; they're not loaded. You would need to look into extending XenForo_Model_Thread::prepareThreadFetchOptions() so that the xf_user_profile table is pulled in when FETCH_USER is enabled. That should make it available.
Yes, that's it, Mike. Thank you for pointing me in the right direction!
 
Top