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

Adding non-XenForo data to User Model

Hardcore

Active member
#1
Quick question. We've got a single non-XenForo table that contains user stats used on non-XenForo pages. We'd like to pull the stats into XenForo for easy use/better integration.

I've been looking at the Model/User.php file, but before I start hacking at the code I was wondering if anyone had an easy way of accomplishing this?

Thanks in advance ...
 

tyteen4a03

Well-known member
#2
If there's a primary key that associates each record in the non-XF table to the xf_user record, then just create a new Model and do whatever you please.
 

Hardcore

Active member
#3
If there's a primary key that associates each record in the non-XF table to the xf_user record, then just create a new Model and do whatever you please.
Yeah. I simply added an additional $selectFields & $joinTables to the prepareUserFetchOptions function in Model/User.php. Works great, and I can easily add others based on my needs.

I'll most likely need to adjust the getVisitingGuestUser function too, but that's just as straight forward.

Thanks.