O.K. i've played around with the plugin and here are some useful tricks:
1.) Always display the graph for the actual date:
Create the following globals:
current_month:
sub {
Links::init_date();
return GT::Date::date_get (($CFG->{date_offset} * 3600), '%mm%');
}
current_year:
sub {
Links::init_date();
return GT::Date::date_get (($CFG->{date_offset} * 3600), '%yyyy%');
}
Then you change the plugin-tags like the example below:
<%Plugins::ExtraStats::DailyStats('All',$current_month,$current_year,'All')%>
Now there is always the actual graph displayed.
2.) Display the actual graphs for every link a link-owner has in your directory:
Create the globals in point 1.).
create another global
link_owner:
sub {
my $user = shift;
my $loop = $DB->table('Links')->select( { LinkOwner => $user } )->fetchall_arrayref({});
return { my_total => scalar @$loop, my_links => $loop };
}
then insert into your template:
<%if Username%>
<%link_owner($Username)%>
<%if my_total%>
<%loop my_links%>
<%Plugins::ExtraStats::DailyStats($ID,$current_month,$current_year,'All')%>
<%endloop%>
<%endif%>
<%endif%>
What you get is a list of graphs for every link owned by a link owner (for the current month and year). Of course the graphs are only displayed if he/she is logged in. Other users can't have a look at the graphs.
Regards,
Manu
Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
1.) Always display the graph for the actual date:
Create the following globals:
current_month:
sub {
Links::init_date();
return GT::Date::date_get (($CFG->{date_offset} * 3600), '%mm%');
}
current_year:
sub {
Links::init_date();
return GT::Date::date_get (($CFG->{date_offset} * 3600), '%yyyy%');
}
Then you change the plugin-tags like the example below:
<%Plugins::ExtraStats::DailyStats('All',$current_month,$current_year,'All')%>
Now there is always the actual graph displayed.
2.) Display the actual graphs for every link a link-owner has in your directory:
Create the globals in point 1.).
create another global
link_owner:
sub {
my $user = shift;
my $loop = $DB->table('Links')->select( { LinkOwner => $user } )->fetchall_arrayref({});
return { my_total => scalar @$loop, my_links => $loop };
}
then insert into your template:
<%if Username%>
<%link_owner($Username)%>
<%if my_total%>
<%loop my_links%>
<%Plugins::ExtraStats::DailyStats($ID,$current_month,$current_year,'All')%>
<%endloop%>
<%endif%>
<%endif%>
What you get is a list of graphs for every link owned by a link owner (for the current month and year). Of course the graphs are only displayed if he/she is logged in. Other users can't have a look at the graphs.
Regards,
Manu
Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.