","",$thehtml); $thehtml = str_replace("
","",$thehtml); $thehtml = str_replace("
","\n",$thehtml); $original = strtr ($thehtml, $trans); return $original; } function strtoprice($value) { return number_format($value); } function displayinches($theinches) { if (is_numeric($theinches)) { if ($theinches>=12) { $thefeet = intval(($theinches / 12),0); $remainder = round(($theinches - ($thefeet*12)),1); $result = $thefeet." ft."; if ($remainder > 0 ) { $result .= " ".$remainder." in."; } } else { $result = round($theinches,1)." in."; } } else { $result = $theinches; } return $result; } function displaycm($thecm) { if (is_numeric($thecm)) { $result = round($thecm,2)." cm"; } else { $result = $thecm; } return $result; } function displayinchesyardsfromcm($thecm) { $theinches = $thecm * 0.393701; // return $theresult; return displayinches($theinches); } function displaycmfrominches($theinches) { $thecm = $theinches / 0.393701; // return $theresult; return displaycm($thecm); } if($stype==2 && $i_keyword!="") { $dealer_result = mysql_query("select dibs_V_id,dibs_V_shortKey from dibssellers where dibs_V_company like '".$i_keyword."'",$mylink); $dealer_nb = mysql_num_rows($dealer_result); if($dealer_nb==1) { $dealer_object = mysql_fetch_object($dealer_result); header("Location:art_gallery.php?gid=".$dealer_object->dibs_V_shortKey); } } // Convert parameters to locations search array $locations = get_locations($st, $location); if ($locations) { if (isset($locations['regions']) && count($locations['regions']) > 0) { $regional_ordering = 0; $city_reordering = 1; } else { $regional_ordering = 1; $city_reordering = 0; } } if ($cur_tab=="SS" && $SSCK!=1) { setcookie("SSCK","1","0","/",COOKIE_SITE,0); } if($i_keyword=='Keyword Search' || $i_keyword=='Dealer Search' || $i_keyword=='Gallery Search' || $i_keyword=='Item Keyword Search') { $i_keyword=""; } if($subSearchKey=='Keyword Search' || $subSearchKey=='Dealer Search' || $subSearchKey=='Gallery Search' || $subSearchKey=='Item Keyword Search') { $subSearchKey=""; } //Check for redirect keywords if(!$has_FRID) include("$pathtolibs/keyredirects.php"); if($regional_ordering || $city_reordering) { $type=2; } include($pathtolibs."/lib_keyword.php"); if(isset($i_keyword) && $i_keyword!="" && $i_keyword!="Keyword Search" && $i_keyword!="Dealer Search" && $i_keyword!="Gallery Search" && $stype==1) { $subSearchKey = $i_keyword; $i_keyword = "Gallery Search"; // Global keyword search // if($sm=="HKS" && $subSearchKey!="") // { // $keywordTabs = KeywordSearch($subSearchKey,'ART'); // } // else // { // $keywordTabs = KeywordSearch("",'ART'); // } } else { // $keywordTabs = KeywordSearch("",'ART'); } //If the keyword is a combination of 1 or 2 letters followed by a bunch of digits, try to match against a reference if ($subSearchKey && preg_match('/[A-Z]{1,2}[0-9]+/', $subSearchKey)) { $search_params = array( 'vertical' => "art", 'reference' => $subSearchKey ); //Perform the search $xml_obj = Solr::search($search_params); //If the solr search failed we stop and switch to db if ($xml_obj === null) { $use_solr = false; } else { //otherwise parse the solar objects into the same structure we get from the db list($item_objects, $item_nb, $item_total_nb, $search_time) = Solr::XMLToItemObjects($xml_obj); if ($item_total_nb == 1) { $item_obj = $item_objects[0]; $itemID = $item_obj->dibs_I_id; if ($itemID > 0) { if ($has_FRID) { header("Location: /store/art_detail.php?id=$itemID"); } else { header("Location: /art_detail.php?id=$itemID"); } return; } } } } if($sm=="HKS" && $subSearchKey!="") { $keywordTabs = SolrKeywordSearch($subSearchKey,"FURNITURE"); } if($artistID>=0) { $artistID = intval($artistID); $artist_result = mysql_query("select * from dibsartistsdealers,dibssellers where a_sellerID=dibs_V_id and a_artistID='".$artistID."' and a_status!='DISABLED' and dibssellers.dibs_V_status!='closed' and dibssellers.dibs_V_status!='internal' and dibssellers.dibs_V_status!='suspended' and dibssellers.dibs_V_status!='pending'",$mylink); $artist_nb = mysql_num_rows($artist_result); if($artist_nb>0) { $artist = mysql_fetch_object($artist_result); } else { $artistID=-1; } } $has_FRID = false; $show_1stdibs_logo = true; $show_small_1stdibs_logo = false; if ($HTTP_HOST!="art.".DOMAIN_NAME && $HTTP_HOST!="www.art.".DOMAIN_NAME) { $dealer_domain = str_replace(".".DOMAIN_NAME,"",$HTTP_HOST); $dealer_domain = str_replace("www.","",$dealer_domain); $dealer_domain = str_replace(".com","",$dealer_domain); $dealer_domain_info = mysql_query("select dibs_V_id,dibs_V_aadla,dibs_V_aadla_date,dibs_V_20thleague,dibs_V_key,dibs_V_allowPR,dibs_V_defaultPR,dibs_V_display_1stdibs_logo,dibs_V_display_mini_logo,dibs_V_custom_priority,dibs_V_preferredlayout from dibssellers where dibs_V_home like '%$dealer_domain%'",$mylink); $dealer_domain_nb = mysql_num_rows($dealer_domain_info); if($dealer_domain_nb==1) { $dealer_obj = mysql_fetch_object($dealer_domain_info); if($dealer_obj->dibs_V_display_1stdibs_logo=="N") { $show_1stdibs_logo = false; $m = "A"; if($dealer_obj->dibs_V_display_mini_logo=="Y") { $show_small_1stdibs_logo = true; } } if(!isset($dpr_no) && $dpr_no!=1 && $dealer_obj->dibs_V_defaultPR=="Y") { $dpr=1; } if($dealer_obj->dibs_V_20thleague=="Y") { $cur_tab = "AIPAD"; } elseif($dealer_obj->dibs_V_aadla=="Y") { $cur_tab = "ADAA"; } $dealer_key = $dealer_obj->dibs_V_key; $decrypted = $dealer_obj->dibs_V_id; $sellerID = $dealer_key; $has_FRID = true; $FRID = $dealer_obj->dibs_V_home; include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'ASD'; $track_data = "Dealer ".$decrypted." - page: ". (($rows>0)?(($start/$rows)+1):("1")); } elseif (isset($FRID) && $FRID!="") { //$decrypted = decrypt(($FRID),$crypt_key); //decrypts the data using the key if ($FRID!="" && !strstr(" ",$FRID)) { $has_FRID = true; $dealer_info = mysql_query("select dibs_V_id,dibs_V_aadla,dibs_V_aadla_date,dibs_V_20thleague,dibs_V_key,dibs_V_allowPR,dibs_V_defaultPR,dibs_V_display_1stdibs_logo,dibs_V_custom_priority,dibs_V_preferredlayout from dibssellers where dibs_V_shortKey='".$FRID."'",$mylink); $dealer_nb = mysql_num_rows($dealer_info); if($dealer_nb==1) { $dealer_obj = mysql_fetch_object($dealer_info); $decrypted = $dealer_obj->dibs_V_id; if($HTTP_HOST!="art.".DOMAIN_NAME && $HTTP_HOST!="www.art.".DOMAIN_NAME) { if($dealer_obj->dibs_V_display_1stdibs_logo=="N") { $show_1stdibs_logo = false; $m = "A"; } } if(!isset($dpr_no) && $dpr_no!=1 && $dealer_obj->dibs_V_defaultPR=="Y") { $dpr=1; } $dealer_key = $dealer_obj->dibs_V_key; $sellerID = $dealer_key; include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'ASD'; $track_data = "Dealer ".$dealer_obj->dibs_V_id." - page: ". (($rows>0)?(($start/$rows)+1):("1")); } else { $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="PR" || $type==411) { $track_code = "APRS"; } else { $track_code = 'AFS'; } } } else { $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="PR" || $type==411) { $track_code = "APRS"; } else { $track_code = 'AFS'; } } } } elseif (isset($FRID) && $FRID!="") { //$decrypted = decrypt(($FRID),$crypt_key); //decrypts the data using the key if ($FRID!="" && !strstr(" ",$FRID)) { $has_FRID = true; $dealer_info = mysql_query("select dibs_V_id,dibs_V_aadla,dibs_V_aadla_date,dibs_V_20thleague,dibs_V_key,dibs_V_allowPR,dibs_V_defaultPR,dibs_V_display_1stdibs_logo,dibs_V_custom_priority,dibs_V_preferredlayout from dibssellers where dibs_V_shortKey='".$FRID."'",$mylink); $dealer_nb = mysql_num_rows($dealer_info); if($dealer_nb==1) { $dealer_obj = mysql_fetch_object($dealer_info); $decrypted = $dealer_obj->dibs_V_id; if($HTTP_HOST!="art.".DOMAIN_NAME && $HTTP_HOST!="www.art.".DOMAIN_NAME) { if($dealer_obj->dibs_V_display_1stdibs_logo=="N") { $show_1stdibs_logo = false; $m = "A"; } } if(!isset($dpr_no) && $dpr_no!=1 && $dealer_obj->dibs_V_defaultPR=="Y") { $dpr=1; } $dealer_key = $dealer_obj->dibs_V_key; $sellerID = $dealer_key; include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'ASD'; $track_data = "Dealer ".$dealer_obj->dibs_V_id." - page: ". (($rows>0)?(($start/$rows)+1):("1")); } else { $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="PR" || $type==411) { $track_code = "APRS"; } else { $track_code = 'AFS'; } } } else { $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="PR" || $type==411) { $track_code = "APRS"; } else { $track_code = 'AFS'; } } } else { $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="PR" || $type==411) { $track_code = "APRS"; } else { $track_code = 'AFS'; } } include("libraries/checkusernobounce_slave.php"); if ($i_creator=='Maison Jansen') { $i_creator='Jansen'; } if ($i_creator!='') { $vignette2_imglink = ''; $vignette3_imglink = ''; } $has_eye=false; if (isset($isreg) && $isreg>0) { $myname = "error"; $query = "select dibs_U_firstname,dibs_U_lastname,dibs_U_displaym from stdib1.dibsusers where dibs_U_id='{$isreg}'"; $user_info = mysql_query($query,$mylink); $user_nb = mysql_num_rows($user_info); if ($user_nb==1) { $myfirstname = (stripslashes(mysql_result($user_info,0,"dibs_U_firstname"))); $mylastname = (stripslashes(mysql_result($user_info,0,"dibs_U_lastname"))); $myname = rtrim(ltrim("$myfirstname $mylastname")); $displaym = mysql_result($user_info,0,"dibs_U_displaym"); if($displaym=='Y') { $dm = 1; } $mynamelen = strlen($myname); $myname = substr($myname,0,19); $designer_result = mysql_query("select * from stdib1.designers_users where dibs_DU_status='ENABLED' and dibs_DU_userID='".$isreg."'",$mylink); $designer_nb = mysql_num_rows($designer_result); if($designer_nb == 1 && $cur_tab!="SS") { $has_eye=true; } if ($mynamelen>19) { $myname.="..."; } } } if($has_FRID) { $numrows = 24; } else { if ($cur_tab=="PR") { $numrows = 60; } elseif($regional_ordering) { $numrows = 60; } elseif($city_ordering) { $numrows = 60; } else { $numrows = 60; } } if (isset($start) && isset($rows)) { $startlimit = $start; if($rows<=108) { $endlimit = $rows; } else { $rows = $numrows; $endlimit = $rows; } if (!isset($numresults)) { $numresults=$numrows; } } else { $start=0; $rows=$numrows; $startlimit = 0; if (isset($numresults)) { $endlimit = $numresults; } else { $numresults = $numrows; $endlimit = $numresults; } } if (!isset($type)) { if($cur_tab=="PR") { $type = 1; } else { $type = 2; } } else { if($i_creator!='' || $i_keyword!='' || (isset($maincat) && $maincat!=-1 && $maincat!="") || (isset($periodselect) && $periodselect!="" && $periodselect>0) ) { $type=2; } else { if ($type<0) { $section_id = abs($type); $section = urlencode(encrypt("$section_id", "EFORCE_SIMPLE_KEY")); } } } if (!(isset($RL) && is_numeric($RL))) { if ($type==1) { $RL = $currelease; if($cur_tab=="PR") { $previous_RL = mktime("8",0,0,date("m",$currelease),date("d",$currelease)-7,date("y",$currelease)); } else { $previous_RL = mktime("11",0,0,date("m",$currelease),date("d",$currelease)-7,date("y",$currelease)); } } else { if ($type==4) { $RL = mktime("11",0,0,date("m",$currelease),date("d",$currelease)-7,date("y",$currelease)); } else { $RL = $currelease; } } } else { if($type==1 && $RL==$currelease) { if($cur_tab=="PR") { $previous_RL = mktime("8",0,0,date("m",$currelease),date("d",$currelease)-7,date("y",$currelease)); } else { $previous_RL = mktime("11",0,0,date("m",$currelease),date("d",$currelease)-7,date("y",$currelease)); } } } if(!isset($m)) { $m = "F"; } $search_tables = "dibsitems,dibssellers,dibsartists"; if($cur_tab=="PR" && !($has_FRID)) { $ordering = " order by dibs_I_PR_releasedate DESC,dibs_I_PR_priority ASC"; } elseif($cur_tab=="SD") { $ordering = " order by IF ((dibs_I_price=0 OR dibs_I_hideprice='Y'),1,2),IF (dibs_I_currency = 'EU',(dibs_I_price / $dollarrate), dibs_I_price) DESC,dibs_I_priority"; } elseif($cur_tab=="AADA" && !($has_FRID)) { $ordering = " order by dibs_I_aadla_releasedate DESC,dibs_I_aadla_priority ASC"; } elseif($cur_tab=="AIPAD" && !($has_FRID)) { $ordering = " order by dibs_I_20th_releasedate DESC,dibs_I_20th_priority ASC"; } else { if($has_FRID) { if($dealer_obj->dibs_V_custom_priority=="Y") { $ordering = " order by dibs_I_store_priority DESC"; } else { $ordering = " order by IF(dibs_I_CSstatus!=50 and dibs_I_CSstatus!=60,2,1),dibs_I_postdate DESC"; } } else { if ($type==1 || $type==4) { if($regional_ordering) { $ordering = " order by IF(dibs_I_CSstatus=60 or dibs_I_CSpreviousstatus=60,2,1),dibs_I_region_releasedate DESC,dibs_I_region_priority ASC,dibs_I_releasedate DESC,dibs_I_priority ASC"; } elseif($city_reordering) { $ordering = " order by IF(dibs_I_CSstatus=60 or dibs_I_CSpreviousstatus=60,2,1),dibs_I_city_releasedate DESC,dibs_I_city_priority ASC,dibs_I_releasedate DESC,dibs_I_priority ASC"; } else { $ordering = " order by dibs_I_releasedate DESC,dibs_I_priority ASC"; } } else { if($regional_ordering) { $ordering = " order by IF(dibs_I_CSstatus=60 or dibs_I_CSpreviousstatus=60,2,1),dibs_I_region_releasedate DESC,dibs_I_region_priority ASC,dibs_I_releasedate DESC,dibs_I_priority ASC"; } elseif($city_reordering) { $ordering = " order by IF(dibs_I_CSstatus=60 or dibs_I_CSpreviousstatus=60,2,1),dibs_I_city_releasedate DESC,dibs_I_city_priority ASC,dibs_I_releasedate DESC,dibs_I_priority ASC"; } else { $ordering = " order by IF(dibs_I_CSstatus=60 or dibs_I_CSpreviousstatus=60,2,1),dibs_I_releasedate DESC,dibs_I_priority ASC"; } } } } $limit = " limit $startlimit,$endlimit"; $item_search_constraints = ""; $solddate = $lastrelease - (86400*90); include("libraries/art_search_keys.php"); include("libraries/art_cat_keys.php"); if(!$has_FRID) { // $item_search_constraints .= " and dibs_I_1stdibs_new!='D' and dibs_I_1stdibs_new!='X' "; } $item_select = "select SQL_CALC_FOUND_ROWS dibs_I_id "; $item_query .= " from ".$search_tables." where dibs_I_sellerID=dibs_V_id and dibs_I_dbartistID=a_id "; if (!$has_FRID && $m!="A" && $cur_tab!="SD") { if($cur_tab=="PR") { if($solds!=2) { $item_query .= "and ((dibs_I_status>0 and dibs_I_status<6 and dibs_I_PR_releasedate>=0) or ( dibs_I_status=0 )) "; } else { $item_query .= "and dibs_I_status=0 "; } } else { if ($type==1 || $type==2 || $type==3 || $type==4) { $item_query .= "and ((dibs_I_status>0 and dibs_I_status<6 and dibs_I_releasedate>=" . ( (int) $solddate) . " and dibs_V_display_solds='Y') or ( dibs_I_status=0 )) "; } else { $item_query .= "and dibs_I_status=0 "; } } } elseif($cur_tab!="SD") { if($has_FRID) { if(isset($m) && $m=="A") { $item_query .= "and (((dibs_I_status>0 and dibs_I_status<6 and dibs_I_releasedate<='{$solddate}' ".((!$has_FRID)?(""):("and dibs_V_display_solds='Y'"))." and dibs_I_store_display='Y') or dibs_I_status=0 or dibs_I_status=6) or dibs_I_store_display='Y') "; } else { //$item_query .= "and (((dibs_I_status>0 and dibs_I_status<6 and dibs_I_releasedate>='{$solddate}' ".((!$has_FRID)?(""):("and dibs_V_display_solds='Y'")).") or dibs_I_status=0 or dibs_I_status=6) or dibs_I_store_display='Y') "; } } else { $item_query .= "and ((dibs_I_status>0 and dibs_I_status<6 and dibs_I_releasedate>='{$solddate}' ".((!$has_FRID)?(""):("and dibs_V_display_solds='Y'")).") or dibs_I_status=0 or dibs_I_status=6) "; } } else { $item_query .= "and dibs_I_status!=0 "; } $item_query .= "and dibs_I_onhold!='Y' "; $item_query .= "and (dibssellers.dibs_V_status!='closed' and dibssellers.dibs_V_status!='internal' and dibssellers.dibs_V_status!='suspended' and dibssellers.dibs_V_status!='pending') "; if(!$has_FRID && $cur_tab!="FD") { $count_dealers_query = "select dibs_I_sellerID " . $item_query . $item_search_constraints . $catkey . $subcatkey . $pkey . "group by dibs_I_sellerID"; if($stype==2) { $countsellers = mysql_query($count_dealers_query,$mylink); $totalsellers = mysql_num_rows($countsellers); if($totalsellers==1) { $cursearchsellerid = mysql_result($countsellers,0,"dibs_I_sellerID"); $dealer_result = mysql_query("select * from dibssellers where dibs_V_id='".$cursearchsellerid."'",$mylink); $dealer_nb = mysql_num_rows($dealer_result); if($dealer_nb==1) { $dealer_obj = mysql_fetch_object($dealer_result); //$FRID = encrypt($cursearchsellerid,$crypt_key); $FRID = $dealer_obj->dibs_V_shortKey; $has_FRID = true; $decrypted = $cursearchsellerid; $dealer_key = $dealer_obj->dibs_V_key; header("Location:dealeritems.php?sellerID=".$dealer_key); exit; $sellerID = $dealer_key; include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'FSD'; $track_data = "Dealer ".$decrypted." - page: ". (($rows>0)?(($start/$rows)+1):("1")); $item_search_constraints .= " and (dibsitems.dibs_I_sellerID='$FRID') "; if($dealer_obj->dibs_V_custom_priority=="Y") { $ordering = " order by dibs_I_store_priority DESC"; } else { $ordering = " order by dibs_I_postdate DESC"; } } } } } $item_columns = "dibs_I_id, dibs_I_status, dibs_I_CSstatus, dibs_I_item, dibs_I_period, dibs_I_artistID, dibs_I_sellerID, dibs_I_storeID, dibs_I_hideprice, dibs_I_bargain, dibs_I_initialprice, dibs_I_price, dibs_I_pricerange, dibs_I_pricerange_low, dibs_I_pricerange_high, dibs_I_creator, dibs_I_editions, dibs_I_currency, dibs_I_measurements, dibs_I_height1, dibs_I_height2, dibs_I_depth, dibs_I_width, dibs_I_diameter, dibs_I_linkimg1s, dibs_I_store_priority, dibs_V_custom_priority, dibs_V_key, dibs_V_company, dibs_V_display_solds, dibs_V_aadla_logo_active, dibs_V_aadla_logo, dibs_V_scrolllogo, dibs_V_scrolllogoactive"; //$item_query = $item_select . $item_query . $item_search_constraints . $catkey . $subcatkey . $pkey . $ordering . $limit; $item_query = "select SQL_CALC_FOUND_ROWS " . $item_columns . $item_query . $item_search_constraints . $catkey . $subcatkey . $pkey . $item_artist_constraints . $ordering . $limit; // echo htmlentities($item_query); // exit(0); if (USE_SOLR === true && !$has_FRID) { /** * SEARCH SOLR INSTEAD OF THE DB **/ //Translate main cats passed from the top menu into solr_maincat if (isset($A) && $A==1) $solr_maincat = "A"; if (isset($B) && $B==1) $solr_maincat = "B"; if (isset($C) && $C==1) $solr_maincat = "C"; if (isset($D) && $D==1) $solr_maincat = "D"; if (isset($E) && $E==1) $solr_maincat = "E"; if (isset($F) && $F==1) $solr_maincat = "F"; if (isset($G) && $G==1) $solr_maincat = "G"; if (isset($H) && $H==1) $solr_maincat = "H"; if (isset($S) && $S==1) $solr_maincat = "S"; if (isset($T) && $T==1) $solr_maincat = "T"; // --- Preapare solr params $use_solr = true; $search_params = array( 'vertical' => 'art', 'items_per_page' => $numresults ); // --- keyword search to param if ($subSearchKey) { $search_params['keyword'] = $subSearchKey; } // --- artist to param if ($artistID && $artistID > 0) { $search_params['artistID'] = $artistID; } // --- categories to param if ($subcat && $subcat != -1) { $search_params['subcat'] = $subcat; } else if ($maincat && $maincat != -1) { $search_params['maincat'] = $maincat; } else if ($solr_maincat) { $search_params['maincat'] = $solr_maincat; } // --- period to param if ($periodselect && $periodselect != -1) { $search_params['period'] = $periodselect; } // --- start/pagination to param if ($start > 0) { $search_params['start'] = $start; } // --- Favorite dealer search if ($cur_tab == 'FDU') { $search_params['fav_dealers'] = $fav_dealers_arr; } if ($cur_tab == "AADA") { $search_params['artsection'] = 'ADAA'; if ($pricesort == 'DOWN') $sort_by = "sort_hide_price asc, sort_price desc, priority asc"; else if ($pricesort == 'UP') $sort_by = "sort_hide_price asc, sort_price asc, priority asc"; else if ($pricesort == 'CONTACT') $sort_by = "releasedate desc, priority asc"; else $sort_by = "aadla_releasedate desc, aadla_priority asc"; } else if ($cur_tab == "AIPAD") { $search_params['artsection'] = 'AIPAD'; if ($pricesort == 'DOWN') $sort_by = "sort_hide_price asc, sort_price desc, priority asc"; else if ($pricesort == 'UP') $sort_by = "sort_hide_price asc, sort_price asc, priority asc"; else if ($pricesort == 'CONTACT') $sort_by = "releasedate desc, priority asc"; else $sort_by = "20th_releasedate desc, 20th_priority asc"; } else { // $search_params['artsection'] = 'ALL'; if ($pricesort == 'DOWN') $sort_by = "sort_hide_price asc, sort_price desc, priority asc"; else if ($pricesort == 'UP') $sort_by = "sort_hide_price asc, sort_price asc, priority asc"; else if ($pricesort == 'CONTACT') $sort_by = "releasedate desc, priority asc"; else $sort_by = "sort_cs_status asc, releasedate desc, priority asc"; } $search_params['sort'] = $sort_by; // --- Perform the search $xml_obj = Solr::art_search($search_params); // --- If the solr search failed we stop and switch to db if ($xml_obj === null) { $use_solr = false; } else { // --- Otherwise parse the solar objects into the same structure we get from the db list($item_objects, $item_nb, $item_total_nb, $search_time) = Solr::XMLToItemObjects($xml_obj); // echo "search time: $search_time
"; // echo "item_nb: $item_nb
"; // echo "item_total_nb: $item_total_nb
"; //echo ""; foreach ($item_objects as $item_object) { if ($item_object->dibs_I_artistID > 0) { $artist = array(); $artist['a_first'] = $item_object->artist_first; $artist['a_last'] = $item_object->artist_last; $artist['a_country'] = $item_object->artist_country; $artist['a_date'] = $item_object->artist_date; $artist = (object) $artist; $item_object->artist = $artist; } } } } if (!$use_solr) { $item_result = mysql_query($item_query,$mylink); $item_nb = mysql_num_rows($item_result); $count_result = mysql_query("SELECT FOUND_ROWS() as total",$mylink); $item_total_nb = mysql_result($count_result,0,"total"); //echo "
SQL SEARCH
"; //echo "item nb: $item_nb
"; } // echo $item_total_nb; if ($item_total_nb>0) { $pagetotal = (($item_total_nb % $numresults)==0)?intval($item_total_nb / $numresults):intval($item_total_nb / $numresults)+1; } else { $pagetotal = 0; } if ($startlimit>0) { $pagenum = ($startlimit / $numresults)+1; } else { $pagenum = 1; } // echo "pagetotal:".$pagetotal; // echo " pagenum:".$pagenum; // Build GA custom dealer var $custom_var['dealer'] = array(); if ($has_FRID) { if ($item_objects && count($item_objects) > 0) { $custom_var['dealer'][] = 'A'.$item_objects[0]->dibs_I_sellerID; } else if ($item_result) { $custom_var['dealer'][] = 'A'.mysql_result($item_result, 0, "dibs_I_sellerID"); mysql_data_seek($item_result, 0); } } elseif ($pagenum == 1) { if ($item_objects && count($item_objects) > 0) { for ($i = 0; $i < 20; $i++) { if ($item_objects[$i]) { $custom_var['dealer'][] = 'A'.$item_objects[$i]->dibs_I_sellerID; } else { break;} } } else if ($item_result) { for ($i = 0; $i < 20; $i++) { if ($dibs_I_sellerID = mysql_result($item_result, $i, "dibs_I_sellerID")) { $custom_var['dealer'][] = 'A'.$dibs_I_sellerID; } else { break;} } mysql_data_seek($item_result, 0); } } $pwform_count = 0; $formfields = ""; include("$pathtolibs/searchvars.php"); ?> dibs_MC_label; $titleString = $curcat_label; $descString = strtolower($curcat_label); if(isset($subcat) && $subcat!="-1" && $subcat!=""){ $que = QueryService::buildQuery('art_subcategory.dibs',array('subcat'=> $subcat,'bypassCache'=>'true')); $ans = json_decode(QueryService::getQueryResult($que),true); $subcatString = $ans['art_subcategory']['row']['dibs_c_label']." "; $descString = strtolower($subcatString).$descString; } } } if(isset($oldst) && $oldst>0) { $query = "select cs_ST_id,cs_ST_label from csstates where cs_ST_active='Y' and cs_ST_id=".$oldst; $cur_state = mysql_query($query,$mylink); if(mysql_num_rows($cur_state)==1) { $cur_state_label = mysql_result($cur_state,0,"cs_ST_label"); } } if ($i_creator!='') { echo "".(($has_FRID)?(stripslashes($dealer_company)." Art Search: "):("1stdibs Art Search: ")).(($i_creator=='Jansen')?('Maison Jansen'):((($i_creator=='Paul Evans')?('Paul Evans Furniture'):((($i_creator=='Robsjohn Gibbings')?('T.H. Robsjohn Gibbings'):(urldecode($i_creator))))))); if ( $item_total_nb>10) { echo " - $item_total_nb ".(($i_creator=='Jansen')?('Maison Jansen'):((($i_creator=='Paul Evans')?('Paul Evans Furniture'):((($i_creator=='Robsjohn Gibbings')?('T.H. Robsjohn Gibbings'):(urldecode($i_creator)))))))." pieces for sale"; } else { echo " pieces for sale"; } if($has_FRID && $m=="F") { echo " on 1stdibs"; } echo ""; } elseif (isset($artistID) && $artistID != -1) { $artName = trim($artist -> a_first).' '.trim($artist -> a_last); echo "$artName Fine Art at 1stdibs"; echo ""; } else { if($has_FRID) { echo "".((!($HTTP_HOST!="www.".DOMAIN_NAME && $HTTP_HOST!=DOMAIN_NAME))?("1stdibs - "):("")).stripslashes($dealer_company).""; } else { echo "Fine Art $subcatString$titleString at 1stdibs"; echo ""; } } ?> 10) { echo " - $item_total_nb ".$i_creator." pieces for sale"; } else { echo " pieces for sale"; } } elseif (isset($artistID) && $artistID != -1) { echo "$artName Fine Art at 1stdibs"; } else { if($has_FRID) { echo ((!($HTTP_HOST!="www.".DOMAIN_NAME && $HTTP_HOST!=DOMAIN_NAME))?("1stdibs - "):("")).stripslashes($dealer_company).""; } else { echo 'Fine Art '.$subcatString.$titleString." at 1stdibs"; } } ?>">
0)) || ($has_FRID)) { $vignette2_imglink = ""; $vignette3_imglink = ""; } if (!isset($i_creator) && !isset($section_decrypt) && !($section_decrypt>0) && !$has_FRID && $stype!=2) { if($cur_tab=="AADA") { /*$f_movie = "/interface/v3/search/0112/1101/ADAA_fine_art_0111_2012.swf"; $alt_html = ""; echo GenerateFlashObject ($f_movie,750,300,"opaque","9.0.45.0",$alt_html);*/ echo "
"; } else { //echo "
$vignette1
"; echo "
"; } } elseif($has_FRID) { $has_strip = false; $gallery_header_result = mysql_query("select * from dibs_art_strips where dibs_AS_sellerID='".$dealer_obj->dibs_V_id."' and dibs_AS_gallery_header='Y'",$mylink); $gallery_nb = mysql_num_rows($gallery_header_result); if ($gallery_nb>0) { $has_strip = true; } else { $gallery_header_result = mysql_query("select * from dibs_art_strips where dibs_AS_sellerID='".$dealer_obj->dibs_V_id."' and dibs_AS_status!='DISABLED'",$mylink); $gallery_nb = mysql_num_rows($gallery_header_result); if ($gallery_nb>0) { $has_strip = true; } } if ($has_strip) { $strip_obj = mysql_fetch_object($gallery_header_result); $strip_width = 522; $strip_slide_width = 522; $image_spacing = 10; $strip_height = 275; $slide_height = 275; $target_width = 512; $target_height = 512; $offsetY = -300; echo "
"; echo "\n"; } else { echo "
".$dealer_obj->dibs_V_company."
"; } echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; echo "".stripslashes($dealer_company).""; echo "    "; if ($showurl=='Y' && $url!=="") { echo "".(($urllabel!="")?(strtolower($urllabel)):("website"))."  "; } if ($dealer_hasshoptalk=="Y" && $dealer_shoptalkurl!="") { echo "".(($dealer_shoptalklabel!="")?(strtolower($dealer_shoptalklabel)):("shop talk"))."  "; } if ($dealer_hasother=="Y" && $dealer_otherurl!="") { echo "".(($dealer_otherlabel!="")?($dealer_otherlabel):("more...")).""; } echo ""; echo "
".$dealer_city.(($dealer_city!="" && $dealer_state!="")?(", "):("")).$dealer_state."
"; echo "
"; echo "
"; echo "
"; } ?>
"; echo ""; //echo $formfields; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($maincat) && $maincat!='') { echo ""; } if (isset($subcat) && $subcat!='') { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo ""; echo "
"; echo ""; //echo $formfields; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($maincat) && $maincat!='') { echo ""; } if (isset($subcat) && $subcat!='') { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo ""; //echo $formfields; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($maincat) && $maincat!='') { echo ""; } if (isset($subcat) && $subcat!='') { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo ""; //echo $formfields; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($maincat) && $maincat!='') { echo ""; } if (isset($subcat) && $subcat!='') { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($dpr) && $dpr==1) { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($dpr) && $dpr==1) { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($dpr) && $dpr==1) { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($dpr) && $dpr==1) { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($dpr) && $dpr==1) { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($dpr) && $dpr==1) { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; echo "
"; echo $formfields; echo ""; echo ""; if (isset($i_creator) && $i_creator!='') { echo ""; } if (isset($periodselect) && $periodselect!='') { echo ""; } echo "
"; ?>