hvad er fejlen i dette script
min webmaster har kæmpet jeg ikke hvor mange timer med et auktionsmodul på min webshop, han fik det også op at køre, men det php scipts han har brugt er skrøbelig, forstået på den måde at nedtællingen ikke kommer til at passe med den oprindelige tid der er tilbage af auktionen.det skal siges at min shop ligger på buydomains server i usa, så det er der taget højde for
Scriptet ser sådan ud:
<?php
/*
$Id: auctions.php,v 1.4 2006/11/15 22:14:33 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
?>
<tr>
<td>
<table width="686">
<tr>
<td width="278"><!-- bof added by jobonline2001@yahoo.com for auction product contribution -->
<?php
if ($auction_product) {
$auction_query = tep_db_query("select auctions_starting_price, expires_date, overbid_amount from " . TABLE_AUCTIONS_PRODUCTS . " where products_id = '" . $product_info['products_id']. "' and status = '1' ");
$auction_infor = tep_db_fetch_array($auction_query);
$datetime_count_down = tep_date_count_down($auction_infor['expires_date']);
?>
<table class="infoBox">
<tr>
<td width="239" class="infoBoxContents"><?php echo TEXT_AUCTION_PRICE . ' ' . $products_price; ?></td>
</tr>
<tr>
<td class="infoBoxContents"><?php echo TEXT_EXPIRED_DATE . ' ' . $auction_infor['expires_date']; ?><br />(<b><span id="countdown_date" > </span></b> <?php echo TEXT_DATETIME_LEFT; ?>)</td>
</tr>
<tr>
<td class="infoBoxContents"><?php echo TEXT_OVERBID_AMOUNT . ' ' . $currencies->display_price($auction_infor['overbid_amount'], tep_get_tax_rate($product_info['products_tax_class_id'])); ?></td>
</tr>
</table>
<?php
} //end if
else {
echo $products_price;
} // else if
?>
<!-- eof added by jobonline2001@yahoo.com for auction product contribution -->
</td>
<td width="396"><!-- bof added by jobonline2001@yahoo.com for auction product contribution -->
<?php // If auction has expired
$mfo_auction_query = mysql_fetch_object(tep_db_query("select auctions_starting_price, expires_date, overbid_amount from " . TABLE_AUCTIONS_PRODUCTS . " where products_id = '" . $product_info['products_id']. "' and status = '1' "));
if (strtotime($mfo_auction_query->expires_date)<time()) {
echo tep_end_auction_valid();
} elseif ( $auction_product ) { // Not sure, but probably similar to - If auction has not expired
echo tep_draw_form('auction_bid',tep_href_link(FILENAME_PRODUCT_INFO),'post', 'onsubmit="return check_agree(this);"');
?>
<input type="hidden" name="placebid" value="true" id="placebid" />
<input type="hidden" name="auction_id" id="auction_id" value="<?php echo $auction_id; ?>" />
<input type="hidden" name="products_id" value="<?php echo (int)$HTTP_GET_VARS['products_id']; ?>" id="products_id" />
<table>
<tr>
<td class="main" colspan="2"><?php echo TEXT_BID_PRICE . ' ' . tep_draw_input_field('bid_price', $bid_price);?></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Byd!"></td>
</tr>
</table></form>
</td>
<?php
}
?>
<!-- eof added by jobonline2001@yahoo.com for auction product contribution -->
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="main"><b><?php echo TEXT_AUCTIONS_BID_LIST; ?></b></td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2" >
<tr class="productListing-heading" >
<td class="productListing-heading"><?php echo TABLE_HEADING_NUMBER; ?></td>
<td class="productListing-heading"><?php echo TABLE_HEADING_CUSTOMERS; ?></td>
<td class="productListing-heading" align="center"><?php echo TABLE_HEADING_BID_PRICE; ?> </td>
<td class="productListing-heading"><?php echo TABLE_HEADING_BID_DATE_ADDED; ?></td>
<td class="productListing-heading" align="center"> </td>
</tr>
<?php
if (isset($HTTP_GET_VARS['page']) && ($HTTP_GET_VARS['page'] > 1)) $rows = $HTTP_GET_VARS['page'] * MAX_DISPLAY_SEARCH_RESULTS - MAX_DISPLAY_SEARCH_RESULTS;
$products_query_raw = "select concat(c.customers_firstname, c.customers_lastname) as customers_name, c.customers_id, ab.bid_price, ab.bid_status, ab.bid_date_added from ".TABLE_CUSTOMERS." c, ".TABLE_AUCTIONS_BIDS.' ab,'.TABLE_AUCTIONS_PRODUCTS.' ap where c.customers_id = ab.customers_id and ab.auctions_id=ap.auctions_id and ab.auctions_id='.$auction_id.' order by bid_price DESC ';
$rows = 0;
$products_query = tep_db_query($products_query_raw);
while ($products = tep_db_fetch_array($products_query)) {
$rows++;
if (strlen($rows) < 2) {
$rows = '0' . $rows;
}
?>
<tr class="productListing-data" >
<td class="productListing-data"><?php echo $rows; ?>.</td>
<td class="productListing-data"><?php echo $products['customers_id']; ?></td>
<td class="productListing-data" align="center"><?php echo $currencies->display_price($products['bid_price'], tep_get_tax_rate($products['products_tax_class_id']) ); ?> </td>
<td class="productListing-data"><?php echo $products['bid_date_added']; ?></td>
<td><?php if ($products['bid_status']=='won') { echo tep_image(DIR_WS_ICONS.'auctionwon.gif',IMAGE_BUTTON_AUCTION_WON); }?>
</td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table></td>
</tr>
<SCRIPT type="text/javascript">
// **** Time Zone Count Down Javascript **** //
/*
Visit http://rainbow.arch.scriptmania.com/scripts/
for this script and many more
*/
////////// CONFIGURE THE COUNTDOWN SCRIPT HERE //////////////////
var month = '<? echo $datetime_count_down['1'];?>'; // '*' for next month, '0' for this month or 1 through 12 for the month
var day = '<?php echo $datetime_count_down['3']; ?>'; // Offset for day of month day or + day
var hour = '0'; // 0 through 23 for the hours of the day
var tz = '+2'; // Offset for your timezone in hours from UTC
var lab = 'countdown_date'; // The id of the page entry where the timezone countdown is to show
function start() {displayTZCountDown(setTZCountDown(month,day,hour,tz),lab);}
// ** The start function can be changed if required **
window.onload = start();
////////// DO NOT EDIT PAST THIS LINE //////////////////
function setTZCountDown(month,day,hour,tz)
{
var toDate = new Date();
if (month == '*')toDate.setMonth(toDate.getMonth() + 1);
else if (month > 0)
{
if (month <= toDate.getMonth())toDate.setYear(toDate.getYear() + 1);
toDate.setMonth(month-1);
}
if (day.substr(0,1) == '+')
{var day1 = parseInt(day.substr(1));
toDate.setDate(toDate.getDate()+day1);
}
else{toDate.setDate(day);
}
toDate.setHours(hour);
toDate.setMinutes(0-(tz*60));
toDate.setSeconds(0);
var fromDate = new Date();
fromDate.setMinutes(fromDate.getMinutes() + fromDate.getTimezoneOffset());
var diffDate = new Date(0);
diffDate.setMilliseconds(toDate - fromDate);
return Math.floor(diffDate.valueOf()/1000);
}
function displayTZCountDown(countdown,tzcd)
{
if (countdown < 0) document.getElementById(tzcd).innerHTML = "Denne auktion er udløbet, kig ind igen for andre sjove auktioner :-)";
else {var secs = countdown % 60;
if (secs < 10) secs = '0'+secs;
var countdown1 = (countdown - secs) / 60;
var mins = countdown1 % 60;
if (mins < 10) mins = '0'+mins;
countdown1 = (countdown1 - mins) / 60;
var hours = countdown1 % 24;
var days = (countdown1 - hours) / 24;
document.getElementById(tzcd).innerHTML = days + " dag" + (days == 1 ? '' : 'e') + ' + ' +hours+ 'tim. : ' +mins+ 'min. : '+secs+'sek.';
setTimeout('displayTZCountDown('+(countdown-1)+',\''+tzcd+'\');',999);
}
}
</SCRIPT>
<!-- eof added by jobonline2001@yahoo.com for auction product contribution -->