open and closing

A place to discuss and receive support for the Web Auction application.

open and closing

Postby martin » Mon Oct 27, 2008 10:24 pm

Hi All

is there any way to set the default closing date 31 days after a item has been posted and to display days left below the item before close
please explain in detail i am new to this
martin
 
Posts: 4
Joined: Mon Oct 27, 2008 10:05 pm

Postby shannah » Tue Oct 28, 2008 8:35 pm

Is there any way to set the default closing date 31 days after a item has been posted


Implement the closing_time__default() method in the tables/products/products.php class.

e.g.
Code: Select all
function closing_time__default(){
    return date('Y-m-d H:i:s', time()+(31*24*60*60));
}


display days left below the item before close


2 Steps.

1. Add a calculated field to the tables/products/products.php delegate class to show the number of days until closing:
Code: Select all
function field__days_left(&$record){
    return (round((strtotime($record->strval('closing_time'))-time())/(24*60*60)));
}

(You may need to play with this a little to get it to work, as I haven't tested it).

2. Then add the following to the templates/view_product.html template where you want this figure to appear:
Code: Select all
{$product->val('days_left')}



-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved