• 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

Not at all it's a very simply single sql query, even shared hosting won't notice a difference, most websites pull a lot more than this does anyway.
 
You know what else would be cool? When the links are displayed, clicking them would lead to the last post in the topic. Not the first one, like right now.
 
Ok, so if anybody is interested I have a working code that gets you to the last post of the thread, displays the last post author, last post date, post count, view count :)
 
New version, check first post for changelog and new code.

Guys please leave off-topic posts for personal messages don't clog up my post if you don't mind.
 
I managed to get avatars like this. Guess it's a somewhat effective way to do it?

PHP:
$user = XenForo_Model::create('XenForo_Model_User')->getUserById(1);
echo '<img src="' . XenForo_Template_Helper_Core::helperAvatarUrl($user, 's') . '" />';
 
Nice.. works perfect
how to add $forum_url in :
Code:
echo "<a href=\"$threadUrl\">$threadTitle</a> Views: {$thread['view_count']}, Comments: {$thread['reply_count']}<br />
<br />";
 
There's 1 problem with your query;)

PHP:
$node_id_list = implode($nodes_get, ',');

$sql_forum = "SELECT `title`, `thread_id`, `view_count`, `reply_count` FROM `xf_thread` WHERE `node_id` IN ($node_id_list) ORDER BY `last_post_date` DESC LIMIT {$limit}";

You check for viable nodes, BUT you don't check if the user is really allowed to view the thread.
It could be softdeleted or moderated(=> not viable for avarage joe) BUT your script would return it
 
Top Bottom