MOD to add a colum to member list?

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
~Sentinel~
Registered User
Posts: 255
Joined: Tue Jun 03, 2003 3:19 pm

MOD to add a colum to member list?

Post by ~Sentinel~ » Wed Mar 26, 2008 3:19 pm

I have a mod that allows me to add members first and last names to their profiles. This mod has an option to make this field visible to all members or admin only. Currently I have it set to admin only. I don't know much about php but I assume that this mod created an extra field in the database for this info to be stored. Currently the only way to see this field is if you click the individual members profile page.
This is the mod I have : http://www.phpbb.com/community/viewtopi ... 4&t=286259

Here is my problem:
I have a lot of members that use nick names. This is fine but it is hard for me to keep track of who is who. Being that this is a discussion board for a club I am charged with making sure that only active members (dues paid) have access to the board. I get a list from the treasurer of members that have quit or not paid their dues but in order for me to go in to the member list and sort through each member to find the ones I have to remove is very difficult. Especially since some use nick names. I have to click each member and see what their real first and last names are.

This is what I would like to be able to do:
I would like to be able to add a column in the member list for at least the last name field. That way I could sort by last name and see who is who. Preferably viewable by the admin only.

I have seen current mods that add existing stuff (like members avatars) or other stuff to the member list that is already contained in the database. I am guessing that since those mods just retrieve something that is already in the database and just create a new column in the members list and display that data, I could possibly just take one of those existing mods and edit what it retrieves from the database and just make it display the last name. Possible?

Better yet ... I have one of those "admin users list" mod that displays a list of users in the admin control panel viewable only to the admin. If I could display the extra column there it would be great.

User avatar
Lumpy Burgertushie
Registered User
Posts: 66338
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: MOD to add a colum to member list?

Post by Lumpy Burgertushie » Wed Mar 26, 2008 4:06 pm

use the following, change the "age" variable to whatever your new varible for the name is.

Code: Select all

    #########################################################################################
    ##
    ## 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 "age" (be aware of the spelling).
    ##        The field "age" is just an example.
    ##
    ## Files to edit: 2
    ##        memberlist.php
    ##                templates/subSilver/memberlist_body.tpl
    ##
    #########################################################################################
    ##
    ## Installation/Author Notes:
    ## First always backup the files that you're going to edit.
    ##
    #########################################################################################
    #
    #-----[ OPEN ]------------------------------------------
    # 
    memberlist.php
    #
    #-----[ FIND ]---------------------------------------------------
    #
    $mode_types_text = array(
    #
    #-----[ IN-LINE FIND ]---------------------------------------------------
    #
    $lang['Sort_Location']
    #
    #-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
    #
    , $lang['Age']
    #
    #-----[ FIND ]---------------------------------------------------
    #
    $mode_types = array(
    #
    #-----[ IN-LINE FIND ]---------------------------------------------------
    #
    'location'
    #
    #-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
    #
    , 'age'
    #
    #-----[ FIND ]---------------------------------------------------
    #
       'L_FROM' => $lang['Location'],
    #
    #-----[ AFTER, ADD ]---------------------------------------------------
    #
       'L_AGE' => $lang['Age'],
    #
    #-----[ FIND ]---------------------------------------------------
    #
          case 'posts':
    #
    #-----[ BEFORE, ADD ]---------------------------------------------------
    #
          case 'age':
             $order_by = "user_age $sort_order LIMIT $start, " . $board_config['topics_per_page'];
             break;
    #
    #-----[ FIND ]---------------------------------------------------
    #
    $sql = "SELECT
    #
    #-----[ IN-LINE FIND ]---------------------------------------------------
    #
    user_from
    #
    #-----[ IN-LINE AFTER, ADD ]---------------------------------------------------
    #
    , user_age
    #
    #-----[ FIND ]---------------------------------------------------
    #
          $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
    #
    #-----[ AFTER, ADD ]---------------------------------------------------
    #
          // only if you´re using an option field (delete // before the next line)
          // $age = ( $row['user_age'] == '0' ) ? $lang['No'] : $lang['Yes'];
          // and uncomment the next line (add // before)
          $age = ( !empty($row['user_age']) ) ? $row['user_age'] : ' ';
    #
    #-----[ FIND ]---------------------------------------------------
    #
             'FROM' => $from,
    #
    #-----[ AFTER, ADD ]---------------------------------------------------
    #
             'AGE' => $age,
    #
    #-----[ OPEN ]------------------------------------------
    # 
    templates/subSilver/memberlist_body.tpl
    #
    #-----[ FIND ]---------------------------------------------------
    #
         <th class="thTop" nowrap="nowrap">{L_FROM}</th>
    #
    #-----[ AFTER, ADD ]---------------------------------------------------
    #
         <th class="thTop" nowrap="nowrap">{L_AGE}</th>
    #
    #-----[ FIND ]---------------------------------------------------
    #
         <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.FROM}</span></td>
    #
    #-----[ AFTER, ADD ]---------------------------------------------------
    #
         <td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.AGE}</span></td>
    #
    #-----[ FIND ]---------------------------------------------------
    #
    # Increase the colspan-value. If you´ve added one new column the value should be "9",
    # but if you´ve added several columns you have to increase the value accordingly with
    # the amount of columns you´ve added.

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

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

