MyBB Community Forums

Full Version: Add prefix to the whole forum?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone!

I was wondering if there was a solution to add thread prefixes to already created threads on my forum without prefixes?

I think i have read some post here on community board that the problem could be solved by doing some modifications in the database,may be i'm wrong.

But i'm not able to find that thread.

So, how i can apply prefixes to the threads which have been already created?

Thanks a lot in advance.
You can either edit the thread using the standard forum option and select a prefix from the prefix dropdown afterwards or
you can use a database tool to modify mybb_threads.prefix manually - using the pid from table mybb_threadprefixes.

[ExiTuS]
My forum got 11000 threads and i think, editing them one by one will need my whole life.

So, i was looking for a quick solution if there is any.
With such an amount of threads, you'll definitely need to go the way with database manipulation.
For an approach, you can use any database tool like PHPMyAdmin, adminer.php, etc

Do you have different prefixes for specific threads or just one replacement prefix for all threads without a prefix?
You can simply add prefixes for all missing prefixes with this SQL:

UPDATE mybb_thread SET prefix = "1" WHERE prefix = "";
(where 1 is the prefix ID from table mybb_threadprefixes)

You can also add prefixes for all missing prefixes in threads of a specific forum:
UPDATE mybb_thread SET prefix = "1" WHERE prefix = "" AND fid = "5";
(where 5 i your forum ID)

[ExiTuS]
Didn't work.

Check the screenshot.

[attachment=42272]
Ahh, I missed the default value "0" of mybb_threads.prefix.
So here you go with this SQL:
UPDATE mybb_thread SET prefix = "14" WHERE prefix = "0" AND fid = "10";

[ExiTuS]
UPDATE mybbmm_threads SET `prefix` = "14" WHERE `prefix` = "0" AND `fid` = "10";


Didn't work.

[attachment=42273]
The SQL query is correct! Or does any error message appear?

After sent the SQL query, did you get an alert on how many rows affected? If no rows affected then there is maybe no fid 10 or no missing prefixes in Forum 10.

[ExiTuS]
Yeah, i get that message, no rows are affected.

I've checked the forum id and the prefix id and the prefid id i used was incorrect. I had to use 12 instead of 14 and it worked but only for 2 lines.

[attachment=42274]
If there are only two rows affected, there are only two threads without prefix in this forum (10).
(This means the two threads were created since yesterday).

It would be best to run a SELECT to find threads without prefixes at all:
SELECT * from mybbmm_threads WHERE prefix = 0 ORDER BY fid
This will display and sort all threads without prefix. Check these results first! Then decide which threads (in which forums) you wish to edit.

[ExiTuS]
Pages: 1 2