選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

sternenkindsaga.php 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. use SCF\Core\DI;
  3. use SCF\Core\Database;
  4. $acl = DI::getInstance()->get('acl');
  5. if($acl->acl('see_SKS') == 1) {
  6. //var_dump($statDays);
  7. $Download = [];
  8. $db_slave = new Database($config['dbext'], $config['dbhost'], $config['dbuser'], $config['dbpass'], 'sks_gametracking');
  9. $db_slave->query("SELECT * FROM sks_core_settings WHERE setting = 'sks_previous_versions'");
  10. $vArray = $db_slave->single();
  11. $versions = explode(',', $vArray['value']);
  12. foreach ($versions as $key => $val) {
  13. $db_slave->query("SELECT * FROM `sks_unique_dls` WHERE `dl_version` = '{$val}'");
  14. $db_slave->execute();
  15. $Download[$val] = $db_slave->rowCount();
  16. }
  17. $db_slave->query("SELECT * FROM `sks_unique_dls` WHERE `timestamp` != 0");
  18. $db_slave->execute();
  19. $Download['all'] = $db_slave->rowCount();
  20. $db_slave->query("SELECT * FROM `sks_unique_user` WHERE `timestamp` != 0");
  21. $db_slave->execute();
  22. $allVistors = $db_slave->rowCount();
  23. $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");
  24. $bla = $db_slave->fetchArray();
  25. $genTraffic = round((($Download['all']*555008)/1024)/1024,2);
  26. $tpl->assign('downloadArray', $Download);
  27. $tpl->assign('allVisitors', $allVistors);
  28. $tpl->assign('traffic', $genTraffic);
  29. $tpl->assign('vardump', $bla);
  30. $tpl->display('Data/specific/sternenkindsaga.tpl');
  31. }
  32. else {
  33. $tpl->display('errorpages/AclError.tpl');
  34. }