MyBB Community Forums
Lastpost plus newpost at index - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Lastpost plus newpost at index (/thread-106013.html)

Pages: 1 2


Lastpost plus newpost at index - Omar G. - 10-16-2011

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?

http://community.mybb.com/thread-xxxxxx-newpost.html

http://community.mybb.com/thread-xxxxxx-lastpost.html

Both from index.php


RE: Lastpost plus newpost at index - Omar G. - 10-19-2011

bump~


RE: Lastpost plus newpost at index - Paul H. - 10-19-2011

Are you using SEO urls or the default URLs?


RE: Lastpost plus newpost at index - Omar G. - 10-19-2011

Google SEO ones Smile


RE: Lastpost plus newpost at index - Paul H. - 10-19-2011

Hmm, you'd have to edit the $lastpost_link variable so that ?action=lastpost would be ?action=newpost.


RE: Lastpost plus newpost at index - ranjani - 10-19-2011

^ one can modify forumbit_depth1_forum_lastpost template to add the another link !!




RE: Lastpost plus newpost at index - Omar G. - 10-19-2011

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


RE: Lastpost plus newpost at index - Paul H. - 10-19-2011

PHP code:

$newpost_link = str_replace('lastpost','newpost',$lastpostlink)



RE: Lastpost plus newpost at index - Omar G. - 10-19-2011

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?


RE: Lastpost plus newpost at index - Paul H. - 10-19-2011

Yeah, that should work.