[RFC|Merged] Last topic title in forum list

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [RFC|Merged] Last topic title in forum list

Post by DavidIQ »

No.
Image

KnocksX
Registered User
Posts: 80
Joined: Thu Jul 19, 2012 2:03 am

Re: [RFC|Merged] Last topic title in forum list

Post by KnocksX »

Tried that code. It's not intuitive to users because the last post is text instead of a link. Any way to get this version working before 3.1?

User avatar
Pony99CA
Registered User
Posts: 986
Joined: Sun Feb 08, 2009 2:35 am
Location: Hollister, CA
Contact:

Re: [RFC|Merged] Last topic title in forum list

Post by Pony99CA »

If you want a phpBB 3.0 MOD, you should probably ask on the Support board. If you want a core change made to phpBB 3.0, you could try the 3.x RFC forum, but good luck -- phpBB 3.0 is feature frozen.

Steve
Silicon Valley Pocket PC (http://www.svpocketpc.com)
Creator of manage_bots and spoof_user (ask me)
Need hosting for a small forum with full cPanel & MySQL access? Contact me or PM me.

User avatar
DionDesigns
Registered User
Posts: 51
Joined: Sat Apr 21, 2012 4:29 am
Location: Uncertain due to momentum
Contact:

Re: [RFC|Merged] Last topic title in forum list

Post by DionDesigns »

KnocksX wrote:Guys, is there a quick hack I can use to integrate this into a live forum while the final code is being straightened out?
Find this line in includes/functions_display.php:

Code: Select all

'LAST_POST_SUBJECT'      => censor_text($last_post_subject),
Directly under it, add this line:

Code: Select all

'LAST_POST_DDSUBJECT'      => (utf8_strlen(censor_text($last_post_subject)) > 24) ? utf8_substr(censor_text($last_post_subject), 0, 24) . '...' : censor_text($last_post_subject),
Now find this line in forumlist_body.html:

Code: Select all

<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
Replace it with:

Code: Select all

<!-- IF forumrow.LAST_POST_TIME --><strong><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}">{forumrow.LAST_POST_DDSUBJECT}</a></strong><br /><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}

KnocksX
Registered User
Posts: 80
Joined: Thu Jul 19, 2012 2:03 am

Re: [RFC|Merged] Last topic title in forum list

Post by KnocksX »

Thanks!

User avatar
tbackoff
Registered User
Posts: 180
Joined: Sat Jun 12, 2010 3:25 am

Re: [RFC|Merged] Last topic title in forum list

Post by tbackoff »

That's basically the same thing as the KB article, just with the added strong and a href tags. :?

User avatar
DionDesigns
Registered User
Posts: 51
Joined: Sat Apr 21, 2012 4:29 am
Location: Uncertain due to momentum
Contact:

Re: [RFC|Merged] Last topic title in forum list

Post by DionDesigns »

My modification also adds a tooltip to display the full topic title on hover, which is how this board works. That feature is not in the KB, and it's why a line is being added in includes/functions_display.php as opposed to being replaced.

I also increased the cutoff length to a more usable 24 characters. This board uses 29 characters, which is fine if there are few capitalized letters in the title, but it's better to be safe than sorry.

KnocksX
Registered User
Posts: 80
Joined: Thu Jul 19, 2012 2:03 am

Re: [RFC|Merged] Last topic title in forum list

Post by KnocksX »

DionDesigns wrote: I also increased the cutoff length to a more usable 24 characters. This board uses 29 characters, which is fine if there are few capitalized letters in the title, but it's better to be safe than sorry.
Which is another reason why "Re: " should not be used as it adds 4 extra characters.

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: [RFC|Merged] Last topic title in forum list

Post by nickvergessen »

for 3.0 there is a mod called NV advanced last topic titles which has several config vars for this. You could use that as long as you have 3.0
Member of the Development-TeamNo Support via PM

User avatar
DionDesigns
Registered User
Posts: 51
Joined: Sat Apr 21, 2012 4:29 am
Location: Uncertain due to momentum
Contact:

[RFC|Merged] Last topic title in forum list

Post by DionDesigns »

KnocksX wrote:Which is another reason why "Re: " should not be used as it adds 4 extra characters.
Well, then get rid of it! ;) Find this code in includes/functions_display.php:

Code: Select all

			$last_post_subject = $row['forum_last_post_subject'];
			$last_post_time = $user->format_date($row['forum_last_post_time']);
			$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
Replace it with this:

Code: Select all

			if (utf8_substr($row['forum_last_post_subject'], 0, 4) == 'Re: ')
			{
				$last_post_subject = utf8_substr($row['forum_last_post_subject'], 4);
			}
			else
			{
				$last_post_subject = $row['forum_last_post_subject'];
			}
			$last_post_time = $user->format_date($row['forum_last_post_time']);
			$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
And the "Re: " will be removed from the last post title. On my own boards, I remove the code in posting.php that adds it in the first place. IMO it is an archaic term that adds nothing...well, nothing other than four characters in the title that could be put to better use. (Actually I'd like to see the subject removed entirely from replies, and have all replies inherit the topic title.)

Post Reply