HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Mentions+ setting problem. Your help will be appreciated.

boardwalkboardwalk New
edited September 2014 in Localization

First of all, I didn't want to bother you guys with every single questions, so I tried to figure it out by myself entire day.

But I surrendered. :(

I am Korean, I am trying to set up Mentions+ for Korean Language.

Definitely, there is few Koreans who build forum with Vanilla.

I need your help.

.
.

(1) To begin with Regular Expression, Yes I am not sure about Korean regex..... (Why is it so difficult??)

To make 'my own regex',

After this '\d\w_ ', should I put Korean regex? ex) '\d\w_ [가-힣]'

or should I replace whole phrase? ex) '[가-힣a-zA-Z0-9]'

I am trying to test every cases, but I don't know I'm doing right or not.

.
.

(2) Moreover, my site get crashed whenever I change /conf/config.php

I did what @R_J‌ mentioned : http://vanillaforums.org/post/quote/24691/Comment_190750

R_J mentioned config.ini but I couldn't find that file, and I thought is is /conf/config.php

anyway, there is no $Configuration['Garden']['User']['ValidationRegex'] = 'my own regex'

(In my case 'my own regex' should match All Numbers, English, and Korean. Am I right?)

However, whenever I change config.php, my site get crashed with this message: 'Something has gone wrong.' with huge vanillicon :-(

To get it back.

① I have to delete /conf/bootstrap.after.php

At this moment, if I add new /conf/bootstrap.after.php → Site crash again.

So I have to do ①first, ②then enable Mentions+ ③upload new /conf/bootstrap.after.php → Site come back to normal.
(I did it many times)

In this case, I am not sure the change I made above(adding new line) in /conf/config.php is working or not.

.
.

(3) And I am not sure about library/core/fuctions.validation.php line152

C("Garden.User.ValidationRegex","\d\w_"),

Should I change this '\d\w_' with 'my own regex'? (I tried both ways)

I did this : https://github.com/vanilla/vanilla/pull/1653/files
`- '/(^|[\s,.>])@(\w{1,50})\b/i', //{3,20}

  • '/(^|[\s,.>])@('.ValidateUsernameRegex().')\b/i', //{3,20}`

Also I did this : https://github.com/vanilla/vanilla/pull/1654/files#diff-604330a5cab4bf405103e84612897812R1404
`- '/(?:^|[\s,.>])@(\w{3,20})\b/i',

  • '/(?:^|[\s,.>])@('.ValidateUsernameRegex().')\b/i'`

.
.

(4) Also I tried this Unicode setting?
http://vanillaforums.org/post/quote/24691/Comment_190756

But you also have to go to the lines that you've already changed in functions.general.php and class.format.php and change /i'(end of the line) to '/iu'

.
.

(5) 'my own regex' should be equal in where and where?
class.mentionsplus.plugin.php config.php functions.validation.php ?

.
.

....So.... would anyone tell me where should I begin again? (I am harshly confused now.)

«1

Comments

    1. Enable the plugin. That will not change anything, but gives you the possibility to change the settings as needed(example.com/settings/mentionsplus)
    2. As the letters allowed in user names, you would need following regex parts: letters, numbers, other characters, the unicode range of Korean characters. It should look like that: '\w\d_- [\x{AC00}-\x{D7A3}]'
    3. Now that the settings are made, add/change the /conf/bootstrap.after.php so that it contains Gdn::FactoryInstall('MentionsFormatter', 'UmlautMentionsFormatter', NULL, Gdn::FactoryInstance); (use the template that's in the zip file).

    The entry in the bootstrap will force Vanilla not to use the built in mentions functions and so you do not have to change any core files.

  • Oh.. my quote went to wrong...
    So do you mean I should keep my changes above? and try your 1~3?

  • boardwalkboardwalk New
    edited September 2014

    to be specific, should I keep the changes in config.php fuctions.validation.php, functions.general.php. class.format.php?

    and make all '\w\d_' to '\w\d_- [ㄱ-ㅎ가-힣]'(example)

  • If you mean the changes in functions.general.php and class.format.php, you should reverse them. You also don't need to change your config.php file manually. Simply reverse anything to the start and do the three steps from above (enable, configure, add bootstrap)

  • OK. I will reset everything and follow your simple 3 steps.

    In addition, you mean I don't need /i to /iu right?

  • boardwalkboardwalk New
    edited September 2014

    Also I don't need to change
    from '/(?:^|[\s,\.>])@(\w{3,20})\b/i'

    to'/(?:^|[\s,\.>])@('.ValidateUsernameRegex().')\b/i', in fuctions.general.php and class.format.php

    is it right? None of codes in the files needs to be manually corrected?

  • @R_J said:
    The entry in the bootstrap will force Vanilla not to use the built in mentions functions and so you do not have to change any core files.

    All your ValidateUsernameRegex changes in the two mentioned files will not be processed anyway, when you use Mentions+

  • I deleted all files and DB. Re-installed Vanilla Forum.
    I tried just 3 simple steps.

    All the post contents disappeared. Is it because of my wrong regex?

  • @boardwalk said:
    I deleted all files and DB.
    (..)
    All the post contents disappeared

    You've deleted everything and you are surprised that everything is gone? You are joking...

    If not: that has nothing to do with regexes at all. If you delete data it is gone. Comments are stored in the database, so I hope you have a backup.

  • boardwalkboardwalk New
    edited September 2014

    oh.....man. of course I made new discussions ...

    The posts are gone after I put the regex at Mentions+ setting.
    I mean posts' contents are not visible.

  • :D glad I just misinterpreted what you said!

    I guess it is a problem with the regex. Could you simply change it in the settings back to \d\w and see if the content is viewable again?

  • boardwalkboardwalk New
    edited September 2014

    Yes. with '\d\w' it came back to normal. I'm trying to put every cases to work, but I haven't found good one yet.

    So.. maybe can I try with /iu ? or no need to change?

  • boardwalkboardwalk New
    edited September 2014

    This is the place to put regex. Right?

    I'm curious why even the regex you wrote is not working. It makes contents not viewable. As same as above.

    8.png 12.1K
  • BleistivtBleistivt Moderator
    edited September 2014

    Try \w\d_\- \x{AC00}-\x{D7A3}

  • boardwalkboardwalk New
    edited September 2014

    @Bleistivt‌ Not working. invisible same :(

  • peregrineperegrine MVP
    edited September 2014

    what about something like this

    /\.?{Hangul}+/u

    /[d_-\p{Hangul}]/

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine‌ Not working. Contents are not viewable...

  • peregrineperegrine MVP
    edited September 2014

    where are you changing regex I'm lost

    only in the mentions plus plugin?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • boardwalkboardwalk New
    edited September 2014

    Here. Settings>Addons>Plugins>Mentions+ Settings

    9.png 6.6K
  • BleistivtBleistivt Moderator
    edited September 2014

    You can't have grouping or delimiters in the regex, as it gets wrapped in [ ]

    try \.?{Hangul}+

    Also make sure you reverted all of the changes you made above that were unnecessary.

Sign In or Register to comment.