[PHP] How to parse Inventory?
#1

Hello! I want to programm a "tool" to see in the webpanel of my website the Inventorys of my chars

 

For example my char had the unique ID: 981, what i must du, to see the full Inventory? or the Money?

 

How to parse the images with the icons of armor etc? (Solved)

 

 

THX for Help

 

//EDIT:

 

To Parse Picture:

Get ROW: (e.g: 8)

Get Collum: (e.g: 9)

Get FileID (ItemBtn0.png)

(ItemID: 20)

ID20 { display: inline-block; width: 32px; height: 32px; background: url(ItemBtn0.png) no-repeat 0 0; }
ID20 { background-position: -288px -256px; }

Short script to get the Icon:

// CONFIG
$SIZE = "32"; // 32x32 standart

// CONFIG --> ItemID = FileID,COL,ROW
$ID['19'] = "0,0,0";
$ID['20'] = "0,8,9";

$IDENT = $_GET['id'];
if(!isset($ID[$IDENT])) {
echo "Error!";
exit;
} else {
echo "<style>";
$R = mb_split(",",$ID[$IDENT]);
$ITE = $R[0];
$COL = $SIZE*$R[1];
$ROW = $SIZE*$R[2];

echo '
ID'.$IDENT.' { display: inline-block; width: 32px; height: 32px; line-height: 32px; background: url(ItemBtn'.$ITE.'.png) no-repeat 0 0; }
ID'.$IDENT.' { text-decoration: none; background-position: -'.$ROW.'px -'.$COL.'px; }
';
echo "</style>";
echo "<ID".$IDENT."></ID".$IDENT.">";
}



Messages In This Thread
[No subject] - by SeaLife - 10-18-2012, 10:53 AM
[No subject] - by someone - 10-18-2012, 02:41 PM
[No subject] - by SeaLife - 10-18-2012, 03:09 PM
[No subject] - by someone - 10-18-2012, 04:11 PM
[No subject] - by Wizatek - 10-18-2012, 05:20 PM
[No subject] - by Wizatek - 10-18-2012, 05:33 PM
[No subject] - by SeaLife - 10-18-2012, 05:49 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)