query ("SELECT version, DATE_FORMAT(date_sub(time, interval 1 DAY), '%d.%m.%Y') AS date, name AS count FROM `active` WHERE user_id='' ORDER BY time ASC")) { foreach ($db as $row) { $info['active'][$row['version']] = $row['count']; } } if ($db->query ("SELECT max(CAST(name AS UNSIGNED)) AS max FROM `active` WHERE user_id='' AND version>='3'")) { $info['maxCols'] = $db[0]['max']; } if ($db->query ("SELECT SUBSTRING(version,1,1) AS ver, DATE_FORMAT(date_sub(time, interval 1 DAY), '%d.%m.%Y') AS date, SUM(name) AS count FROM `active` WHERE user_id='' " . ($range == "year" ? "&& time > date_sub(NOW(), interval 1 YEAR)" : "") . " && version>='3' && version<='9' GROUP BY ver, date ORDER BY time, ver ASC")) { $info['firstday']= $db[0]['date']; $info['flow']= ""; $count = array(0,0,0); $days = array(0,0,0); $lastdate = ""; $day = 1; foreach ($db as $row) { if (($day % $precision) == 0 && $row['date'] != $lastdate) { $info['flow'] .= ""; for ($i=2; $i>=0; $i--) { if ($count[$i]) { $info['flow'] .= "
"; } } $info['flow'] .= "
"; $count = array(0,0,0); $days = array(0,0,0); } $day += $row['date'] == $lastdate ? 0 : 1; $lastdate = $row['date']; $ver = $row['ver'] - 3; $info['active'][$ver+3] = $row['count']; $count[$ver] += $row['count']; $days[$ver] ++; } $info['flow'] = "
" . $info['flow'] . "
"; $info['maxRows'] = $day; } //$info['active']['total'] = array_sum($info['active']); $info['active']['total'] = $info['active'][3] + $info['active'][4] + $info['active'][5]; $info['date'] = date ("j. M Y"); ignore_user_abort(true); if ($fp = fopen("{$config['data']}info_{$range}.txt", "r+")) { if (flock($fp, LOCK_EX)) { fwrite($fp, serialize($info)); flock($fp, LOCK_UN); } fclose($fp); } else { touch("{$config['data']}info_{$range}.txt"); } ignore_user_abort(false); } ?> "text", 'parent' => $tpl_content, 'max' => 1)); ?>
setPlaceholder("text", $info); ?> html ("text")?>