UBB.Dev
Posted By: blaaskaak [7.2.2] [7.3] Rename topic - 09/16/2007 1:44 AM
When you merge 2 threads together you end up with a thread that has more then 1 topictitle. Confusing, because the last-reply subject put on the main forum index.

Also when you move a post with it's reply's to a new topic, you often want to rename the topic. And sometimes, well, you want want to rename a topic. Get a spell error out, and get that spell error also out of the subjects in the reply.

This hack adds a menu option to the "manage topic" menu for mods and admins that renames an entire thread according to the subject of post #1 in that topic.

Enjoy! Or not smile Whatever makes you happy smile

Attached File
renamethreads.zip  (14 downloads)

Description: Update for 7.3
Attached File
renametopic73.zip  (1 downloads)
Posted By: Gizmo Re: [7.2.2] Rename topic - 09/16/2007 3:57 AM
Looks great, thanks blaaskaak!
Posted By: Myke Re: [7.2.2] Rename topic - 09/16/2007 5:09 AM
I had trouble with the attached zip. Anyone else?

And although I've yet to try it out, I'd love to see something like this integrated into the main product! smile
Posted By: Gizmo Re: [7.2.2] Rename topic - 09/16/2007 5:34 AM
Just tested the zip; fails in both winrar and the built in zip option in WXP
Posted By: blaaskaak Re: [7.2.2] Rename topic - 09/16/2007 10:18 AM
Just reuploaded it. It was compressed with winzip, used the WinXP build in zip now.
Posted By: Myke Re: [7.2.2] Rename topic - 09/16/2007 12:18 PM
Thanks blaaskaak, the zip file is fine now and I've successfully integrated your mod! Me likes! smile

I have a couple of considerations for future revisions:

1. It would be nice to be given an opportunity, via js popup or form, to enter a "new" name for the topic. This saves you from having to manually edit the first post, which lazy admins like me would really appreciate! wink

2. When moving/merging threads, have the option of renaming as well. This would be really useful for when you're moving sub-threads that have gone off topic.
Posted By: blaaskaak Re: [7.2.2] Rename topic - 09/17/2007 6:18 PM
I am also lazy, so I like to leave stuff that's already in ubb to ubb.

Not having my own box to edit a topictitle saves me the code to make sure the current subject is correct smile

Originally Posted by Myke
1. It would be nice to be given an opportunity, via js popup or form, to enter a "new" name for the topic. This saves you from having to manually edit the first post, which lazy admins like me would really appreciate! wink

Alternative (less work and safer to code) would be to have a checkbox when you edit the first post of a topic with "Rename the rest also".

Heck, for our board a checkbox would not even be needed. We can force it always.
Posted By: blaaskaak Re: [7.2.2] Rename topic - 09/17/2007 6:35 PM
Originally Posted by blaaskaak
Heck, for our board a checkbox would not even be needed. We can force it always.

For those interested,

if you modify
/scripts/modifypost.inc.php
by finding
Code

if ($post_is_topic == true) {
and adding this below
Code
		// Rename entire topic if first post is editted.
$newSubject="Re: ".$Subject;

$query = "
UPDATE {$config['TABLE_PREFIX']}POSTS
SET POST_SUBJECT = ?
WHERE TOPIC_ID = ?
AND POST_IS_TOPIC = 0
";
$dbh -> do_placeholder_query($query,array($newSubject,$topic_id),__LINE__,__FILE__);

You rename an entire topic simply by editing the first post. This also works if a user renames the subject.
Posted By: Gizmo Re: [7.2.2] Rename topic - 09/18/2007 12:33 AM
Ohhhh, I like that latest addition... Edit the first post and all carries over... definately handy as I've had to rename quite the many topics hehe
Posted By: blaaskaak Re: [7.2.2] Rename topic - 09/18/2007 12:44 AM
Me too, I just put it on our liveboard smile

Nothing like installing a hack just before bedtime and seeing what you'll wake up to in the morning laugh

I've always disliked how threads handled subjects. We were used to classic, where topicstarter sets the topic, and that's it. It's so stupid to see topic subject X on the main forum page, and you can't find that same topic subject on the overview of that specific forum.

Topics have subjects, not individual posts smile
Posted By: luckie Re: [7.2.2] Rename topic - 11/01/2007 2:32 PM
Originally Posted by blaaskaak
When you merge 2 threads together you end up with a thread that has more then 1 topictitle. Confusing, because the last-reply subject put on the main forum index.

Also when you move a post with it's reply's to a new topic, you often want to rename the topic. And sometimes, well, you want want to rename a topic. Get a spell error out, and get that spell error also out of the subjects in the reply.

This hack adds a menu option to the "manage topic" menu for mods and admins that renames an entire thread according to the subject of post #1 in that topic.

Enjoy! Or not smile Whatever makes you happy smile

Hi,
When I click on 'rename this topic', it says 'the selected action has been completed' grin That's all, no oppertunity to insert a new name for the topic..
Did I do something wrong? I followed the instructions step by step smirk
Posted By: Myke Re: [7.2.2] Rename topic - 11/01/2007 2:53 PM
You've done nothing wrong, this is how the mod works. smile Read the original post a little more carefully:

Quote
This hack adds a menu option to the "manage topic" menu for mods and admins that renames an entire thread according to the subject of post #1 in that topic.
So whatever the subject of the first post is, all replies inherit that subject with a "Re: " prefixed.
Posted By: luckie Re: [7.2.2] Rename topic - 11/01/2007 2:58 PM
oops, sorry, overlooked that one smirk
Posted By: Gizmo Re: [7.2.2] Rename topic - 11/01/2007 11:51 PM
I so vote for this and reply & close topic to be included in the next stock release :x...
Posted By: blaaskaak Re: [7.2.2] [7.3] Rename topic - 05/19/2008 3:45 AM
Originally Posted by Gizmo
I so vote for this and reply & close topic to be included in the next stock release :x...


Since this didn't make it into stock 7.3, I attached an update to the first post.

If you had this hack implemented, please replace the /scripts/dorenamethreads.inc.php also.

The hack I posted in this topic to just rename the entire thread if you edit a the first post still works in 7.3.
© UBB.Developers