Gossamer Forum
Quote Reply
Plugin User_Clicks
Hi Andy,
I would like to have the number userclicks from the user_clicks plugin in the community profile.
But thats to difficult I think.

The other way should be easier.
Is it possible to show the number of user logins in the table of the user_clicks plugin in g-links
Perhaps with a code like this?

Code:
<%Plugins::Auth_Community::get_profile('username')%><%comm_login_count%>

An option "sort for number of clicks" (DESC) in the user_clicks_plugin would be perfect.
At the moment there is only a alphabetical search or a keyword search.

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Plugin User_Clicks In reply to
Hi,

Mmm.. I'm not sure that is really possible :(

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] Plugin User_Clicks In reply to
Hi Andy,
I tried this code
Code:
<tr>
<td>$user->{Username}</td>
<td>$user->{Jump_Clicks}</td>
<td><%Plugins::Auth_Community::get_profile('username')%><%comm_login_count%></td>
<td>$user->{Email}</td>
</tr>

But it does not work. There are no % in the pm-file so I tried to change the code to this one




Code:
<tr>
<td>$user->{Username}</td>
<td>$user->{Jump_Clicks}</td>
<td>$Plugins::Auth_Community::get_profile('username')->{comm_login_count}</td>
<td>$user->{Email}</td>
</tr>

But this one does not work, too. But you know I'm no coder :-)


What about the sorting thing.
I found this code
Code:
sub get_letter_results {

my $letter = $_[0];

my $tbl = $DB->table('Users');
$tbl->select_options('ORDER BY Username');

Can't this modified to ORDER BY Clicks ?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Plugin User_Clicks In reply to
Hi,

Ah, I see what you mean now =)

I've changed:

Code:
$tbl->select_options('ORDER BY Username');

..to:

Code:
# $tbl->select_options('ORDER BY Username');
$tbl->select_options('ORDER BY Jump_Clicks DESC');

..and it now lists them by the number of people with the highest clicks, going downwards :)

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] Plugin User_Clicks In reply to
Andy wrote:
I've changed:

Code:
$tbl->select_options('ORDER BY Username');


..to:

Code:
# $tbl->select_options('ORDER BY Username');
$tbl->select_options('ORDER BY Jump_Clicks DESC');


..and it now lists them by the number of people with the highest clicks, going downwards :)

That's it, thank you Andy.

What about this code. Is there something I could change to get the 'number of logins' output from community?

Code:
<tr>
<td>$user->{Username}</td>
<td>$user->{Jump_Clicks}</td>
<td>$Plugins::Auth_Community::get_profile('username')->{comm_login_count}</td>
<td>$user->{Email}</td>
</tr>

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Plugin User_Clicks In reply to
Hi,

Glad that works for you :)

Quote:
What about this code. Is there something I could change to get the 'number of logins' output from community?

I don't see why not. It would just require you to add a function to the Auth_Community.pm file (in GLinks), something like:

Code:
sub get_users_login_count {

my $cfg = Links::Plugins->get_plugin_user_cfg('Auth_Community');

my $NEWDB = new GT::SQL (
def_path => "$cfg->{community_private}/defs",
cache => 0,
debug => 0,
subclass => 1
);


require GT::SQL::Condition;
my $db = $NEWDB->table('comm_users');

my $num_logins = $db->select( { comm_username => $_[0] } )->fetchrow_hashref || die $GT::SQL::error;

return $num_logins;

}

..then call with:

<%Plugins::Auth_Community::get_users_login_count($Username)%>

This is *totally* untested, as I'm a bit busy at the moment, but hopefully it will work :)

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] Plugin User_Clicks In reply to
    Hi Andy,
I'm getting an error :-(

Code:
Unable to load plugin: User_Clicks (Global symbol "$Username" requires explicit package name at /admin/Plugins/User_Clicks.pm line 273.
Global symbol "$Username" requires explicit package name at /admin/Plugins/User_Clicks.pm line 315.
Compilation failed in require at admin.cgi line 205.
) at admin.cgi line 207.

Do you know what it means?
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Plugin User_Clicks In reply to
Hi,

Erm, I said to put that into Auth_Community.pm :P

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] Plugin User_Clicks In reply to
Andy wrote:
Hi,

Erm, I said to put that into Auth_Community.pm :P

Cheers

Hi Andy,
that's what I did, but I'm getting this error?

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Plugin User_Clicks In reply to
Hi,

Ok, I think I see what you are doing. Are you trying to add this into User_Click.pm?

<%Plugins::Auth_Community::get_users_login_count($Username)%>

I'm a little confused as to what you are actually trying to do? I'll probably feel like an idiot when you explain, but I'm stumped at the moment :P

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] Plugin User_Clicks In reply to
Hi Andy,
I only want to see the number of user logins from community beside the number of user jump clicks of the user_clicks Plugin..
At the moment I can see the number of user logins in community and the number of jump clicks in user_clicks Plugin.
So I have to jump between community and userclicks plugin to combare them. Would be easier to have it on one site.

I certainly would prefer to show the userclicks in community user_admin.html, but I thought it would perhaps easier to show the number of logins in the userclicks plugin.
When there is a way to show the userclicks in community. That would be my favorit.

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Plugin User_Clicks In reply to
Hi,

Ok, I've made some changes for you in User_Clicks.pm - you now have these fields in the User Clicks plugin:

Username Clicks Logins Email

That should do the trick =) You needed the global as an actual function in the plugin itself - because you can't use tags in a plugin ;)

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] Plugin User_Clicks In reply to
Hi Andy,
thanks looks perfect ;-)
Matthias

Matthias
gpaed.de