• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Block Space?

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
6 posts • Page 1 of 1

Postby snipey50 » Thu Oct 28, 2010 4:07 am

Ok I noticed there is a glitch with the kick command and I cant kick people with spaces in their name. Is there a way to fix that or block spaces from people's names?
If so please reply with what to change. Thanks in advance.
snipey50
New member
 
Posts: 3
Joined: Wed Oct 27, 2010 3:35 pm
Top

Postby OldWolf » Thu Oct 28, 2010 7:04 am

Try it with quotes
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby snipey50 » Fri Oct 29, 2010 6:31 am

Thanks!!! That helped out a lot. One more thing, How would I go about adding an icon next to my name when I'm tagged as a admin so It stands out more when I say something in the chat?
snipey50
New member
 
Posts: 3
Joined: Wed Oct 27, 2010 3:35 pm
Top

Postby OldWolf » Fri Oct 29, 2010 7:29 am

That I couldn't tell you. You are identified on the user list with a shield, but I've never attempted what you're describing. I'm sure someone has though, wait and see if anyone else jumps in.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby waiheke » Fri Oct 29, 2010 12:06 pm

snipey50 wrote:Ok I noticed there is a glitch with the kick command and I cant kick people with spaces in their name. Is there a way to fix that or block spaces from people's names?
If so please reply with what to change. Thanks in advance.

It doesn't have to be a problem

I set up a front door page that asks for the user name.
They can put what they like, but it's asimple form that will only take 8 characters

Then the next page does several things:
Trims any spaces, makes the name lowercase, and removes numbers or weird characters.


From then on in, the user name is manageable.
The change nickname is disabled.



Code: Select all
<?php
$n = $_POST[name]
// page 2, name has been posted in a simple form, max 8 characters

$string = strtolower($n);
// name is now lower case

$new_string = preg_replace("/[^a-zA-Z0-9s]/", "", $string);
// alphabet only

// remove spaces
$new = str_replace(' ', '', $new_string);

// passed into session for the next page
$_SESSION[name]=$new;

?>
Last edited by waiheke on Fri Oct 29, 2010 12:06 pm, edited 1 time in total.
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby OldWolf » Fri Oct 29, 2010 7:40 pm

He worked out that problem waiheke, he just needed to use quotes. Now we're trying to find out how to add an identifying symbol in the chat next to admin messages.
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top


Post a reply
6 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 12 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub