F
Floris
Guest
Yeah I guess, you're doing awesome work though. This addon is very useful
The issue with checking permissions with this code, is that this is a completely external interface to XenForo, so your user account and permissions are not available. I suppose if it was on the same domain you could share cookies, but at that point it would be far less of a pain to just integrate the XenForo user/session systems into your external code.
How would you use this to make a block in the side bar?
Here is a quick and simple way to get a list of the latest posts on your website
.
GeekPoint_Symfony::initializeXenforo($forum_directory, $startTime);
$query = "SELECT [...]";
$threads = XenForo_Application::get('db')->fetchAll($query);
foreach ($threads as $thread)
{
// The absolute thread url is constructed for you
$threadUrl = XenForo_Link::buildPublicLink('full:threads', $thread);
// Trimmed and properly escaped
$threadTitle = XenForo_Template_Helper_Core::helperWordTrim($thread['title'], 50);
}
Path is correct.An unexpected error occurred. Please try again later.
Line 28:Undefined variable: config /***/lastpost_xf2.php:28
mysql_connect($config['db']['host'], $config['db']['username'], $config['db']['password']);
We use essential cookies to make this site work, and optional cookies to enhance your experience.