PDA

View Full Version : The "Re: Re: Re: Re: Re:" problem...


Axe
01-10-2003, 08:23 AM
Does anybody know if there's a hack out there that prevents adding on all the extra "Re: " strings at the beginning of replies to replies?

So that all replies, and responses to replies are "Re: Original Thread" instead of "Re: Re: Re: Re: Original Thread"?

Graphics
01-10-2003, 12:59 PM
Lol, I'd like to know this too. As if you've got a huge thread the topic name will end up bigger than the actual post. :p

WetWired
01-10-2003, 01:05 PM
I've never actually seen this problem. Most users in forums I visit don't use quote, and so don't ususally have a topic for non-thread-starting posts. This should be a simple matter of finding the bit of code where the "Re: " is added, and seeing if the 1st 4 chars are "Re: " first.

NTLDR
01-10-2003, 01:50 PM
In newreply.php

Replace:

if ($postinfo[title]!="") {
$title="Re: ".unhtmlspecialchars($postinfo[title]);
}

With:

if (strpos($postinfo[title], "Re:") {
$title=unhtmlspecialchars($postinfo[title]);
} elseif ($postinfo[title]!="") {
$title="Re: ".unhtmlspecialchars($postinfo[title]);
}

Untested but it should work.

Axe
01-10-2003, 07:31 PM
Yup, should work quite well except under rare circumstances (like the topic of this thread) ;)

I'll modify it a lil and actually check for the position of "Re: " in the string, and set it to only add one if strpos>0.

Thanks very much.

Xenon
01-10-2003, 10:07 PM
i'd use this:
if ($postinfo[title]!="") {
$title="Re: ".unhtmlspecialchars($postinfo[title]);
}
$title = str_replace("Re: Re: ", "Re: ", $title);

Boofo
01-10-2003, 11:14 PM
How would you do the same thing for private messages?

Xenon
01-12-2003, 12:39 PM
in private.php after this:
$subject="Re: $message[title]";

add this:
$subject=str_replace("Re: Re: ", "Re: ", $subject);

Boofo
01-12-2003, 12:59 PM
Thank you, sir. ;)