Multi Prefix

Multi Prefix [Paid] 2.11.2

No permission to buy ($30.00)

swiftyste

Active member
@Xon Yeah your thinking not this guy again 🤬 do you know the code for multi prefixes in filters? example:

<xf:if is="in_array($filters.prefix_id,[256,257,258])">

Thanks again.
 

Xon

Well-known member
The easiest solution is;
XML:
<xf:if is="in_array(256, $filters.prefix_id) || in_array(257, $filters.prefix_id) || in_array(258, $filters.prefix_id)">
 

swiftyste

Active member
The easiest solution is;
XML:
<xf:if is="in_array(256, $filters.prefix_id) || in_array(257, $filters.prefix_id) || in_array(258, $filters.prefix_id)">
If only xf wasn't as simple, thanks so much for your help with this! Does save me copying and pasting the same code 20 times it is what it is when you want different descriptions to some prefixes & doesn't use default for the rest.

That's definitely it for now thanks again!
 

Robert9

Well-known member
Maybe someone can explain me how the prefix and prefix_ids are saved?
In prefix_id we have one prefix_id, in prefix_ids we have them all.
So one prefix_id is in both fields, but which one?

What is the rule to save them? Is it done by the display_value? Or come in first, saved first? Or ?
 

Xon

Well-known member
The value which gets saved into prefix_id is somewhat non-deterministic when inspecting a pile of threads after they have been saved.

The prefix displays prefixes by prefix sort order, and tries to save in that sort order. Meaning the first prefix you see should be the one you expect as prefix_id.

However, if the thread's prefix sort order doesn't match the forum's prefix sort order' the forum's sort user is used for rendering. This makes the first prefix in the prefix list not match the value of prefix_id
 

Cyberkef

Member
Good afternoon @Xon

In v2.4.0 support was added for Watched Threads filtering, but today one of my users reported that this does not seem to work (don't know since when, currently running v2.10.1). The prefixes are clickable, but nothing happens when clicked.
 

Cyberkef

Member
@Cyberkef make sure you've updated both MultiPrefix and Watched Threads filtering to the latest versions
Ah my bad, I did not see from the description of v2.4.0 that it was a whole other add-on on itself (Watched Threads filtering is not installed on our forum)!

Maybe it would make sense that the (Multi) Prefixes remain unclickable on the vanilla watched thread overview (= as it is by default) if the Watched Threads filtering add-on is not installed (as it doesn't do anything anyway)? 🤔
 

Tamasita

New member
Hello @Xon

I really like the plugin but I have an issue. In the article nodes, the prefixes are not linked correctly. Only the first prefix has a link and if you click from the second prefix they are just labels and follow the same link what is for the first prefix. Is it possible to make it compatible to works in article view too?


HTML:
<h2 class="articlePreview-title">
                        
                        
                            
                                <a href="/forums/6/?prefix_id=36" class="labelLink" rel="nofollow"><span class="unlimitedLabel label label--1" dir="auto">Combat sports</span><span class="label-append">&nbsp;</span><span class="unlimitedLabel label label--2" dir="auto">Kickboxing</span><span class="label-append">&nbsp;</span><span class="unlimitedLabel label label--3" dir="auto">City of London</span><span class="label-append">&nbsp;</span></a>
                                
                        
                        <a href="/threads/25/">IAKSHII KAKAHIII SE</a>
                    </h2>
 

ShinLim

Active member
Hi Xon, can I force user choose one of prefix in a prefix group only?
Example:
A prefix group is including one of these prefix : [Shopping] [Cheap] [Mod]
Can I force user can only choose one of them? (And meanwhile other prefix groups can choose multiple prefix)
 

VersoBit

Well-known member
Heya on PHP8.1 we get the following error during upgrade:
PHP:
An exception occurred: [ErrorException] [E_WARNING] Cannot declare class SV\MultiPrefix\XF\Template\XFCP_Templater, because the name is already in use in src/XF/Extension.php on line 171

XF::handlePhpError()
class_alias() in src/XF/Extension.php at line 171
XF\Extension->extendClass() in src/XF/App.php at line 2868
XF\App->extendClass() in src/XF/App.php at line 1819
XF\App->setupTemplaterObject() in src/XF/App.php at line 1381
XF\App->XF\{closure}() in src/XF/Container.php at line 31
XF\Container->offsetGet() in src/XF/App.php at line 3244
XF\App->templater() in src/XF/Admin/App.php at line 99
XF\Admin\App->preRender() in src/XF/Mvc/Dispatcher.php at line 397
XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 60
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2352
XF\App->run() in src/XF.php at line 524
XF::runApp() in admin.php at line 13
 

Xon

Well-known member
How did you upload the files?

When doing a update via the GUI, you must leave the existing files intact and merge the zip's files in overwriting files (but not folders!).

Doing an add-on rebuild should get the add-on & site back into a working state.
 

VersoBit

Well-known member
How did you upload the files?

When doing a update via the GUI, you must leave the existing files intact and merge the zip's files in overwriting files (but not folders!).

Doing an add-on rebuild should get the add-on & site back into a working state.

Managed to get it back on by re-installing; for context I did this update using the GUI and made no adjustments to the files of the install before processing. (Zip was uploaded to the gui installer).

It appears to be related to this: https://xenforo.com/community/threa...xtension-php-at-line-171.206168/#post-1581467
 

Xon

Well-known member
That is definitely sounding like an XF bug, the class extensions for this add-on haven't changed in a while.
 

Sirmadsen

Active member
Would be possible to have a setting that puts prefixes on their own row? For example top row pushing title below prefixes. If you are using many prefixes which this addon is for, title is pushed far right and depending on how many prefixes and/or title length it can look really weird.
 

Xon

Well-known member
Would be possible to have a setting that puts prefixes on their own row? For example top row pushing title below prefixes. If you are using many prefixes which this addon is for, title is pushed far right and depending on how many prefixes and/or title length it can look really weird.
That already exists; look for the "Move thread prefixes location" style property with the XF admin quick search.
 

Sirmadsen

Active member
That already exists; look for the "Move thread prefixes location" style property with the XF admin quick search.
It only works in forums, not in resources app. Sorry, should have been more specific. But yeah, only works in forums.
 

Russ

Well-known member
Hey Xon, have you seen this before? Clicking thread title opens another prefix field. Doesn't really seem right. Tried with all other add-ons disabled but still doing it (capture is before I disabled add-ons). Version: 2.11.2

chrome_2p5Fj61Xud.gif
 
Last edited:

Xon

Well-known member
Hey Xon, have you seen this before? Clicking thread title opens another prefix field. Doesn't really seem right. Tried with all other add-ons disabled but still doing it (capture is before I disabled add-ons). Version: 2.11.2

View attachment 271747
There is likely a template modification that isn't applying correctly, I'll likely need to adjust it a bit for custom themes.
 
Top