MyBB Community Forums

Full Version: remove ?action=lastpost from main forum page links
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On the main forum page, all of the links point to the thread urls and contain ?action=lastpost

Is there a way to turn of "?action=lastpost"

I don't want any of my links from the forum main page to contain this action (or any action)

I'm using google seo, so the "?action=lastpost" has a slight performance impact on redirecting, I want to reduce this impact.


Okay, I've made my own custom hack

update the functions_forumlist.php file where it says:

$lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);
$lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");

add the flowing lines:
// custom hack to not have ?action=lastpost on the front page
$pos = strrpos($lastpost_link, "?action");
$thispost_link = substr($lastpost_link , 0, $pos); 


now in the ACP update the template: forumbit_depth2_forum_lastpost
to:
<span class="smalltext">
<a href="{$thispost_link}" title="{$full_lastpost_subject}"><strong>{$lastpost_subject}</strong></a>
<br />{$lastpost_date} {$lastpost_time}<br />{$lang->by} {$lastpost_profilelink}</span> 
It's much simpler to just change this line:
$lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");
into
$lastpost_link = get_thread_link($lastpost_data['lastposttid']); 

Although, I wouldn't recommend doing core modifications if you can also use a simple template change. In the templates 'forumbit_depth1_forum_lastpost' and 'forumbit_depth2_forum_lastpost', search:
{$lastpost_link}
with
showthread.php?tid={$forum['lastposttid']}
Yeah, I didnt want to change the $lastpost_link string, since I wasn't sure if it was used any where else. I only wanted to change the link on the first page (the 2nd depth forums has a link: Last Post: Tenants. I didnt want to change this )

The seconds suggestion looks like what I was looking for. I agree, using what you've suggested is much more recommended, than changing core files (But in my case, I'm stripping down, increasing performance and making lots of core changes, so core changes are fine )


Thanks Aries-Belgium


There is no need to deal with these codes, the simplest solution;

./inc/functions_forumlist.php file to download to your computer, through a program like notepad++ open,

Locate the following codes:

$lastpost_link = get_thread_link($lastpost_data['lastposttid'], 0, "lastpost");

change :

$lastpost_link = get_thread_link($lastpost_data['lastposttid']);  

In short, at the end of the code to delete the following code, again to restore to FTP ..


, 0, "lastpost"

Note: compatible with google seo . [Image: super.gif]

For the demonstration of recent topics, see http://tr.mybbdepo.com/
I tried to doing core modification with /inc/functions_forumlist/

But it doesn't get the current link, all thread link converted to : http://www.myforum.com/ instead of http://www.myforum.com/thread-XXX.html

Please help!

Thanks in advanced.