Auction System For MACC (Only Page)
Credits:
xTremoxx - Fix Script and Customize
Paxton - Fix Script
vdK - Develop Script
Install:
First step, get all script in this TOPIC, except website page.
Second step, goto MACC root folder and /system/pages create a new file called auctionsystem.php and paste:
PHP:
<?PHP
require("config.php");
$ots = POT::getInstance();
$ots->connect(POT::DB_MYSQL, connection());
$SQL = $ots->getDBHandle();
$auctions = $SQL->query('SELECT `auction_system`.`player`, `auction_system`.`id`, `auction_system`.`item_name`, `auction_system`.`item_id`, `auction_system`.`count`, `auction_system`.`cost`, `auction_system`.`date`, `players`.`name` FROM `auction_system`, `players` WHERE `players`.`id` = `auction_system`.`player` ORDER BY `auction_system`.`id` DESC')->fetchAll();
$players = 0;
$main_content = '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR><TD CLASS=white><b><center><font color="green" size="3"><h4><b>Instruções</b></h4></font></center><b></TD></TR><TR><TD><center><h2>Comandos</h2><b><font color="red">!offer add, NomeDoItem, PreçoDoItem, Quantidade</font></b><br />Exemplo: !offer add, Plate Armor, 500, 1<br /><br /><B><font color="red">!offer buy, ID</font></b><br />Exemplo: !offer buy, 1943<br /><br /><b><font color="red">!offer remove, ID</font></b><br />Exemplo: !offer remove, 1943<br /><br /><b><font color="red">!offer withdraw</font></b><br />Use este comando para retirar os lucros de suas vendas.</center></TR></TD></TABLE><br />';
if(empty($auctions))
{
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR><TD CLASS=white><b><center><h3>Auctions</h3></center></b></td></TR><TR><TD><center>Currently is no one active Auction.</center></TD></TR></TABLE>';
}
else
{
foreach($auctions as $auction) {
$players++;
$cost = round($auction['cost']/1000, 2);
$content .= '<TD><center>'.$auction['id'].'</center></TD><TD><center><img src="/public/images/items/'.$auction['item_id'].'.gif"/></center></TD><TD><center>'.$auction['item_name'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($auction['name']).'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.' k<br />'.$auction['cost'].' gps</center></TD><TD><center>!offer buy, '.$auction['id'].'</center></TR>';
}
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Foto</center></b></TD><TD class="white"><b><center>Nome do Item</center></b></TD><TD class="white"><b><center>Vendedor</center></b></TD><TD class="white"><b><center>Quantidade</center></b></TD><TD class="white"><b><center>Preço</center></b></td><TD class="white"><b><center>Comprar</center></TR></b></td>'.$content.'</TABLE>';
}
echo $main_content;
?>
Third Step, goto /templates/youtemplatename/index.tpl
Find:
PHP:
<li><a href="{$path}/index.php/forum">Forum</a></li>
Add Above:
PHP:
<li><a href="{$path}/index.php/p/v/auctionsystem"><span style="color: green;font-weight: bold;">Trade Online</span></a></li>
Information
This script is working perfectly, but have one bug, and i don't know to resolve it, if any people know, please post solution here, the bug is, when u enter in page, a php error apear :} ...
PS: this bug isn't serious, stay calm
Script in Work:
REP ++
Last edited: