Gossamer Forum
Home : Products : Others : Gossamer Community :

Number of user logins

Quote Reply
Number of user logins
Hm, in Gossamer Community, it's possible to sort user by 'number of logins'.
But in the search result I can not see, the number of logins :-(
Is there a way to display the number of logins???

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Number of user logins In reply to
Hi,

Do you mean in the admin area?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Number of user logins In reply to
Andy wrote:
Hi,

Do you mean in the admin area?

Hi Andy,
yes I mean in the admin area, but in the user profile would it be nice too ;-)

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Number of user logins In reply to
Hi,

The easiest way, is to edit admin_user.html (with the attached HTML file).

Then, in /lib/Community/Web/Admin.pm, replace the _search_bar function (approx line 2184), with;

Code:
sub _search_bar {
#---------------------------------------------------------------------
# create quick search bar
#
my $current = $IN->param('alpha') || '';
my $user_db = $DB->table('comm_users');
my $count = $user_db->count;

my $url = "$CFG->{path_cgi_url}?do=admin_user&sb=comm_login_count&so=DESC";
my $search_bar = "";
if ((!$current or $current eq 'all') and !$IN->param('bsearch')) {
$search_bar = comm_language('ADMIN_SEARCH_ALL') . " ";
}
else {
$search_bar = qq~<a href="$url&alpha=all">~ . comm_language('ADMIN_SEARCH_ALL') . "</a> ";
}
foreach ('A' .. 'Z') {
my $count = $user_db->count(
GT::SQL::Condition->new(
'comm_username',
'LIKE',
"$_%"
)
);
if ($count) {
$search_bar .= uc $current eq $_ ? "$_ " : "<a href='$url&alpha=$_'>$_</a> ";
}
else {
$search_bar .= "$_ ";
}
}

# Make the special not validated searches show up on the next line
$search_bar .= '<br>';

# Entry to find users that have yet to validate their email addresses
my $count_not_validated = $user_db->count( { comm_email_val => 0 } );
my $notval_str = comm_language( 'ADMIN_NOT_VALIDATED' );
$search_bar .= ($count_not_validated and ($current ne 'notval'))
? "<a href='$url&alpha=notval'>$notval_str</a> "
: "$notval_str ";

# Entry to find users that have not yet been validated by the admin
if ( $CFG->{signup_validate_admin} ) {
$count_not_validated = $user_db->count( { comm_admin_val => 0 } );
$notval_str = comm_language( 'ADMIN_NOT_VALIDATED_ADMIN' );
$search_bar .= ($count_not_validated and ($current ne 'notvaladmin'))
? "<a href='$url&alpha=notvaladmin'>$notval_str</a> "
: "$notval_str ";

}

return $search_bar;
}

This will sort results based on comm_login_count (DESC).

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Number of user logins In reply to
Thank you Andy,
it works perfect.
I think there is a lot more potential (or is it possibilities in english) in gossamer community.
I wonder why there is no further customization of gossamer community...

Thanks again
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Number of user logins In reply to
Hi,

No problem - glad it worked :)

I believe Gossamer are doing more work on Gossamer Community (in fact, there was a pretty major release a month or so ago - at least in terms of features, bug fixes etc).

Gossamer are busy people - and as GComm is a freebie, I'd be suprised if it was too high up on their list of priorities :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!