MyBB Community Forums

Full Version: Lastpost plus newpost at index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
IS it possible to get the newpost variable? Just like lastpost action from forumlist

I mean, there is already the variable that prints the lastpost in forumlist, but could it be possible to print the lastthread newpost variable?

Both from index.php
Are you using SEO urls or the default URLs?
Google SEO ones Smile
Hmm, you'd have to edit the $lastpost_link variable so that ?action=lastpost would be ?action=newpost.
^ one can modify forumbit_depth1_forum_lastpost template to add the another link !!

Yes I know, I have a plugin that already do that, but is not there a way to "duplicate" the variable so that I can use for example:
{$lastpost_link} = normal action=lastpost
{$lastpost_link2} = action=newpost

So that I can use both in templates? Will appreciate if you provide me with a clue Smile
PHP code:

$newpost_link = str_replace('lastpost','newpost',$lastpostlink)
I searched for:
$lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");

Added just after that:
$newpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "newpost");

Then in my forumbit_depth2_forum_lastpost I added {$newpost_link} where I want the newpost link to appear.

Do you think this is the best way?
Yeah, that should work.
Pages: 1 2