Pulling Xenforo Threads, Avatars, Etc. Frontside Onto Wordpress Based Site?

Deepmartini

Well-known member
Does anyone know how of any widgets for wordpress which can pull xenforo info frontside onto a wordpress based site? Widgets such as: recent posts, who's online, unanswered posts, most popular posts, etc.

This would be great to be able to show off what's happening in the community on other areas of the site.
 

euantor

Well-known member
Recent posts could be done using an RSS widget in all likelihood. The others would need a custom XF integration plugin of some sort.
 

Digital Doctor

Well-known member

LPH

Well-known member
Latest posts may be pulled by using the following:

PHP:
<div class="forum_posts">
 
    <h3>The following posts are from our community</h3>
 
    <?php
 
    /* Script to pull the latest posts from the XF Forum */
   
    $db = XenForo_Application::getDb();
 
    if (!$db) {
 
        die('This script did not connect to the database' . mysql_error());
 
    }
 
    $thread_qry = "
            SELECT * FROM `xf_thread`
            ORDER BY `last_post_date` DESC
            LIMIT 5
 
    ";
 
    $threads = XenForo_Application::get('db')->fetchAll($thread_qry);
 
    foreach ($threads AS $thread)
    {
 
            echo ("<div class='entry-meta'><a href='/community/" . XenForo_Link::buildPublicLink('threads', $thread) .    "' >" . $thread['title'] . "</a> Viewed: "  .$thread['view_count'] .      "<br /></div>"); // Echo the title with a link.
 
    }
 
    ?>
 
</div><!-- Latest Forum Posts -->
Hope this helps.
 
Top