vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Change Username Hack (https://vborg.vbsupport.ru/showthread.php?t=24582)

Scott MacVicar 08-04-2001 11:32 PM

I wrote a small modification to allow users to change their usernames, they can change their username ok and post at the forums etc.

BUT when they go to view a forum where only admins and moderators can post they get the standard No Permissions or You need to be registered error.

Dennis Wrenn 08-05-2001 12:16 AM

Well, that's perfectly normal. If the forum is only for Administrators and Moderators, then they shouldn't be allowed to view it.

Do you want them to be able to view - but not post in the forum?

Scott MacVicar 08-05-2001 12:41 AM

sorted now :)

i had it set on private forum =/

Admin 08-06-2001 04:47 AM

Can you release your hack?
It sounds nice, and very useful. :)

Scott MacVicar 08-06-2001 05:48 AM

Instructions are in the file. Isn't too hard to install.

If you need any help just post back here.

Look at http://vbulletin.com/forum/showthrea...threadid=24722 latest verion from there

RobAC 08-06-2001 06:50 AM

If a user has...say....20 posts, and they go and change their username, do all their posts automatically update with the new username? If you have a members only board with a lot of members and you have several members changing their usernames, you're probably going to have problems with posts having invalid usernames, etc., unless you periodically update user info, post counts, etc., via the Admin CP.

Admin 08-06-2001 07:21 AM

The user's ID does not change. Everything the user has posted before is associated with his ID, including his username.
So yes, all of past posts and everything else will have the new username.

Scott MacVicar 08-06-2001 07:25 AM

Nope, only the user ID is stored in the thread table not the Username. So when the username changes, it changes it for all posts made by the user.

Dimitri 08-06-2001 08:14 AM

I get the following error after applying the hack to member.php:
Code:

Parse error: parse error in /---removed---/member.php on line 1298
I am using 2.0.3 so I'm not sure if that's the problem.

Admin 08-06-2001 08:25 AM

Dimitri, this is the code you will need to paste:
PHP Code:

  if ($username != $bbuserinfo[username]) {
    
$username trim($username);
    
$username eregi_replace("( ){2,}"" "$username);
    if (
$checkuser=$DB_site->query_first("SELECT username FROM user WHERE username='".addslashes(htmlspecialchars($username))."' OR username='".addslashes(eregi_replace("[^A-Za-z0-9]","",$username))."'")) {
      eval(
"standarderror(\"".gettemplate("error_usernametaken")."\");");
      exit;
    }
    }
    else {
      
$DB_site->query("UPDATE user SET username='".addslashes(htmlspecialchars($username))."' WHERE userid='$bbuserinfo[userid]'");
      
$bbuserinfo[username] = $username;
    } 

PPN forgot to close one IF statement.


All times are GMT. The time now is 01:41 AM.

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.01134 seconds
  • Memory Usage 1,737KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_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
  • (10)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