![]() |
change username in template
Hi,
I want to replace all occurrences of the username in my forum with the real name, which is a custom field in the user profile. For example, on the forum home I want to replace 'last post made by jdoo" with "last post by John Doo". I found the forumhome_lastpostby template but it refers to $lastpostinfo[lastposter] to find the actual name. However I can't figure out where this variable is filled. Can anyone point me in the right direction? I found that in some templates it is allowed to insert $user[field5], however this is not the case for the lastpostby templates. I'm ok with modifying vbulletin core. thanks! p.s. in case you're asking why not assign the full names as usernames: The usernames are email addresses which is a requirement because its part of a network of services. However I don't want to disclose the email addresses of my members |
You'll be editing a lot of files - many usernames are fetched directly from the database, meaning you will have to change the query in every case this occurs in vBulletin.
|
The problem with this is vBulletin uses usernames for things other then display. For example, to send PMs you use the username (then vBulletin goes and looks up the userid to send to). The last post info is also cached and the username is stored in that cache. If I remember correctly the build_new_post() function in functions_newpost.php might be where it updates the last post info. But I'm not 100% sure. You'll need to have a fair bit of knowledge of PHP as it won't be a case of simple template replacements.
p.s. You may be better of modifying vBulletin to use the email field in the way in which you need it. Instead of trying to replace the usernames. I think there is a modification out that, that will allow users to log in with their email. |
thanks guys, I feared this would involve a lot of editing. The php knowledge is no problem, I've done quite some php-ing. I'm afraid I lack decent knowledge about the structure of vbulletin though.
I'll look into the plugin, that looks certainly like the best option |
All times are GMT. The time now is 04:44 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|