Commit a790925f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't add old stuff from the view log when there have been no page visits for a week


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 82250683
......@@ -2345,7 +2345,13 @@ function cron_site_data_daily() {
if ($fh = @fopen(get_config('dataroot') . 'views.log', 'r')) {
// Read the new stuff out of the file
$latest = get_field_sql("SELECT MAX(ctime) FROM {view_visit}");
$latest = get_field('view_visit', 'MAX(ctime)');
if (empty($latest)) {
$latest = get_config('viewloglatest');
}
else {
set_config('viewloglatest', $latest);
}
$visits = array();
while (!feof($fh)) {
$line = fgets($fh, 1024);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment