Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to get stats from today and yesterday #4

Closed
amq opened this issue Oct 6, 2014 · 3 comments
Assignees
Labels

Comments

@amq
Copy link

@amq amq commented Oct 6, 2014

I couldn't find a proper way to do this.

Currently offered day option produces the same results as:

index.php?module=Counter&action=show&date=2014-10-05&id=1

(it is 2014-10-06 today)

Meaning that it combines stats from ysterday and today.

I want to be able to easily get the today's stats without having to manually specify date=2014-10-06 and also yesterday's (currently not even manually possible as far as I understand).

@Globulopolis

This comment has been minimized.

Copy link
Owner

@Globulopolis Globulopolis commented Oct 6, 2014

You mean "date range" like in the piwik?

@Globulopolis Globulopolis self-assigned this Oct 6, 2014
@amq

This comment has been minimized.

Copy link
Author

@amq amq commented Oct 6, 2014

I just want a counter which would display the number of visitors from the current day. Just like almost every counter-as-a-service does (liveinternet etc)

I can achieve that by using

index.php?module=Counter&action=show&date=2014-10-06&id=1

But I would need some script to keep the correct date.

In other words, I am looking for something like this:

index.php?module=Counter&action=show&date=today&id=1
index.php?module=Counter&action=show&date=yesterday&id=1
@amq

This comment has been minimized.

Copy link
Author

@amq amq commented Oct 18, 2014

I think it should be

if ($_date == 'day') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y')));
} elseif ($_date == 'yesterday') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-1, date('Y')));

instead of

if ($_date == 'day') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-1, date('Y')));
} elseif ($_date == 'yesterday') {
$date = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d')-2, date('Y')));
@Globulopolis Globulopolis reopened this Oct 19, 2014
Globulopolis pushed a commit that referenced this issue Oct 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.