• 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!

[ZnoteAAC] Offline Auction System

HalfAway

Thanatos
Joined
Sep 3, 2011
Messages
3,771
Solutions
25
Reaction score
2,584
Location
Sweden
GitHub
HalfAway
I converted and edited this script to ZnoteAAC because of a request by @zabuzo here:
https://otland.net/threads/help-convert-this-page-to-znote.243672/

The script was orginally created by @vDk.

Code:
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

    $cache = new Cache('engine/cache/ingmarket');
    if ($cache->hasExpired()) {
        $inGameAuctions = mysql_select_multi('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');
       
        $cache->setContent($inGameAuctions);
        $cache->save();
    } else {
        $inGameAuctions = $cache->load();
    }
    $players = 0;   
?>
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr>
            <th>
                <b>Instruction<b>
            </th>
        </tr>
        <tr>
            <td align="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>
            </td>
        </tr>
    </table><br/>

    <table width="100%" class="table table-striped table-bordered table-condensed">
        <tr>
            <th align="center">
                AuctionID
            </td>
            <th class="white">
                Image
            </td>
            <th class="white">
                Item Name
            </td>
            <th class="white">
                Player
            </td>
            <th class="white">
                Count
            </td>
            <th class="white">
                Price
            </td>
            <th class="white">
                Buy Command
            </td>
        </tr>
<?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>

                <tr>
                    <td>
                        <?php echo $auction['id']; ?>
                    </td>
                    <td>
                        <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                    </td>
                    <td>
                        <?php echo $auction['item_name']; ?>
                    </td>
                    <td>
                        <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                            <?php echo $auction['name']; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $auction['count']; ?>
                    </td>
                    <td>
                        <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                    </td>
                    <td>
                        !offer buy, <?php echo $auction['id']; ?>
                    </td>
                </tr>
<?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
    }
    echo '</table>';
    echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php'; ?>


Item images is loaded from my images host.
items.************.

Image
http://www.************/talkactionMarket.png


You need to add tables in your database and a in-game talkaction script for your server you can find it here:
https://otland.net/threads/offline-player-to-player-item-trader-auction-system.51447/
 

Jacobs

Webdev, mapper
Joined
Jun 22, 2014
Messages
417
Solutions
4
Reaction score
316
Location
Slovakia
GitHub
Jacobs63
You know, as there's only a buyout it's not really an auction, more like a website market.
Thanks for the release though! :)
 

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,519
Solutions
4
Reaction score
371
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
I've converted that page too, I think it's shorter than yours, but not matter, both are working \õ/

PHP:
<?php require_once 'engine/init.php';
include 'layout/overall/header.php'; ?>

<?php
$players = 0;
$auctions = mysql_select_multi('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` ASC');
?>
<script type="text/javascript">
function show_hide(flip)
{
    var tmp = document.getElementById(flip);
    if(tmp)
        tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
}
</script>
<a onclick="show_hide('commands'); return false;" style="cursor: pointer;">Click here to show the Instructions</a><br/>
<div id="commands" style="display: none;">
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr bgcolor="#505050">
            <td class="white"><b>Instructions<b></td>
        </tr>
        <td><center><h2>Commands</h2>
            <b>!market add,ItemName,ItemPrice,ItemCount</b><br>
            <small>Example: <b>!market add,carlin sword,500,1</small><br>
            <small><font color="red">DO NOT USE SPACE BETWEEN COMMAS !!!</font></b></small><br><br>
            <b>!market buy, AuctionID</b><br><small>Example: <b>!market buy, 1943</b></small><br><br>
            <b>!market remove, AuctionID</b><br><small>Example: <b>!market remove, 1943</b></small><br><br>
            <b>!market withdraw</b><br><small>Use this command to get money for sold items.</small><br><br>
            <small><font color="red"><b>Requirements:<br>Your character must be level 8 or higher to make an offer and must have a vocation.</b></font></small>
        </center></td>
    </table>
