1. GSManager
    1. Funktionen
    2. Unterstützte Spiele
    3. Neuigkeiten
    4. Statistiken
    5. Serverliste
  2. Lexikon
  3. Filebase
  4. Entwicklung
  5. Forum
    1. Dashboard
    2. Unerledigte Themen
  6. Web-Interface
  7. Artikel
  8. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Dateien
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. GSManager
  2. Mitglieder
  3. Postbote

Beiträge von Postbote

Das Projekt GSManager (vormals ManuAdminMod) wurde am 01.01.2020 eingestellt - diese Internetpräsenz bleibt verfügbar, die Software wird aber nicht länger gepflegt. Vielen Dank für eure Unterstützung in den mehr als zehn vergangenen Jahren!
  • Statusimage

    • Postbote
    • 15. Oktober 2010 um 00:42

    Ist zwar schon komplett oben, aber bitte:

    PHP
    <?php
    	$mysqlhost =	"localhost";		// Host des MySQL-Servers - Host of you MySQL-Server
    	$mysqluser =	"buh";				// Benutzername des MySQL-Servers - Loginname for the MySQL-Server
    	$mysqlpasswd =	"muh";		// Passwort des MySQL-Servers - Password for the MySQL-Server
    	$mysqldbname =	"mamstats";				// Datenbank des MySQL-Servers - Database of the MySQL-Server
    	$ip =   		"192.168.1.4";			
    	$port =  		"28960";      		// Port deines Gameservers - You gameserver's port
    	$timeout =		"0.5";   				// Maximale Verbindungzeit zum Gameserver in Sekunden - Maximum connection time to the gameserver
    	$bildname = 	"Signatur.png";		// Hintergrund-Bild - Background-Image
    	$font_file = 	"./bankgthd.ttf";	// Sonstige Schriftart - Other font
    	$font_file2 = 	"./Battlev2bi.ttf";	// Überschrift (Nick) Schriftart - headline (nickname) font
    
    	/*
    	Don't Change something after these lines except you know what you are doing!
    	Ändere ab hier nichts mehr außer du weißt was du machst!
    	*/
    
    	mysql_connect($mysqlhost, $mysqluser, $mysqlpasswd);
    	mysql_select_db($mysqldbname);
    	header("Content-type: image/png");
    	$userid = addslashes($_GET["user"]); 
    	$hm = mysql_query("SELECT user FROM mam01_nicks WHERE nick = '".$userid."'");
    	$ha = mysql_fetch_array($hm);
    	$as = mysql_query("SELECT * FROM mam01_user WHERE id = '".$ha["user"]."'");
    	$user = mysql_fetch_array($as); 
    	function textstroke($img,$text,$posx,$posy,$textcolor,$font,$size,$strokecolor,$angle,$dick,$d3,$dicks)
    	{
    		for($i=0;$i<$dicks;$i++)
    		{
    			imagettftext($img, $size, $angle, $posx + $dick, $posy+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx - $dick, $posy+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx, $posy + $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx, $posy - $dick+$i, $strokecolor, $font,$text);	
    			imagettftext($img, $size, $angle, $posx + $dick, $posy - $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx + $dick, $posy + $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx - $dick, $posy - $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx - $dick, $posy + $dick+$i, $strokecolor, $font,$text);
    		}
    		imagettftext($img, $size, $angle, $posx + $dick, $posy, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx - $dick, $posy, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx, $posy + $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx, $posy - $dick, $strokecolor, $font,$text);	
    		imagettftext($img, $size, $angle, $posx + $dick, $posy - $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx + $dick, $posy + $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx - $dick, $posy - $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx - $dick, $posy + $dick, $strokecolor, $font,$text);
    		for($i=0;$i<$dicks;$i++)
    		{
    			imagettftext($img, $size, $angle, $posx, $posy+$i, $d3, $font,$text);
    		}
    		imagettftext($img, $size, $angle, $posx, $posy, $textcolor, $font,$text);
    	}
    	$pic = ImageCreateFromPNG($bildname);
    	$weiss = ImageColorAllocate($pic, 255, 255, 255);
    	$black = ImageColorAllocate($pic, 50, 50, 50);
    	$gray = ImageColorAllocate($pic, 125, 125, 125);
    	$green = ImageColorAllocate($pic, 0, 255, 0); 
    	$font_height = ImageFontHeight(10);
    	$font_width = ImageFontWidth(10);
    	$image_height = ImageSY($pic);
    	$image_width = ImageSX($pic);
    	$userid = addslashes($_GET["user"]);
    	$online = false;
    	$con = fsockopen("udp://$ip", $port, $errno, $errstr, 3);
    	if ($con)
    	{
    		fwrite($con, "\xFF\xFF\xFF\xFFgetstatus\x00");
    		stream_set_timeout($con, (int) $timeout, ($timeout - ((int) $timeout)) * 100000);
    		$start = microtime(true);
    		$s = "";
    		do {
    			$s .= substr(fread($con, 9999), 10);
    			$info = stream_get_meta_data($con);
    			if (!isset($end)) {
    				$end = microtime(true);
    			}
    		}
    		while(!$info["timed_out"]) ;
    		if (empty($s))
    		{
    		} else {
    			$ping = round(($end - $start) * 1000) . " ms";
    			list($dummy, $dvarslist, $playerlist) = explode("\n", $s, 3);
    			$playerlist = explode("\n", $playerlist);
    			array_pop($playerlist);
    			$players = array();
    			foreach ($playerlist as $value) {
    				list($score, $pingp, $name) = explode(" ", $value, 3);
    				$players[] = array(
    					"name" => htmlspecialchars(trimcolor(substr($name, 1, -1))),
    					"score" => $score,
    					"ping" => $pingp
    				);
    			}
    			$playerlist = "";
    			foreach ($players as $value) {
    				if(strtolower($value["name"]) == strtolower($userid))
    				{
    					$online = true;
    					$score = $value["score"];
    				}
    			}
    		}
    	}
    	function trimcolor($name) {
    		return preg_replace('|\^.|', '', $name);
    	}
    	if($online)
    	{
    		textstroke($pic,"ONLINE score:".$score,220,148,$green,$font_file2,10,$black,0,1,$gray,1);
    	}
    	textstroke($pic,$userid,3,21,$weiss,$font_file2,20,$black,0,1,$gray,5);
    	textstroke($pic,"Kills: ".$user["kills"],5,40,$weiss,$font_file,14,$black,0,1,$gray,3);
    	textstroke($pic,"Deaths: ".$user["deaths"],5,65,$weiss,$font_file,14,$black,0,1,$gray,3);
    	textstroke($pic,"Headshots: ".$user["headshots"],5,90,$weiss,$font_file,14,$black,0,1,$gray,3);
    	textstroke($pic,"Rate: ".round($user["kills"]/$user["deaths"],2),5,115,$weiss,$font_file,14,$black,0,1,$gray,3);
    	ImagePNG($pic);
    	ImageDestroy($pic)
    ?>
    Alles anzeigen
  • Statusimage

    • Postbote
    • 15. Oktober 2010 um 00:36

    Nein, der Code oben ist die ganze userstats.php.

  • Statusimage

    • Postbote
    • 15. Oktober 2010 um 00:25

    Ah, garnicht aufgefallen. Gut, geändert, jetzt kommt das:


    PHP
    Warning:  Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\statsimage\userpic.php:1) in C:\xampp\htdocs\statsimage\userpic.php on line 20

    Den Fehler hab ich schon oft zu Gesicht bekommen - auch bei anderen Scripts.

  • MySQL-Statistik-Seite / MySQL-Stats-Page

    • Postbote
    • 14. Oktober 2010 um 21:18

    Hey, danke :)
    Werds mal heute abend raufspielen. Klingt ja schonmal vielversprechend ;)


    €: Läuft einwandfrei, klasse gemacht

  • Statusimage

    • Postbote
    • 14. Oktober 2010 um 13:45

    Sorry für Doppelpost:
    Hab jetzt anscheinend den Fehler gefunden. Am Anfang der Datei muss anstatt

    PHP
    <?
    PHP
    <?php


    eingesetzt werden. Doch nun taucht ein neuer Fehler auf:

    Code
    Parse error:  syntax error, unexpected T_LNUMBER in C:\xampp\htdocs\statsimage\userpic.php on line 7


    Hier der Code:

    PHP
    <?php
    	$mysqlhost =	"localhost";		// Host des MySQL-Servers - Host of you MySQL-Server
    	$mysqluser =	"h";				// Benutzername des MySQL-Servers - Loginname for the MySQL-Server
    	$mysqlpasswd =	"f";		// Passwort des MySQL-Servers - Password for the MySQL-Server
    	$mysqldbname =	"mamstats";				// Datenbank des MySQL-Servers - Database of the MySQL-Server
    	$ip =   		"192.168.1.4;			
    	$port =  		"28960";      		// Port deines Gameservers - You gameserver's port
    	$timeout =	   0.5;   				// Maximale Verbindungzeit zum Gameserver in Sekunden - Maximum connection time to the gameserver
    	$bildname = 	"Signatur.png";		// Hintergrund-Bild - Background-Image
    	$font_file = 	"./bankgthd.ttf";	// Sonstige Schriftart - Other font
    	$font_file2 = 	"./Battlev2bi.ttf";	// Überschrift (Nick) Schriftart - headline (nickname) font
    
    	/*
    	Don't Change something after these lines except you know what you are doing!
    	Ändere ab hier nichts mehr außer du weißt was du machst!
    	*/
    
    	mysql_connect($mysqlhost, $mysqluser, $mysqlpasswd);
    	mysql_select_db($mysqldbname);
    	header("Content-type: image/png");
    	$userid = addslashes($_GET["user"]); 
    	$hm = mysql_query("SELECT user FROM mam01_nicks WHERE nick = '".$userid."'");
    	$ha = mysql_fetch_array($hm);
    	$as = mysql_query("SELECT * FROM mam01_user WHERE id = '".$ha["user"]."'");
    	$user = mysql_fetch_array($as); 
    	function textstroke($img,$text,$posx,$posy,$textcolor,$font,$size,$strokecolor,$angle,$dick,$d3,$dicks)
    	{
    		for($i=0;$i<$dicks;$i++)
    		{
    			imagettftext($img, $size, $angle, $posx + $dick, $posy+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx - $dick, $posy+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx, $posy + $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx, $posy - $dick+$i, $strokecolor, $font,$text);	
    			imagettftext($img, $size, $angle, $posx + $dick, $posy - $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx + $dick, $posy + $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx - $dick, $posy - $dick+$i, $strokecolor, $font,$text);
    			imagettftext($img, $size, $angle, $posx - $dick, $posy + $dick+$i, $strokecolor, $font,$text);
    		}
    		imagettftext($img, $size, $angle, $posx + $dick, $posy, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx - $dick, $posy, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx, $posy + $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx, $posy - $dick, $strokecolor, $font,$text);	
    		imagettftext($img, $size, $angle, $posx + $dick, $posy - $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx + $dick, $posy + $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx - $dick, $posy - $dick, $strokecolor, $font,$text);
    		imagettftext($img, $size, $angle, $posx - $dick, $posy + $dick, $strokecolor, $font,$text);
    		for($i=0;$i<$dicks;$i++)
    		{
    			imagettftext($img, $size, $angle, $posx, $posy+$i, $d3, $font,$text);
    		}
    		imagettftext($img, $size, $angle, $posx, $posy, $textcolor, $font,$text);
    	}
    	$pic = ImageCreateFromPNG($bildname);
    	$weiss = ImageColorAllocate($pic, 255, 255, 255);
    	$black = ImageColorAllocate($pic, 50, 50, 50);
    	$gray = ImageColorAllocate($pic, 125, 125, 125);
    	$green = ImageColorAllocate($pic, 0, 255, 0); 
    	$font_height = ImageFontHeight(10);
    	$font_width = ImageFontWidth(10);
    	$image_height = ImageSY($pic);
    	$image_width = ImageSX($pic);
    	$userid = addslashes($_GET["user"]);
    	$online = false;
    	$con = fsockopen("udp://$ip", $port, $errno, $errstr, 3);
    	if ($con)
    	{
    		fwrite($con, "\xFF\xFF\xFF\xFFgetstatus\x00");
    		stream_set_timeout($con, (int) $timeout, ($timeout - ((int) $timeout)) * 100000);
    		$start = microtime(true);
    		$s = "";
    		do {
    			$s .= substr(fread($con, 9999), 10);
    			$info = stream_get_meta_data($con);
    			if (!isset($end)) {
    				$end = microtime(true);
    			}
    		}
    		while(!$info["timed_out"]) ;
    		if (empty($s))
    		{
    		} else {
    			$ping = round(($end - $start) * 1000) . " ms";
    			list($dummy, $dvarslist, $playerlist) = explode("\n", $s, 3);
    			$playerlist = explode("\n", $playerlist);
    			array_pop($playerlist);
    			$players = array();
    			foreach ($playerlist as $value) {
    				list($score, $pingp, $name) = explode(" ", $value, 3);
    				$players[] = array(
    					"name" => htmlspecialchars(trimcolor(substr($name, 1, -1))),
    					"score" => $score,
    					"ping" => $pingp
    				);
    			}
    			$playerlist = "";
    			foreach ($players as $value) {
    				if(strtolower($value["name"]) == strtolower($userid))
    				{
    					$online = true;
    					$score = $value["score"];
    				}
    			}
    		}
    	}
    	function trimcolor($name) {
    		return preg_replace('|\^.|', '', $name);
    	}
    	if($online)
    	{
    		textstroke($pic,"ONLINE score:".$score,220,148,$green,$font_file2,10,$black,0,1,$gray,1);
    	}
    	textstroke($pic,$userid,3,21,$weiss,$font_file2,20,$black,0,1,$gray,5);
    	textstroke($pic,"Kills: ".$user["kills"],5,40,$weiss,$font_file,14,$black,0,1,$gray,3);
    	textstroke($pic,"Deaths: ".$user["deaths"],5,65,$weiss,$font_file,14,$black,0,1,$gray,3);
    	textstroke($pic,"Headshots: ".$user["headshots"],5,90,$weiss,$font_file,14,$black,0,1,$gray,3);
    	textstroke($pic,"Rate: ".round($user["kills"]/$user["deaths"],2),5,115,$weiss,$font_file,14,$black,0,1,$gray,3);
    	ImagePNG($pic);
    	ImageDestroy($pic)
    ?>
    Alles anzeigen

    Kann wer helfen?

  • MySQL-Statistik-Seite / MySQL-Stats-Page

    • Postbote
    • 14. Oktober 2010 um 13:34

    Auch wenn ich sicher gleich gehängt werde, weil ich den Thread wieder erweckt habe, poste ich trotzdem mein Anliegen:
    Also... erstmal. Echt schickes Plugin, es funktionierte auch auf Anhieb :thumbup:
    Dafür erstma ein fettes Lob von mir.
    Allerdings gibt es eine Sache die mich (noch) stört, und zwar dieses Fadenkreuz als Mauszeiger. Erstmal passt es überhaupt nicht zu meiner HP und eigentlich versuch ich den Code zu minimalisieren, also alles unnötige "rauszuschmeissen". Allerdings bin ich eigentlich noch totaler CSS/php boon und hoffe, dass mir einer zeigt, wie man den Mauzeiger wieder "normalisiert" ;)


    -Postbote

  • Statusimage

    • Postbote
    • 19. September 2010 um 18:44

    Ja, mit xampp. phpsysinfo läuft z.b. ohne Probleme.

  • Statusimage

    • Postbote
    • 19. September 2010 um 14:35

    Das Plugin ist anscheinend fehlerhaft, entweder spuckt Firefox den Fehler aus, dass das Bild fehlerhaft ist, oder es kommt son scheiß raus:

    Code
    htmlspecialchars(trimcolor(substr($name, 1, -1))), "score" => $score, "ping" => $pingp ); } $playerlist = ""; foreach ($players as $value) { if(strtolower($value["name"]) == strtolower($userid)) { $online = true; $score = $value["score"]; } } } } function trimcolor($name) { return preg_replace('|\^.|', '', $name); } if($online) { textstroke($pic,"ONLINE score:".$score,220,148,$green,$font_file2,10,$black,0,1,$gray,1); } textstroke($pic,$userid,3,21,$weiss,$font_file2,20,$black,0,1,$gray,5); textstroke($pic,"Kills: ".$user["kills"],5,40,$weiss,$font_file,14,$black,0,1,$gray,3); textstroke($pic,"Deaths: ".$user["deaths"],5,65,$weiss,$font_file,14,$black,0,1,$gray,3); textstroke($pic,"Headshots: ".$user["headshots"],5,90,$weiss,$font_file,14,$black,0,1,$gray,3); textstroke($pic,"Rate: ".round($user["kills"]/$user["deaths"],2),5,115,$weiss,$font_file,14,$black,0,1,$gray,3); ImagePNG($pic); ImageDestroy($pic) ?>
  1. Mitarbeiter
  2. Datenschutzerklärung
  3. Nutzungsbedingungen
  4. Impressum
  5. Kontakt
Community-Software: WoltLab Suite™