Multi Prefix

Multi Prefix [Paid] 2.13.3

No permission to buy ($30.00)
Ugh, styling conflicts.

This add-on uses default XenForo select2 styling which needs to be styled for a dark-style. You might need to poke however you got the dark theme to look at that.

I think the input field itself just needs to have the "input" class on it along with the select2 classes. Even in the default style, it's actually using Safari's styling for it, causing it to look off.

eTL8x1C.png

XF clears that styling using

Code:
 -webkit-appearance: none;
on .input

This would be a temporary fix @BigPete7978

Code:
.select2 .select2-selection ul .select2-search .select2-search__field
{   
   -webkit-appearance: none;
}
 
I think the input field itself just needs to have the "input" class on it along with the select2 classes. Even in the default style, it's actually using Safari's styling for it, causing it to look off.

View attachment 264175

XF clears that styling using

Code:
 -webkit-appearance: none;
on .input

This would be a temporary fix @BigPete7978

Code:
.select2 .select2-selection ul .select2-search .select2-search__field
{  
   -webkit-appearance: none;
}
Would I put this bottom code in extra.less @Russ?
 
I have to add one millions prefixes to a clients forum.
When i want to set the sv_default_prefix_ids[] i have to use the complete list.
If this list would be reduced to the selected prefixes, it would be mich easier.
 
How is the prefix data actually stored in the thread table?

At the moment, I have a few custom mods that run joins on the prefix_id field - will these be impacted by this add-on?
 
How is the prefix data actually stored in the thread table?

At the moment, I have a few custom mods that run joins on the prefix_id field - will these be impacted by this add-on?
xf_thread.prefix_id is left as-is, but a new xf_thread.sv_prefix_ids column is added. This is an array of sorted prefix ids.

For SQL joins, there is then a new table.
SQL:
CREATE TABLE `xf_sv_thread_prefix_link` (
  `thread_id` int(10) unsigned NOT NULL,
  `prefix_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`thread_id`,`prefix_id`)
)
But you don't need to write any raw SQL for this, and instead should use the provided finder methods.

The thread finder is then extended with the following methods;
PHP:
public function hasPrefixes($prefixIds, bool $andWhere = null): self
public function notHasPrefixes($prefixIds): self

This creates the join to select a thread based on a list of prefixes either by OR (ie at least one) or AND (ie all of them). The 'has not' feature isn't exposed via the public UI for this add-on and is there for some of my private add-ons.
 
Last edited:
xf_thread.prefix_id is left as-is, but a new xf_thread.sv_prefix_ids column is added. This is an array of sorted prefix ids.
So going forward, prefix_id would just have the id of the first prefix chosen?

Thanks 😊
 
The Prefix usage help isn't yet supported.

Adding the prefix description wasn't hard, but the usage help requires some rework of the prefix input.
 
@Xon, if this add-on is removed what happens? Does it leave the first prefix in place? Also the setting to make prefixes clickable where they are not, what is the behavior? If you are in a new post list, does it take you to the forum with the prefix selected like when clicking inside a forum? Thanks!
 
The first prefix is copied into xf_thread.prefix_id so if a thread has a single prefix it will just work. However, when you have multiple prefixes which one is the "first prefix" can be somewhat hard to determine.

Also the setting to make prefixes clickable where they are not, what is the behavior? If you are in a new post list, does it take you to the forum with the prefix selected like when clicking inside a forum? Thanks!
It makes a number of places turn the prefix into a link to the forum+prefix. New post list, view the thread, etc. Can't remember all the spots off the top of my head.
 
@Xon which is right prefix conditional statement for your add-on? I used the following on forum_view didn't cut it:

Code:
<xf:if is="$filters.prefix_id == 256">
 
I'ld recommend using Standard Lib's "View template modifications" to see what it does in forum_view. It uses the template sv_multiprefix_filter to render the filters.

You can use this to work with MultiPrefix and without it being installed;
XML:
<xf:if is="$filters.prefix_id == 256 || in_array(256, $filters.prefix_id)">
 
I'ld recommend using Standard Lib's "View template modifications" to see what it does in forum_view. It uses the template sv_multiprefix_filter to render the filters.

You can use this to work with MultiPrefix and without it being installed;
XML:
<xf:if is="$filters.prefix_id == 256 || in_array(256, $filters.prefix_id)">
Giving me an headache 🤣 trying do custom forum descriptions now you saved me without losing my marbles! Thanks so much for your help and i will try to get my head around standard lib now it's the difficult time making everything work together :rolleyes:

Thanks again :)
 
Top Bottom