To fill in the gaps from deleted threads in the past. I've also split some old threads into separate ones, and wanted to assign them lower numbers.
If you get it wrong then yes you could cause serious problems with your board - it is not something that I would attempt to do. Also renumbering topics randomly may cause some unexpected results if topics are sorted by their id.
Well, that's enough trouble in my opinion, because if you intend to change the ID to more than 1 topic, you'll have to automatize the change, and make sure you don't leave your tables in a broken state.
Newly generated topics won't use lower IDs to fill those sequence gaps, they will be +1 higher than the last ID on your tables, so they won't be affected nor do what you want.
No problem, thank you for explaining this, I won't touch a thingAlfredoRamos wrote: ↑Wed Sep 22, 2021 8:52 pm No offense, but it seems that you don't know the implications of what you are doing (or want to do), and hence, unless you are very proficient in database management, you shouldn't try to do any database changes.
Yes it would have it's own ID but it would be incremented from last topic created. The OP wants to use lower numbers presumably from deleted topics.
I've got a couple of left field ideas - could you create a word/swear filter that replaces the links? eg. a filter to change viewtopic.php?t=XXXXX with viewtopic.php?t=YYYYY so that all of the original links point to the new topic.wualla wrote: ↑Sat Apr 16, 2022 12:22 pm I got this thread looking for a way to change the topic identification number.
My problem is that I made a mistake in merging two topics and the final topic identification number was taken from the new topic and not from the old one. The real issue is that the old topic was quite large and the entire bulletin board is riddled with links to that topic which are currently broken.
Maybe modifying the topic identification number back to the original one is not the best solution but what other options would I have?
$topic_id = $request->variable('t', 0);
, add $topic_id = ($topic_id === XXXXXX) ? YYYYYY : $topic_id; // Replace XXXXXX with the original topic id, YYYYYY with the new topic id
. That way whenever anyone tries to view the original topic, it will redirect them to the new topic.These are excellent proposals but I would not implement them in the forum. If that were my goal I would find it easier and cleaner to do a search and replace in the database tables to modify the old topic number with the new one in all the related posts; but I won't do it because there are many links to the old topic number on other web sites and search engines.battye wrote: ↑Sun Apr 17, 2022 7:29 amI've got a couple of left field ideas - could you create a word/swear filter that replaces the links? eg. a filter to change viewtopic.php?t=XXXXX with viewtopic.php?t=YYYYY so that all of the original links point to the new topic.
It could be worth trying that because it's an easy one to experiment with. Maybe it won't play nice with the url bbcode's though.
Another thing you could do, which is a bit of a quick and dirty fix but I see no reason why it wouldn't work if you're comfortable modifying PHP files, would be at the top of viewtopic.php just under https://github.com/phpbb/phpbb/blob/a12 ... ic.php#L31$topic_id = $request->variable('t', 0);
, add$topic_id = ($topic_id === XXXXXX) ? YYYYYY : $topic_id; // Replace XXXXXX with the original topic id, YYYYYY with the new topic id
. That way whenever anyone tries to view the original topic, it will redirect them to the new topic.