PDA

View Full Version : Highest Bidder Issue Continued.. - [0.7.3] [RC4]



jbilliau
27-01-2009, 05:58 PM
Scenario:

Auction created starting at .99 by rick1tand

Chugger came in and bidded 5.00, then decided right away to do 6.00 again. ( which tested RC3's bug ;) )

So now the item is at 6.00, then lukasz came in and bidded 6.00. He was outbidded by chugger since chugger had the 1st bid.

Chugger shows as highest bidder... PERFECT. However I'm logged in as Lukasz right now, and in GREEN it says "Im the current highest bidder"

renlok
28-01-2009, 10:04 PM
fixed for next release

jbilliau
29-01-2009, 05:45 PM
Still same issue in RC5.

dam :(

jbilliau
29-01-2009, 06:21 PM
renlok,

It definetely has to do with this line of code in item.php

//check if youve bid on this before
$query = "SELECT bid FROM ".$DBPrefix."bids WHERE auction = ".$id." AND bidder = ".$_SESSION['WEBID_LOGGED_IN']." ORDER BY bid DESC, id DESC LIMIT 1";
$result = mysql_query($query);
$system->check_mysql($result, $query, __LINE__, __FILE__);
if(mysql_num_rows($result) > 0) {
if(mysql_result($result, 0, 'bid') == $high_bid) {
$yourbidmsg = $MSG['25_0088'];

More specifically this line:

if(mysql_result($result, 0, 'bid') == $high_bid) {


because if I was the original bidder on at item at 16.00 lets say...and then a second bidder came in and bidded 16.00 as well, the the original bidder should still be the highest bidder since he was 1st. So the green "your the highest bidder" should actually say "you've been outbidded"

I can't wrap my head around what that conditional should read though. Essentially its saying right now, if the result of 16.00 = the high bid which is 16, then display the green "your highest message" which is wrong, because again, chugger was the original bidder.

So hard to explain. but the conditional maybe should say something like if the result is equal = to the highest bid, but not equal to the original bidders highest bid.

jbilliau
29-01-2009, 10:09 PM
Ok, I've battled with this for hours..and I'm stumped. I no longer think its that line of code, but could be a database issue? How come the proxybid table doesn't have a timestamp column? I wonder if that could be part of the problem renlok?

Because the bug lies with this issue: If a bidderA comes along and bids 20 as his proxy (or max bid) and then bidderB comes by and bids 20 as well, the system doesn't know who to give the "highest bidder" too. Because the proxy bid comes along and matches the same timestamp as the last bidder who placed a bid. So now you have two of the same timestamps, and I think thats what the issue can stem from. If the proxy table had a timestamp column, then you could compare timestamps from the proxy table to the bid table.

Then alter your conditional in item.php like I showed above. Although its a little outta my realm. I just wanted to give you direction, so you could fix it easier/quickier...hopefully ;)

Let me know if you have any questions renlok. I know it can be confusing.

renlok
30-01-2009, 10:49 AM
ahh i think i didnt understand what you meant in the first place but ive figured out what was wrong in item.php change

if(mysql_result($result, 0, 'bid') == $high_bid) {
to

if($_SESSION['WEBID_LOGGED_IN'] == $hbidder_data['bidder']) {

ive testing it with this and seems to work fine :)