Last Post Title

Mixed forum with code snippets, guides and styles
Forum rules
Everything in this forum is for everybody
But support only for Donators!
User avatar
Stoker
Site Admin
Site Admin
Posts: 3502
Joined: 12 May 2008, 21:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark

Last Post Title

Post by Stoker » 27 Jul 2011, 06:40

Last Post Title
Written by LEW21

This codechanges will display the last post title of each forum on index page.

You see the last post titles to the right on this screenshot:
last_post.png
Open: includes/functions_display.php
Find:

Code: Select all

$last_post_subject = $row['forum_last_post_subject'];
Replace with:

Code: Select all

if (substr($row['forum_last_post_subject'], 0, 4) == 'Re: ')

		{

   			$last_post_subject = substr(censor_text($row['forum_last_post_subject']), 4);

		}

		else

		{

   			$last_post_subject = censor_text($row['forum_last_post_subject']);

		}
Find:

Code: Select all

'LAST_POST_SUBJECT'		=> censor_text($last_post_subject),
Replace with:

Code: Select all

'LAST_POST_SUBJECT'		=> $last_post_subject,
			'LAST_POST_SHORTENED_SUBJECT'	=> (utf8_strlen($last_post_subject) > 26) ? truncate_string($last_post_subject, 25) . "\xE2\x80\xA6" : $last_post_subject,
Open: styles/prosilver/template/forumlist_body.html
Find:

Code: Select all

<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
In line, add after:

Code: Select all

 <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SHORTENED_SUBJECT}</a><br />
Open: styles/subsilver2/template/forumlist_body.html
Find:

Code: Select all

<p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>
Add before:

Code: Select all

<p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_SHORTENED_SUBJECT}</a></p>
Save, upload changed files and refresh the templates.
You do not have the required permissions to view the files attached to this post.
Board rules! No PM support
Sure, I can install the Mod for you ;)
Like the site? Then buy me a bear


User avatar
Solidjeuh
BBCoder IV
BBCoder IV
Posts: 257
Joined: 16 Oct 2011, 00:15
BBCodes: 7
Favourite MOD: Top stats
Location: Aalst / Belgium

Last Post Title

Post by Solidjeuh » 25 Dec 2011, 00:31

Thank you!
Just what I needed!
Yeah I'm crazy.. So What!?! Live Your Life The Way You Want It To be!
Download +30.000 arcade extension games @ ~ http://www.froddelpower.be ~

User avatar
mikef35
BBCoder III
BBCoder III
Posts: 147
Joined: 23 Feb 2012, 19:45

Last Post Title

Post by mikef35 » 05 Apr 2014, 00:13

Stoker,
Is there a way to get this to show in recent active topics?

User avatar
Stoker
Site Admin
Site Admin
Posts: 3502
Joined: 12 May 2008, 21:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark

Last Post Title

Post by Stoker » 05 Apr 2014, 04:49

Sure is, but not with this code.
The recent actice displays single topics. Topic title and last post title will therefore almost allways be the same.
Take a look at html and copy the title code and put it where you want.
Board rules! No PM support
Sure, I can install the Mod for you ;)
Like the site? Then buy me a bear