Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Add Special Characters

Asked Modified Viewed 7,791 times
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
asked
Senior Member

I was wanting to know how I could add 2 extra characters to allowed characters. The 2 I want to add are [ ]. Can someone point me in the right direction as to what to edit. thanks
0 replies

29 posts

A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Warning: Please Post your Problem in the Correct Thread !!!

You can simply use them in Regular Expressions by putting a backslash(\) before them.
Example:
if (preg_match("([a-zA-Z\[\]]+)", $username))

This will allow Lowercase and Uppercase A-Z and [ and ] characters.

[ Thread Moved to Modifications and Requests ]
0 replies
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
answered
Senior Member

ok thanks ankur

Merged on Jul 20 2012 at 10:55:58:
LOL. I forgot to ask which file do i modify. That would help.
Edited by Vyper69 on 20-07-2012 16:55,
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Quote

Vyper69 wrote:

ok thanks ankur

Merged on Jul 20 2012 at 10:55:58:
LOL. I forgot to ask which file do i modify. That would help.


You also forgot to ask where do you want to allow those characters... ? B)
0 replies
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
answered
Senior Member

yes i did thanks. I wan them to be allowed in registration and login. For the use of clan tags. I am with a clan and this is how we used to use our tags. [FPS]Vyper.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Edit /includes/classes/UserFieldsInput.class.php. Find this piece of Code :
   private function _settUserName() {
      global $locale;
      $this->_userName = isset($_POST['user_name']) ? stripinput(trim(preg_replace("/ +/i", " ", $_POST['user_name']))) : "";

      if ($this->_userName != "" && $this->_userName != $this->userData['user_name']) {
         if (!preg_check("/^[-0-9A-Z_@\s]+$/i", $this->_userName)) {
            $this->_setError("user_name", $locale['u120']);
         } else {
            $name_active = dbcount("(user_id)", DB_USERS, "user_name='".$this->_userName."'");
            $name_inactive = dbcount("(user_code)", DB_NEW_USERS, "user_name='".$this->_userName."'");
            if ($name_active == 0 && $name_inactive == 0) {
               $this->_userLogFields[] = "user_name";
               $this->_setDBValue("user_name", $this->_userName);
            } else {
               $this->_setError("user_name", $locale['u121']);
            }
         }
      } else {
         $this->_setError("user_name", $locale['u122'], true);
      }
   }


