Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

ExtraStats plugin

(Page 2 of 2)
> >
Quote Reply
Re: [afinlr] ExtraStats plugin In reply to
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.
Quote Reply
Re: [ManuGermany] ExtraStats plugin In reply to
Manu,

That's great!

I assumed that most people would want to display the Unique hits graphs - which of course you know you can display for the current month just with <%Plugins::ExtraStats::DailyStats('All')%>. But this gives more flexibility again.

Rather than asking everyone to add globals to their site to use this, I think that I will just change the plugin so that the tags will be something like

<%Plugins::ExtraStats::DailyStats('All','A')%> and <%Plugins::ExtraStats::DailyStats('All','U')%>

to show the graphs for the current month and

<%Plugins::ExtraStats::DailyStats('All','A','12','2002')%> to show the graph for all hits for Dec 2002.

Hopefully you won't need to make too many changes to your site if I do this! but I think it will be a lot easier in the long run.

I've also made a lot of other changes in the backend of the plugin to make it easier in the future.

For example, I've changed the name of the Hits field in the new tables to U_Hits so that it doesn't cause a name clash with the Hits column in the Links table when these tables are joined. I've also added a foreign key relation so these tables can be joined. This makes it possible to show the list of most popular links today and this month and these tags have been added.

The templates are now refreshed automatically (thanks Alex) and you are now able to make changes to your graphs templates so they display exactly how you want and will not be overwritten on upgrades.

As Pugdog flagged up a problem with the Clicktrack table not being cleared for dynamic sites in his detail page plugin, I have set the uniqueness to be truly a daily unique - i.e. the plugin checks that that ip address has not clicked on that link within the last 24 hours for it to be counted as a unique hit.

Hopefully I'll be able to release the next version later today or tomorrow. It will probably involve a price increase.

Laura.

By the way, I think that the date_offset variable is used as soon as you call Links::init_date(). You don't need to add it again.
The UK High Street

Last edited by:

afinlr: Nov 10, 2002, 9:15 AM
Quote Reply
Re: [afinlr] ExtraStats plugin In reply to
Laura... on your site you say ExtraStats is £30, but below, you say its $30? Unsure

Quote:
I've decided to charge $30 for this plugin. This includes updates - I think there will be several updates as people decide what they want from it. I'm just waiting for Alex to upload it to the plugin download 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] ExtraStats plugin In reply to
Sorry - that was when it was very first released - it has had a lot added to it since then so I put the price up.

Laura.
Quote Reply
Re: [afinlr] ExtraStats plugin In reply to
Thanks... I was just checking up.. because on my UK keyboard, I have £ and $ next to each other :)

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!
> >