Raggaer
Godly Member
Hello, I made this simple script that shows the last 4 items a player bought!
*Note: table style will change depending on your layout
- Image -

- Install -
Open characters.php and add this code!
And we are done! hope you like it!
*Note: table style will change depending on your layout
- Image -

- Install -
Open characters.php and add this code!
PHP:
$namer = $player->getName();
$query = $SQL->query("SELECT `id`, `to_name`, `price`, `offer_id`, `trans_state` FROM `z_shop_history_item` WHERE `to_name` = '$namer' ORDER BY `id` DESC LIMIT 4") or die(mysql_error());
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD CLASS=white width="64px"><B>Item</B></TD><TD CLASS=white><B>Status</B></TD><TD CLASS=white><B>Price</B></TD></TR>';
foreach($query as $result) {
$ide = $result['offer_id'];
$query2 = $SQL->query("SELECT `id`, `itemid1` FROM `z_shop_offer` WHERE `id` = '$ide' ORDER BY `id` DESC LIMIT 4") or die(mysql_error());
foreach ($query2 as $esult) {
$itemid = $esult['itemid1'];
}
$bgcolor = $config['site']['darkborder'];
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td><img src="images/items/'.$itemid.'.gif"></td><td>'.$result['trans_state'].'</td><td>'.$result['price'].'</td>';
}
$main_content .= '</TABLE>';
$main_content .= '</br>';
And we are done! hope you like it!