Author |
Topic  |
|
mbuckner
Starting Member
4 Posts |
Posted - 23 November 2008 : 14:32:50
|
Can anyone help me change the members page to show full names and not usernames
Thanks< |
|
balexandre
Junior Member
 
Denmark
418 Posts |
Posted - 23 November 2008 : 15:35:55
|
do you really want to do this? isn't it be better to change the login into the user first and last name using Admin rights? and ask as well to instead of a username the user can enter his/her full name?
cause the First and Last name are not required when you sign in into Snit Forum by default, and that will show an empty field in where it currently reads the username.
--
you can always change the SQL code when retrieving the topics and forums, for example, in topics.asp, line 96 and again in line 288
change this
strSql = "SELECT M.M_NAME, M.M_RECEIVE_EMAIL, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO" & _ into
strSql = "SELECT M.M_FIRSTNAME + ' ' + M.M_LASTNAME AS M_NAME, M.M_RECEIVE_EMAIL, M.M_AIM, M.M_ICQ, M.M_MSN, M.M_YAHOO" & _
and again in default.asp line 210
from
"M.MEMBER_ID, M.M_NAME, " & _ into
"M.MEMBER_ID, M.M_FIRSTNAME + ' ' + M.M_LASTNAME AS M_NAME, " & _
and all other pages that show the user name (search for M_NAME and replace by M_FIRSTNAME + ' ' + M_LASTNAME AS M_NAME using the correct Table alias if used.< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 23 November 2008 15:44:49 |
 |
|
mbuckner
Starting Member
4 Posts |
Posted - 23 November 2008 : 15:53:17
|
Not sure, My forum is locked down, must login to even access because it is only for my members. I have had request that when the members click on members after logging in that they would like to see the persons first name and last name instead of just the username.
Would the changes that you mentioned cover this for me
Thanks in advance< |
 |
|
mbuckner
Starting Member
4 Posts |
Posted - 23 November 2008 : 16:09:45
|
Not really concerned about blank First Name and Last Name entries because I actually create the user profile information myself. Can you advise how to change the display from the username to Full Name in the members page, thanks< |
 |
|
pwhitehurst
Starting Member
United Kingdom
18 Posts |
Posted - 23 November 2008 : 16:25:12
|
Hi,
In the page members.asp looks like you'd need to make the following changes
The following bit of code builds the SQL to return the recordset of the member details to be displayed.
At or around line 147 replace
'## Forum_SQL - Get all members strSql = "SELECT MEMBER_ID, M_STATUS, M_NAME, M_LEVEL, M_EMAIL, M_COUNTRY, M_HOMEPAGE, " strSql = strSql & "M_AIM, M_ICQ, M_MSN, M_YAHOO, M_TITLE, M_POSTS, M_LASTPOSTDATE, M_LASTHEREDATE, M_DATE " strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS " if mlev = 4 then strSql3 = " WHERE M_NAME <> 'n/a' " else strSql3 = " WHERE M_STATUS = " & 1 end if end if select case SortMethod case "nameasc" strSql4 = " ORDER BY M_NAME ASC " case "namedesc" strSql4 = " ORDER BY M_NAME DESC"
With
'## Forum_SQL - Get all members strSql = "SELECT MEMBER_ID, M_STATUS, M_FIRSTNAME + ' ' + M_LASTNAME AS M_NAME, M_LEVEL, M_EMAIL, M_COUNTRY, M_HOMEPAGE, " strSql = strSql & "M_AIM, M_ICQ, M_MSN, M_YAHOO, M_TITLE, M_POSTS, M_LASTPOSTDATE, M_LASTHEREDATE, M_DATE " strSql2 = " FROM " & strMemberTablePrefix & "MEMBERS " if mlev = 4 then strSql3 = " WHERE M_NAME <> 'n/a' " else strSql3 = " WHERE M_STATUS = " & 1 end if end if select case SortMethod case "nameasc" strSql4 = " ORDER BY M_FIRSTNAME ASC, M_LASTNAME ASC " case "namedesc" strSql4 = " ORDER BY M_FIRSTNAME DESC, M_LASTNAME DESC "
The order by clauses are used to sort the data returned, ASC means ascending and desc stands for descending.
That's it I think - Note that this will not retain the username in the members page as well. To see this you'd need to click the profile link to bring up the members profile.
Cheers
Phil
< |
Edited by - pwhitehurst on 23 November 2008 19:21:42 |
 |
|
mbuckner
Starting Member
4 Posts |
Posted - 23 November 2008 : 17:28:43
|
after changing above got below; Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[MySQL][ODBC 3.51 Driver][mysqld-5.0.67-log]Unknown column 'M.M_FIRSTNAME' in 'field list'
/chshog/forums/members.asp, line 218 < |
 |
|
gary b
Junior Member
 
USA
267 Posts |
Posted - 23 November 2008 : 19:09:17
|
Have you looked at the 'Real Name' MOD on SnitzBitz.com?? (AKA 'Full name' MOD)
This may be exactly what you are looking for.< |
 |
|
pwhitehurst
Starting Member
United Kingdom
18 Posts |
Posted - 23 November 2008 : 19:22:54
|
quote: Originally posted by mbuckner
after changing above got below; Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[MySQL][ODBC 3.51 Driver][mysqld-5.0.67-log]Unknown column 'M.M_FIRSTNAME' in 'field list'
/chshog/forums/members.asp, line 218
Sorry about that slight typo in the post I made above.
I have amended the post
See my original post but essentially I'd said M.M_FIRSTNAME + ' ' + M.M_LASTNAME AS M_NAME when it should have read M_FIRSTNAME + ' ' + M_LASTNAME AS M_NAME as the SQL doesn't set a table correlation name of M
From your error I notice you're using mysql so the syntax may need to be CONCAT(M_FIRSTNAME,' ',M_LASTNAME) AS M_NAME. The + syntax is for database table column concatenation under Microsoft Access / Microsoft SQL Server. Phil
< |
Edited by - pwhitehurst on 23 November 2008 19:37:08 |
 |
|
|
Topic  |
|
|
|