diff --git a/market.php b/market.php new file mode 100644 index 0000000..bbfe465 --- /dev/null +++ b/market.php @@ -0,0 +1,174 @@ +setExpiration(6); + if ($cache->hasExpired()) { + $offers = array( + 'wts' => mysql_select_multi("SELECT `id`, `itemtype` AS `item_id`, `amount`, `price`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 1 ORDER BY `created` DESC;"), + 'wtb' => mysql_select_multi("SELECT `id`, `itemtype` AS `item_id`, `amount`, `price`, `created`, `anonymous`, (SELECT `name` FROM `players` WHERE `id` = `player_id`) AS `player_name` FROM `market_offers` WHERE `sale` = 0 ORDER BY `created` DESC;") + ); + $cache->setContent($offers); + $cache->save(); + } else { + $offers = $cache->load(); + } + ?> +

Marketplace

+

You can buy and sell items by clicking on the market in depot.
To sell an item: Place item inside your depot, click on market, search for your item and sell it.

+

WTS: Want to sell

+ + + + + + + + + + + + + + + + + + + +
ItemCountPriceAddedByCompare
" alt="Item Image">".$o['player_name'].""; ?>
+

WTB: Want to buy

+ + + + + + + + + + + + + + + + + + + +
ItemCountPriceAddedByCompare
" alt="Item Image">".$o['player_name'].""; ?>
+ +

Comparing item

+ +

Active offers

+ + + + + + + + + + + + + + + + + +
ItemCountPriceAddedBy
" alt="Item Image">".$o['player_name'].""; ?>
+ +

Want to buy:

+ + + + + + + + + + + + + + + + + +
ItemCountPriceAddedBy
" alt="Item Image">".$o['player_name'].""; ?>
+ +

Old purchased offers

+ + + + + + + + + + + + + + + + + + + +
ItemCountPriceOffer addedOffer expiredBy
" alt="Item Image">".$o['player_name'].""; ?>
+ \ No newline at end of file