Is there an addon that adds a prefix?

Robert9

Active member
1. Thread 1 Prefix London
Thread 2 Prefix Manchester

Now i want to add for both prefix UK

If i choose both thread and gon on, i will have both threads with

UK, London, Manchester


2. Is there an addon that adds a prefix because the thread is in a forum x,y, z without adding a real prefix?
So the problem from above could be solved as long all threads are in

forum uk (with virtual prefix uk)
 

sbj

Well-known member
(Honestly, half of the time I don't understand your threads and questions. It looks like most of the time you are talking to yourself. Anyway, here is my try to make some suggestions, but not sure if I understood you correctly.)

If you want to use multiple prefixes for threads, you can use this addon:

Alternatively you can use this addon for custom thread fields and let the fields display as prefixes (also multiply):

To force prefixes (like have all thread in the forum uk to have a prefix called "uk"), you can use this addon:
 

Robert9

Active member
Thank you, to understand this questions you should know XON's Multi Prefix.

Example:
Thread 1 has Prefix LONDON
Thread 2 has Prefix MANCHESTER

I want to add the Prefix UK to both threads.

At the moment this means, that i have to change thread 1 and then thread 2, because we can set "the prefixes" for these (multiple threads), but we cant "add" one prefix to these threads.

If you have 100 threads with 100 different prefixes and you want to add "UK" to all of them, you have to change 100 threads by hand now.

So i ask for the function "add" instead of "set" {prefixes} to all of them.
I will solve this like usual with a small extern php script manipulating the database directly, but i am wondering that nobody has coded this.
 

Robert9

Active member
Are you shure?
I am afraid this will be also a "set", but not an "add" of prefixes.
But i will try it. Thank you.

Xenforo has only one prefix, so there is no sense to have an "add"; normally this function has to be done from XON with and for his "multiprefix add-on".
 

imno007

Well-known member
Are you shure?
I am afraid this will be also a "set", but not an "add" of prefixes.
But i will try it. Thank you.

Xenforo has only one prefix, so there is no sense to have an "add"; normally this function has to be done from XON with and for his "multiprefix add-on".
When batch updating, you won't be able to add just one prefix to threads with already existing prefixes, if I remember right. Just adding a new one will delete the previous prefix(es). So what you do is search for the prefixes you want to add to (by node if you want) and then add them all at the same time, which works as well in most cases. I'm assuming you're using Xon's addon, of course.

So using your examples above...

1. Thread 1 Prefix London = search for all threads with London prefix and then add both London and UK prefixes at same time.
2. Thread 2 Prefix Manchester = search for all threads with Manchester prefix and add Manchester and UK prefixes at same time
 

Robert9

Active member
Yes, this is the problem. And if you have 100 threads with 100 different prefixes, then you do it 100 times (or you write a small script and let it do for you.)
 

beerForo

Active member
Why don't you use custom fields (for your location fields) and this add-on (for content discovery):
 

Robert9

Active member
No!
I am sorry for my english, i dont know how to say it better.

Example

t1: Paris
t2: Rom
t3: Berlin

and now they all should have an additional prefix "EU" means three times an update.

t1: EU Paris
t2: EU Rom
t3: EU Berlin

There is no batch to do this! <= and this is the point!
 

beerForo

Active member
That is possible

When batch updating, you won't be able to add just one prefix to threads with already existing prefixes, if I remember right. Just adding a new one will delete the previous prefix(es). So what you do is search for the prefixes you want to add to (by node if you want) and then add them all at the same time, which works as well in most cases. I'm assuming you're using Xon's addon, of course.

So using your examples above...

1. Thread 1 Prefix London = search for all threads with London prefix and then add both London and UK prefixes at same time.
2. Thread 2 Prefix Manchester = search for all threads with Manchester prefix and add Manchester and UK prefixes at same time
 
  • Like
Reactions: Xon

imno007

Well-known member
No!
I am sorry for my english, i dont know how to say it better.

Example

t1: Paris
t2: Rom
t3: Berlin

and now they all should have an additional prefix "EU" means three times an update.

t1: EU Paris
t2: EU Rom
t3: EU Berlin

There is no batch to do this! <= and this is the point!
I'm not sure you're understanding my reply above, or you are understanding but are balking at the fact that you would have to do multiple searches for multiple prefixes. But you have two choices: write your own script, as you say you might, or do it like I suggest. If you can write your own script and do it quicker than the time it would take you to batch update multiple prefixes the way I suggested, then go for it. If you literally have 100+ different prefixes and want to simply add one prefix to all 100+ different prefixes, then maybe creating your own script would be quicker. I estimate that it would probably take me somewhere around two hours to add a prefix or prefixes to 100 different (unique) existing prefixes - a ballpark time estimate - so if you can whip up a script in under that time, then I say go for it.
 

Robert9

Active member
Sure. Or better we can make XON understand, that his add-on really, really, really needs that "add-function". :D



There are more examples in the xenforo world like this:


Example:
Move a thread to a conversation || better would be: move OR copy a thread to conversation.

or

Copy a post to conversation || better would be copy OR move a post to conversation


Less more code, but powerful functions for some nice add-ons like the two mentioned above.
 

imno007

Well-known member
Sure. Or better we can make XON understand, that his add-on really, really, really needs that "add-function".
Well, you should request it in the support thread for the addon. It might be possible, or it might be difficult or impossible because of some limitation of the existing XF system. @Xon would definitely be the best person to ask.
 

Robert9

Active member
No, i dont think so.
I am not 100% sure about the tables, but with a fast view a second ago; it is just an

for every chosen thread, select prefixes from prefix_table, prefix from thread
$arr1 = normal prefix
$arr2 = multi prefix(es)

check if new prefix_id(s) are in arrays => yes, next;
else add new prefix_ids to arr1 and/or arr2 (after check where to put)
update table_row.

Very simple, i guess. I will test it tomorrow.
 
Top