Jerichos
Forum Replies Created
-
I think c# is awesome.
I love it either =)))
Anyway I Love your widget and now It look to work fine, Thanks
I’m not so good at PHP, I work more with C#.
I just looked at this query where function now is present/* RANGE: Daily */ // views if ($args['order_by'] == "views" || $args['order_by'] == "avg" || $args['stats_tag']['views']) { $join .= " LEFT JOIN (SELECT id, SUM(pageviews) AS 'pageviews', day FROM (SELECT id, pageviews, day FROM {$table}cache WHERE day > DATE_SUB('".self::now()."', INTERVAL 1 DAY) ORDER BY day) sv GROUP BY id) v ON p.ID = v.id "; $fields .= ", IFNULL(v.pageviews, 0) AS 'pageviews' "; }Thank You.
Jetpack’s Today’s top posts *should* be the same as in the popular plugin
But it’s not because it depends on date of my computer.
Ok, I changed WordPress timezone to my local timezone, which is currently UTC+3 and it works just fine for me. But if I were in Kiritimati, Christmas Island, Kiribati (UTC/GMT +14) there would be 27 June already.
In my admin panel I can see all popular news for today (for me it’s 26 June right now), but if I change date on my device to 27 June (which is true for Kiritimati) and try to access my web page, plugin shows “Sorry. No data yet.”.
Changing timezone in WordPress settings to UTC +14 is not a very good idea as well, because the opposite thing happens – it shows popular posts, indeed, but for me it shows yesterday’s most popular stats.
Problem resolved by changing WordPress timezone to UTC+0 and changing function “now” at popular-posts-tab-widget-for-jetpack.php
static function now(){ return current_time('mysql'); }to this
static function now(){ return current_time('mysql', 1); }now this function returns current server’s UTC time
Thank you.
The thing is that jetpack shows Today’s top posts without any problem, but this plugin tries to get top list from the next day if user’s local date is after WordPress timezone’s date.
In my last post I meant something like to get jetpack’s day’s top posts using it’s own function now() or something. I don’t know how to do it, i’m just suggesting)))
I made this widget to work satisfactorily by changing my wordpress local timezone to UTC+14.
Thank you for your responds.
Is it possible to pick date from my WordPress instead of my local date?
Thank you.
Yes, I’ve tried to set Date range to weekly and it works just fine, but I think that visitors, who live to West from my WordPress time zone will face the same problem if they click Today’s popular news.
Thank you.