then, to make those new columns viewable by admins only, try this:

Code: Select all

############################################### 
##   Hack Title:   Admin Only View
##   Hack Version:   1.0.0
##   Author:      Majorflam <majorflam@blueyonder.co.uk>
##   Description:  This hack allows you to place switches between code in any tpl file. When the
##                 page is generated, only administrators may see the code that is between the switches.
##
##
##
##   Compatibility:   2.0.6 - 2.0.10 
## 
##   Installation Level: Easy 
##   Installation Time: 1 minute 
##   Files To Edit: <2> 
##       
##      includes/page_header.php  
##      templates/subSilver/**file_you_want_to_place_swicth_in**.tpl
## 
##   Included Files: <none> 
## 
##   History: 
##      Version 1.0.0: First Release  
## 
##   Author Notes: 
##      N.B. Please back-up all files related to this Mod, before attempting any edits. 
## 
##   Support:        http://www.majormod.com/viewforum.php?f=8
##   Copyright:      ©2004 Admin Only View Mod 1.0.0 - Majorflam 
## 
############################################### 
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads. 
##   You may also visit http://www.phpbbhacks.com/forums for support.
############################################### 
## 
############################################### 
##   This hack is released under the GPL License. 
##   This hack can be freely used, but not distributed, without permission. 
##   Intellectual Property is retained by the hack author(s) listed above.   
############################################### 



# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$template->assign_block_vars('switch_user_logged_in', array());

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

// Admin Only View Mod	
	if ( $userdata['user_level'] == ADMIN ) 
   { 
      $template->assign_block_vars('switch_admin_view_only', array()); 
   } 
// Admin Only View Mod

# 
#-----[ OPEN ]------------------------------------------ 
#
#
# templates/subSilver/**file_you_want_to_place_swicth_in**.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
# The code you want to remain hidden from everyone except Administrators

# 
#-----[ BEFORE **CODE**, ADD ]------------------------------------------ 
# 

<!-- BEGIN switch_admin_view_only -->

# 
#-----[ AFTER **CODE**, ADD ]------------------------------------------ 
#

<!-- END switch_admin_view_only -->


# 
#-----[ SAVE & CLOSE ALL FILES ]-------------------------- 
# 
#End 
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

~Sentinel~
Registered User
Posts: 255
Joined: Tue Jun 03, 2003 3:19 pm

Re: MOD to add a colum to member list?

Post by ~Sentinel~ » Wed Mar 26, 2008 4:44 pm

Thanks. I will give that a try if my first hope doesn't work. That looks like it will work but first I would like to try this. Hope you don't mind :)

