Skip to content

Instantly share code, notes, and snippets.

@johnduhart
Created October 10, 2009 17:41
Show Gist options
  • Save johnduhart/206973 to your computer and use it in GitHub Desktop.
Save johnduhart/206973 to your computer and use it in GitHub Desktop.
<?php
/*
* Server Status V1
*
* compwhizii, 2009
* http://compwhizii.net/
*/
error_reporting(E_ALL);
ini_set('display_errors', '1');
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'serverstatus.php');
$templatelist = "";
require_once "./global.php";
$lang->load("serverstatus");
add_breadcrumb($lang->servers_head, "serverstatus.php");
if($mybb->input['do'] == "makeimg")
{
if (!function_exists('imagecreatefrompng')) {
die(header("Location: images\servertracker\gd-error.png"));
}
if(!$mybb->input['server']) {
die("Missing server GET variable");
}
$query = $db->simple_select("st_servers", "*", "serverid = ".$mybb->input['server']);
if($db->num_rows($query) == 0) {
die(header("Location: images\servertracker\badid.png"));
}
$serverinfo = $db->fetch_array($query);
if($serverinfo['makeimg']) {
header('Content-type: image/png');
$im = imagecreatefrompng("images/servertracker/Server.png");
//$color = imagecolorallocate($im, 231, 226, 226);
//$font = MYBB_ROOT.'images/servertracker/arial.ttf';
$font = 'arial';
//imagettftext($im, 31, 0, 10, 10, $color, $font, "This is a test");
imagepng($im);
imagedestroy($im);
}
}
if(!$mybb->input)
{
add_breadcrumb($lang->servers_list, "serverstatus.php");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment