file_put_contents('rt-content/hidden/config.json', json_encode(array('server_root' => substr($_SERVER['REQUEST_URI'], 0, -1), 'header_img' => '/assets/img/logo/v2.png'))); // create private properties file_put_contents('rt-content/hidden/private.json', json_encode(array('db' => array('host' => '', 'name' => '', 'user' => array('name' => '', 'pswd' => ''))))); // make image uploads directory mkdir('rt-content/uploads/'); // add upload script file_put_contents('rt-content/uploads/upload.php', file_get_contents('assets/php/image_upload.txt')); // create users database /*file_put_contents('rt-content/hidden/users.xml', simplexml_load_string('<udb></udb>')->asXML()); // and add system user // @see /util.php for attribute descripstions, minified to save characters rt_create_user(array( 'id' => 0, 'u' => 'roundtable', 'e' => '*****@*****.**', 'p' => 0, 'n' => 'System', 'b' => 1452453301, 'pp' => 's', 'ba' => 's', 'l' => 'In the cloud, or a datacenter. What\'s the difference?', 'w' => 'https://roundtable.nektro.net', 'ab' => 'I am RoundTable. I keep the lights on around here.
Be nice and I will too :)', 'ac' => '[0]', 'ad' => '[0]' ));*/ } $RT = new RoundTable(); // set properties // determine whether or not we should redirect to the setup page $RT->setProp('setup_complete', $RT->getProp('setup_complete') ?? false);
?> " style="width: 100%; position: relative;"> <div id="tipsy-<?php echo $round->getRoundId(); ?> " class="tipsy tipsy-n" style="visibility: hidden; display: block; opacity: 0.8;"> <div class="tipsy-arrow"></div> <div class="tipsy-inner" id="tipsy-content-<?php echo $round->getRoundId(); ?> "></div> </div> </div> <?php $eventArray = array(); $events = RoundTable::getInstance()->createQuery("r")->where("r.map_id = ?", $match->getMap()->getId())->andWhere("r.round_id = ?", $round->getRoundId())->orderBy("r.event_time ASC")->leftJoin("r.Kill pk")->execute(); foreach ($events as $event) { $color = "#000"; $text = $event->getEventName(); if ($event->getEventName() == "round_start") { $text = "Start of the round"; } elseif ($event->getEventName() == "kill") { $color = "#F00"; $kill = $event->getKill(); if (!$kill) { continue; } $text = $kill->getKillerName() . " has killed " . $kill->getKilledName() . " with " . $kill->getWeapon(); } elseif ($event->getEventName() == "round_end") { $text = "End of the round"; } elseif ($event->getEventName() == "bomb_planting") {
public function executeExportEstats(sfWebRequest $request) { $mO = $this->getRoute()->getObject(); $stats = array(); $match = $mO->toArray(); unset($match['id'], $match['config_password'], $match['season_id'], $match['server_id'], $match['rules'], $match['team_a'], $match['team_b'], $match['config_authkey'], $match['current_map']); $stats['match'] = $match; foreach ($mO->getMaps() as $mapO) { $map = $mapO->toArray(); unset($map['match_id'], $map['id']); $stats['map'] = $map; foreach ($mapO->getMapsScore() as $sO) { $score = $sO->toArray(); unset($score['id'], $score['map_id']); $stats['scores'][] = $score; } } foreach ($mO->getPlayers() as $pO) { $player = $pO->toArray(); unset($player['map_id'], $player['match_id'], $player['ip']); $stats['players'][] = $player; } $heatmap = PlayersHeatmapTable::getInstance()->createQuery()->where("match_id = ?", $mO->getId())->orderBy("created_at ASC")->execute(); foreach ($heatmap as $hO) { $data = $hO->toArray(); unset($data['id'], $data['match_id'], $data['map_id']); $stats['heatmap'][] = $data; } $kills = PlayerKillTable::getInstance()->createQuery()->where("match_id = ?", $mO->getId())->orderBy("created_at ASC")->execute(); foreach ($kills as $hO) { $data = $hO->toArray(); unset($data['match_id'], $data['map_id']); $stats['kills'][] = $data; } $kills = RoundTable::getInstance()->createQuery()->where("match_id = ?", $mO->getId())->orderBy("created_at ASC")->execute(); foreach ($kills as $hO) { $data = $hO->toArray(); unset($data['id'], $data['match_id'], $data['map_id']); $stats['rounds'][] = $data; } $kills = RoundSummaryTable::getInstance()->createQuery()->where("match_id = ?", $mO->getId())->orderBy("created_at ASC")->execute(); foreach ($kills as $hO) { $data = $hO->toArray(); unset($data['id'], $data['match_id'], $data['map_id']); $stats['summary'][] = $data; } return $this->renderText(json_encode($stats)); }