Version: 1.00, by Tommy Boy
Developer Last Online: Oct 2014
Version: 2.2.x
Rating:
Released: 02-05-2002
Last Update: Never
Installs: 7
No support by the author.
If you run a support forum, you certainly hate these thread with names like "BUG!" or "NOT WORKING!" or "HELP!!", because they don't give any indication about the content of the threads, and other users will probably create new threads with similar content, just because the other thread names were not clear enough.
After installing this hack, you will be able to change a thread title when replying to it, without having to go to the admin panel, and waste precious time and clicks.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
There's a nasty little bug in this hack. Essentially, the title will always be overwritten when replied to by a moderator but it will not strip special html characters. If you've installed this hack, follow the following steps to fix it. In newreply.php, find:
PHP Code:
$DB_site->query("UPDATE thread SET title='" . addslashes ($newthreadtitle) . "' WHERE threadid='$threadid'");
Replace it with:
PHP Code:
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($newthreadtitle))."' WHERE threadid='$threadid'");
You will now need to run a series of MySQL queries to fix threads affected by this bug:
Code:
UPDATE `thread` SET title = REPLACE(title,"\"","&quot\;") WHERE title LIKE "%\"%";
UPDATE `thread` SET title = REPLACE(title,">","&gt\;") WHERE title LIKE "%>%";
UPDATE `thread` SET title = REPLACE(title,"<","&lt\;") WHERE title LIKE "%<%";
UPDATE `thread` SET title = REPLACE(title,"&","&amp\;") WHERE title NOT REGEXP "&(quot|amp|lt|gt)" AND title LIKE "%&%";
As usual, backup everything before doing the above.
Best wishes,
Paul
Edit: Due to a bug on vbulletin.org, I had to alter the queries and add an additional & to get them to display properly. They should appear correctly now.
It removes special html characters from a string and fixes a bug that was causing your hack to always update the database when a moderator replied. See:
Certain functions on the forum require that the text stored in the database be htmlspecialchars()'ed. For an example, create a new thread with a title that has quotation marks in it, reply to that thread with a moderator account, and then attempt to split the thread. Notice what happens to the thread title.
All input should be processed with htmlspecialchars(); The first change in my post above corrrects that. The second change fixes the matching check. The queries add special html tags (like " instead of ") to existing thread titles that may have already been affected by this hack.
After a year of running with this hack, we had approximately 400 out of ~60,000 threads which had the problem. We only realized it when someone tried to split one.
Today at 12:40 PM LoveShack said this in Post #33 For an example, create a new thread with a title that has quotation marks in it, reply to that thread with a moderator account, and then attempt to split the thread. Notice what happens to the thread title.
Umm... I did that...notice the ;quot thing...however, I plit the thread and everything was normal. I don't understand what is 'wrong' or 'different.' :ermm: