• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Latest posts on your website

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

This is something i am doing for my website where i use similar code to what's posted, once i am finished and i understand it - i will give a go at updating this little script, but for now it works fine for people not hiding forums.
 
Thanks.. I probably will. I don't know if you saw this thread but I got the idea after reading this one. I thought it would be good to have "most liked" as well as "Latest"
 
I don't belive this will work for other users;)
they don't have your geekpoint_symfony class
PHP:
GeekPoint_Symfony::initializeXenforo($forum_directory, $startTime);
 
// OT

If you've initialized the xenforo framework, use its database object to perform all your queries. Also, you can use the XenForo_Link class to construct links for any resource inside xenforo. (prepending the route name with ":full" will create absolute links). And make sure you are escaping the thread titles!

PHP:
$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);
}
 
Second version of the code is not working. I've used the one that another user pointed out, where you have to input the db details. That one is working.
I have another problem - it doesn't display any other characters, besides English ones, but I guess this won't be solved, since author is ignoring this thread.
 
Top Bottom