</div>
        <?php
        if(empty($auctions) || $auctions === false) {
        ?>
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr bgcolor="#505050">
            <td class="white">
                <b>Auctions</b>
            </td>
        </tr>
        <tr bgcolor="#D4C0A1">
            <td><center>Currently there is no item in Market.</center></td>
        </tr>
    </table>
    <br>
    <?php
        } else {
    ?>
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr bgcolor="#505050">
        <td class="white"><b><center>Offer ID</center></b></td>
        <td class="white"><b><center>Item Image</center></b></td>
        <td class="white"><b><center>Item Name</center></b></td>
        <td class="white"><b><center>Seller</center></b></td>
        <td class="white"><b><center>Item Count</center></b></td>
        <td class="white"><b><center>Item Cost</center></b></td>
        <td class="white"><b><center>Buy</center></b></td>
    </tr>
    <?php
    foreach($auctions as $auction) {
    $players++;
    if(is_int($players / 2)) {
        $bgcolor = '#F1E0C6';
    } else {
        $bgcolor = '#D4C0A1';
        $cost = round($auction['cost'] / 1000, 2);
    }   
    ?>
    <tr bgcolor=<?php echo $bgcolor ?>>
        <td class="white"><center><?php echo $auction['id'] ?></center></td>
        <td class="white"><center><?php echo '<img src="http://'. $config['shop']['imageServer'] .''.$auction['item_id'].'.gif"/>' ?></center></td>
        <td class="white"><center><?php echo $auction['item_name'] ?></center></td>
        <td class="white"><center><a href="characterprofile.php?name=<?php echo urlencode($auction['name']) ?>"><?php echo $auction['name'] ?></a></center></td>
        <td class="white"><center><?php echo $auction['count'] ?></center></td>
        <td class="white"><center><?php echo $cost ?>k<br><small><?php echo $auction['cost'] ?>gp</small></center></td>
        <td class="white"><center>!market buy, <?php echo $auction['id'] ?></center></td>
        </tr> <?php } } ?>
    </table>

<?php include 'layout/overall/footer.php'; ?>
 

Dyabl0

Dyablo
Joined
Sep 22, 2009
Messages
1,867
Solutions
9
Reaction score
275
Location
Spain
I've converted that page too, I think it's shorter than yours, but not matter, both are working \õ/

Stop posting and do us a favour.

Why you come up with sharing now? You act like you're the first one in everything, why you didn't make your own thread for it and now you're posting here showing off your skills, goddamn.

Sorry to be rude, had to say. @Topic, great job! Will be surely using in a future.
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,518
Solutions
47
Reaction score
1,099
Location
Arica - Chile
Stop posting and do us a favour.

Why you come up with sharing now? You act like you're the first one in everything, why you didn't make your own thread for it and now you're posting here showing off your skills, goddamn.

Sorry to be rude, had to say. @Topic, great job! Will be surely using in a future.
anyways is a better one version
 

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,519
Solutions
4
Reaction score
371
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Stop posting and do us a favour.

Why you come up with sharing now? You act like you're the first one in everything, why you didn't make your own thread for it and now you're posting here showing off your skills, goddamn.

Sorry to be rude, had to say. @Topic, great job! Will be surely using in a future.
Man, seriously, did you have any problem with me?
 
OP
OP
HalfAway

HalfAway

Thanatos
Joined
Sep 3, 2011
Messages
3,771
Solutions
25
Reaction score
2,584
Location
Sweden
GitHub
HalfAway
I've converted that page too, I think it's shorter than yours, but not matter, both are working \õ/

PHP:
<?php require_once 'engine/init.php';
include 'layout/overall/header.php'; ?>

<?php
$players = 0;
$auctions = mysql_select_multi('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` ASC');
?>
<script type="text/javascript">
function show_hide(flip)
{
    var tmp = document.getElementById(flip);
    if(tmp)
        tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
}
</script>
<a onclick="show_hide('commands'); return false;" style="cursor: pointer;">Click here to show the Instructions</a><br/>
<div id="commands" style="display: none;">
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr bgcolor="#505050">
            <td class="white"><b>Instructions<b></td>
        </tr>
        <td><center><h2>Commands</h2>
            <b>!market add,ItemName,ItemPrice,ItemCount</b><br>
            <small>Example: <b>!market add,carlin sword,500,1</small><br>
            <small><font color="red">DO NOT USE SPACE BETWEEN COMMAS !!!</font></b></small><br><br>
            <b>!market buy, AuctionID</b><br><small>Example: <b>!market buy, 1943</b></small><br><br>
            <b>!market remove, AuctionID</b><br><small>Example: <b>!market remove, 1943</b></small><br><br>
            <b>!market withdraw</b><br><small>Use this command to get money for sold items.</small><br><br>
            <small><font color="red"><b>Requirements:<br>Your character must be level 8 or higher to make an offer and must have a vocation.</b></font></small>
        </center></td>
    </table>
