Previous Thread
Next Thread
Print Thread
Rate Thread
#317623 10/23/2008 9:02 AM
Joined: Oct 2008
Posts: 6
Lurker
Lurker
Offline
Joined: Oct 2008
Posts: 6
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

Sponsored Links
Joined: Oct 2008
Posts: 6
Lurker
Lurker
Offline
Joined: Oct 2008
Posts: 6
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?

SteveZ #317631 10/26/2008 11:17 PM
Joined: Oct 2008
Posts: 6
Lurker
Lurker
Offline
Joined: Oct 2008
Posts: 6
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.

Joined: Jan 2000
Posts: 254
Likes: 4
Beta Tester
Beta Tester
Joined: Jan 2000
Posts: 254
Likes: 4
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?


There is no such thing as stupid questions.
Just stupid answers.
Joined: Oct 2008
Posts: 6
Lurker
Lurker
Offline
Joined: Oct 2008
Posts: 6
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.

Sponsored Links


Added data element:



Joined: Oct 2008
Posts: 6
Lurker
Lurker
Offline
Joined: Oct 2008
Posts: 6
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}


{$userrow[user].GradYear}
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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.


- Allen wavey
- What Drives You?
Joined: Oct 2008
Posts: 6
Lurker
Lurker
Offline
Joined: Oct 2008
Posts: 6
Thanks for the info Allen smile


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)