Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Display full name instead of username in comments?
On the comments, I would like to display the users' full names instead of their usernames. I looked around, but I haven't been successful in locating where the relevant code is so that I can make the small modification.
Can someone please help me find the code? As an extra bonus, it would be nice to know the variable or hash to replace in order to display the full name instead of the username.
Thanks,
Bryce
0
Comments
If you're still using 092, you'll need to alter the controls/comments.php file, line 132:
$sReturn .= "<a href=\"account.php?u=".$Comment->AuthUserID."\">".$Comment->AuthUsername."</a></div>";
Change to this:
$sReturn .= "<a href=\"account.php?u=".$Comment->AuthUserID."\">".$Comment->AuthFullName."</a></div>";
I believe that should do it. I just can't remember if first/last name are required fields in 092, I know they are *not* in 093, so I would do something like this to be safe:
$sReturn .= "<a href=\"account.php?u=".$Comment->AuthUserID."\">".($Comment->AuthFullName == "" ? $Comment->AuthUsername : $Comment->AuthFullName )."</a></div>";
In 093 there is no AuthFullName on the user object. I got rid of it because it was slowing down the query and not being used on any of the pages (except the account profile).
There is a lot to do to make it an extension in 093, and I don't have time to do it.
Basically, you'd need to add the FirstName+LastName to the query that returns the comments by using a delegate. Then you'd need to do something wacky like (a) alter the user object so that if there is a fullname loaded in the object, display that as the username, or (b) make a new template for the comments or (c) alter the comment object so that if there is a fullname loaded, display that as the username, etc.
There are many ways to accomplish it...
any hints
# I have spent a bit of tme here... and sadly my php is nil so any help would not only be appreciated... but it is essential if I am to keep with Vanilla
many thanks for looking
cheerts
I seriously hope so
thanks so much for commentting
In my All Discussions the username still appears.
http://www.bajrfed.co.uk/mod/vanillaforum/vanilla/index.php
everywhere else it is the Display Name