</div>
        <?php
        if(empty($auctions) || $auctions === false) {
        ?>
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr bgcolor="#505050">
            <td class="white">
                <b>Auctions</b>
            </td>
        </tr>
        <tr bgcolor="#D4C0A1">
            <td><center>Currently there is no item in Market.</center></td>
        </tr>
    </table>
    <br>
    <?php
        } else {
    ?>
    <table border="0" cellspacing="1" cellpadding="4" width="100%">
    <tr bgcolor="#505050">
        <td class="white"><b><center>Offer ID</center></b></td>
        <td class="white"><b><center>Item Image</center></b></td>
        <td class="white"><b><center>Item Name</center></b></td>
        <td class="white"><b><center>Seller</center></b></td>
        <td class="white"><b><center>Item Count</center></b></td>
        <td class="white"><b><center>Item Cost</center></b></td>
        <td class="white"><b><center>Buy</center></b></td>
    </tr>
    <?php
    foreach($auctions as $auction) {
    $players++;
    if(is_int($players / 2)) {
        $bgcolor = '#F1E0C6';
    } else {
        $bgcolor = '#D4C0A1';
        $cost = round($auction['cost'] / 1000, 2);
    }  
    ?>
    <tr bgcolor=<?php echo $bgcolor ?>>
        <td class="white"><center><?php echo $auction['id'] ?></center></td>
        <td class="white"><center><?php echo '<img src="http://'. $config['shop']['imageServer'] .''.$auction['item_id'].'.gif"/>' ?></center></td>
        <td class="white"><center><?php echo $auction['item_name'] ?></center></td>
        <td class="white"><center><a href="characterprofile.php?name=<?php echo urlencode($auction['name']) ?>"><?php echo $auction['name'] ?></a></center></td>
        <td class="white"><center><?php echo $auction['count'] ?></center></td>
        <td class="white"><center><?php echo $cost ?>k<br><small><?php echo $auction['cost'] ?>gp</small></center></td>
        <td class="white"><center>!market buy, <?php echo $auction['id'] ?></center></td>
        </tr> <?php } } ?>
    </table>

<?php include 'layout/overall/footer.php'; ?>
You should use Cache instead of running the query everytime the page refreshes.
Loading alot of items each time a player visits the page is not a good way to do it.
 

Cornex

Web Developer
Staff member
Global Moderator
Joined
Jun 15, 2008
Messages
3,447
Solutions
5
Reaction score
1,163
Location
Sweden
Please stop the spam, be patient.

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

    $cache = new Cache('engine/cache/ingmarket');
    if ($cache->hasExpired()) {
        $inGameAuctions = mysql_select_multi('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');
     
        $cache->setContent($inGameAuctions);
        $cache->save();
    } else {
        $inGameAuctions = $cache->load();
    }
    $players = 0; 

    if (isset($_POST)) {
        if (isset($_POST['player']) && ! empty($_POST['player'])) {
            $name = getValue($_POST['player']);
            $player_id = user_character_exist($name);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
                return $player_id == $auction['player'];
            });
        }

        if (isset($_POST['item']) && ! empty($_POST['item'])) {
            $item = getValue($_POST['item']);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
                return strtolower($item) == strtolower($auction['item_name']);
            });
        }
    }
?>

    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr>
            <th>
                <b>Instruction<b>
            </th>
        </tr>
        <tr>
            <td align="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>
            </td>
        </tr>
    </table><br/>

    <form action="" method="POST">
        <input type="text" name="player" placeholder="Player..">
        <input type="text" name="item" placeholder="Item..">
        <input type="submit" value="Search">
    </form>

    <table width="100%" class="table table-striped table-bordered table-condensed">
        <tr>
            <th align="center">
                AuctionID
            </td>
            <th class="white">
                Image
            </td>
            <th class="white">
                Item Name
            </td>
            <th class="white">
                Player
            </td>
            <th class="white">
                Count
            </td>
            <th class="white">
                Price
            </td>
            <th class="white">
                Buy Command
            </td>
        </tr>
