ASP-FastBoard - Demo/Support-Forum
Forum anmelden / register Board
SearchSearch CalendarCalendar GalleryGalleryAuction-PortalAuctions GlobalGlobal Top-ListTopMembersMembers StatisticsStats
get your RSS-Feed
Language/Sprache:  Admin  
 Login: ChatChat (0) new User-MapUser-Mapsend Passwordsend Password RegisterRegister

Forum Overview » Homepagetools - Support » PHP » Spielerranking und Teamranking abfragen.
Pages: (1) [1] »
Registration necessaryRegistration necessary
Spielerranking und Teamranking abfragen.
MPStheGuuhlno Access no Access first Post cannot be deleted -> delete the whole Topic 
Group: User
Level: braver Poster

Posts: 42
Joined: 9/20/2006
IP-Address: saved
offline


Euer Ranking immer aktuell.

<?php

//********************************************************************************************************
// wenn du den text änder möchtest dann brauchst du das nur in den 6 variablen machen
$name = 'Spieler : ';
$weltrang = 'Int-Rang: ';
$land = 'Nat-Rang: ';
$nation = 'Nation : ';
$punkte = 'Punkte : ';
$team = 'Team MPS: ';//hier auch den Teamnanamen ändern(das MPS)
//********************************************************************************************************

$file = "http://tmnstats.rockweb.org/xml_ranking_player.php?login=theGuuhl"; //theGuuhl bin ich bitte mit deinem TMN Namen ersetzen
$xml_parser = xml_parser_create();

if (!($fp = fopen($file, "r"))) {
die("could not open XML input");
}
$data = fread($fp, 1024);
fclose($fp);
xml_parse_into_struct($xml_parser, $data, $vals, $index);
xml_parser_free($xml_parser);

$params = array();
$level = array();
foreach ($vals as $xml_elem) {
if ($xml_elem['type'] == 'open') {
if (array_key_exists('attributes',$xml_elem)) {
list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']);
} else {
$level[$xml_elem['level']] = $xml_elem['tag'];
}
}
if ($xml_elem['type'] == 'complete') {
$start_level = 1;
$php_stmt = '$params';
while($start_level < $xml_elem['level']) {
$php_stmt .= '[$level['.$start_level.']]';
$start_level++;
}
$php_stmt .= '[$xml_elem[\'tag\']] = $xml_elem[\'value\'];';
eval($php_stmt);
}
}
echo "<pre>";

//Exemple
Foreach ($params as $user) {

//Spielername
echo $name;
echo $user['PLAYER']['NAME'].'<br>';

//Rang Int
echo $weltrang;
echo $user['PLAYER']['PLACEINT'].'<br>';

//Rang Nat
echo $land;
echo $user['PLAYER']['PLACECTY'].'<br>';

//Nation
echo $nation;
echo $user['PLAYER']['COUNTRY'].'<br>';

//Punkte
echo $punkte;
echo $user['PLAYER']['SCORE'].'<br>';


//Team
echo $team;
//echo $user['PLAYER']['SCORE'].'<br>';
$team_rank=@file("http://ladder.trackmanianations.com/ladder/getteamstats.php?login=theGuuhl"); //auch hier Namen ersetzen

if(is_array($team_rank) && count($team_rank) > 0) {
$team_rank = implode("\n", $team_rank);
}

$team_rank=ereg_replace("(.+[;])(.+)([;]$)", "\\2",$team_rank);

echo "".$team_rank."</br>";
}


echo "</pre>";
?>

Gruß MPS-theGuuhl

PS: kann man wunderbar für Banner benutzen. Siehe unten.



edited by MPStheGuuhl on 11/8/2006 7:26:56 AM



www.MultiPlayerSuite.de.vu -/- www.ARWeb.de.vu -/- www.Trackmaniacks.de.vu
11/5/2006 11:00:03 AM    
Cyberlordno Access no Access no Access 
Group: Administrator
Level: heavy Spammer


Posts: 3610
Joined: 3/11/2004
IP-Address: saved
offline


Oder einfach den Banner-Code von FastTM-Stats benutzen.
Sieht dann so aus:



lg


Forum-Changelog || zu unseren Angeboten
11/8/2006 11:43:14 AM    
Registration necessaryRegistration necessary
Pages: (1) [1] »
all Times are GMT +1:00
Thread-Info
AccessModerators
Reading: all
Writing: User
Group: general
none
Forum Overview » Homepagetools - Support » PHP » Spielerranking und Teamranking abfragen.

.: Script-Time: 0.203 || SQL-Queries: 6 || Active-Users: 2,569 :.
Powered by ASP-FastBoard HE v0.8, hosted by cyberlord.at