1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Prefixes alphabetically

Discussion in 'Troubleshooting and Problems' started by Dakis, May 21, 2013.

  1. Dakis

    Dakis Well-Known Member

    As I have many many prefixes, it becomes really ugly when they can't be sorted in alphabetical order. When my moderators or myself want to add a prefix to a thread, it's ridiculous searching through dozens of prefixes to find the one we need, as I don't seem to find any way of sorting them.

    Am I missing something?
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Set the display order accordingly for each prefix.
    http://xenforo.com/help/thread-prefixes/
     
  3. Dakis

    Dakis Well-Known Member

    Thanks for the reply Brogan, but I was looking for if there's an automatic way to just sort them alphabetically - I have more than 350 of them and editing them one by one is something I'd like to avoid.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    That's the only way of sorting them.
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    Brogan is correct. There's no interface to sort the prefixes differently other than the display order.

    It would be possible to sort it differently via a code edit or add-on, however.

    I can understand the awkwardness of your situation though. Seeing as all of your prefixes were imported using a custom script written by someone (;)) so it's not like you had the opportunity to enter the display_order properly.
     
  6. Dakis

    Dakis Well-Known Member

    Well I see the point of NOT having such an option, as you would imagine someone that enters the prefixes one by one can also control their display order, but for all imports from vbulletin like mine, I have to go edit them one by one.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    It may be possible to edit the database directly, using a custom script, which would be very quick.
    I haven't tested that though.
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    The difficulty lies as well in that the prefix titles are phrased. So the actual thread_prefix table has no knowledge of the phrase titles. So sorting differently actually still isn't all that easy.
     
  9. Dakis

    Dakis Well-Known Member

    No worries, I'll just edit them - thank you both for your replies.
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    Hold up.

    I think I can do this.

    Give me... some time :)
     
  11. Chris D

    Chris D XenForo Developer Staff Member

    OK. I have something.

    Do you want me to install it and run it for you at your site, Dakis?
     
  12. Dakis

    Dakis Well-Known Member

    sure, go for it lets see what happens.​
     
  13. Chris D

    Chris D XenForo Developer Staff Member

    I'm not using you for testing or anything, I just installed it at my site and nothing blew up.

    Only thing I'm unsure of is how it will deal with Greek letters. But I have used the SORT_LOCALE_STRING flag so hopefully it will take that into account.

    (You may have to tell me if it's worked or not in that case :p)
     
  14. Chris D

    Chris D XenForo Developer Staff Member

  15. Dakis

    Dakis Well-Known Member

    It's behaving funny, most parts it looks ok but for some characters it just puts the prefixes anywhere. I really don't want you spending more time on this, it's no big deal :)
     
  16. Dakis

    Dakis Well-Known Member

    Maybe it's because some of the prefixes now have display order numbers?
     
  17. Chris D

    Chris D XenForo Developer Staff Member

    That's what my script has done.

    It's taken all your thread prefixes, sorted them, and based on the new sorting it gives them a display order.

    Is it only Greek characters that have odd behaviour?
     
  18. Dakis

    Dakis Well-Known Member

    As far as I can see, yes.
     
  19. Dakis

    Dakis Well-Known Member

    But I meant one of my mods already put some display order numbers in some prefixes - would your mod change ALL of them or only those that had zero there?
     
  20. Chris D

    Chris D XenForo Developer Staff Member

    It should have changed all of them.
     

Share This Page