As I said, I have a "Admin User List" mod that I got a long time ago from "somewhere else" ;). It's a very simple one consisting of just two files that you upload. They are named "admin_users_list.php" and "admin_users_list_body.tpl. By doing this you have a new entry in the ACP called user list and it just generates a list of all users. You can then click on the users and manage them. My guess/hope is that by editing one of those files I can add a new column to it for the users last name field. I'm guessing the file I have to edit is the admin_users_list.php so here it is...

Code: Select all

<?php
/***************************************************************************
 *                              admin_users_list.php
 *                              -------------------
 *   begin                : Wednesday, January 29, 2003
 *   copyright            : (C) 2003 Smartor
 *   email                : smartor_xp@hotmail.com
 *
 *   $Id: admin_users_list.php,v 1.1.0 1/29/2003, 11:02:14 ngoctu Exp $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);

if( !empty($setmodules) )
{
	$filename = basename(__FILE__);
	$module['Users']['Users List'] = $filename;
	return;
}

//
// Let's set the root dir for phpBB
//
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

//
// Set variables
//
$users_per_page = 25;

$start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : 0;

if( isset($HTTP_POST_VARS['sort']) )
{
	$sort_method = $HTTP_POST_VARS['sort'];
}
else if( isset($HTTP_GET_VARS['sort']) )
{
	$sort_method = $HTTP_GET_VARS['sort'];
}
else
{
	$sort_method = 'user_id';
}

if( isset($HTTP_POST_VARS['order']) )
{
	$sort_order = $HTTP_POST_VARS['order'];
}
else if( isset($HTTP_GET_VARS['order']) )
{
	$sort_order = $HTTP_GET_VARS['order'];
}
else
{
	$sort_order = '';
}


$template->set_filenames(array(
	'body' => 'admin/admin_users_list_body.tpl')
);

// Count users
$sql = "SELECT count(user_id) as total FROM ".USERS_TABLE." WHERE user_id > 0";
if(!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Could not count users", "", __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$total_users = $row['total'];

$template->assign_vars(array(
	'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
	'U_LIST_ACTION' => append_sid("admin_users_list.$phpEx"),
	'L_SORT' => $lang['Sort'],
	'L_ORDER' => $lang['Order'],
	'L_SORT_DESCENDING' => $lang['Sort_Descending'],
	'L_SORT_ASCENDING' => $lang['Sort_Ascending'],
	'ID_SELECTED' => ($sort_method == 'user_id') ? 'selected="selected"' : '',
	'USERNAME_SELECTED' => ($sort_method == 'username') ? 'selected="selected"' : '',
	'POSTS_SELECTED' => ($sort_method == 'user_posts') ? 'selected="selected"' : '',
	'LASTVISIT_SELECTED' => ($sort_method == 'user_lastvisit') ? 'selected="selected"' : '',
	'ASC_SELECTED' => ($sort_order != 'DESC') ? 'selected="selected"' : '',
	'DESC_SELECTED' => ($sort_order == 'DESC') ? 'selected="selected"' : '',
	'TOTAL_USERS' => $total_users
	)
);

// Query users info...
$sql = "SELECT user_id, username, user_email, user_regdate, user_lastvisit, user_posts, user_active
		FROM ".USERS_TABLE."
		WHERE user_id > 0
		ORDER BY " . $sort_method . " " . $sort_order . "
		LIMIT ".$start.",".$users_per_page;
if(!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Could not query Users information", "", __LINE__, __FILE__, $sql);
}

while( $row = $db->sql_fetchrow($result) )
{
	$userrow[] = $row;
}

for ($i = 0; $i < $users_per_page; $i++)
{
	if (empty($userrow[$i]))
	{
		break;
	}

	$row_color = (($i % 2) == 0) ? "row1" : "row2";
	
	$template->assign_block_vars('userrow', array(
		'COLOR' => $row_color,
		'NUMBER' => $userrow[$i]['user_id'],
		'USERNAME' => $userrow[$i]['username'],
		'U_ADMIN_USER' => append_sid("admin_users.$phpEx?mode=edit&" . POST_USERS_URL . "=" . $userrow[$i]['user_id']),
		'U_ADMIN_USER_AUTH' => append_sid("admin_ug_auth.$phpEx?mode=user&" . POST_USERS_URL . "=" . $userrow[$i]['user_id']),
		'EMAIL' => $userrow[$i]['user_email'],
		'JOINED' => create_date($lang['DATE_FORMAT'], $userrow[$i]['user_regdate'], $board_config['board_timezone']),
		'LAST_VISIT' => (!$userrow[$i]['user_lastvisit']) ? '' : create_date($lang['DATE_FORMAT'], $userrow[$i]['user_lastvisit'], $board_config['board_timezone']),
		'POSTS' => $userrow[$i]['user_posts'],
		'ACTIVE' => ( $userrow[$i]['user_active'] ) ? $lang['Yes'] : $lang['No']
		) //end array
	);
} // end for

$template->assign_vars(array(
	'PAGINATION' => generate_pagination(append_sid("admin_users_list.$phpEx?sort=$sort_method&order=$sort_order"), $total_users, $users_per_page, $start),
	'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $users_per_page ) + 1 ), ceil( $total_users / $users_per_page ))
	) // end array
);

// Finally...
$template->pparse('body');

include('./page_footer_admin.'.$phpEx);

?>
Since I have no knowledge of php I am guessing that there is probably a line in here that tells the page to display a certain number of colums and that those colums should contain certain fields. If I'm right then all I would have to do is to add an extra field to that line of code for this page to display and extra colum containing that extra field. Hopefully someone in here knows what line I would have to change. Am I right? I can post the tpl file too if that would help.

User avatar
Ricky_Racer
Registered User
Posts: 609
Joined: Wed Feb 12, 2003 10:02 pm

Re: MOD to add a colum to member list?

Post by Ricky_Racer » Wed Mar 26, 2008 5:12 pm

Actually, it looks like that mod added 2 new fields to the users table.

Code: Select all

#
#-----[ SQL ]-------------------------------------------
#
ALTER TABLE phpbb_users ADD user_name_first VARCHAR(64) DEFAULT '' NOT NULL;
ALTER TABLE phpbb_users ADD user_name_last VARCHAR(64) DEFAULT '' NOT NULL;
I hope the Admin Userlist mod you are using is this one [20/01/07] Admin Userlist

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_userlist.php
#
#-----[ FIND ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------
#
//- mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
				$sql = "SELECT user_id, user_email
#
#-----[ BEFORE, ADD ]-----------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
//- here we added	, user_name_first, user_name_last
#
#-----[ IN-LINE, FIND ]---------------------------------
#
user_id
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, user_name_first, user_name_last
#
#-----[ FIND ]------------------------------------------
#
					WHERE user_id = $user_id";
#
#-----[ AFTER, ADD ]------------------------------------
#
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
		'L_USERNAME' => $lang['Username'],
#
#-----[ AFTER, ADD ]------------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
		'L_NAME_FIRST' => $lang['name_first'],
		'L_NAME_LAST' => $lang['name_last'],
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
				'USERNAME' => $row['username'],
#
#-----[ AFTER, ADD ]------------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
			'USERNAME_FIRST' => $row['user_name_first'],
			'USERNAME_LAST' => $row['user_name_last'],
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/userlist_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="{user_row.ROW_CLASS}" align="center"><span class="gen"><b><a href="{user_row.U_MANAGE}" class="gen">{user_row.USERNAME}</a></b></span></td>
#
#-----[ IN-LINE, FIND ]---------------------------------
#
{user_row.USERNAME}</a></b></span>
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
<div align="left"><span class="gensmall">&nbsp;{L_NAME_FIRST}:&nbsp;{user_row.USERNAME_FIRST}<br />&nbsp;{L_NAME_LAST}:&nbsp;{user_row.USERNAME_LAST}</span></div>
Screenshot :

Image

~Sentinel~
Registered User
Posts: 255
Joined: Tue Jun 03, 2003 3:19 pm

Re: MOD to add a colum to member list?

Post by ~Sentinel~ » Wed Mar 26, 2008 6:04 pm

Actually no :(. The one I am using is an older and simpler one that I posted above. The more I think about it the more I think that perhaps the tpl file might have ot be edited too so here it is ...

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_userlist.php
#
#-----[ FIND ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------
#
//- mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
            $sql = "SELECT user_id, user_email
#
#-----[ BEFORE, ADD ]-----------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
//- here we added   , user_name_first, user_name_last
#
#-----[ IN-LINE, FIND ]---------------------------------
#
user_id
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, user_name_first, user_name_last
#
#-----[ FIND ]------------------------------------------
#
               WHERE user_id = $user_id";
#
#-----[ AFTER, ADD ]------------------------------------
#
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
      'L_USERNAME' => $lang['Username'],
#
#-----[ AFTER, ADD ]------------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
      'L_NAME_FIRST' => $lang['name_first'],
      'L_NAME_LAST' => $lang['name_last'],
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
            'USERNAME' => $row['username'],
#
#-----[ AFTER, ADD ]------------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
         'USERNAME_FIRST' => $row['user_name_first'],
         'USERNAME_LAST' => $row['user_name_last'],
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/userlist_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="{user_row.ROW_CLASS}" align="center"><span class="gen"><b><a href="{user_row.U_MANAGE}" class="gen">{user_row.USERNAME}</a></b></span></td>
#
#-----[ IN-LINE, FIND ]---------------------------------
#
{user_row.USERNAME}</a></b></span>
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
<div align="left"><span class="gensmall">&nbsp;{L_NAME_FIRST}:&nbsp;{user_row.USERNAME_FIRST}<br />&nbsp;{L_NAME_LAST}:&nbsp;{user_row.USERNAME_LAST}</span></div>
But looking at the one you posted I might be able to make it work with the one I have. Ya think maybe? Or is it wishful thinking?

User avatar
Ricky_Racer
Registered User
Posts: 609
Joined: Wed Feb 12, 2003 10:02 pm

Re: MOD to add a colum to member list?

Post by Ricky_Racer » Wed Mar 26, 2008 6:45 pm

I noticed that after I clicked "Submit" . :lol:
I don't use Smartor's Admin Userlist anymore, however I still have a copy on my hard drive, and I do believe this should work for you ;)

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
./admin_users_list.php
#
#-----[ FIND ]------------------------------------------
#
	'L_SORT_ASCENDING' => $lang['Sort_Ascending'],
#
#-----[ AFTER, ADD ]------------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
		'L_NAME_FIRST' => $lang['name_first'],
		'L_NAME_LAST' => $lang['name_last'],
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
// Query users info...
$sql = "SELECT user_id, username, user_email, user_regdate, user_lastvisit, user_posts, user_active
#
#-----[ BEFORE, ADD ]-----------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
//- here we added	, user_name_first, user_name_last
#
#-----[ IN-LINE, FIND ]---------------------------------
#
username
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, user_name_first, user_name_last
#
#-----[ FIND ]------------------------------------------
#
		LIMIT ".$start.",".$users_per_page;
#
#-----[ AFTER, ADD ]------------------------------------
#
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ FIND ]------------------------------------------
#
		'USERNAME' => $userrow[$i]['username'],
#
#-----[ AFTER, ADD ]------------------------------------
#
//- add mod : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
			'USERNAME_FIRST' => $userrow[$i]['user_name_first'],
			'USERNAME_LAST' => $userrow[$i]['user_name_last'],
//- end add : full name v.1.0.5 [The Defpom (for admin userlist Ricky_Racer)] --
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/admin_users_list_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="{userrow.COLOR}" align="center" valign="middle" height="28" nowrap="nowrap"><span class="genmed">{userrow.USERNAME}</span></td>
#
#-----[ IN-LINE, FIND ]---------------------------------
#
<span class="genmed">{userrow.USERNAME}</span>
#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
<div align="left"><span class="gensmall">&nbsp;{L_NAME_FIRST}:&nbsp;{userrow.USERNAME_FIRST}<br />&nbsp;{L_NAME_LAST}:&nbsp;{userrow.USERNAME_LAST}</span></div>

~Sentinel~
Registered User
Posts: 255
Joined: Tue Jun 03, 2003 3:19 pm

Re: MOD to add a colum to member list?

Post by ~Sentinel~ » Wed Mar 26, 2008 8:10 pm

You are a php God! ;) That worked like a charm. I love it. Now I can see everyones first and last name just by going in to the Users List in the ACP. This will save me loads of time. Thank you so very much.

I did change it slightly though. I edited the tpl so that it has 2 new columns instead of just adding the names under the username field the way you did. Not better; just different :) I just prefer seeing the full names in their own columns.

Awesome! Many thanks...

~Sentinel~
Registered User
Posts: 255
Joined: Tue Jun 03, 2003 3:19 pm

Re: MOD to add a colum to member list?

Post by ~Sentinel~ » Wed Mar 26, 2008 10:02 pm

Can I ask one more favor please :) ... while we're all here :D

Is there anyway that I can add the last name field to the sort by list? I tried it on my own and it didn't work so I guess I am not doing it right. It looks like at the top of the php file there is a list of ways to sort and I kind of guess that I could just follow the same syntax and add a new item there using the format of the last name fields that you created but I just can't figure out how to make it work. If you don't mind.

User avatar
Ricky_Racer
Registered User
Posts: 609
Joined: Wed Feb 12, 2003 10:02 pm

Re: MOD to add a colum to member list?

Post by Ricky_Racer » Thu Mar 27, 2008 10:43 am

Is this what you tried ?

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
./admin_users_list.php
#
#-----[ FIND ]------------------------------------------
#
	'USERNAME_SELECTED' => ($sort_method == 'username') ? 'selected="selected"' : '',
#
#-----[ AFTER, ADD ]------------------------------------
#
	'USERNAME_FIRST_SELECTED' => ($sort_method == 'user_name_first') ? 'selected="selected"' : '',
	'USERNAME_LAST_SELECTED' => ($sort_method == 'user_name_last') ? 'selected="selected"' : '',
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/admin_users_list_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<option value="username" class="genmed" {USERNAME_SELECTED} >Username</option>
#
#-----[ AFTER, ADD ]------------------------------------
#
<option value="user_name_first" class="genmed" {USERNAME_FIRST_SELECTED} >Username First</option>
<option value="user_name_last" class="genmed" {USERNAME_LAST_SELECTED} >Username Last</option>
It should have worked. :?

~Sentinel~
Registered User
Posts: 255
Joined: Tue Jun 03, 2003 3:19 pm

Re: MOD to add a colum to member list?

Post by ~Sentinel~ » Thu Mar 27, 2008 2:05 pm

To my amazement that is what I did on the tpl, but I did not do anything on the php file.
Once again ... thank you so much. I really wish I could read and see this stuff like a language like you obviously can. You are a really nice person for sharing your time and knowledge with others like this.
Thank you

Works like a charm BTW ;)

User avatar
Ricky_Racer
Registered User
Posts: 609
Joined: Wed Feb 12, 2003 10:02 pm

Re: MOD to add a colum to member list?

Post by Ricky_Racer » Fri Mar 28, 2008 10:31 am

Glad I was able to help, and Thank you for the kind words :oops:
Just keep doing it, and before you know it, phpBB will become second nature for you too. :mrgreen:
I don't want to embarrass anybody, however, Lumpy Bugertushie, brf, episcom, RMcgirr83, drathbun, Thoul, plus many, many others (you know who you are) are good sources of information, I owe most of my knowledge to these folks, and these fora. ;)

Post Reply

Return to “[2.0.x] MOD Requests”