I'm planning to make the guild website of "BWL Back-Up Squad" and was planning to give all chars of our guild a banner with their char information so we can put those beneath the forums on wich we are active. With a link to "www.smolderforge.com" so we can promote the server aswell.
I just need a XML feed or a XML look a like feed. If you want this it would be great because I tryed to export the data from the armory just with "file_get_content()" but its just to slow.. and needed to RIP the whole data I needed.
I got a example beneath:
Code: Select all
<?php
// ------------------------
//XML FEED
//MADE BY: Jan Willem
// ------------------------
// Never tested this..
// =============================
// DATABASE
// =============================
//Settings from the Server
$db_host = "localhost";
$db_user = "root";
$db_pass = "mangos";
$db_database = "mangos";
// De database connectie zelf
$db_connectie = mysql_connect($db_host, $db_user, $db_pass);
if (!$db_connectie) {
die('Error: <br><b>' . mysql_error() .'</b>');
}
// Database selecteren
$db_select = mysql_select_db($db_database, $db_connectie);
if (!$db_select) {
die ('Error: <br><b>' . mysql_error() .'</b>');
}
// =============================
// END DATABASE CONNECTION
// =============================
// $_GET['n'] = Name of the player
// $_GET['r'] = The name of the Realm
if(isset($_GET['n']) && isset($_GET['r'])){
if($_GET['n'] != "" && $_GET['r'] != ""){
//Uhmm I don't know if it works at all as I don't have a server standing by. But you can ofc edit this.
//I just seen the Database ERD on forum so thats the only information I got
//
$mysql_query = mysql_query("SELECT * FROM `characters` WHERE `name` = '".$_GET['n']."'") or print mysql_error();
if(!mysql_num_rows($mysql_query)){
$do_query = 0;
echo "Char: ".$_GET['n']. ", don't existst on realm ".$_GET['r'];
}
$data = mysql_fetch_assoc($StatQuery);
$statistic_data = explode(' ',$data['data']);
$array_data = array(
'name' => $data['name'],
'race' => $data['race'],
'class' => $data['class'],
'health' => $statistic_data[28],
'mana' => $statistic_data[29],
'rage' => $statistic_data[30],
'energy' => $statistic_data[32],
'lvl' => $statistic_data[34],
'gender' => $statistic_data[36],
'meele_mainhand_att_time' => $statistic_data[147],
'meele_offhand_att_time' => $statistic_data[148],
'range_att_time' => $statistic_data[149],
'meele_mainhand_min_dmg' => $statistic_data[155],
'meele_mainhand_max_dmg' => $statistic_data[156],
'meele_offhand_min_dmg' => $statistic_data[157],
'meele_offhand_max_dmg' => $statistic_data[158],
'armor' => $statistic_data[186],
'holyress' => $statistic_data[187],
'fireress' => $statistic_data[188],
'natureress' => $statistic_data[189],
'frostress' => $statistic_data[190],
'shadowress' => $statistic_data[191],
'arcaneress' => $statistic_data[192],
'melee_apbase' => $statistic_data[210],
'melee_apbonus' => $statistic_data[211],
'ranged_apbase' => $statistic_data[213],
'ranged_apbonus' => $statistic_data[214],
'ranged_min_dmg' => $statistic_data[216],
'ranged_max_dmg' => $statistic_data[217],
'guild' => $statistic_data[237],
'guidrank' => $statistic_data[238],
'skilldata' => $statistic_data[928],
'kills' => $statistic_data[1517],
'honor' => $statistic_data[1562]
);
echo "<pre>";
print_r($array_data);
echo "</pre>";
}
else{
//They left the value's empty
echo "Error";
}
}
else{
//They didn't add n or r in the URL
echo "Error";
}
?>
If you got any questions or you don't want to do this.. :( or you want my script for the banners afher I made it... just reply on this topic.
Greetings Jan Willem (Wimpie)
EDIT: maybe was beter for Suggestion topic...