1. 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

Discussion in 'XenForo Development Discussions' started by Hardcore, May 1, 2013.

  1. Hardcore

    Hardcore Active Member

    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 ...
     
  2. tyteen4a03

    tyteen4a03 Well-Known Member

    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.
     
  3. Hardcore

    Hardcore Active Member

    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.
     

Share This Page