Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

53 users online



neverside registering and subdomain

neverside registering and subdomain

Currently viewing this thread: 1 (0 members and 1 guests)


Page 1 out of 2
celldamage

celldamage

dahnhilla
Status: Offline!

neverside registering and subdomain

Hey,

I'm trying to acheive user profiles, like you have here eg. username.domain.com

I'm going to use SMF as my member base and forum, and my own gallery script, both work perfectly Smile

My question is related to this:
Because your neverside account will comes with a .neverside.com subdomain (Unavailable at the moment), we have to restrict the characters you can use in your username. You may only use letters, numbers, the underscore (_) character and the hyphen (-) character. Also, you may not use underscores or hyphens as the first or last character of your username, and you may not use adjacent ones.

How do you detect:
1. Underscores or hyphens at beginning or end (and remove them?)
2. Adjacent underscores/hyphens
2. How to remove anything that isnt a underscore, hyphen, number or letter?

Thanks!

___________________

http://elixant.co.uk/banner.jpg http://ftmb.net/mystuff/ftmbmini.gif

Rook

Rook

Everywhere you go. There you are.
Status: Offline!

I'd say pass the entry data through a function, like so:

PHP:

<?php

function boldme ($text)
{

$search = array(
'#\[b\](.*?)\[/b\]#' //this finds [b] text [/b]
);

$replace = array(
'<b>\\1</b>' //this replaces it with <b> Text </b>
);
return 
preg_replace($search $replace$text);

}

?>

I know that isn't what you're looking for exactly, thats just the method, I took that from my BBCode filter function. Just search for erroneous characters and replace them with ones that work. Or you could send back to the user that you can't have those certain characters, and force them to try again.

Theres probably a better way to do that, but I've never done anything like that, so I can only give you a suggestion.

Hope that helped, good luck.

___________________

Koreans stole my domain.

Last edited by Rook, March 18th, 2006 01:39 PM (Edited 1 times)

BigToach

BigToach

Neversidian
Status: Offline!
PHP:

<?php

$finds 
= array('/[^a-z0-9_-]/i''/(__|-_|_-|--)/''/^([_-]+)/''/([_-]+)$/');
echo 
preg_replace($finds''$username);

?>

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

celldamage

celldamage

dahnhilla
Status: Offline!

Bingo! That worked, thanks BigToach! Grin Also thank you Substance, yours would have worked too, but Toach put the characters into it, and i'm a lazy so n so Wink

NS rules Smile

___________________

http://elixant.co.uk/banner.jpg http://ftmb.net/mystuff/ftmbmini.gif

Last edited by celldamage, March 19th, 2006 03:07 PM (Edited 1 times)

bleedwithme

bleedwithme

i do my crosswords in pen
Status: Offline!

Err... We can use underscores as the first character. For example, me! Tongue

BigToach

BigToach

Neversidian
Status: Offline!

No we can't, remember I changed yours individually. You are the special one with it like that.

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

Noel

Noel

Nobody fucks with my title.
Status: Offline!

Plus your subdomain doesn't work: http://_jordan.neverside.com/

Sucks for you!

___________________

<3

Rook

Rook

Everywhere you go. There you are.
Status: Offline!
Originally posted by Noel:

Plus your subdomain doesn't work: http://_jordan.neverside.com/

Sucks for you!

I don't know if that was joke, but it works just fine for me:

Attachments:

jordanprofile.jpg jordanprofile.jpg (Download) 426.38 Kb, 139 views

___________________

Koreans stole my domain.

DigitalDream

DigitalDream

ruby on weapon
Status: Offline!

yep, works for me too Grin

___________________

digitalDream // complete Webdesign solution //
- - - - - - [ end signature ] - - - - - -

BigToach

BigToach

Neversidian
Status: Offline!

sux for noel it appears

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

Page 1 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0191 seconds.