Initial commit as of 2018-10-16
This commit is contained in:
92
application/controllers/Tools/Minecraft.php
Normal file
92
application/controllers/Tools/Minecraft.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Minecraft extends MY_Controller {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct('tools');
|
||||
$this->load->model('minecraftModel', '', TRUE);
|
||||
}
|
||||
|
||||
public function index() {
|
||||
$this->load->view('header', ['active' => '', 'title' => 'Error']);
|
||||
$this->load->view('under_construction');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
public function servers() {
|
||||
$this->load->view('header', ['active' => '', 'title' => 'Error']);
|
||||
$this->load->view('under_construction');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
public function players() {
|
||||
$this->load->view('header', ['active' => '', 'title' => 'Error']);
|
||||
$this->load->view('under_construction');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*public function server() {
|
||||
$serverip = isset($_GET['serverip']) ? $_GET['serverip'] : 'gommehd.net';
|
||||
|
||||
$errorIP = $this->MinecraftModel->getServerName($serverip) == lang('servers_error_ip') ? true : false;
|
||||
|
||||
$this->load->view('header', ['active' => 'minecraft-servers', 'title' => lang('servers_site_title')]);
|
||||
$this->load->view('minecraft', ['type' => 'server', 'serverip' => $serverip, 'error' => $errorIP]);
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
public function player()
|
||||
{
|
||||
$username = !empty($_GET['username']) ? $_GET['username'] : "KingOfDog";
|
||||
$username = $this->MinecraftModel->getUUID($username)[1];
|
||||
|
||||
$cracked = $this->MinecraftModel->getUUID($username)[2] == true ? '<small>Cracked</small>' : '<small style="color:#FFAA00;">Premium</small>';
|
||||
$crackedBool = $this->MinecraftModel->getUUID($username)[2];
|
||||
if ($crackedBool == false) {
|
||||
$uuid = $this->MinecraftModel->getUUID($username)[0];
|
||||
$uuid_formatted = $this->MinecraftModel->formatUUID($uuid);
|
||||
} else {
|
||||
$uuid = null;
|
||||
$uuid_formatted = null;
|
||||
}
|
||||
|
||||
if (isset($_GET['download']) && !empty($_GET['download'])) {
|
||||
if ($_GET['download'] == "skin") {
|
||||
header('Content-Type: image/png');
|
||||
header('Content-Disposition: attachment; filename="skin_' . $username . '.png"');
|
||||
readfile('https://crafatar.com/skins/' . $username);
|
||||
die();
|
||||
}
|
||||
if ($_GET['download'] == "render") {
|
||||
header('Content-Type: image/png');
|
||||
header('Content-Disposition: attachment; filename="render_' . $username . '.png"');
|
||||
readfile('https://crafatar.com/renders/body/' . $username . '?overlay&scale=7');
|
||||
die();
|
||||
}
|
||||
if ($_GET['download'] == "head") {
|
||||
header('Content-Type: image/png');
|
||||
header('Content-Disposition: attachment; filename="head_' . $username . '.png"');
|
||||
readfile('https://crafatar.com/renders/head/' . $username . '?overlay&scale=7');
|
||||
die();
|
||||
}
|
||||
if ($_GET['download'] == "avatar") {
|
||||
if (isset($_GET['size']) && !empty($_GET['size'])) {
|
||||
$size = $_GET['size'];
|
||||
} else {
|
||||
$size = "128";
|
||||
}
|
||||
|
||||
header('Content-Type: image/png');
|
||||
header('Content-Disposition: attachment; filename="avatar' . $size . '_' . $username . '.png"');
|
||||
|
||||
readfile('https://crafatar.com/avatar/' . $username . '?overlay&size=' . $size);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->view('header', ['active' => 'minecraft-players', 'title' => lang('players_site_title')]);
|
||||
$this->load->view('minecraft', ['type' => 'player', 'username' => $username, 'uuid' => $uuid, 'uuid_formatted' => $uuid_formatted, 'cracked' => $cracked, 'crackedBool' => $crackedBool]);
|
||||
$this->load->view('footer');
|
||||
}*/
|
||||
}
|
Reference in New Issue
Block a user