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

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

Deepmartini

Well-known member
#1
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.
 

Digital Doctor

Well-known member
#3

LPH

Well-known member
#4
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.