#//v.3.2.1 #/////////////////////////////////////////////////////// #// COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED// #/////////////////////////////////////////////////////// require('./includes/config.inc.php'); #// Run cron according to SETTINGS if($SETTINGS['cron'] == 2) { include_once "cron.php"; } require("./header.php"); $TIME = mktime(date("H")+$SETTINGS['timecorrection'],date("i"),date("s"),date("m"), date("d"),date("Y")); $NOW = date("YmdHis",$TIME); /* prepare data for templates/template */ /* prepare categories list for templates/template */ # Prepare categories sorting if($SETTINGS['catsorting'] == 'alpha') { $catsorting = " ORDER BY t.cat_name ASC"; } else { $catsorting = " ORDER BY sub_counter DESC"; } $TPL_categories_value = ""; $query = "select distinct * from PHPAUCTIONXL_categories c, PHPAUCTIONXL_cats_translated t WHERE c.parent_id=0 AND t.cat_id=c.cat_id AND t.lang='".$language."' $catsorting"; $result = mysql_query($query); if(!$result) { MySQLError($query); exit; } else { $num_cat = mysql_num_rows($result); $i = 0; $TPL_categories_value = "
".ArrangeDateNoCorrection($day,$month,$year,$hours,$minutes)." "; if($ISHIGHLIGHTED) { $TPL_last_auctions_value .= ""; } if($ISBOLD) { $TPL_last_auctions_value .= ""; } $TPL_last_auctions_value .= stripslashes($title); if($ISBOLD) { $TPL_last_auctions_value .= ""; } if($ISHIGHLIGHTED) { $TPL_last_auctions_value .= ""; } $TPL_last_auctions_value .= "
"; $i++; } /* get ending soon auctions */ $TPL_ending_soon_value = ""; $query = "select ends,id,title from PHPAUCTIONXL_auctions WHERE closed='0' AND suspended='0' AND "; $query .= "starts<=".$NOW." order by ends LIMIT ".$SETTINGS['endingsoonnumber']; $result = mysql_query($query); $num_auction = mysql_num_rows($result); $i = 0; $bgcolor = "#FFFFFF"; while($i < $num_auction) { if($bgcolor == "#FFFFFF") { $bgcolor = $FONTCOLOR[$SETTINGS['headercolor']]; } else { $bgcolor = "#FFFFFF"; } $title = mysql_result($result,$i,"title"); $id = mysql_result($result,$i,"id"); $ends = mysql_result($result,$i,"ends"); $nowt = $TIME; $difference = mktime( substr ($ends, 8, 2), substr ($ends, 10, 2), substr ($ends, 12, 2), substr ($ends, 4, 2), substr ($ends, 6, 2), substr ($ends, 0, 4))-$nowt; if ($difference > 0) { $days_difference = floor($difference / 86400); $difference = $difference % 86400; $hours_difference = floor($difference / 3600); $difference = $difference % 3600; $minutes_difference = floor($difference / 60); $seconds_difference = $difference % 60; $ends_string = sprintf("%d%s %02dh:%02dm:%02ds",$days_difference,$MSG_126, $hours_difference,$minutes_difference,$seconds_difference); } else { $ends_string = $MSG_911; } #// Check bold and highlighted options $ISBOLD = FALSE; $ISHIGHLIGHTED = FALSE; $TPL_ending_soon_value .= " "; $i++; } /** * NOTE: get higher bids */ $TPL_maximum_bids = ""; $query = "select auction,max(bid) AS max_bid FROM PHPAUCTIONXL_bids b, PHPAUCTIONXL_auctions a WHERE a.suspended=0 AND a.closed=0 AND a.id=b.auction GROUP BY b.bid,b.auction ORDER BY max_bid desc"; $result = mysql_query($query); if ($result) $num_auction = mysql_num_rows($result); else $num_auction = 0; $i = 0; $j = 0; $bgcolor = "#FFFFFF"; $AU = array(); while($i < $num_auction && $j < $SETTINGS['higherbidsnumber']) { $max_bid = mysql_result($result,$i,"max_bid"); $auction = mysql_result($result,$i,"auction"); //-- Get auction data $query = "SELECT title,closed,id from PHPAUCTIONXL_auctions WHERE id=\"$auction\" AND"; $query .= "'".$NOW."'>=starts"; //print $query; $result_bid = mysql_query($query); if(mysql_num_rows($result_bid) > 0) { $title = mysql_result($result_bid,0,"title"); $closed = mysql_result($result_bid,0,"closed"); $auc_id = mysql_result($result_bid,0,"id"); } if($closed == "0" && !in_array($auction,$AU)) { #// Check bold and highlighted options $ISBOLD = FALSE; $ISHIGHLIGHTED = FALSE; $TPL_maximum_bids .="" .print_money ($max_bid)." "; if($ISHIGHLIGHTED) { $TPL_maximum_bids .= ""; } if($ISBOLD) { $TPL_maximum_bids .= ""; } $TPL_maximum_bids .= stripslashes($title); if($ISBOLD) { $TPL_maximum_bids .= ""; } if($ISHIGHLIGHTED) { $TPL_maximum_bids .= ""; } $TPL_maximum_bids .= "
"; if($bgcolor == "#FFFFFF") { $bgcolor = $FONTCOLOR[$SETTINGS['headercolor']]; } else { $bgcolor = "#FFFFFF"; } $AU[] = $auction; $j++; } $i++; } // Build list of help topics $query = "SELECT * FROM PHPAUCTIONXL_faqscategories"; $r_h = @mysql_query($query); if(!$r_h) { MySQLError($query); exit; } if(mysql_num_rows($r_h) > 0) { $TPL_helptopics = "