You cant bid on ended auctions any more.

fixed #4
This commit is contained in:
Stefan Brannfjell 2013-09-12 22:47:53 +02:00
parent 2ff7dd077c
commit b7ff2616d1

View File

@ -16,7 +16,7 @@ if ($house !== false && $config['TFSVersion'] === 'TFS_10') {
// Bid on house logic // Bid on house logic
$bid_char = getValue($_POST['char']); $bid_char = getValue($_POST['char']);
$bid_amount = getValue($_POST['amount']); $bid_amount = getValue($_POST['amount']);
if ($bid_amount !== false && $bid_char !== false) { if ($bid_amount !== false && $bid_char !== false && $house['bid_end'] > time()) {
$bid_char = (int)$bid_char; $bid_char = (int)$bid_char;
$bid_amount = (int)$bid_amount; $bid_amount = (int)$bid_amount;
@ -84,34 +84,31 @@ if ($house !== false && $config['TFSVersion'] === 'TFS_10') {
echo "<br><b>Bid will end on:</b> ". getClock($house['bid_end'], true); echo "<br><b>Bid will end on:</b> ". getClock($house['bid_end'], true);
} }
if (user_logged_in()) { if ($house['bid_end'] > time()) {
// Your characters, indexed by char_id if (user_logged_in()) {
$yourChars = mysql_select_multi("SELECT `id`, `name`, `balance` FROM `players` WHERE `account_id`='". $user_data['id'] ."';"); // Your characters, indexed by char_id
if ($yourChars !== false) { $yourChars = mysql_select_multi("SELECT `id`, `name`, `balance` FROM `players` WHERE `account_id`='". $user_data['id'] ."';");
$charData = array(); if ($yourChars !== false) {
foreach ($yourChars as $char) { $charData = array();
$charData[$char['id']] = $char; foreach ($yourChars as $char) {
if (get_character_guild_rank($char['id']) > 0) { $charData[$char['id']] = $char;
$guild = get_player_guild_data($char['id']); }
$charData[$char['id']]['guild'] = $guild['guild_id']; ?>
$charData[$char['id']]['guild_rank'] = $guild['rank_level']; <form action="" method="post">
} else $charData[$char['id']]['guild'] = '0'; <select name="char">
} <?php
?> foreach ($charData as $id => $char) {
<form action="" method="post"> echo "<option value='$id'>". $char['name'] ." [". $char['balance'] ."]</option>";
<select name="char"> }
<?php ?>
foreach ($charData as $id => $char) { </select>
echo "<option value='$id'>". $char['name'] ." [". $char['balance'] ."]</option>"; <input type="text" name="amount" placeholder="Min bid: <?php echo $minbid + 1; ?>">
} <input type="submit" value="Bid on this house">
?> </form>
</select> <?php
<input type="text" name="amount" placeholder="Min bid: <?php echo $minbid + 1; ?>"> } else echo "<br>You need a character to bid on this house.";
<input type="submit" value="Bid on this house"> } else echo "<br>You need to login before you can bid on houses.";
</form> } else echo "<br><b>Bid has ended! House transaction will proceed next server restart assuming active bidder have sufficient balance.</b>";
<?php
} else echo "<br>You need a character to bid on this house.";
} else echo "<br>You need to login before you can bid on houses.";
} }
} else { } else {
?> ?>