?#//v.2.5.1 enhanced version /* index.php 2005 - WEB2035.com revision - COPYRIGHT 2004 Phpauction.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation (version 2 or later). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ require('./includes/config.inc.php'); require("./header.php"); #// Run cron according to SETTINGS if($SETTINGS['cron'] == 2) { include_once "cron.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 cat_name ASC"; } else { $catsorting = " ORDER BY sub_counter DESC"; } $TPL_categories_value = ""; $query = "select * from PHPAUCTION_categories WHERE parent_id=0 $catsorting"; $result = mysql_query($query); if(!$result) { MySQLError($query); exit; } else { $num_cat = mysql_num_rows($result); $i = 0; // $TPL_categories_value .= "\n"; while($i < $num_cat && $i < 23) { $cat_id = mysql_result($result,$i,"cat_id"); $cat_name = mysql_result($result,$i,"cat_name"); $sub_count = intval(mysql_result($result, $i, "sub_counter")); $cat_colour = mysql_result($result, $i, "cat_colour"); $cat_image = mysql_result($result, $i, "cat_image"); $cat_counter = (int)mysql_result($result, $i, "counter" ); if ($sub_count!=0) $cat_counter = "(".$sub_count.")"; else { $cat_counter = ""; } $cat_url = "./browse.php?id=$cat_id"; // $TPL_categories_value .= "\n\n"; if ( $cat_colour != "") { // $TPL_categories_value .= "". "". "". ""; } else { /* No zoom Auction pictures */ /* $TPL_last_auctions_value .= "
"; // if ( $cat_image != "") { // $TPL_categories_value .= ""; // } // $TPL_categories_value .= ""; } else { // $TPL_categories_value .= ""; } $TPL_categories_value .= "$cat_name "."$cat_counter"."\n"; $i++; } // $TPL_categories_value .= "\n"; $TPL_categories_value .= "$MSG_277"; } /* No Zoom Featured Auction pictures */ if(!$zoom == "1"){ require('./view_featured_nz.php'); /* Zoom Featured Auction pictures */ }else{ require('./view_featured.php'); } #// #################################################################################################################### /* get last created auctions */ $query = "select id, title, pict_url, photo_uploaded, current_bid,starts from PHPAUCTION_auctions WHERE closed='0' AND suspended=0 AND private='n' AND starts<=".$NOW." ORDER BY starts DESC LIMIT ".$SETTINGS['lastitemsnumber']; $result = mysql_query($query); if ($result) { $num_auction = mysql_num_rows($result); } else { $num_auction = 0; } $i = 0; $bgcolor = "#ffffff"; $TPL_last_auctions_value = ""; while($i < $num_auction) { if($bgcolor == "#ffffff") { $bgcolor = "$tablebg"; } else { $bgcolor = "#ffffff"; } $title = mysql_result($result,$i,"title"); $id = mysql_result($result,$i,"id"); $date = mysql_result($result,$i,"starts"); $current_bid = mysql_result($result, $i, "current_bid"); $year = substr($date,0,4); $month = substr($date,4,2); $day = substr($date,6,2); $hours = substr($date,8,2); $minutes = substr($date,10,2); $seconds = substr($date,12,2); include("./includes/thumbimage.php"); $query = "select bid from PHPAUCTION_bids where auction='$id'"; $result_numbids = mysql_query($query); $num_bids = mysql_num_rows($result_numbids); //-- Added Zoom feature 8/4/2005 - Max /* Zoom Auction pictures */ if($pict_url !=""){ if($zoom == "1"){ $TPL_last_auctions_value .= "". "   ". $thumbnail ."  Zoom image actual size
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "
". "$std_font".stripslashes($title). "
". "
". "$sml_font"."Created:"."
"."$sml_font". ArrangeDateNoCorrection($day, $month, $year, $hours, $minutes)."

"."Number of bids:"."
"."$sml_font".$num_bids. "

". "". "". "
   ". $thumbnail ."
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "
". "$std_font".stripslashes($title). "
". "
". "$sml_font"."Created:"."
"."$sml_font". ArrangeDateNoCorrection($day, $month, $year, $hours, $minutes)."

"."Number of bids:"."
"."$sml_font".$num_bids. "

". "";*/ $TPL_last_auctions_value .= "
$thumbnail
". "".stripslashes($title). "
" ."
Number of bids: ".$num_bids. "
Current bid: 
".print_money ($current_bid)."
". "  Created: ".ArrangeDateNoCorrection($day, $month, $year, $hours, $minutes)."
" ; } } else { if($zoom == "1"){ $TPL_last_auctions_value .= "". "   ". $thumbnail ."
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "". "". "$std_font".stripslashes($title). "
". "". "". "$sml_font"."Created:"."
"."$sml_font". ArrangeDateNoCorrection($day, $month, $year, $hours, $minutes)."

"."Number of bids:"."
"."$sml_font".$num_bids. "". ""; } else { /* No zoom Auction pictures */ $TPL_last_auctions_value .= "". "   ". $thumbnail ."
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "". "". "$std_font".stripslashes($title). "
". "". "". "$sml_font"."Created:"."
"."$sml_font". ArrangeDateNoCorrection($day, $month, $year, $hours, $minutes)."

