#########################################################################################
## 
## Hack Title:    Display a (new) field in memberlist
## Author:        Acid
##
## Description:   If you want to display a (new) field in memberlist and if you
##		  want to sort it..
##		  If you want to add several (new) fields to the memberlist duplicate
##		  the following steps and change "info" (be aware of the spelling).
##		  The field "info" is just an example.
##
## Files to edit: 2
##		  memberlist.php
##                templates/xxx/memberlist_body.tpl
##
#########################################################################################
## 
## Installation/Author Notes: 
## First always backup the files that you're going to edit. 
## 
#########################################################################################
# 
#-----[ OPEN ]------------------------------------------
#  
# memberlist.php
# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
$mode_types_text = array(
$mode_types = array(

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
$lang['Sort_Location']

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, $lang['Info']

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
'location'

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, 'info'

# 
#-----[ FIND ]---------------------------------------------------
# 
	'L_FROM' => $lang['Location'],

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	'L_INFO' => $lang['Info'],

# 
#-----[ FIND ]---------------------------------------------------
# 
		case 'location':
			$order_by = "user_from $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		case 'info':
			$order_by = "user_info $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;

# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
$sql = "SELECT 
	FROM " . USERS_TABLE . "

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
user_from

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, user_info

# 
#-----[ FIND ]---------------------------------------------------
# 
		$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;';

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		// only if youre using an option field (delete // before the next line)
		// $info = ( $row['user_info'] == '0' ) ? $lang['No'] : $lang['Yes'];
		// and uncomment the next line (add // before)
		$info = ( !empty($row['user_info']) ) ? $row['user_info'] : '&nbsp;';

# 
#-----[ FIND ]---------------------------------------------------
# 
			'FROM' => $from,

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
			'INFO' => $info,


# 
#-----[ OPEN ]------------------------------------------
#  
# templates/xxx/memberlist_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
	  <th class="thTop" nowrap="nowrap">{L_FROM}</th>

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	  <th class="thTop" nowrap="nowrap">{L_INFO}</th>

# 
#-----[ FIND ]---------------------------------------------------
# 
	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.FROM}</span></td>

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	  <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.INFO}</span></td>

# 
#-----[ FIND ]---------------------------------------------------
# 
# Increase the colspan-value. If youve added one new column the value should be "9",
# but if youve added several columns you have to increase the value accordingly with
# the amount of columns youve added.

	  <td class="catbottom" colspan="8" height="28">&nbsp;</td>

#########################################################################################
#########################################################################################
#########################################################################################