How to display Real name instead of user name
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23280
Printed Date: 07 April 2026 at 7:52pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: How to display Real name instead of user name
Posted By: wwf100
Subject: How to display Real name instead of user name
Date Posted: 09 May 2007 at 3:52pm
I want to display real name instead of user name. I tried modify the code in forum_topics.asp as a test, but it didn't work.
Appreciate any tips on this mod.
T
|
Replies:
Posted By: User123
Date Posted: 10 May 2007 at 2:15pm
This is a pretty big change as I went through this same issue myself.
There are a ton of places you have to modify. As an example to get
started if you want to try to embark on this, look at the file
"forum_posts.asp". Down around line 400 (395 in my file but other
modifications may have moved this from the original source code) there
is a SQL select statement. You have to add "Author.Real_Name" to this
select statement something like this:
strSQL = "" & _
"SELECT " & strDbTable & "Thread.Thread_ID, " & strDbTable
& "Thread.Message, " & strDbTable & "Thread.Message_date, "
& strDbTable & "Thread.Show_signature, " & strDbTable &
"Thread.IP_addr, " & strDbTable & "Thread.Hide, " &
strDbTable & "Author.Author_ID, " & strDbTable &
"Author.Username, " & strDbTable & "Author.Homepage, " &
strDbTable & "Author.Location, " & strDbTable &
"Author.No_of_posts, " & strDbTable & "Author.Join_date, "
& strDbTable & "Author.Signature, " & strDbTable &
"Author.Active, " & strDbTable & "Author.Avatar, " &
strDbTable & "Author.Avatar_title, " & strDbTable &
"Group.Name, " & strDbTable & "Group.Stars, " & strDbTable
& "Group.Custom_stars, " & strDbTable & "GuestName.Name, "
& strDbTable & "Author.Real_name " & _
"FROM (" & strDbTable & "Group INNER JOIN (" & strDbTable
& "Author INNER JOIN " & strDbTable & "Thread ON " &
strDbTable & "Author.Author_ID = " & strDbTable &
"Thread.Author_ID) ON " & strDbTable & "Group.Group_ID = "
& strDbTable & "Author.Group_ID) LEFT JOIN " & strDbTable
& "GuestName ON " & strDbTable & "Thread.Thread_ID = "
& strDbTable & "GuestName.Thread_ID " & _
"WHERE " & strDbTable & "Thread.Topic_ID = " & lngTopicID & " " | As you can see I added it to the end of the field list, after the last field which was GuestName.Name. Down a little farther in the file are some inline comments about the array each record gets loaded in to: (excerpted)
... '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, ... '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name | Since I added Real_name after GuestName.Name, Real_name becomes element 20. While it's not required, I added this to the comments to jog my memory if I made further changes in the future:
'20 = tblAuthor.Real_name | This array comment list is repeated down around line 750 so I added it in both places.
Now you have to find the places where it gets the Username and replace it with the Real_name. As you can see from the array list above, element 7 is the Username. This means finding all references to element 7 and changing them to reference element 20. In this particular file there is only 1 place (unless you have other modifications), around line 775:
strUsername = sarryPosts(7,intCurrentRecord) |
Change this to:
strUsername = sarryPosts(20,intCurrentRecord) |
Voila, it will now show the real name instead of the username. Again this is only 1 of a dozen or more places you have to make similar changes.
|
Posted By: wwf100
Date Posted: 10 May 2007 at 2:59pm
|
thanks, user123!
Actually, I did similar mod in forum_topics.asp as you did for forum_posts.asp, but it run into error of can't finding Real_name is field list. Anyway, I will try your approach to see if that works.
|
Posted By: User123
Date Posted: 10 May 2007 at 3:51pm
For forum_topics.asp here's what I changed to achieve the desired results...
Changed line 299:
" " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Topic.Moved_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Icon, " & strDbTable & "Topic.Start_Thread_ID, " & strDbTable & "Topic.Last_Thread_ID, " & strDbTable & "Topic.No_of_replies, " & strDbTable & "Topic.No_of_views, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Priority, " & strDbTable & "Topic.Hide, " & strDbTable & "Thread.Message_date, " & strDbTable & "Thread.Message, " & strDbTable & "Thread.Author_ID, " & strDbTable & "Author.Username, LastThread.Message_date, LastThread.Author_ID, LastAuthor.Username, " & strDbTable & "Topic.Event_date, " & strDbTable & "Author.Real_name, LastAuthor.Real_name " & _ |
(Notice it has 2 additional fields, 1 for the author and one for the last post author).
Added lines 430 and 431:
'20 = tblAuthor.Author_Real_name '21 = LastAuthor.Real_name |
(Just comments for future reference)
Changed line 467:
"SELECT " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Forum_description, " & strDbTable & "Forum.No_of_topics, " & strDbTable & "Forum.No_of_posts, " & strDbTable & "Author.Username, " & strDbTable & "Forum.Last_post_author_ID, " & strDbTable & "Forum.Last_post_date, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Locked, " & strDbTable & "Forum.Hide, " & strDbTable & "Permissions.View_Forum, " & strDbTable & "Author.Real_name " & _ |
(Added Real_name field to the return list)
Added lines 854 and 855:
'20 = tblAuthor.Author_Real_name '21 = LastAuthor.Real_name |
(More comments)
Changed line 874:
strTopicStartUsername = sarryTopics(20,intCurrentRecord) |
(References element 20 instead of 15)
Changed line 880:
strLastEntryUsername = sarryTopics(21,intCurrentRecord) |
(References element 21 instead of 18)
|
|