Thread prefixes

Morgain

Well-known member
I would like to set thread prefixes so that any thread in forums in root Category X has prefix XXX (same name as the Category)

Please tell me if Prefixes will do this. I do not want this as a user option but automatic default that cannot be user opt out.

Also what is a Prefix Group?

LATER
Um I made one to test - named one of the coloured buttons and then selected a Categorty under Nodes and Permissions. Left ALL selected for userghroups.​
No effect whatsoever. When I go in that Category and click to start a new thread it looks just as usual - no prefix even as an option.​
OK messed up wha? If I click what appears to be a link beside an individual button nothing happens. So I put the prefix text I want in the Title textbox.​
That has named ALL the buttons with that label.​
 
Its possible.

First, about prefixes. Prefix groups allow you to group prefixes in groups to make managing prefixes much easier.

How to do it:

Create group for predefined prefixes that you'll use for forums, create one prefix for each forum. Then edit forums, in thread prefixes tab select that group and also select default prefix.

When checking input in function actionAddThread() in XenForo_ControllerPublic_Forum, check if $forum['default_prefix_id'] is set and override user choice with that id. Do you need add-on for this?

Then edit posting form template to hide prefix selection.
 
Ok thank you I got it working.
I had to set a prefix for EVERY Forum instead of doing it for a group of forums in a Category YUCK!

I can see it is working now if I open a new message text box.
But it doesn't work on all the threads that exist already. That's a shame.
It will be OK if someone posts a new message on an existing thread I suppose. But when existing threads come up in a Search the prefix will not be there if no post before today.

When checking input in function actionAddThread() in XenForo_ControllerPublic_Forum, check if $forum['default_prefix_id'] is set and override user choice with that id. Do you need add-on for this?
Then edit posting form template to hide prefix selection.

I have NO IDEA what that means! I am not a coder.
 
Oh thank you! Nice guy.

Possible to make it give the default prefix to all existing threads?
So if you do searches they show up on older threads?
 
Run this SQL query in phpMyAdmin:
Code:
UPDATE xf_thread 
SET xf_thread.prefix_id = 
(
SELECT default_prefix_id FROM xf_forum
WHERE xf_thread.node_id = xf_forum.node_id LIMIT 1
)
WHERE prefix_id = 0;

If you have many threads, this query might take a while to execute.
 
Thank you. Unfortunately my new webhost does not have cpanel and I have not learned the way to use the system there. I will ask my host who is a coder as well to run this for me.
 
Run this SQL query in phpMyAdmin:
Code:
UPDATE xf_thread
SET xf_thread.prefix_id =
(
SELECT default_prefix_id FROM xf_forum
WHERE xf_thread.node_id = xf_forum.node_id LIMIT 1
)
WHERE prefix_id = 0;

If you have many threads, this query might take a while to execute.
Does this apply a thread prefix to all threads within a subforum even if the thread already has an existing prefix?

Edit nvm I found what I was looking for: http://xenforo.com/community/thread...-to-all-threads-in-x-forum.31816/#post-364139
 
No, it doesn't apply prefixes to subforums and does not change existing prefixes. To change existing prefixes, remove last line "WHERE prefix_id = 0".
 
Hello,

I am using the theme Flexile
By default in the system, is it possible to change the prefix while editing a topic ? I couldn't see that function. Or is it a hack to implement ?
Do you know a way to do this?

Thank you
 
You should be able to change prefix when editing thread.

There are two functions: edit thread and edit post. Make sure you are editing thread, not first post. You can edit thread from "thread tools" dropdown when viewing thread or by clicking "edit" link when viewing threads list.
 
Thank you Arty, yes i saw i could do this for thread post, in fact i was looking for this function while editing the first message of the list (to avoid clicking back to edit message)
Regards
 
Top Bottom