93 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			93 lines
		
	
	
		
			3.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?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');
 | |
|     }*/
 | |
| }
 |