Skip to:

Re: “alphabetical” ordering of hot tags

Thanks for reply, ck.

I didn’t know how to make plugins..

So, anywhere that say

apply_filter('___', '___');

can be replaced?

Now.. about original question:

$tag_counts is

  • key: raw_tag
  • value: how many times topics are tagged with this tag

Googling a bit more made me realize, there’re problems associated with ordering Japanese words/strings as there’re 2 types of letters and chinese character used.

strnatcasecmp() seem to put things in order of

  1. hiragana in ascending
  2. katakana in ascending
  3. chinese characters in encoding#

ssetlocale(LC_COLLATE, "jp", "jpn");
ksort($tag_counts, SORT_LOCALE_STRING);

shows exactly the same result.

It seems pretty impossible (for me) to order them.

I will flip it to descending, with krsort(); just so the tag “other” won’t come to start.

Skip to toolbar