vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin.org Site Feedback (https://vborg.vbsupport.ru/forumdisplay.php?f=7)
-   -   Is the VB Chat turned OFF?? (https://vborg.vbsupport.ru/showthread.php?t=100677)

David Copeland 11-13-2005 12:04 AM

Is the VB Chat turned OFF??
 
I went to www.vbulletin.org and click on the upper right link tiltled CHAT. The applet loaded, and although I was logged in with my user name showng, inside the chat box it said:

Looking up your hostname

Found your hostname (cache)


That nickname is erroneus. Enter another one.

Ramsesx 11-13-2005 12:12 AM

I tried, no problem (from germany)

Brad 11-13-2005 05:12 AM

Sounds like your username doesn't play well with the irc server. If you get that error type "/nick nicknamehere" (without the quotes, replace nicknamehere with the nick you want to use).

Club3G 11-13-2005 05:36 AM

I use the same Chat, and on my IRC server (EFNet) from what I can tell names with spaces aren't allowed. The applet is setting your nick as "David Copeland", which is why it's bouncing you.

Brad, if you come up with a way to truncate spaces, I'd be mucho appreciative of seeing how you do it. :)

Marco van Herwaarden 11-13-2005 06:21 AM

Quote:

Originally Posted by Club3G
Brad, if you come up with a way to truncate spaces, I'd be mucho appreciative of seeing how you do it.

If you mean to remove spaces inside names, you could use simply:
PHP Code:

$name str_replace(" """$name); 


eXtremeTim 11-13-2005 06:52 AM

Quote:

Originally Posted by MarcoH64
If you mean to remove spaces inside names, you could use simply:
PHP Code:

$name str_replace(" """$name); 


Darn I got beat to it lol.

Club3G 11-13-2005 07:04 AM

Aah, outstanding, thanks. :D I've no idea how to get php to actually pull the vb name variable and stuff it into $name, but I'll look into doing it. :D

(Sorry for turning this into an impromptu quick hack support discussion, lol)

Dean C 11-13-2005 09:12 AM

Quote:

Originally Posted by MarcoH64
If you mean to remove spaces inside names, you could use simply:
PHP Code:

$name str_replace(" """$name); 


Or better yet :D

PHP Code:

$name preg_replace('/[^A-Za-z0-9-_`\[\]]/i'''$name); 


Lea Verou 11-14-2005 09:17 AM

Quote:

Originally Posted by Dean C
Or better yet :D

PHP Code:

$name preg_replace('/[^A-Za-z0-9-_`\[\]]/i'''$name); 


Ahh those regular expressions... They are too difficult :(

Brad 11-14-2005 09:31 AM

At first yes, but once you get the hang of them they become very powerful. :)

Lea Verou 11-14-2005 09:34 AM

Quote:

Originally Posted by Brad
At first yes, but once you get the hang of them they become very powerful. :)

Yes, I can understand that but they are still difficult :p
And my book only talks about the other ones (those that work with ereg_replace :()

Brad 11-14-2005 09:49 AM

Shame, I notice a lot of them leave out PCRE.

http://www.tote-taste.de/X-Project/regex/

Hopefully you'll find that link of use. ;)

Lea Verou 11-14-2005 09:51 AM

Quote:

Originally Posted by Brad
Shame, I notice a lot of them leave out PCRE.

http://www.tote-taste.de/X-Project/regex/

Hopefully you'll find that link of use. ;)

Thanks, I bookmarked :)
It looks nice-written :)

Marco van Herwaarden 11-14-2005 09:59 AM

Well by answer was the best for the original question, only to remove the spaces. If you have the choice, a str_replace is much faster. Dean however extended to original question nicely with the removal of some more special characters (although with some limitations that could also be done with str_trplace..

Lea Verou 11-14-2005 10:02 AM

Quote:

Originally Posted by MarcoH64
Well by answer was the best for the original question, only to remove the spaces. If you have the choice, a str_replace is much faster. Dean however extended to original question nicely with the removal of some more special characters (although with some limitations that could also be done with str_trplace..

Yep, why shouldn't that for example be doen with str_replace (many of them for the other characters)? Is it slower?

Marco van Herwaarden 11-14-2005 10:06 AM

BEcause with a str_replace you can only search for a list of chracters. With regular expressions, you can also deny any character that is not in a list.

David Copeland 11-22-2005 02:18 AM

Quote:

Originally Posted by Dean C
Or better yet :D

PHP Code:

$name preg_replace('/[^A-Za-z0-9-_`\[\]]/i'''$name); 



Dean C,

I noticed you are the only one in this thread with a space between first and last name, such as my user name.

So do I have to log out as David Copeland to use this forum's chat?? Or can the webmaster here modify the code to allow anyone with a space to use the live chat?

David

Guest190829 11-22-2005 02:22 AM

No, once you go into the chat and get the error just type:

Quote:

/nick NICKNAME
Replace NICKNAME with any other nickname that you want, and that doesn't produce an error. My username isn't allowed either thanks to the period, but I use Danny on the irc.

Chris M 11-22-2005 02:46 AM

Mine also isn't allowed because of the space - I use ChrisM with no space :)

Chris

Jenta 11-22-2005 02:55 AM

PHP Code:

// bad characters
$cleanchr preg_replace("/[^ \\\\{}\^`\[\]\|\-\w]/"""$vbulletin->userinfo['username']);

// leading numbers and dashes
$cleannum ereg_replace("^[0-9\-]*[0-9\-]"""$cleanchr);

// convert spaces to underscores
$nick ereg_replace(" ""_"$cleannum); 


Chris M 11-22-2005 03:37 AM

Quote:

Originally Posted by Jenta
PHP Code:

// bad characters
$cleanchr preg_replace("/[^ \\\\{}\^`\[\]\|\-\w]/"""$vbulletin->userinfo['username']);

// leading numbers and dashes
$cleannum ereg_replace("^[0-9\-]*[0-9\-]"""$cleanchr);

// convert spaces to underscores
$nick ereg_replace(" ""_"$cleannum); 


I'm sure you meant $bbuserinfo[username] ;)

We aren't on 3.5 yet ;);)

Chris


All times are GMT. The time now is 01:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01672 seconds
  • Memory Usage 1,776KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_php_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (21)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete