vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   fake dirs (https://vborg.vbsupport.ru/showthread.php?t=127265)

sabret00the 09-23-2006 07:14 AM

thanks nico :)

nico_swd 09-23-2006 08:17 AM

I've checked your site a bit, and there are some users with weird usernames that could cause errors. This here should work with most of them.
Code:

RewriteEngine on
RewriteRule ^(.*)/$ user.php?username=$1
RewriteRule ^(.*)/friends(/)?$ user.php?username=$1&display=friends
RewriteRule ^(.*)/syndications(/)?$ user.php?username=$1&display=syndications
RewriteRule ^(.*)/([0-9]+)$ user.php?username=$1&e=$2

It would be easier and safer if you could use the userids instead of the usernames. If a user has for example a * in his username it will cause an error, and I'm not sure if there's a way around that.

The code above also requires a slash at the end when calling /journals/sabret00the/. I couldn't get it to work without.

sabret00the 09-23-2006 09:34 AM

Quote:

Originally Posted by nico_swd
I've checked your site a bit, and there are some users with weird usernames that could cause errors. This here should work with most of them.
Code:

RewriteEngine on
RewriteRule ^(.*)/$ user.php?username=$1
RewriteRule ^(.*)/friends(/)?$ user.php?username=$1&display=friends
RewriteRule ^(.*)/syndications(/)?$ user.php?username=$1&display=syndications
RewriteRule ^(.*)/([0-9]+)$ user.php?username=$1&e=$2

It would be easier and safer if you could use the userids instead of the usernames. If a user has for example a * in his username it will cause an error, and I'm not sure if there's a way around that.

The code above also requires a slash at the end when calling /journals/sabret00the/. I couldn't get it to work without.

what i'll do is, i'll get users to change their usernames, it seems the best bet. thanks for your help, i really appreciate that.

nico_swd 09-23-2006 10:04 AM

What you can do is following to avoid new users with bad characters.

Go to.

Admincp -> vbulletin options -> User registration options -> Username Regular Expression

And enter this: ^[-_A-Za-z0-9]+$

This way users can't pick bad characters and you don't have to worry about it in the future.


All times are GMT. The time now is 02:20 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.01744 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete