Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Truncate message subject

Quote Reply
Truncate message subject
Hi

Who's done the hack to truncate message subjects? If anyone has, do they fancy posting how to do this. This would be a welcomed addition to the default installation.

Cheers

- wil
Quote Reply
Re: [Wil] Truncate message subject In reply to
This is just an easy template change. If you add a global, say short_post_subject, which has the following code:
Code:
sub {
my $vars = shift;
(my $subject = $vars->{post_subject}) =~ s/^(.{25}).+$/$1 .../;
$subject;
};
Where 25 is the maximum length of the subject. Of course, you could always make that regex a little more intelligent (eg. don't truncate words).

In forum_view.html, around line 170, replace
<%post_subject%>
with
<%short_post_subject%>
and you'll acheive that.

Adrian

Last edited by:

brewt: Jan 14, 2002, 2:06 AM