help or suggestions for updating thread prefixes?

Paulm

Member
Can I get some help either finding an add-on or writing and SQL query to update my forum's old thread titles to match and include the newly added XF prefixes?

The reason for this is that I have a forum that has been around a long time and members regularly search old posts. Since migrating to XF I added prefixes to the built-in system but in the old days members manually entered prefixes in thread titles to identify the type of thread they were starting. I would like to convert those manually entered prefixes to use the XF system.

TIA, Paul
 
That would definitely work for identifying threads which have common text in the title, e.g.

1675709431731.png

1675709445918.png

1675709460311.png

A prefix can then be applied to the matching threads.

It's not clear whether you also wanted the thread titles changed to remove the prefix text.
If so, that would require a custom add-on, or a query for each specific string.
For example: 'UPDATE xf_thread SET title= REPLACE(title, '[solved]', ''); .
You would also need to rebuild the search index to reflect the changes.

Ensure you test any queries on a test installation first and take a backup of any tables before running queries on them.
 
Thank you for the quick reply. I looked at Batch Update but I didn't see a way to change the title so that it was not redundant with the prefix. So that is why I was thinking maybe SQL Query but I was not sure what the sql reference for setting the prefix would be. But looking at yours I'm thinking I could just run the batch update first, then just update the titles and rebuild the search index as you indicated. Thank you
 
Top Bottom