Any data you can pull off XenForo as it basically loads the whole system (including Zend).um, im a little unclear what this addon is supposed to do. what data does it pull into your website from the message board?
$bbCodeParser = new XenForo_BbCode_Parser(new XenForo_BbCode_Formatter_Base());
$bbCodeOptions = array(
'noFollow' => true,
'showSignature' => false,
'states' => array(
'viewAttachments' => false
)
);
echo XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($post, $bbCodeParser, $bbCodeOptions);
I don't understand your question?Can this integrate with another xenforo install? Like xenforo to xenforo.
No, this is for an external website, not an XF2XF bridge.Can you login with one xenforo info on another xenforo install, with this?
Is there a sample to pull off the "X" most recent posts from "Y" forums and then display them in a plain (external to XF) PHP page on the same site? Dynamically, of course, and with links to the posts....
(my posts are visible to guests, so that part is not a problem).
public function run($options)
{
$excludeForums = array();
if(!isset($options['xflimit']) || $options['xflimit'] < 1)
{
$options['xflimit'] = 10;
}
if(!empty($options['xfexclude']))
{
if(strstr($options['xfexclude'], ','))
{
$excludeForums = explode(',', $options['xfexclude']);
}
else
{
$excludeForums[] = $options['xfexclude'];
}
}
$threadModel = XenForo_Model::create('XenForo_Model_Thread');
$sql = 'SELECT thread.* FROM xf_thread AS thread WHERE node_id NOT IN("'.$options['xfexclude'].'") ORDER BY last_post_date DESC LIMIT '.$options['xflimit'].'';
$where = "NOT IN('".$options['xfexclude']."')";
$query = $this->db->query($sql);
$result = $query->result();
return array('threads' => $result);
}
$nodeModel = XenForo_Model::create('XenForo_Model_Node'); // Retrieve the default viewable forums
$nodes = $nodeModel->getViewableNodeList();
unset($nodes[X], $nodes[Y]); // X, Y are the IDs of publicly viewable forums but I don't want to retrieve threads from them
$latestthreads = array();
// Here I use XF's own $db connector (Zend_Db), but you can do it another away
$db = XenForo_Application::getDb();
$threads = $db->query("
SELECT thread_id, title, reply_count, post_date
FROM xf_thread
WHERE node_id IN (" . implode(',', array_keys($nodes)) . ")
AND discussion_state = 'visible'
AND discussion_open = 1
AND sticky = 0
ORDER BY post_date DESC
LIMIT 10
");
while ($thread = $threads->fetch())
{
$latestthreads[$thread['thread_id']] = array(
'id' => $thread['thread_id'],
'title' => $thread['title'],
'url' => XenForo_Link::buildPublicLink('canonical:threads', $thread),
'replycount' => $thread['reply_count'],
'dateline' => $thread['post_date']
);
}
// $latestthreads contains all your threads data
That's what the connector is forThanks...the only question I have is whether these template examples need to be created where they "know" XF is there - for instance, inside the XF system.
That is, are the references to XF in the code just created php objects, and if not, how do they know XF is even there?
(XenForo_Model, etc.)
When you define XF_ROOT, the path should be from the server root. You can use dirname(__FILE__) or __DIR__ to set the path from the current file. Be careful, don't include any trailing slash.Firstly, is the path to XF setting in the connector from the web root or server root? In other words, if my XF main directory is /talk , is that all I need there? Or do I point deeper into XF or from the server root?
I guess you can try var_dump($visitor).Secondly, is there any easy way of testing to see if the connector works? Just a one or two line php to include it and return that everything is found and connected?
We use essential cookies to make this site work, and optional cookies to enhance your experience.