As admins we want to see the user's "Real Name" and not just the UserName as listed on the
.../admin/user/user/list? Page.
The only way I see to make an "add a column" change to this page is to edit
.../modules/user/user.admin.inc
I have "almost" got it... The real name is stored in the user.signature column
and I want to add this column to the .../list page above as the second column.
So I added, starting at line 129, one new line with u.signature in it and
the addition of u.signature to the $sql line:
function user_admin_account() {
$filter = user_build_filter_query();
$header = array(
array(),
array('data' => t('Username'), 'field' => 'u.name'),
array('data' => t('Name'), 'field' => 'u.signature'),
array('data' => t('Status'), 'field' => 'u.status'), t('Roles'),
array('data' => t('Member for'), 'field' => 'u.created', 'sort' => 'desc'),
array('data' => t('Last access'), 'field' => 'u.access'),
t('Operations')
);
$sql = 'SELECT DISTINCT u.uid, u.name, <strong>u.signature,</strong> u.status, u.created, u.access FROM {users}...
I also edited the code starting at line 911 by adding the Name(Sig) header and u.signature line
and added the next to last drupal_render line.
function theme_user_admin_account($form) {
// Overview table:
$header = array(
theme('table_select_header_cell'),
array('data' => t('Username'), 'field' => 'u.name'),
array('data' => t('Name(Sig)'), 'field' => 'u.signature'),
array('data' => t('Status'), 'field' => 'u.status'),
t('Roles'),
array('data' => t('Member for'), 'field' => 'u.created', 'sort' => 'desc'),
array('data' => t('Last access'), 'field' => 'u.access'),
t('Operations')
);
$output = drupal_render($form['options']);
if (isset($form['name']) && is_array($form['name'])) {
foreach (element_children($form['name']) as $key) {
$rows[] = array(
drupal_render($form['accounts'][$key]),
drupal_render($form['name'][$key]),
drupal_render($form['signature'][$key])
drupal_render($form['status'][$key]),
I *Almost* have it... the page renders with the proper header "Name(sig)" and it is clickable
for sort, But No signature column values show. No "Real Names show.
Can anyone direct me to what I am missing? There must be another place where I need
to make the user.signature column part of the search results.
AND as a bonus, there is probably a better way to do this without digging into the core
modules folder. Suggestions?
Much Appreciated.
-Bob O
Comments
_
Have you seen the http://drupal.org/project/realname module?
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Hi WorldFallz, I tried that
Hi WorldFallz, I tried that module... and got a fatal php error.... AND I posted this as a bug in that project.
Also, this doesn't accomplish my simple desire to add another column from the user table "signature".
and my bonus request for a "Drupalish" way to accomplish this. All my "Real Names" are in the signature column.
Thanks
-Maine Bob O
_
I'm not sure what you mean by real names in the signature column-- but you couldn't get a more 'drupal way' to do this than is done in the realname module. I've got it working and it seems to work great. But whatever works for you is the ultimate goal.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz