• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Modern ACC] Auction System (Page)

xTremoxx

domasturb(cid, genital)
Joined
Aug 11, 2007
Messages
418
Reaction score
6
Location
Brazil
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;  
?>
The language is Portuguese, because i'm from Brazil, feel free to translate. if you don't know Portuguese use Google translator.

Third Step, goto /templates/youtemplatename/index.tpl

Find:

PHP:
<li><a href="{$path}/index.php/forum">Forum</a></li>
or same this...

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 :D

Script in Work:​

imagemqh.png

REP ++
 
Last edited:
Below
PHP:
$SQL = $ots->getDBHandle();
Put
PHP:
$content = '';
to get rid of your notice 'bug'.
 
Below
PHP:
$SQL = $ots->getDBHandle();
Put
PHP:
$content = '';
to get rid of your notice 'bug'.

He is just using that variable once so the .= isn't needed :p
PHP:
 $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>';
 
Aha, did not even see that. Good find!
 
i rlly like it :D!! but why appear this??

A PHP Error was encountered
Severity: Notice

Message: Undefined variable: content

Filename: pages/auctionsystem.php

Line Number: 19
 
and all appear like this:
ID Foto Item Name Seller Amount Price Buy 6 crystal key Download 1 10 k 10000 gps !offer buy, 6 5 demonic essence Xyzon 1 1000 k 1000000 gps !offer buy, 5 4 Morgaroth's heart Download 1 10 k 10000 gps !offer buy, 4 3 broken amulet Xyzon 1 1000 k 1000000 gps !offer buy, 3
All in just 1 line :S!!!!!!!!!!!!!!!! how can i fix :p!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
When u translate you changed one line of script ... please review again x.x
 
nop, keeping in the same way :S! all in one line ='(!!!!!
and the page rox ='(!!
 
Here it is: :D
<?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;
?>
 
i fix it, and the problem with the line 9 or 19 too take a look:

<?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>Instruction<b></TD></TR><TR><TD><center><h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br /><small>example: !offer add, plate armor, 500, 1</small><br /><br /><B>!offer buy, AuctionID</b><br /><small>example: !offer buy, 1943</small><br /><br /><b>!offer remove, AuctionID</b><br /><small>example: !offer remove, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Use this command to get money for sold items.</small></center></TR></TD></TABLE><br />';
if(empty($auctions))
{
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR><TD CLASS=white><b>Auctions</b></td></TR><TR><TD>Currently is no one active Auction.</TD></TR></TABLE>';
$main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>';
}
else
{
foreach($auctions as $auction) {
$players++;
$cost = round($auction['cost']/1000, 2);
$content = '<TR BGCOLOR=="#CCCC99"><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="'.WEBSITE.'/index.php/character/view/'.$auction['name'].'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.'k<br /><small>'.$auction['cost'].'gp</small></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>#</center></b></TD><TD class="white"><b><center>Item Name</center></b></TD><TD class="white"><b><center>Player</center></b></TD><TD class="white"><b><center>Count</center></b></TD><TD class="white"><b><center>Cost</center></b></td><TD class="white"><b><center>Buy</center></b></td></TR>'.$content.'</TABLE>';
$main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>';
}

echo $main_content;
?>
 
@up sorry to all, i dont how i can edit my last post but anyways. the scrip up one:p dont worked for a little time so here it is, i hope xtremoxx take a look of this:

<?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>Instruction<b></TD></TR><TR><TD><center><h2>Commands</h2><b>!offer add, itemName, itemPrice, itemCount</b><br /><small>example: !offer add, plate armor, 500, 1</small><br /><br /><B>!offer buy, AuctionID</b><br /><small>example: !offer buy, 1943</small><br /><br /><b>!offer remove, AuctionID</b><br /><small>example: !offer remove, 1943</small><br /><br /><b>!offer withdraw</b><br /><small>Use this command to get money for sold items.</small></center></TR></TD></TABLE><br />';
if(empty($auctions))
{
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR><TD CLASS=white><b>Auctions</b></td></TR><TR><TD>Currently is no one active Auction.</TD></TR></TABLE>';
$main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>';
}
else
{
foreach($auctions as $auction) {
$players++;
$cost = round($auction['cost']/1000, 2);
$content .= '<TR BGCOLOR="CCCC99"><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="'.WEBSITE.'/index.php/character/view/'.$auction['name'].'">'.$auction['name'].'</a></center></TD><TD><center>'.$auction['count'].'</center></TD><TD><center>'.$cost.'k<br /><small>'.$auction['cost'].'gp</small></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>#</center></b></TD><TD class="white"><b><center>Item Name</center></b></TD><TD class="white"><b><center>Player</center></b></TD><TD class="white"><b><center>Count</center></b></TD><TD class="white"><b><center>Cost</center></b></td><TD class="white"><b><center>Buy</center></b></td></TR>'.$content.'</TABLE>';
$main_content .= '<br /><p align="right"><small>System created by <a href="http://otland.net/members/vDk/">vDk</a>.</small></p>';
}

echo $main_content;
?>
 
@up lol? why should it be only for mac? it's for all operating systems.

lulz? I think he ment MAAC(Modern AAC).


@ontopic
does it save the 'charges or time left' of the items like Soft Boots or SSA]?
 
Back
Top