Print Topic - Archive

E-Blah Community  /  Mod Requests and Support  /  more username characters
Posted by: hwystitch, January 20, 2007, 10:11pm
ok, got a small problem, we are a gameing clan and our tag has [] in it, is there anyway to edit the register.pl to allow this? I found a line that I thought would work but didnt.
Code
error_reg($registertxt[27]) if($FORM{'username'} !~ /\A[0-9A-Za-z%+,\.†^_ ]+\Z/);
	error_reg($registertxt[27]) if($FORM{'username'} !~ /\A[0-9A-Za-z%+,\.†^_ ]+\Z/);
	error_reg($registertxt[21]) if($FORM{'email'} !~ /\A([0-9A-Za-z\._\-]{1,})@([0-9A-Za-z\._\-]{1,})+\.([0-9A-Za-z\._\-]{1,})+\Z/);


I tried numerous ways to get the [] characters to work in the username, but to no avail. also would like to add the {} characters as well, I know they are used in code so this makes it hard but I tried to use \[ and that didnt work, maybe I am even going about it the wrong way.....any suggestions?
Posted by: pcmantinker, January 20, 2007, 11:16pm; Reply: 1
I'm not a Perl expert, but those characters, no matter where you put them, tell the interpreter how to execute code. You could search Google and see if there is a solution to including your special characters in a string for Perl, but I am unsure of how to do it.
Posted by: Justin, January 20, 2007, 11:48pm; Reply: 2
Code
	error_reg($registertxt[27]) if($FORM{'username'} !~ /\A[0-9A-Za-z%+,\.@†\[\]^_ ]+\Z/);


Should do it.  But that's just for register.  You'll need to do something similar to ProfileEdit.pl.
Posted by: hwystitch, January 21, 2007, 9:10am; Reply: 3
thanks justin, works on edit profile now, but still doesnt work on the register.pl. Not a real big deal, members will just have to register without the tag then change it in profile later. heres what I changed profileedit.pl to.
Code
error($profiletxt[66]) if($FORM{'sn'} !~ /\A[0-9A-Za-z#%+,-\.@†\[\]^_ "']+\Z/ && !$disablesn);


I may try to change register.pl to
Code
!~ /\A[0-9A-Za-z#%+,-\.@†\[\]^_ "']+\Z/ && !$disablesn);


and see if that works. Also noticed that the error_reg($registertxt[27]) is repeated, that on purpose or accident? also do i need to change both of them?
Posted by: hwystitch, January 21, 2007, 9:14am; Reply: 4
nope change to register.pl didnt work.

but still works on the profileedit.pl so no big deal.

thanks justin
Posted by: Martin, January 21, 2007, 11:48am; Reply: 5
In Register.pl find:

Code
$unerror = 1 if($URL{'u'} !~ /\A[0-9A-Za-z%+,\.@†^_ ]+\Z/);


and change to:

Code
$unerror = 1 if($URL{'u'} !~ /\A[0-9A-Za-z#%+,-\.@†\[\]^_ "']+\Z/ && !$disablesn);


Find:

Code
error_reg($registertxt[27]) if($FORM{'username'} !~ /\A[0-9A-Za-z%+,\.@†^_ ]+\Z/);


and change to:

Code
error($profiletxt[66]) if($FORM{'sn'} !~ /\A[0-9A-Za-z#%+,-\.@†\[\]^_ "']+\Z/ && !$disablesn);


I think there is also a typo here, the error_reg($registertxt[27]) line is there twice so delete one of them.
Posted by: Justin, January 21, 2007, 12:22pm; Reply: 6
Yeah, I noticed that thing was in there twice.  I'm not sure why or how it got there twice either.  lol
Posted by: Dmitry, January 27, 2007, 3:00am; Reply: 7
I wonder is it possible to make special characters available in forum messages? For example an English Pound sign: £ It converts to something but not back.
Posted by: Martin, January 27, 2007, 3:37am; Reply: 8
You just need to do the £ sign, it needs no speciel code.

If you need to use code then you would have to enable html in posts.
Posted by: Dmitry, January 27, 2007, 4:07am; Reply: 9
Quoted from Martin
You just need to do the £ sign, it needs no speciel code.

If you need to use code then you would have to enable html in posts.


Thanks for the advise! Anyway £ doesn't work either on my forums.
Posted by: Martin, January 27, 2007, 4:57am; Reply: 10
Try changing this in your template.html:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

to this:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Posted by: Dmitry, January 27, 2007, 5:27am; Reply: 11
Thanks, it works for my forum members. For me the problem is in Opera, which switches automatically charset to Cyrillic  :-/ I have to search through browser preferences.
Posted by: Martin, January 27, 2007, 7:34am; Reply: 12
In Opera:

1. Choose Tools from the menu
2. Select Preferences
3. Under Language select Details
4. Change the character set to iso-8859-1
Posted by: McArgent, August 14, 2009, 5:23pm; Reply: 13
Should this enable spaces in user names?  I've been trying to get that to work with no luck so far.  

I made the changes listed to Register.pl above.  I didn't make any changes to ProfileEdit.pl.  What's the line I'm looking for there?
Print page generated: February 12, 2012, 2:32pm