PDA

View Full Version : Message reply "Re: " prefix hack


05-29-2000, 01:48 PM
This hack will prefix "Re: " at the beginning of the topic line on replies. It'll check to see if the post being replied to is itself a reply (has "Re: " in front of it) and won't add the "Re: ", avoiding threads full of "Re: ", "Re: Re: " etc posts.

In newreply.php

Line 258 (usually) find:

$threadtitle=htmlspecialchars($threadinfo[title]);


Replace with:

/*
* Reply Patch by Moonwolf
*/
$threadtmp=htmlspecialchars($threadinfo[title]);
$repdone = explode (" ", $threadtmp);
if ($repdone[0] == "Re:") {
$threadtitle = $threadtmp;
} else {
$threadtitle = "Re: $threadtmp";
}
/*
* End Reply Patch
*/


Now open the newreply template.

Find:

<td valign=top><INPUT TYPE="text" NAME="title" VALUE="$title" SIZE=40 MAXLENGTH=85>


Replace with:

<td valign=top><INPUT TYPE="text" NAME="title" VALUE="$threadtitle" SIZE=40 MAXLENGTH=85>


And you're all set. I'm working up a hack that will allow you to use a radio button when replying that will make your reply a new thread (for those replies that end up going totally off topic :p)

Katherine

05-30-2000, 05:54 AM
Well if you want to do this without hacking the code you could do something like this... this way the user can change the title but if they leave the default it looks organized...


On the 'newreply' template find:

<INPUT TYPE="text" NAME="title" VALUE="$title" SIZE=40 MAXLENGTH=85>

and replace it with:

<INPUT TYPE="text" NAME="title" VALUE="Re: $threadtitle" SIZE=40 MAXLENGTH=85>




[Edited by stv on 05-30-2000 at 02:55 PM]

05-30-2000, 06:40 AM
Yep that would work, but you'd end up with a whole chain of "Re: "'s in later replies. They can still change the topic if they want to using the hack above.

Kath

05-30-2000, 09:34 AM
Actually no you wouldn't. The thread title is passed from the first message. We did this on our site several weeks ago and our users are happy.

Webmasta XT
05-22-2002, 10:42 AM
how can I add this to the Quick Reply Box??

gmarik
05-17-2003, 08:36 PM
You can't do that to the box...

Dean C
05-18-2003, 10:02 AM
Marco - why are you bumping such an old thread with answers :)?

- miSt

Gary King
05-19-2003, 01:34 AM
Nice to see a part of history re-surface on the forums again, eh? :p