PDA

View Full Version : Change Username Hack


Scott MacVicar
05 Aug 2001, 00:32
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
05 Aug 2001, 01:16
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
05 Aug 2001, 01:41
sorted now :)

i had it set on private forum =/

Chen
06 Aug 2001, 05:47
Can you release your hack?
It sounds nice, and very useful. :)

Scott MacVicar
06 Aug 2001, 06:48
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/showthread.php?s=&threadid=24722 latest verion from there

RobAC
06 Aug 2001, 07:50
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.

Chen
06 Aug 2001, 08:21
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
06 Aug 2001, 08:25
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
06 Aug 2001, 09:14
I get the following error after applying the hack to member.php:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


I am using 2.0.3 so I'm not sure if that's the problem.

Chen
06 Aug 2001, 09:25
Dimitri, this is the code you will need to paste:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------


PPN forgot to close one IF statement.

Scott MacVicar
06 Aug 2001, 09:37
my bad :p

updated txt file and reloaded it

i just copied and pasted from my member.txt file, never bothered to check the code i had copied -_-

thanks for pointing it out firefly

Chen
06 Aug 2001, 09:57
No problem. :)

Great hack, you should release it! :D

Dakota
06 Aug 2001, 16:39
Is there a way that you could require a certain post count before a user can change their name?

Scott MacVicar
06 Aug 2001, 20:19
ok updated so you can set a amount of posts needed before they can change username, look at

http://vbulletin.com/forum/showthread.php?s=&threadid=24722

for latest version

Wayne Luke
06 Aug 2001, 22:14
Hmmm doesn't leave a whole lot of consistency..

Anyway, you don't need a Hack for this. You should require at least one field (username) to remain constant. You can then give the members a display name which they can change at will. All without hacking needed at all.

Go into the Admin Control Panel and scroll down to the User Profile Field section.

Create a new field called display name and make it required.

Then edit your templates to display this value instead of the username.

Same effect, no hacking, no mess.

It will require hacking to change it based on posts though.

Santa
07 Aug 2001, 06:16
Can u please tell me, which templates I must edit ??? I think this will be not only one or two :) ?

Many Thx


Santa

Chen
07 Aug 2001, 07:03
You need to edit the postbit template.

Santa
07 Aug 2001, 07:06
many thx for this fast answer


Santa