Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. use SCF\Core\DI;
  3. use SCF\Core\Database;
  4. use SCF\Core\StatsGenerator;
  5. $acl = DI::getInstance()->get('acl');
  6. if($acl->acl('see_SKS') == 1) {
  7. //var_dump($statDays);
  8. $Download = [];
  9. $db_slave = new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], 'sks_gametracking');
  10. $db_slave->query("SELECT * FROM sks_core_settings WHERE setting = 'sks_previous_versions'");
  11. $vArray = $db_slave->single();
  12. $versions = explode(',', $vArray['value']);
  13. foreach ($versions as $key => $val) {
  14. $db_slave->query("SELECT * FROM `sks_unique_dls` WHERE `dl_version` = '{$val}'");
  15. $db_slave->execute();
  16. $Download[$val] = $db_slave->rowCount();
  17. }
  18. $db_slave->query("SELECT * FROM `sks_unique_dls` WHERE `timestamp` != 0");
  19. $db_slave->execute();
  20. $Download['all'] = $db_slave->rowCount();
  21. $db_slave->query("SELECT COUNT(guid) AS visit_count, DAY(FROM_UNIXTIME(`timestamp`)) as visit_day, MONTH(FROM_UNIXTIME(`timestamp`)) as visit_month, YEAR(FROM_UNIXTIME(`timestamp`)) AS visit_year FROM sks_unique_dls GROUP BY visit_year DESC, visit_month DESC, visit_day DESC LIMIT 10");
  22. $downloadsPerDay = $db_slave->fetchArray();
  23. $db_slave->query("SELECT * FROM `sks_unique_user` WHERE `timestamp` != 0");
  24. $db_slave->execute();
  25. $allVistors = $db_slave->rowCount();
  26. $db_slave->query("SELECT COUNT(guid) AS visit_count, DAY(FROM_UNIXTIME(`timestamp`)) as visit_day, MONTH(FROM_UNIXTIME(`timestamp`)) as visit_month, YEAR(FROM_UNIXTIME(`timestamp`)) AS visit_year FROM sks_unique_user GROUP BY visit_year DESC, visit_month DESC, visit_day DESC LIMIT 10");
  27. $visitorsPerDay = $db_slave->fetchArray();
  28. $stats = new StatsGenerator($db_slave);
  29. $stats->setDateLabels($_GET['day'], $_GET['month'], $_GET['year'], $_GET['range']);
  30. $stats->setUserDateRows('user', $_GET['day'], $_GET['month'], $_GET['year'], $_GET['range']);
  31. $stats->setDownloadDateRows('dls', $_GET['day'], $_GET['month'], $_GET['year'], $_GET['range']);
  32. $genTraffic = round((($Download['all']*555008)/1024)/1024,2);
  33. $tpl->assign('downloadArray', $downloadsPerDay);
  34. $tpl->assign('visitorArray', $visitorsPerDay);
  35. $tpl->assign('allVisitors', $allVistors);
  36. $tpl->assign('allDownloads', $Download['all']);
  37. $tpl->assign('traffic', $genTraffic);
  38. $tpl->assign('stats', $stats);
  39. //$tpl->assign('vardump', $stats);
  40. $tpl->display('Data/specific/sternenkindsaga.tpl');
  41. }
  42. else {
  43. $tpl->display('errorpages/AclError.tpl');
  44. }