<?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>

                <tr>
                    <td>
                        <?php echo $auction['id']; ?>
                    </td>
                    <td>
                        <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                    </td>
                    <td>
                        <?php echo $auction['item_name']; ?>
                    </td>
                    <td>
                        <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                            <?php echo $auction['name']; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $auction['count']; ?>
                    </td>
                    <td>
                        <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                    </td>
                    <td>
                        !offer buy, <?php echo $auction['id']; ?>
                    </td>
                </tr>
<?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
    }
    echo '</table>';
    echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php'; ?>

8mgWOy2SeZ.png
 

Tarek1337

Legendary OT User
Joined
Jun 9, 2012
Messages
3,587
Solutions
3
Reaction score
1,167
Location
Sweden
Please stop the spam, be patient.

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

    $cache = new Cache('engine/cache/ingmarket');
    if ($cache->hasExpired()) {
        $inGameAuctions = mysql_select_multi('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');
    
        $cache->setContent($inGameAuctions);
        $cache->save();
    } else {
        $inGameAuctions = $cache->load();
    }
    $players = 0;

    if (isset($_POST)) {
        if (isset($_POST['player']) && ! empty($_POST['player'])) {
            $name = getValue($_POST['player']);
            $player_id = user_character_exist($name);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
                return $player_id == $auction['player'];
            });
        }

        if (isset($_POST['item']) && ! empty($_POST['item'])) {
            $item = getValue($_POST['item']);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
                return strtolower($item) == strtolower($auction['item_name']);
            });
        }
    }
?>

    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr>
            <th>
                <b>Instruction<b>
            </th>
        </tr>
        <tr>
            <td align="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>
            </td>
        </tr>
    </table><br/>

    <form action="" method="POST">
        <input type="text" name="player" placeholder="Player..">
        <input type="text" name="item" placeholder="Item..">
        <input type="submit" value="Search">
    </form>

    <table width="100%" class="table table-striped table-bordered table-condensed">
        <tr>
            <th align="center">
                AuctionID
            </td>
            <th class="white">
                Image
            </td>
            <th class="white">
                Item Name
            </td>
            <th class="white">
                Player
            </td>
            <th class="white">
                Count
            </td>
            <th class="white">
                Price
            </td>
            <th class="white">
                Buy Command
            </td>
        </tr>
<?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>

                <tr>
                    <td>
                        <?php echo $auction['id']; ?>
                    </td>
                    <td>
                        <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                    </td>
                    <td>
                        <?php echo $auction['item_name']; ?>
                    </td>
                    <td>
                        <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                            <?php echo $auction['name']; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $auction['count']; ?>
                    </td>
                    <td>
                        <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                    </td>
                    <td>
                        !offer buy, <?php echo $auction['id']; ?>
                    </td>
                </tr>
<?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
    }
    echo '</table>';
    echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php'; ?>

8mgWOy2SeZ.png
<3
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,518
Solutions
47
Reaction score
1,099
Location
Arica - Chile
Please stop the spam, be patient.

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

    $cache = new Cache('engine/cache/ingmarket');
    if ($cache->hasExpired()) {
        $inGameAuctions = mysql_select_multi('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');
    
        $cache->setContent($inGameAuctions);
        $cache->save();
    } else {
        $inGameAuctions = $cache->load();
    }
    $players = 0;

    if (isset($_POST)) {
        if (isset($_POST['player']) && ! empty($_POST['player'])) {
            $name = getValue($_POST['player']);
            $player_id = user_character_exist($name);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
                return $player_id == $auction['player'];
            });
        }

        if (isset($_POST['item']) && ! empty($_POST['item'])) {
            $item = getValue($_POST['item']);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
                return strtolower($item) == strtolower($auction['item_name']);
            });
        }
    }
?>

    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr>
            <th>
                <b>Instruction<b>
            </th>
        </tr>
        <tr>
            <td align="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>
            </td>
        </tr>
    </table><br/>

    <form action="" method="POST">
        <input type="text" name="player" placeholder="Player..">
        <input type="text" name="item" placeholder="Item..">
        <input type="submit" value="Search">
    </form>

    <table width="100%" class="table table-striped table-bordered table-condensed">
        <tr>
            <th align="center">
                AuctionID
            </td>
            <th class="white">
                Image
            </td>
            <th class="white">
                Item Name
            </td>
            <th class="white">
                Player
            </td>
            <th class="white">
                Count
            </td>
            <th class="white">
                Price
            </td>
            <th class="white">
                Buy Command
            </td>
        </tr>
