artstellars.com (@artstellarscom)

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @artstellarscom

    Participant

    Hi robkk, you’re exactly right. Using extra characters as a user id would be a tough challenge. I’ve created a new topic by a Chinese user id in my forum so that you can see what’s going on by clicking on its id. http://artstellars.co.nz/forums/forum/art-stellars-forum/

    The url for the user profile is http://artstellars.co.nz/forums/users/username such as http://artstellars.co.nz/forums/users/admin/ or http://artstellars.co.nz/forums/users/anna/ but with the Chinese id it still redirect to http://artstellars.co.nz/forums/users/

    I’ve downloaded the pluggin you mentioned above but once it’s activated, the Art Stellars Forum even can’t be opened by Chinese username logon. Hope WordPress can fix such issues like Discuz or another BBS program that can support other characters and have more fancy options for a forum.

    Thanks.

    @artstellarscom

    Participant

    Alright. I downloaded an plugin called “Chinese-username” and it works right now which is great! The code is:

    <?php
    /*
    Plugin Name: Chinese UserName
    Plugin URI: http://www.01on.com/?p=654
    Description: 允许用a-z0-9_.-@和汉字作为用户名
    Author: 白云山
    Version: 1.0
    Author URI: http://www.01on.com/
    */
    add_filter( ‘sanitize_user’, ‘ys_sanitize_user’,3,3);
    function ys_sanitize_user($username, $raw_username, $strict){
    $username = $raw_username;
    $username = strip_tags($username);
    // Kill octets
    $username = preg_replace(‘|%([a-fA-F0-9][a-fA-F0-9])|’, ”, $username);
    $username = preg_replace(‘/&.+?;/’, ”, $username); // Kill entities

    // If strict, reduce to ASCII and chinese for max portability.
    if ( $strict )
    $username = preg_replace(‘|[^a-z0-9 _.\-@\x80-\xFF]|i’, ”, $username);

    // Consolidate contiguous whitespace
    $username = preg_replace(‘|\s+|’, ‘ ‘, $username);

    return $username;
    }
    ?>

    The only problem I found is the Chinese username owner can’t update his info. by clicking on his username in the forum page. Whenever clicking on the hyperlink of the Chinese username, it just redirects to http://artstellars.co.nz/forums/users and displaying a message saying “Not Found – Sorry, but the page you were trying to view does not exist. It looks like this was the result of either a mishtyped address or an out-of-date link”.

    But while registering as an English username there’s no such trouble. Hope WordPress or bbpress can consider support Chinese username in the near future. Thanks.

    @artstellarscom

    Participant

    Hi Robkk

    Many thanks for your help. Change the url and lost password page works right now! You’re the man!

    I’ve installed and activated the wordpress special characters in username pluggin as you recommended but unfortunately it doesn’t work. May be it’s only for russian, cyrillic, arabic as it describes? Any other way to fix it? Thanks.

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