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 in template (https://vborg.vbsupport.ru/showthread.php?t=190086)

erikp 09-05-2008 08:57 AM

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

Dismounted 09-05-2008 10:02 AM

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.

Opserty 09-05-2008 10:03 AM

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.

erikp 09-08-2008 08:49 AM

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
  • Page Generation 0.01243 seconds
  • Memory Usage 1,711KB
  • 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
  • (4)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