Now Change this Line in this Code :
if (!preg_check("/^[-0-9A-Z_@\s]+$/i", $this->_userName)) {

to :
if (!preg_check("/^[-0-9A-Z_@\s\[\]]+$/i", $this->_userName)) {


Done !
0 replies
V
Vyper69
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
answered
Senior Member

:G Awesome works perfect, thank ankur
0 replies
— 1 year later —
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

please how do I add characters to act from Czech Republic as:

ě š č ř ž ý á í é

s27.postimg.org/7qb24h1hb/znaky.png


Thank you.
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Start with an switch activation for your locale set,
Replace any instance of preg_match where you need these chars to work.
As described above for registration
if (!preg_check("/^[\w-0-9A-Z_@\s\[\]]+$/i", $this->_userName)) {
0 replies
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

private function _settUserName() { 
 global $locale;
 $this->_userName = isset($_POST['user_name']) ? stripinput(trim(preg_replace("/ +/i", " ", $_POST['user_name']))) : "";

 if ($this->_userName != "" && $this->_userName != $this->userData['user_name']) {
[color=#ff3300] if (!preg_check("/^[-0-9A-Z_@\s]+$/i", $this->_userName)) {[/color]
 $this->_setError("user_name", $locale['u120']);
 } else {
 $name_active = dbcount("(user_id)", DB_USERS, "user_name='".$this->_userName."'");
 $name_inactive = dbcount("(user_code)", DB_NEW_USERS, "user_name='".$this->_userName."'");
 if ($name_active == 0 && $name_inactive == 0) {
 $this->_userLogFields[] = "user_name";
 $this->_setDBValue("user_name", $this->_userName);
 } else {
 $this->_setError("user_name", $locale['u121']);
 }
 }
 } else {
 $this->_setError("user_name", $locale['u122'], true);
 }
 }


Ten červený řádek bys měl nahradit takto:

if (!preg_check("/^[-0-9A-Z_@\s\ě\š\č\ř\ý\á\í\é]+$/i", $this->_userName)) {



I did this and it did not help me still says that the characters are not supported.
pls help me.
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Start with my line above your post. Please note the \w addition, it might be all you need.

If you still have problems you can try this,

if (!preg_match("/^[\p{L}a-zA-Z\s]+$/", $this->_userName)) {


There are also ranges for unicode @ http://www.unicode.org/
0 replies
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Unfortunately I still have a problem or your advice helped. butt with [] mentions went out to work these brackets. But my characters do not work :-/

Where can you be more error? :-(
0 replies
A
Arevind
A
Sorry for my bad english, still learning! smile
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums
answered
Newbie

Quote

CrackCZ wrote:

Unfortunately I still have a problem or your advice helped. butt with [] mentions went out to work these brackets. But my characters do not work :-/

Where can you be more error? :-(


Hi! The "fix" what Domi showed is working. Just replace the code with this:
if (!preg_check("/^[\w-0-9A-Z_@\s\[\]]+$/i", $this->_userName)) {

I tested all characters you mentioned so I think it should also work with other letters with diacritic. If you have still problems, just replace the UserFieldsInput.class.php file with the file I attached (you need to extract it first).
Arevind attached the following file:
userfieldsinputclass_3.rar [No information available / 279 Downloads]
0 replies
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Still I wrote that use invalid characters (with registration)


there is a change to be allowed full all the characters? because I really do not know :-(
Edited by CrackCZ on 18-05-2014 09:19,
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Is your site running on Czech locale or is it English?
You need to have the Czech locale defined in locale/global.php


// Locale Settings
setlocale(LC_TIME, "cs_CS.utf8","CS"); // Linux Server (Windows may differ)
$locale['charset'] = "utf-8";
$locale['xml_lang'] = "cs";
$locale['tinymce'] = "cs";
$locale['phpmailer'] = "cs";
0 replies
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

I use a location in Czech / locale / English / global.php is


// Locale Settings
setlocale(LC_TIME, "cs_CS.utf8","CS"); // Linux Server (Windows may differ)
$locale['charset'] = "utf-8";
$locale['xml_lang'] = "cs";
$locale['tinymce'] = "cs";
$locale['phpmailer'] = "cs";
$locale['recaptcha'] = "cs";
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

Everything you should need are in the responses here. The fixes provided are working for other people who have tested them.
You will need to tinker and experiment.
It might be your environment that causes your problem, try other hosts.
Dont run on your own local wamp, xamp installation.
0 replies
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Hello, yesterday I was contacted Arevind using Skype. We tried to look for the error and found this: If you use Slovak translation so my problem is solved and the characters that need work. But when I use the back Czech location features you can not use.

We tried to look for the difference between these locations but we could not find him. Do you know where the problem might be?

PHPFusion CZ: http://www.phpfusion.cz/news.php
PHPFusion SK: http://www.php-fusion.sk/news.php
0 replies
F
Falk
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
answered
Super Admin

I did some research for you.

Try the following methods for your locale/yourlocale/global.php

Replace current section of with one of the below samples, try these one at a time.
Do a hard reload of your page for each test.
Please let us know the results.


// Locale Settings
setlocale(LC_TIME, "cs_CZ.utf8","CS"); // Linux Server (Windows may differ)
$locale['charset'] = "utf-8";
$locale['xml_lang'] = "cs";
$locale['tinymce'] = "cs";
$locale['phpmailer'] = "cs";


// Locale Settings
setlocale(LC_TIME, "cs_CZ.ISO8859-2","CZ"); // Linux Server (Windows may differ)
$locale['charset'] = "utf-8";
$locale['xml_lang'] = "cs";
$locale['tinymce'] = "cs";
$locale['phpmailer'] = "cs";


// Locale Settings
setlocale(LC_TIME, "cs_CZ","CZ");
$locale['charset'] = "Windows-1250";
$locale['xml_lang'] = "cs";
$locale['tinymce'] = "cs";
$locale['phpmailer'] = "cs";
Edited by N/A on 21-05-2014 12:12,
0 replies
C
CrackCZ
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

Unfortunately, none of the codes you send does not work. I tried global.php file from / locate / Slovakia / copy to / locate / Czech / a features work but the whole language of the site is translated into different characters, and the text is not readable.

I tried to copy only the local line from global.php (Slovakia)


// Locale Settings
setlocale(LC_ALL, 'sk_SK', 'slovak');
$locale['charset'] = "Windows-1250";
$locale['xml_lang'] = "sk";
$locale['tinymce'] = "sk";
$locale['phpmailer'] = "sk";


and put it into english global.php but it did not help.

So they know the problem is in global.php but it has to be something more than just


// Locale Settings
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 29 posts
  • Votes 0 votes
  • Topic users 6 members

6 participants

F
F
Falk 131
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 11 questions
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
V
V
Unprecedented Times call for Unprecedented Measures
  • Senior Member, joined since
  • Contributed 551 posts on the community forums.
  • Started 146 threads in the forums
  • Started this discussions
C
C
  • Junior Member, joined since
  • Contributed 18 posts on the community forums.
  • Started 4 threads in the forums
A
A
Sorry for my bad english, still learning! smile
  • Newbie, joined since
  • Contributed 7 posts on the community forums.
  • Started 2 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet