The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using "display name" instead of username when quoting
Hi,
I'm trying to replace the username with a display name (a custom user profile field) on our forums. I've modified the postbit as recommended. I had some trouble getting the "display name" to appear when a user is quoted in a post but came up with the following modification to newreply.php, which seems to work: Code:
// START QUOTE DISPLAY NAME HACK // $originalposter = $postinfo['username']; $originalposter = $postinfo['field5']; } else { // $getusername = $DB_site->query_first("SELECT username FROM " . TABLE_PREFIX . "user WHERE userid = " . intval($postinfo['userid'])); $getusername = $DB_site->query_first("SELECT field5 FROM " . TABLE_PREFIX . "userfield WHERE userid = " . intval($postinfo['userid'])); // $originalposter = $getusername['username']; $originalposter = $getusername['field5']; // END QUOTE DISPLAY NAME HACK If anyone can help with getting "display name" to appear in the threadbit and search results, that would be great. :classic: Edit: Does not change pre-existing quotes, just ones made after this change. The following modification to functions/functions_newpost.php appears to work (again, it's not retroactive, works for posts made after the change): Code:
// START QUOTE DISPLAY NAME HACK // $post['postusername'] = $bbuserinfo['username']; $post['postusername'] = $bbuserinfo['field5']; // END QUOTE DISPLAY NAME HACK I'm just a beginner at this so if it's a bad idea maybe a smarter person than me can advise. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|