PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™
<?php
//Two main filters,
add_filter('manage_users_columns', 'add_eot_column');
add_filter('manage_users_custom_column', 'view_eot_column', 10, 3);
function add_eot_column($columns) {
$columns['current_eot'] = 'EOT';
return $columns;
}
function view_eot_column($empty='', $column_name, $id) {
if( $column_name == 'current_eot' ) {
//The return below is what is shown.
return ;
}
}
?>
<?php
add_filter ('manage_users_columns', 'add_eot_column');
add_filter ('manage_users_custom_column', 'view_eot_column', 10, 3);
function add_eot_column ($columns)
{
$columns['view_eot'] = 'EOT';
return $columns;
}
function view_eot_column ($empty = '', $column_name, $id)
{
if ($column_name == 'view_eot')
{
if (!get_user_field ('s2member_auto_eot_time', $id) == 0)
{
return date ("M/d/Y", get_user_field ('s2member_auto_eot_time', $id));
}
else
{
return "No EOT Set";
}
}
}
?>
add_filter ('manage_users_columns', 'add_eot_column');
add_filter ('manage_users_custom_column', 'view_eot_column', 11, 3);
function add_eot_column ($eot_column)
{
$eot_column['view_eot'] = 'EOT';
return $eot_column;
}
function view_eot_column ($eot_column, $column_name, $id)
{
if ($column_name == 'view_eot')
{
if (!get_user_field ('s2member_auto_eot_time', $id) == 0)
{
$eot_column = date ("M/d/Y", get_user_field ('s2member_auto_eot_time', $id));
}
}
return $eot_column;
}
redliontrader wrote: Would be even better if it were a sortable column.
add_filter ('manage_users_columns', 'add_eot_column');
add_filter ('manage_users_custom_column', 'view_eot_column', 11, 3);
function add_eot_column ($eot_column)
{
$eot_column['view_eot'] = 'EOT';
return $eot_column;
}
function view_eot_column ($eot_column, $column_name, $id)
{
if ($column_name == 'view_eot')
{
if (!get_user_field ('s2member_auto_eot_time', $id) == 0)
{
$eot_column = date ("M/d/Y", get_user_field ('s2member_auto_eot_time', $id));
}
}
return $eot_column;
}
function eot_sortable_columns ($columns)
{
$columns['view_eot'] = 'EOT';
return $columns;
}
add_filter ('manage_users_sortable_columns', 'eot_sortable_columns');
function eot_column_orderby ($vars)
{
if (isset ($vars['orderby']) && 'view_eot' == $vars['orderby'])
{
$vars = array_merge ($vars, array ('meta_key' => 'view_eot', 'orderby' => 'meta_value', 'order' => 'asc'));
}
return $vars;
}
add_filter ('request', 'eot_column_orderby');
'view_eot' == $vars['orderby']
'EOT' == $vars['orderby']
Users browsing this forum: Yahoo [Bot] and 1 guest