Exemplo n.º 1
0
        body{
          animation: 2s fadeint ease-in-out;
          -o-animation: 2s fadeint ease-in-out;
          -ms-animation: 2s fadeint ease-in-out;
          -webkit-animation: 2s fadeint ease-in-out;
          -moz-animation: 2s fadeint ease-in-out;
        }
        </style>
    </head>

    <body>
      <a href="index.php" style="text-decoration: none;"><div class="home"><div class="hometext">Torna alla home</div></div></a>
      <div class="text" style="text-align: center; margin-top: 100px;">
          <?php 
require 'phplibs/infos.class.php';
$getInfos = new getInfos();
$logovalue = $_GET['logo'];
$bannervalue = $_GET['banner'];
$id = $_GET['server_id'];
$url = "https://api.minecraft-italia.it/server-info/{$id}";
$infos = json_decode($getInfos->serverInfos($url), true);
if (preg_match('/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-]/', $_GET['server_id']) || array_key_exists("error", $data) || preg_match('/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-]/', $logovalue) || preg_match('/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-]/', $bannervalue) || empty($id)) {
    die("ID del server invalido");
}
if ($logovalue > 3 || $bannervalue > 2) {
    die("Stile o banner non disponibile.");
}
if (array_key_exists("error", $infos)) {
    die("Il server che hai inserito non esiste.");
}
if ($bannervalue === "" || $logovalue === "") {
Exemplo n.º 2
0
<?php

ini_set('display_errors', 1);
$logovalue = $_GET['logo'];
$bannervalue = $_GET['banner'];
$url = "https://api.minecraft-italia.it/server-info/" . $_GET['server_id'];
require 'phplibs/infos.class.php';
require 'phplibs/flat.class.php';
require 'phplibs/material.class.php';
$flat = new FlatImage();
$material = new MaterialImage();
$getInfos = new getInfos();
$getInfos->serverInfos($url);
$data = json_decode($getInfos->serverInfos($url), true);
$title = $data['title'];
$ip = $data['address'];
$position = $data['position'];
if (preg_match('/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-]/', $_GET['server_id']) || array_key_exists("error", $data) || preg_match('/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-]/', $logovalue) || preg_match('/[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-]/', $bannervalue)) {
    die("ID del server invalido");
}
$path = "/home/macca/www/mcbanners.it/public_html/cache/" . $_GET['server_id'] . "-cached-" . $logovalue . "-" . $bannervalue . ".png";
$timeout = 180;
if ($logovalue === '1' && $bannervalue === '2') {
    header("Content-type: image/png");
    if (file_exists($path)) {
        readfile($path);
        if (time() - filectime($path) >= $timeout) {
            unlink($path);
        }
    } else {
        header("Content-type: image/png");