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

Pulling non-XF data into XF

Hardcore

Active member
#1
Hey everyone -

Looking for an easy way to pull some data (user stats) from our non-XF database into XF and display it in the visitor sidebar under Messages and Likes counts; I'd be using TMS to drop it in.

I'm not an add-on developer (obviously), so I'm looking for a quick hack to drop it in without having to create one ... unless creating an add-on for something like this would be easy.

Thanks in advance ...
 

Jake Bunce

XenForo moderator
Staff member
#2
A template hook can be used to insert content at a specific point on the page. Here is a code example of a template hook:

http://xenforo.com/community/threads/how-to-create-a-bridge.28515/#post-331631

For your purposes you can use the "sidebar_visitor_panel_stats" hook (from the sidebar_visitor_panel template) which will insert your content in the visitor panel.

Then you need to write the code to retrieve the desired information and append that to the $contents of the hook. Here is a code example of a second database connection for your purposes:

http://xenforo.com/community/resources/run-query-on-user-upgrade-code-example.396/

I'm not an add-on developer (obviously), so I'm looking for a quick hack to drop it in without having to create one
In that case you should probably post a request:

http://xenforo.com/community/forums/custom-service-development-requests.69/