"."Number of bids:"."
"."$sml_font".$num_bids. "". ""; } } $query = "select bid from PHPAUCTION_bids where auction='$id'"; $result_numbids = mysql_query($query); $num_bids = mysql_num_rows($result_numbids); $i++; } /* get ending soon auctions */ $TPL_ending_soon_value = ""; $now = date("YmdHis",time()); $query = "SELECT ends,id,title,pict_url, photo_uploaded, current_bid from PHPAUCTION_auctions WHERE closed='0' AND suspended='0' AND private='n' AND starts<=".$NOW." order by ends LIMIT ".$SETTINGS['endingsoonnumber']; $result = mysql_query($query); if ($result) { $num_auction = mysql_num_rows($result); } else { $num_auction = 0; } $i = 0; $bgcolor = "#ffffff"; $TPL_ending_soon_value = ""; while($i < $num_auction) { if($bgcolor == "#ffffff") { $bgcolor = "$tablebg"; } else { $bgcolor = "#ffffff"; } $title = mysql_result($result,$i,"title"); $id = mysql_result($result,$i,"id"); $ends = mysql_result($result,$i,"ends"); $current_bid = mysql_result($result, $i, "current_bid"); $pict = "uploaded/$pict_url"; $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 = "$err_font $MSG_911"; } include("./includes/thumbimage.php"); $query = "select bid from PHPAUCTION_bids where auction='$id'"; $result_numbids = mysql_query($query); $num_bids = mysql_num_rows($result_numbids); //-- Added Zoom feature 8/4/2005 - Max /* Zoom Auction pictures */ if($pict_url !=""){ if($zoom == "1"){ $TPL_ending_soon_value .= "". "".$thumbnail."  Zoom image actual size ". "". "$std_font".stripslashes($title). "
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "
". "". "". "$sml_font"."Ends in:"."
$sml_font $ends_string

". "$sml_font"."Number of bids:"."
"."$sml_font".$num_bids. "". ""; } else { /* No zoom Auction pictures */ /*"

$thumbnail
". "".stripslashes($title). "
" ."
Number of bids: ".$num_bids. "
Current bid: 
".print_money ($current_bid)."
". "  Created: ".ArrangeDateNoCorrection($day, $month, $year, $hours, $minutes)."
" */ $TPL_ending_soon_value .= "
". "
".$thumbnail."
". "".stripslashes($title). "
". "
Number of bids: ".$num_bids. "
Current bid: 
".print_money ($current_bid)."
". "  Ends in: ".$ends_string."". "
"; } } else { if($zoom == "1"){ $TPL_ending_soon_value .= "". "".$thumbnail."". "". "$std_font".stripslashes($title). "
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "
". "". "". "$sml_font"."Ends in:"."
$sml_font $ends_string

". "$sml_font"."Number of bids:"."
"."$sml_font".$num_bids. "". ""; } else { /* No zoom Auction pictures */ $TPL_ending_soon_value .= "". "".$thumbnail."". "". "$std_font".stripslashes($title). "
"."$sml_font". "Current Bid:"."
"."$sml_font"."$".print_money ($current_bid). "
". "". "". "$sml_font"."Ends in:"."
$sml_font $ends_string

". "$sml_font"."Number of bids:"."
"."$sml_font".$num_bids. "". ""; } } $query = "select bid from PHPAUCTION_bids where auction='$id'"; $result_numbids = mysql_query($query); $num_bids = mysql_num_rows($result_numbids); $i++; } /** * NOTE: get higher bids */ $TPL_activity_value = ""; $query = "select auction,max(bid) AS max_bid FROM PHPAUCTION_bids GROUP BY bid,auction order by max_bid desc"; $result = mysql_query($query); $bgcolor = "$tablebg"; if ($result) $num_auction = mysql_num_rows($result); else $num_auction = 0; $i = 0; $j = 0; $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 PHPAUCTION_auctions WHERE id=\"$auction\" AND private='n' AND '".$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"); } $query = "select auction, bid from PHPAUCTION_bids where auction='$auction'"; $result_numbids = mysql_query($query); $num_bids = mysql_num_rows($result_numbids); if($closed == "0" && !in_array($auction,$AU)) { #// Check bold and highlighted options $TPL_activity_value .= ""; $AU[] = $auction; if($bgcolor == "$tablebg") {$bgcolor = "#ffffff"; } else{$bgcolor = "$tablebg"; } $j++; } $i++; } $TPL_activity_value .= "
" .print_money ($max_bid)." "."Number of bids: "."".$num_bids. " ".stripslashes($title)."
"; // Build list of help topics $query = "SELECT * FROM PHPAUCTION_faqscategories"; $r_h = @mysql_query($query); if(!$r_h) { MySQLError($query); exit; } if(mysql_num_rows($r_h) > 0) { while($faqscat = mysql_fetch_array($r_h)) { $faqscat['category']=stripslashes($faqscat['category']); $TPL_helptopics .= "

".$faqscat['category']."
"; } } else { $TPL_helptopics = " "; } //-- Build news list if($SETTINGS['newsbox'] == 1) { $query = "SELECT title,id,new_date from PHPAUCTION_news where suspended=0 order by new_date DESC limit ".$SETTINGS['newstoshow']; $res = mysql_query($query); if(!$res) { MySQLError($query); exit; } $TPL_news_list = ""; while($new = mysql_fetch_array($res)) { $new['title'] = stripslashes($new['title']); $new_date= $new['new_date']; $F_date = FormatDate($new_date); $TPL_news_list .= "
".$new['title']."  
$F_date
"; } } else { $TPL_news_list = " "; } require("./templates/template_index_php.html"); require('./footer.php'); ?>