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

Discussion in 'XenForo Development Discussions' started by Hardcore, Sep 13, 2012.

  1. Hardcore

    Hardcore Active Member

    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 ...
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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:


    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:


    In that case you should probably post a request:


Share This Page