UBB.Dev
Posted By: SteveZ Customize User List - 10/23/2008 4:02 PM
I want to add a sortable column from the user profile record.

It is the ubbt_USER_PROFILE.USER_EXTRA_FIELD_1 field.

I've had users enter their Graduation year and I'd like to include it on the User List page.

I see that you can modify the showmembers.tpl template. But, it is unclear to me where to begin.

I have UBB.Threads Version: 7.2.2

Thanks smile
Posted By: SteveZ Re: Customize User List - 10/23/2008 9:34 PM
I see this forum's "User List" has some customization, but it's using version 7.3.1. Is this a new feature that was introduced after 7.2.2?
Posted By: SteveZ Re: Customize User List - 10/27/2008 6:17 AM
Tap, tap, tap... Is this mike on?

I hacked the showmembers.inc.php and the showmembers.tpl files and it seems to work, including the sorting.
Posted By: Ruben Rocha Re: Customize User List - 10/27/2008 8:32 PM
Test Test Test 123.
Steve I have no suggestion just that I have been watching your post here and at UBB and was waiting on a response from someone because I was contemplating the same issue myself.
Can you elate on what you did?
Did you also edit the language file?
Can you post a URL to your site so I can peek at the user list?
Posted By: SteveZ Re: Customize User List - 10/28/2008 4:32 AM
I'll post the changes that I did. I didn't edit the language file. I hardcoded the English header text in the .tpl file.

Here's a link to my board's User List. I added the Graduation Year column.

http://www.zamaalum.com/forum/ubbthreads.php?ubb=showmembers

I'll post back with the changes.
Posted By: SteveZ Re: Customize User List - 10/28/2008 4:54 AM
Showmembers.inc.php
===================

Line 64: Added line after $PictureS initialization.

$GradYearS = "";

Line 112: Added line after $sortpic assignment.

$sortgradyear = 13;

Line 129: Added comma to end of array item 12 for $Sorting assignment.

12 => array(0=>"", 1=> "t2.USER_AVATAR DESC"),

Line 130: Added two lines for the sorting of the new column.

13 => array(0=>"", 1=> "t2.USER_EXTRA_FIELD_1 ASC"),
14 => array(0=>"", 1=> "t2.USER_EXTRA_FIELD_1 DESC")

Line 186: Added two case statement entries in the switch($sb) block.

case 13:
$GradYearS = $Sorting['13']['0'];
$sortgradyear = 14;
break;
case 14:
$GradYearS = $Sorting['14']['0'];
$sortgradyear = 13;
break;

Line 216: Added new field to end of $query assignment's SELECT clause.

SELECT t1.USER_DISPLAY_NAME,t1.USER_REGISTERED_ON,t2.USER_HOMEPAGE,t2.USER_TOTAL_POSTS,t1.USER_MEMBERSHIP_LEVEL,t1.USER_ID,t2.USER_AVATAR,t2.USER_AVATAR_WIDTH,t2.USER_AVATAR_HEIGHT,t2.USER_EXTRA_FIELD_1

Line 278: Added setting of new field in array.

$userrow[$i]['GradYear'] = $GradYear;

Line 346: Added new field to $smarty_data assignment.

"GradYearS" => $GradYearS,
"sortgradyear" => $sortgradyear,

showmembers.tpl
===============

Added column header:



{"Graduation Year"} {$GradYearS}



Added data element:


{$userrow[user].GradYear}

Posted By: AllenAyres Re: Customize User List - 10/29/2008 3:58 AM
Thank you Steve thumbsup

There's more in the 7.4 version (I need to update us) where you can search for usernames in the userlist.
Posted By: SteveZ Re: Customize User List - 10/29/2008 4:15 PM
Thanks for the info Allen smile
© UBB.Developers