<?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>

                <tr>
                    <td>
                        <?php echo $auction['id']; ?>
                    </td>
                    <td>
                        <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                    </td>
                    <td>
                        <?php echo $auction['item_name']; ?>
                    </td>
                    <td>
                        <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                            <?php echo $auction['name']; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $auction['count']; ?>
                    </td>
                    <td>
                        <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                    </td>
                    <td>
                        !offer buy, <?php echo $auction['id']; ?>
                    </td>
                </tr>
<?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
    }
    echo '</table>';
    echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php'; ?>

8mgWOy2SeZ.png
nice-su
 

zabuzo

Well-Known Member
Joined
Jun 10, 2016
Messages
237
Reaction score
54
Please stop the spam, be patient.

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';

    $cache = new Cache('engine/cache/ingmarket');
    if ($cache->hasExpired()) {
        $inGameAuctions = mysql_select_multi('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');
    
        $cache->setContent($inGameAuctions);
        $cache->save();
    } else {
        $inGameAuctions = $cache->load();
    }
    $players = 0;

    if (isset($_POST)) {
        if (isset($_POST['player']) && ! empty($_POST['player'])) {
            $name = getValue($_POST['player']);
            $player_id = user_character_exist($name);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($player_id) {
                return $player_id == $auction['player'];
            });
        }

        if (isset($_POST['item']) && ! empty($_POST['item'])) {
            $item = getValue($_POST['item']);

            $inGameAuctions = array_filter($inGameAuctions, function($auction) use($item) {
                return strtolower($item) == strtolower($auction['item_name']);
            });
        }
    }
?>

    <table border="0" cellspacing="1" cellpadding="4" width="100%">
        <tr>
            <th>
                <b>Instruction<b>
            </th>
        </tr>
        <tr>
            <td align="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>
            </td>
        </tr>
    </table><br/>

    <form action="" method="POST">
        <input type="text" name="player" placeholder="Player..">
        <input type="text" name="item" placeholder="Item..">
        <input type="submit" value="Search">
    </form>

    <table width="100%" class="table table-striped table-bordered table-condensed">
        <tr>
            <th align="center">
                AuctionID
            </td>
            <th class="white">
                Image
            </td>
            <th class="white">
                Item Name
            </td>
            <th class="white">
                Player
            </td>
            <th class="white">
                Count
            </td>
            <th class="white">
                Price
            </td>
            <th class="white">
                Buy Command
            </td>
        </tr>
<?php
    if ($inGameAuctions) {
        foreach($inGameAuctions as $auction) {
            $players++;
            if(is_int($players / 2)) {
                $bgcolor = "black";
            } else {
                $bgcolor = "grey";
            }
            $cost = round($auction['cost']/1000, 2);
            ?>

                <tr>
                    <td>
                        <?php echo $auction['id']; ?>
                    </td>
                    <td>
                        <img src="http://items.************/<?php echo $auction['item_id']; ?>.gif"/>
                    </td>
                    <td>
                        <?php echo $auction['item_name']; ?>
                    </td>
                    <td>
                        <a href='characterprofile?name=<?php echo $auction['name']; ?>'>
                            <?php echo $auction['name']; ?>
                        </a>
                    </td>
                    <td>
                        <?php echo $auction['count']; ?>
                    </td>
                    <td>
                        <?php echo $cost;?>k<br/><small><?php echo $auction['cost']; ?>gp</small>
                    </td>
                    <td>
                        !offer buy, <?php echo $auction['id']; ?>
                    </td>
                </tr>
<?php
        }
    } else {
        echo '<tr><td colspan="7">Currently no auctions exists..</td></tr>';
    }
    echo '</table>';
    echo '<p align="right"><span style="font-size: 9px;">System originally created by <a href="https://otland.net/members/vdk.1553/">vDk</a>. | Converted to ZnoteAAC and edited by <a href="https://otland.net/members/halfaway.142275/">HalfAway</a>.</span></p>';

include 'layout/overall/footer.php'; ?>

8mgWOy2SeZ.png

P-E-R-F-E-C-T TY
 
Top