jun. 06, 2006 session_start(); include_once ("config/config.php"); if ($setts['stores_enabled']!="Y") { echo ""; } else { include ("themes/".$setts['default_theme']."/header.php"); $shopDets = getSqlRow("SELECT store_name, username, store_template, shop_logo, store_active, store_about, store_specials, store_shippinginfo, store_policies, store_featured_items, store_endingsoon_items, store_recentlylisted_items FROM probid_users WHERE id='".$_REQUEST['userid']."'"); if (eregi("favourites",$_GET['option'])) { if ($_SESSION['memberid']) { $isFav = getSqlNumber("SELECT id FROM probid_favourite_stores WHERE storeid='".$_GET['userid']."' AND userid='".$_SESSION['memberid']."'"); if (!$isFav) $addFavStore = mysql_query("INSERT INTO probid_favourite_stores (storeid, userid) VALUES ('".$_GET['userid']."', '".$_SESSION['memberid']."')"); else $delFavStore = mysql_query("DELETE FROM probid_favourite_stores WHERE storeid='".$_GET['userid']."' AND userid='".$_SESSION['memberid']."'"); } } $logo = $shopDets['shop_logo']; if (!$_REQUEST['orderField']) $orderField = "enddate"; else $orderField=$_REQUEST['orderField']; if (!$_REQUEST['orderType']) { $orderType = "ASC"; $newOrder="DESC"; } else { $orderType=$_REQUEST['orderType']; $newOrder=($orderType=="ASC")?"DESC":"ASC"; } $searchPattern = " WHERE ownerid='".$_REQUEST['userid']."' AND active='1' AND closed='0' AND deleted!='1' AND listin!='auction' "; if ($_GET['start'] == "") $start = 0; else $start = $_GET['start']; $limit = 20; $totalAuctions = getSqlNumber("SELECT * FROM probid_auctions ".$searchPattern." ORDER BY ".$orderField." ".$orderType.""); $auctionsQuery = mysql_query("SELECT * FROM probid_auctions ".$searchPattern." ORDER BY ".$orderField." ".$orderType." LIMIT ".$start.",".$limit.""); $additionalVars = "&userid=".$_REQUEST['userid']."&parent=".$_REQUEST['parent']; if ($shopDets['store_active']==1) { echo ' '; include_once ("store_templates/store".$shopDets['store_template']."/header.php"); ?> '.addSpecialChars($shopDets[$_REQUEST['page']]).'

'; } else { ## seach in shop form echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo '
'.$lang[srcitemsinshop].'   '; echo '  
'; ## now we display featured items if ($shopDets['store_featured_items']) { $getFeatItems=mysql_query("SELECT id, itemname, picpath, bidstart, maxbid, enddate, currency FROM probid_auctions WHERE active=1 AND closed=0 AND deleted!=1 AND listin!='auction' AND ownerid='".$_REQUEST['userid']."' ORDER BY rand() LIMIT 0,".$shopDets['store_featured_items']." "); $nbFeatItems=mysql_num_rows($getFeatItems); (array) $featItem = NULL; (int) $featCnt = 0; while ($hpFeatured=mysql_fetch_array($getFeatItems)) $featItem[$featCnt++] = $hpFeatured; echo ' '; echo ' '; $width=(100/$shopDets['store_featured_items'])."%"; for ($i=0;$i<$shopDets['store_featured_items'];$i++) { if (!empty($featItem[$i]['itemname'])) { echo ' '; } else { echo ''; } } echo ' '; echo '
'; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo '
'.$featItem[$i]['itemname'].'

'; echo ' '.$lang[bid_now].'
'.strtoupper($lang[startbid]).': '.displayAmount($featItem[$i]['bidstart'],$featItem[$i]['currency']).'
'.$lang[currbid].' : '.displayAmount($featItem[$i]['maxbid'],$featItem[$i]['currency']).'
'.$lang[ends].' : '; echo ' '.displaydatetime($featItem[$i]['enddate'],$setts['date_format']).'
'; echo '

'; } ## now we display ending soon and recently listed items echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo '
'; ## ending soon first if ($shopDets['store_endingsoon_items']) { echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; $getClosingAuctions=mysql_query("SELECT id, enddate, itemname, bidstart, currency, maxbid FROM probid_auctions WHERE active=1 AND closed=0 AND deleted!=1 AND listin!='auction' AND ownerid='".$_REQUEST['userid']."' ORDER BY enddate ASC LIMIT ".$shopDets['store_endingsoon_items'].""); while ($closingAuctions=mysql_fetch_array($getClosingAuctions)) { echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; } echo '
 » '.$lang[Ending_Soon].'
 '.$lang[auction_title].' 
'.titleResize($closingAuctions['itemname']).'
'; echo '
'.$lang[timeleft].': '; $daysleft=timeleft($closingAuctions['enddate'],$setts['date_format']); echo (($daysleft>=0)?"$daysleft":"bidding closed"); echo '
'; echo '
'.$lang[currently].': '.displayAmount((($closingAuctions['maxbid']>0)?$closingAuctions['maxbid']:$closingAuctions['bidstart']),$closingAuctions['currency']).'
'.itemPics($closingAuctions['id']).'
'; } echo '
'; ## now recently listed if ($shopDets['store_recentlylisted_items']) { echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; $getOpenAuctions=mysql_query("SELECT id, startdate, bidstart, currency, itemname FROM probid_auctions WHERE closed=0 AND active=1 AND deleted!=1 AND listin!='auction' AND ownerid='".$_REQUEST['userid']."' ORDER BY startdate DESC LIMIT ".$shopDets['store_recentlylisted_items'].""); while ($openAuctions = mysql_fetch_array($getOpenAuctions)) { echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; } echo '
 » '.$lang[Recently_Listed_Auction].'
 '.$lang[auction_title].' 
'.titleResize($openAuctions['itemname']).'
'; echo '
'.$lang[start_date].': '.displaydatetime($openAuctions['startdate'],$setts['date_format']).'
'; echo '
'.$lang[startbid].': '.displayAmount($openAuctions['bidstart'],$openAuctions['currency']).'
'.itemPics($openAuctions['id']).'
'; } echo '
'; echo '
'; $parent=$_REQUEST['parent']; if($parent > 0) { $croot = $parent; $nav = ""; $cntr = 0; while ($croot>0) { $sbcts = mysql_query("SELECT id,parent FROM probid_categories WHERE id='$croot'") or die(mysql_error()); $crw = mysql_fetch_array($sbcts); if($cntr == 0) { $nav = $c_lang[$crw['id']]; } else { if($parent != $croot) { $nav = "".$c_lang[$crw['id']]." > ".$nav; } } $cntr++; $croot = $crw['parent']; } $navigation = "$lang[shop]: $nav"; } else { $navigation = "$lang[shop]: $lang[allcats]"; } ?>
0) { ?>
 » 
0) { $crw = getSqlRow("SELECT * FROM probid_categories WHERE id='$croot'"); if($cntr == 0) { $catname = $crw['name']; } else { if($crw['parent'] != $croot) { $catname = "$crw[name] : $catname"; } } $cntr++; $croot = $crw['parent']; } $catname = trim($catname); ## get all subcats reset($cat_array); if ($catname!="") { while (list($cat_array_id, $cat_array_details)=each($cat_array)) { list($cat_array_name, $userid) = $cat_array_details; $strResult = strpos($cat_array_name,$catname); if (trim($strResult)=="0") $cat_id[$catcnt++] = $cat_array_id; } $all_subcats = implode (",",$cat_id); $subcatquery="(a.category IN (".$all_subcats.") OR a.addlcategory IN (".$all_subcats.")) AND "; } else { $subcatquery = ""; } $mysqlVersion = substr(mysql_get_server_info(),0,1); $additionalVars = "&userid=".$_REQUEST['userid']."&parent=".$_REQUEST['parent']."&basicsearch=".$_REQUEST['basicsearch']; if (!empty($_REQUEST['basicsearch'])) $searchQuery = " AND keywords LIKE '%".$_REQUEST['basicsearch']."%' "; if ($mysqlVersion>=4) { $additionalQuery = "SQL_CALC_FOUND_ROWS "; } else { ## this is only used if the mySql is older than v4. Slower version $nbItems = getSqlNumber("SELECT DISTINCT a.id, a.itemname, a.picpath, a.maxbid, a.currency, a.nrbids, a.enddate FROM probid_auctions a WHERE ".$subcatquery." a.active=1 AND a.closed=0 AND a.deleted!=1 AND a.listin!='auction' AND ownerid='".$_GET['userid']."' ".$searchQuery." ORDER BY a.".$orderField." ".$orderType); } $getAuctions = mysql_query("SELECT ".$additionalQuery." DISTINCT a.id, a.itemname, a.hpfeat, a.picpath, a.maxbid, a.currency, a.bn, a.bnvalue, a.nrbids, a.enddate, a.bidstart, a.bn, a.bnvalue FROM probid_auctions a WHERE ".$subcatquery." a.active=1 AND a.closed=0 AND a.deleted!=1 AND a.listin!='auction' AND ownerid='".$_GET['userid']."' ".$searchQuery." ORDER BY a.".$orderField." ".$orderType." LIMIT $start,$limit"); if ($mysqlVersion>=4) $nbItems = mysql_result(mysql_query("Select FOUND_ROWS() AS nbr"),0,"nbr"); if ($nbItems==0) { echo ""; } else { if ($nbItems>($start+$limit)) $final = $start+$limit; else $final = $nbItems; while ($auction = mysql_fetch_array($getAuctions)) { ?> ">
".$lang[nostore]."
$auction['itemname'], 'id' => $auction['id']))."\">"; echo ""; echo ""; ?>