Skip to:
Content
Pages
Categories
Search
Top
Bottom

Lost passowrd page conflicts with Woocommerce Theme and Chinese username issues

  • @artstellarscom

    Participant

    Hi bbpress team, thanks for creating such good forum product. It’s a great plugin that I can create my own forum easily. There’re two questions. First one is the lost password page doesn’t work when I activated the Woocommerce theme but if I de-active the Woocommerce the lost password page works! I do need Woocommerce to show my gallery. My url is: http://artstellars.co.nz/lost-password/

    Another question is the Chinese username registration by bbpress. it says “ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.” if I register using a Chinese as a username. Is there any pacth can work around this?

    I am using the latest version of bbpress v.2.5.8, Woocommerce v.2.4.7 and WordPress v.4.3.1. Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • @robkk

    Moderator

    1. Not sure why your lost password page is not there?? You can use Woocommerce’s lost password form instead though.

    My Account

    2. Use this plugin, and see if it will help.

    https://wordpress.org/plugins/wordpress-special-characters-in-usernames/

    @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.

    @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.

    @robkk

    Moderator

    I am not going to lie but this chinese username thing is tough to find a fix for since I think most of the work does need to be done for WordPress itself.

    You can try going here and posting a topic aobut this issue to see if anyone has a good suggestion/workaround.

    https://zh-cn.forums.wordpress.org/

    Other than that I guess you might want to look in users keeping english characters in their usernames. I even found a bbPress chinese forum in the wild and they all seem to just be using english characters for their usernames some even numbers which is interesting, because using the users id instead of their username will definitely help you.

    cos.name/cn

    The forums topics using the id looks like they might be using this.

    https://wordpress.org/plugins/bbpress-permalinks-with-id/

    But since you seem to be getting the users to at least register with the characters now. Do you know what each user profile url is in the topic/reply post. Can you check it out in your browsers dev tools so I can see what the url is. I am expecting a url with some chinese characters and maybe some of these %%% in the url which would be leading to a 404.

    @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.

    @robkk

    Moderator

    When I was talking about User ID, I was talking about a number not the name.

    Here is an example on the other site I mentioned. The users username is 谢益辉 but the user profile shows the users ID in their profile url.

    cos.name/cn/profile/1/

    The plugin I mentioned will just help if you do not want the chinese characters in the urls of your forum posts it will just show the ID instead of the name. It is just a helpful plugin that might be useful, it won’t really help you with the profile issue though.

    I do see that the profile page url is filterable and I could possibly make it the users ID instead, so I might try to fool with this. I post a snippet later If I can get it to work, and if it does work might suggest the plugin author of the plugin I listed earlier to add it to their plugin as it might be helpful.

    You can also try switching to the default permalinks to see if that would help, because bbPress by default displays the profile links to be ?bbp_user=1, with the number being the ID which bypasses using the chinese characters completely. See if that works.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar