phpbb-auction.com Forum Index phpbb-auction.com
Download, Support, Documentation
 
Donate to phpbb-auction.com to support the project


phpbb-Auction
  Home
   - News
   - Bug report/Patches
   - Future Features
  Demo
  Downloads
   - Version 1.3m  (Core /Lang /Mods)
   - Version 1.2m  (Core /Lang /Mods)
   - Version 1.0m  (Core /Lang /Mods)
   - All
  Services
  Documentation
   - Features
   - Documents
   - How-Tos
   - About
  Support
   - English
   - German
  Development
   - Changlog
   - Requests
   - Team
   - CVS
  Community
   - Website of the Month
   - Websites
   - Community Forum
   - Member

Navigation
FAQFAQ
SearchSearch
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesLog in to check your private messages
Log inLog in

Forum
Changing start time auctions
Sun Feb 07, 2010 4:33 am FR
Easy: what code to use to update sql table?
Fri Oct 16, 2009 8:39 am guyb
Unlimited products(downloads)
Wed Oct 14, 2009 7:09 pm hoimyr
Seller chooses currency
Sun Oct 11, 2009 8:00 pm hoimyr
Cant select end date without getting error
Sun Oct 11, 2009 6:43 pm hoimyr

About
Author: FR
Credits:
Brookfresh, Brad Lawryk, Crogon, DaMysterious, EklipzeDesigns, ML, musashi, phpBB Group, phpBB-Auction-Team, php-styles, sanman, Tel, Vampy, wGEric

Supported Sites





Statistics
User: 17931
Posts: 18401
Latest User: ThomasJew

Delay Ending time after a bid

 
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
castromind
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 21 Jan 2005
Posts: 5

PostPosted: Fri Jan 21, 2005 5:47 pm    Post subject: Delay Ending time after a bid Reply with quote

I'm New here, but i want to share something i thing it's a mod for this great script.

I made something to delay more 5 minutes the date of ending of an auction if someone make a bid.
I think this is useful, because if someone bids at 15 seconds from the end, it may not be possivel other users to make another higher bid for the auction... so.... if someone bids, the ending time delays and other may make onother bid.

In auction_offer.php

Find:
Quote:

// UPDATE Last bid in offer-table. I know its not normalized, but it saves us a lot of sql-queries on the users frontend.
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_last_bid_price = " . doubleval($HTTP_POST_VARS['auction_your_amount']) . ",
FK_auction_offer_last_bid_user_id = ". $userdata['user_id'] . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";


Replace with

Quote:

// Check start and stop of offer
$sql_time = "SELECT auction_offer_time_stop
FROM " . AUCTION_OFFER_TABLE . "
WHERE PK_auction_offer_id= " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result_time = $db->sql_query($sql_time)) )
{
message_die(GENERAL_ERROR, 'Could not query auction-start and stop date', '', __LINE__, __FILE__, $sql);
} // if

$auction_time_stop_row = $db->sql_fetchrow($result_time);
$auction_ends = $auction_time_stop_row['auction_offer_time_stop'];
$auctionDelayTime = 300;

// delay this auction
$auction_ends += $auctionDelayTime;

// UPDATE Last bid in offer-table. I know its not normalized, but it saves us a lot of sql-queries on the users frontend.
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_last_bid_price = " . doubleval($HTTP_POST_VARS['auction_your_amount']) . ",
auction_offer_time_stop = " .$auction_ends . ",
FK_auction_offer_last_bid_user_id = ". $userdata['user_id'] . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";


It worked for me, but i'm not so good with php, so you may verify and test it and even optimize it.

I really am expecting the auctobid mod....

Bye.
[/code]
Back to top
View user's profile Send private message
castromind
Small-Cap Auctioneer
Small-Cap Auctioneer


Joined: 21 Jan 2005
Posts: 5

PostPosted: Fri Jan 21, 2005 11:48 pm    Post subject: Re: Delay Ending time after a bid Reply with quote

If you want to do this only in the last hour of the auction maybe its like this:

In auction_offer.php

Find:
Quote:

// UPDATE Last bid in offer-table. I know its not normalized, but it saves us a lot of sql-queries on the users frontend.
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_last_bid_price = " . doubleval($HTTP_POST_VARS['auction_your_amount']) . ",
FK_auction_offer_last_bid_user_id = ". $userdata['user_id'] . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";


Replace with

Quote:

// Check start and stop of offer
$sql_time = "SELECT auction_offer_time_stop
FROM " . AUCTION_OFFER_TABLE . "
WHERE PK_auction_offer_id= " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result_time = $db->sql_query($sql_time)) )
{
message_die(GENERAL_ERROR, 'Could not query auction-start and stop date', '', __LINE__, __FILE__, $sql);
} // if

$auction_time_stop_row = $db->sql_fetchrow($result_time);
$auction_ends = $auction_time_stop_row['auction_offer_time_stop'];
$auctionDelayTime = 300;

$only_in_the_last_our = 3600;


If ($auction_ends < $only_in_the_last_our) {
// delay this auction
$auction_ends += $auctionDelayTime;
}

// UPDATE Last bid in offer-table. I know its not normalized, but it saves us a lot of sql-queries on the users frontend.
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_last_bid_price = " . doubleval($HTTP_POST_VARS['auction_your_amount']) . ",
auction_offer_time_stop = " .$auction_ends . ",
FK_auction_offer_last_bid_user_id = ". $userdata['user_id'] . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";


Must be tested but if think is correct ...

I need also someone to help me randomize de Special items Block.
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Jan 23, 2005 2:28 pm    Post subject: Reply with quote

thanks for the info, but it doesn't work on my auction... no difference.. Sad
anyone maybe has an idea, why those anti-sniper mods won't work?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


phpbb-auction.com - Developed by www.digital-media-lab.com
Sponsored by: www.globibo.com - www.learn2go.de - www.talentone.org - www.language-school.in - www.ping-ke.cn