vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Showing a different username (https://vborg.vbsupport.ru/showthread.php?t=275846)

L1teHawk 12-22-2011 08:15 PM

Showing a different username
 
Hi! I have a $userid, and I want to change the username displayed for that id without changing the username. For example, I have a user named "abcd". For the user, I want to show "Mike" instead of abcd. I guess what I'm asking for is a display name/nickname? I should still be able to log in as abcd, but the name displayed should be different.

So far I retrieved some data from a database, and I'm trying to change the name displayed.

Thank you for all your help. Have a great holiday season.

L1teHawk 12-25-2011 02:25 AM

I figured it out-- I just created a hook to fetch_userinfo and changed the $user['username'] to whatever I wanted based on the $user['userid'].

However, it doesn't work everywhere though. There are still some places where the username still says the original unmodified one... Any ideas?

Edit: sorry for the double post

kh99 12-25-2011 11:41 AM

I think your problem may be that the user name for a post is saved in the post table. I'm sure that's done for efficiency, so that post information can be displayed without going to the user table. But it's a problem for what you're doing because you need to either find the places where posts are displayed and change to the nickname, or else find where the post user name is saved and change to saving the nickname (or add a column for it (and in that case you'd also need to fix the existing posts).


All times are GMT. The time now is 02:19 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.01002 seconds
  • Memory Usage 1,706KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete