myu (@myu)

Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • It would work fine. :)

    I hacked mine so users would tick on tags that are pre-defined, using only one forum. I thought it would be more suited for the target users who might not be familiar with the whole concept of “tags”, and I think it is working as expected.

    The way I could think of in how to enter tags in the first place is pretty silly but ah well…

    You’d be letting users enter the tags themselves, so it’ll be logically nicer.

    Thanks ck,

    hiragana/katakana are ok, only 50+ letters each, only one pronounciation each but…

    the number of Chinese characters used is “crazy”, as well as one character having several ways of pronouncing, so that’s a real problem… I wonder how MSWord etc does the sorting that actually works.

    Though the way I hacked to make tags only selectable out of list (only mods/admins/etc can add new one to list. Bit dodgey hack..) leaves a possibility of caching it in order maybe…

    For now, I made a plugin, thanks to your instruction, to sort it descending order, so it is sorted in Chinese character -> Katakana -> Hiragana

    I was actually very happy I could make a plugin, instead of hacking the function, so, thanks!

    Thank you.

    I will look for those guides. (And re-do all the “hack”s if possible..)

    Should’ve thought about looking for WordPress guides instead of bbPress ones.

    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.

    how silly I was…. trying to encode the whole header array….

    here’s the working code, just in case somebody else is too tired to work it out …

    (from around line542 down)

    if ($from)
    //$headers[] = 'From: "' . bb_get_option('name') . '" <' . $from . '>'; //orig
    //
    edit
    $headers[] = 'From: "' . mb_encode_mimeheader(bb_get_option('name'), 'utf-8') . '" <' . $from . '>';
    //
    end edit
    }
    $headers = trim(join(defined('BB_MAIL_EOL') ? BB_MAIL_EOL : "n", $headers));
    //
    edit --added
    $subject = mb_encode_mimeheader($subject, 'utf-8', 'B', defined('BB_MAIL_EOL') ? BB_MAIL_EOL : "n");

    //
    end edit
    return @mail($to, $subject, $message, $headers);

    hi,

    tried the mb_encode_mimeheader() thing.. but can’t get it to work as desired. :(

    could i please get a bit more of instruction where to put it in with what parameter(s)?

    —-what i have tried


    towards the end of function bb_mail() in bb-includes/pluggable.php

    $headers = trim(join(defined('BB_MAIL_EOL') ? BB_MAIL_EOL : "n", $headers));

    //--added--
    $headers = mb_encode_mimeheader($headers, 'utf-8', 'B', defined('BB_MAIL_EOL') ? BB_MAIL_EOL : "n");
    //--end add--

    return @mail($to, $subject, $message, $headers);

    Although it shows fine as it comes on my Apple Mail, as momo-i and somebody else mentioned, utf8 can get garbled…

    Thank you in advance

    In reply to: Accents in username

    Will it be possible to upgrade to 1.0 when there’re people registering with utf8 usernames?

    (I’m still testing and editing with 0.9, and will need utf8 names)

    Or will it be better to use 1.0 alpha?

    In reply to: Accents in username

    Thanks for reply.

    Me, I personally don’t mind using alphabet for username, but have to think of target audience. Got me worried a bit. :)

    I hope in the future version there’s some sort of conversion mechanism for people that’s already registered using utf-8 encoded username. (pretty please..)

    In reply to: Accents in username

    sambauers,

    may I ask why non-ascii chars for user name can make the threats of SQL injection etc greater?

Viewing 9 replies - 1 through 9 (of 9 total)