Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 15 Sep 2013, 22:56
create365 create365 is offline
 
Join Date: Aug 2013
replace usernames with displaynames - need function location help

Hello.

So I need to add a value to datastore, so it will be available as style variable.
I need to do the same, as the function that displays username (in post, etc), so it will be available via $postinfo, like $postinfo['myvariable'] and other places within vbulletin.

So I guess it will be a low-level function of vB and probably I have to add my own hook there as there will not be any.

I'm writing a plugin to replace shown usernames with display names set by user. Logging in, etc still with username.

Any ideas on how to achieve that?

Last edited by create365; 15 Sep 2013 at 23:02.
Reply With Quote
  #2  
Old 07 Oct 2013, 08:05
Dogma21cw Dogma21cw is offline
 
Join Date: Sep 2011
Real name: Chris
http://www.vbulletin.org/forum/showthread.php?t=228078
Try this?

Any why not just add it as a profile field and pull it from the users table fieldx?
vB4 tutorial
vB5 Tutorial
Reply With Quote
  #3  
Old 16 Oct 2013, 13:02
Dogma21cw Dogma21cw is offline
 
Join Date: Sep 2011
Real name: Chris
I don't know if you're still paying attention to this thread. But I have done some research for something I am working on and have some more information for you.

fetch_musername is the function & hook that creates the html marked up username. This is what allows you to colour names based on usergroup and such.

Now, near as I can tell, to achieve what you desire you will need to do the following:
  1. Create a user profile field to contain your display username.
  2. Create a template and register the variable for dusername.
  3. Query the sql table for the field you created in step 1 and assign that string to dusername.
  4. NOT RECOMMENDED You can now overwrite the musername function through a plugin substituting the dusername variable for the username one currently in the function. This is simplest, but use it at your own risk.
  5. The other method is to create your own function fetch_dusername, copy the musername function, subbing as I suggested above, setting it up as a hook as well. Then going through your templates and replacing all references to musername and fetch_musername.

It's a bit of a PITA the second way. And probably someone better at me with php and vBulletin will be able to offer you better direction. But since no one spoke up, I thought I'd share the information I had.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 09:22.

Layout Options | Width: Wide Color: