Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbhost = 'localhost';
- $dbuser = 'we';
- $dbpass = 'pass';
- $dbname = 'wecraftrp';
- $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('blad laczenia z baza danych');
- mysql_select_db($dbname);
- $q = mysql_query("select count(name) as count from users_online where online='1'") or die(mysql_error());
- $row = mysql_fetch_array($q);
- $ucount = $row['count'];
- unset($q);
- $q = mysql_query("select name from users_online where online='1'") or die(mysql_error());
- while($row = mysql_fetch_array($q)) {
- $olist .= "";
- }
- // sciezka do pliku z klasa
- require_once('status/class.hlsocket.php');
- // przykladowe czcionki
- define('TEMPESTA', 'status/fonts/tempesta.ttf');
- define('MINE', 'status/fonts/mine.ttf');
- define('TAHOMA', 'status/fonts/tahoma.ttf');
- define('VERDANA', 'status/fonts/verdana.ttf');
- define('TAHOMA_BOLD', 'status/fonts/tahoma_bold.ttf');
- $serwer="37.59.1.44";
- $port="25565";
- $socket=@fsockopen($serwer,$port,$errno,$errstr,2);
- if($socket==true)
- {
- $im = imagecreatefrompng("status/background.png");
- $white = imagecolorallocate($im, 255, 255, 255);
- $red = imagecolorallocate($im, 233, 18, 29);
- $info = " ";
- imagettftext($im, 12, 0, 37, 24, $white, MINE, "RP.WEMC.PL");
- imagettftext($im, 12, 0, 41, 24, $white, MINE, " $ucount/100"); //
- }else{
- $im = imagecreatefrompng("status/backgroundoff.png");
- $white = imagecolorallocate($im, 255, 255, 255);
- $red = imagecolorallocate($im, 233, 18, 29);
- $info = " ";
- imagettftext($im, 12, 0, 41, 24, $white, MINE, "RP.WEMC.PL");
- imagettftext($im, 12, 0, 41, 24, $red, MINE, " OFF");
- }
- // okreslenie typu zawartosci
- header('Content-type: image/png');
- imagepng($im);
- imagedestroy($im);
- ?>
Add Comment
Please, Sign In to add comment