0 && $periodselect != -1) { $period_url_label = get_period_url_label($periodselect); $redirect_page .= ($query_params ? "&" : "?")."per={$period_url_label}"; $query_params = TRUE; $redirect = TRUE; } if ($type == 1) { $redirect_page .= ($query_params ? "&" : "?")."latest=true".($query_params ? "" : "&h=true"); $query_params = TRUE; $redirect = TRUE; } if ($dm == 1) { $redirect_page .= ($query_params ? "&" : "?")."measurements=true"; $query_params = TRUE; $redirect = TRUE; } if (isset($creator_url_label) && $creator_url_label) { if ($seller_redirect) { $redirect_page .= ($query_params ? '&' : '?') . "creator=" . $creator_url_label; $query_params = TRUE; } elseif (!$query_params) { $redirect_page = '/creators/'.$creator_url_label.'/furniture/'; $redirect = TRUE; } else { $redirect_page .= "&creator=".$creator_url_label; $query_params = TRUE; } } if ($location) { list($location, $redirect_page, $query_params, $redirect) = LocationsRedirects::getRedirectUrl($location, $redirect_page, $query_params, $redirect); } // check Seller if ($seller_redirect) { $redirect = TRUE; if (isset($FRID)) { $seller = Seller::load(decrypt(($FRID), $crypt_key), NULL, 'furniture'); } else { $seller = Seller::load(NULL, $sellerID, 'furniture'); } $seller_uri = Seller::redirect($seller, TRUE); if ($redirect_page == '/furniture/') { $redirect_page = $seller_uri; } else { $redirect_page = ($seller_uri != '/furniture/' ? rtrim($seller_uri, '/') : '') . $redirect_page; } } } if ($redirect) { Redirects::doRedirect($redirect_page); } function get_creator_url_label($creator) { global $mylink; $creator = trim($creator); //leave these mysql_real_escape_strings alone $query = "SELECT dibs_C_url_label FROM dibscreators WHERE dibs_C_litteral = '" . mysql_real_escape_string(urldecode($creator)) . "' OR dibs_C_key = '" . mysql_real_escape_string(urlencode($creator)) . "'"; $result = mysql_query($query, $mylink); if (!$result) { // Some creators with special chars brakes the query (in first condition on "dibs_C_litteral") // trying to match just on the second one $query = "SELECT dibs_C_url_label FROM dibscreators WHERE dibs_C_key = '" . mysql_real_escape_string(urlencode($creator)) . "'"; $result = mysql_query($query, $mylink); if (!$result) { return NULL; } } $row = mysql_fetch_array($result); $url_label = $row['dibs_C_url_label']; // if can't find creator url_label in db // try to build if (!$url_label) { $url_label = String::getSeoVersion($creator, '-', array()); } $query = QueryService::buildQuery('url_redirect.dibs', array('url_tag' => $url_label, 'creator' => 'true')); $result = QueryService::getQueryResult($query); if ($json = json_decode($result)) { if (!is_array($json->url_redirect->row) && !empty($json->url_redirect->row->url_tag)) { return $json->url_redirect->row->url_tag; } } return NULL; } function get_maincat_url_label($maincat) { global $mylink; $query = "SELECT dibs_MC_seo_label FROM dibsmaincategories WHERE dibs_MC_code='".$maincat."'"; $result = mysql_query($query, $mylink); if (!$result) { header("Location: /error.php"); exit(1); } $row = mysql_fetch_array($result); $maincat_url_label = $row['dibs_MC_seo_label']; return $maincat_url_label; } function get_subcat_url_label($subcat) { global $mylink; $query = "SELECT dibs_C_seo_label FROM dibscategories WHERE dibs_C_id='".$subcat."'"; $result = mysql_query($query, $mylink); if (!$result) { header("Location: /error.php"); exit(1); } $row = mysql_fetch_array($result); $subcat_url_label = $row['dibs_C_seo_label']; return $subcat_url_label; } function get_period_url_label($period) { global $mylink; $query = "SELECT dibs_P_url_label FROM dibsperiods WHERE dibs_P_code='".$period."'"; $result = mysql_query($query, $mylink); if (!$result) { header("Location: /error.php"); exit(1); } $row = mysql_fetch_array($result); $subcat_url_label = $row['dibs_P_url_label']; return $subcat_url_label; } // END REDIRECTS // // IMAGES HOSTS // shuffle($images_hosts); $search_images_hosts = array_slice($images_hosts, 0, SEARCH_IMAGES_HOSTS); include($pathtolibs."/imaging.php"); include($pathtolibs."/lib_flash.php"); include($pathtolibs."/lib_special_search_banners.php"); require_once $pathtolibs.'/lib_locations.php'; require_once($pathtolibs. "/util/utils.inc.php"); require_once($pathtolibs. "/search/Solr.php"); // DEBUG::activate(); // ERROR::activate(); // BENCHMARK::activate(); // BENCHMARK::createPoint("near page start (after connectdb)"); if(DEBUG::isActive()){ ini_set('display_errors', TRUE); $lolos_error_handler = set_error_handler($old_error_handler); //this is changed in the connectdb files error_reporting(E_ALL ^ E_NOTICE); } // DEBUG::lvar_dump("display errors?", ini_get('display_errors')); // DEBUG::lvar_dump("error reporting", ini_get('error_reporting')); // DEBUG::lvar_dump("i_keyword", $i_keyword); //Migrating subcategories $cat_migrations = array( "B10" => "B1", "B8" => "B4", "J44" =>"J40", "J31" => "J40", "J24" => "J40", "J35" => "J40", "J45" => "J40", "J48" => "J40", "J1" => "J34", "J21" => "J34", "J42" => "J33", "J7" => "J33", "J8" => "J33", "J10" => "J33", "J12" => "J33", "J14" => "J33", "J15" => "J33", "J16" => "J33", "J41" => "J33", "J17" => "J33", "J46" => "J33", "J28" => "J33", "J29" => "J33", "J47" => "J33", "J21" => "J33", "J13" => "J39", "J25" => "J38", "J22" => "J43", "J26" => "J43", "J4" => "J5", "J6" => "J5", "J9" => "J5", "J36" => "J5", "J27" => "J5", "J37" => "J5", "J18" => "J32", "J19" => "J32", "J23" => "J32", "J30" => "J32" ); foreach ($cat_migrations as $from_cat => $to_cat) { if (${$from_cat} == 1 || $subcat == $from_cat) { $page_url = $_SERVER['REQUEST_URI']; $page_url = str_replace($from_cat, $to_cat, $page_url); header("HTTP/1.1 301 Moved Permanently"); header("Location: $page_url"); } } function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); function htmltotxt($thehtml) { $trans = get_html_translation_table(HTML_ENTITIES); $trans = array_flip ($trans); $thehtml = str_replace("
","",$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) { if (is_numeric($thecm)) { $theinches = $thecm * 0.393701; return displayinches($theinches); } else { return displayinches($thecm); } } function displaycmfrominches($theinches) { if (is_numeric($theinches)) { $thecm = $theinches / 0.393701; // return $theresult; return displaycm($thecm); } else { return $theinches; } } function itemDetailHref ($dibs_id, $current_tab, $dq_page) { $sub_domain_f = 'http://%s.' . DOMAIN_NAME; $item_link_f = '%s%s_item_detail.php?id=%s'; $sub_domain = ''; $keyname = 'furniture'; if ($current_tab == "SS") { if ($dq_page == 4) { $sub_domain = sprintf($sub_domain_f, 'jewelry'); $keyname = 'jewelry'; } elseif ($dq_page == 14) { $sub_domain = sprintf($sub_domain_f, 'fashion'); $keyname = 'avl'; } elseif ($dq_page == 15) { $sub_domain = sprintf($sub_domain_f, 'art'); $keyname = 'art'; } } $item_href = sprintf($item_link_f, $sub_domain, $keyname, $dibs_id); $item_href = empty($sub_domain) ? $item_href : 'http://' . $item_href; if ($current_tab == "NYDC") { $item_href .= '&cur_tab=NYDC'; } return $item_href; } if(!isset($solds)) { $solds = 1; } $image_host = ""; $resultsfile = "furniture_search.php"; // 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(!isset($COL)) { $COL = 1; } // setcookie("COL",($COL+1),"0","/", COOKIE_SITE,0); if($i_keyword=='Keyword Search' || $i_keyword=='Dealer Search' || $i_keyword=='Item Keyword Search') { DEBUG::writeln("resetting ikeyword to ''"); $i_keyword=""; } if($subSearchKey=='Keyword Search' || $subSearchKey=='Dealer Search' || $subSearchKey=='Item Keyword Search') { $subSearchKey=""; } if(!$has_FRID && ($i_keyword!="" || $subSearchKey!="")) { include($pathtolibs."/keyredirects.php"); } include($pathtolibs."/lib_keyword.php"); if(isset($i_keyword) && $i_keyword!="" && $i_keyword!="Keyword Search" && $i_keyword!="Dealer Search" && $stype==1) { $subSearchKey = $i_keyword; $i_keyword = "Dealer Search"; /* * Commented by Adrian Gusa - Don't do ref keyword search here, let it run through solr and do redirection only if there is a single result * if($sm=="HKS" && $subSearchKey!="") { $keywordTabs = KeywordSearch($subSearchKey,"FURNITURE"); } else { $keywordTabs = KeywordSearch("","FURNITURE"); } if($sm=="HKS" && $subSearchKey!="") { KeywordReferenceSearch($subSearchKey,"FURNITURE"); } else { KeywordReferenceSearch("","FURNITURE"); } * */ } else { //KeywordReferenceSearch("","FURNITURE"); } //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]+/i', $subSearchKey)) { $search_params = array( 'vertical' => "furniture", '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/furniture_item_detail.php?id=$itemID"); } else { header("Location: /furniture_item_detail.php?id=$itemID"); } return; } } } } if($sm=="HKS" && $subSearchKey!="") { $keywordTabs = SolrKeywordSearch($subSearchKey,"FURNITURE"); } //If the keyword starts with NY, check against NYDC items references if ($subSearchKey && strpos($subSearchKey, "NY") === 0) { NYDCReferenceSearch($subSearchKey); } include("dsp/lib_eye.php"); $has_FRID = FALSE; $show_1stdibs_logo = TRUE; $show_small_1stdibs_logo = FALSE; if ($HTTP_HOST!="www.".DOMAIN_NAME && $HTTP_HOST!=DOMAIN_NAME) { //first make sure we accept hostnames like bittersweet.f2.1stdibs.com $dealer_domain = str_replace(".f2.", ".", $HTTP_HOST); $dealer_domain = str_replace(".".DOMAIN_NAME,"",$dealer_domain); $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,dibs_V_home,dibs_V_open_hours 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 = "TWTH"; } elseif($dealer_obj->dibs_V_aadla=="Y") { $cur_tab = "LEAGUE"; } $dealer_key = $dealer_obj->dibs_V_key; $dealer_open_hours = $dealer_obj->dibs_V_open_hours; $decrypted = $dealer_obj->dibs_V_id; $sellerID = $dealer_key; $has_FRID = TRUE; $FRID = urlencode(encrypt($item_object->dibs_I_sellerID,$crypt_key)); include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'FSD'; $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 ($decrypted>0) { $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,dibs_V_home,dibs_V_open_hours from dibssellers where dibs_V_id='".$decrypted."'",$mylink); $dealer_nb = mysql_num_rows($dealer_info); if($dealer_nb==1) { $dealer_obj = mysql_fetch_object($dealer_info); if($HTTP_HOST!="www.".DOMAIN_NAME && $HTTP_HOST!=DOMAIN_NAME) { //first make sure we accept hostnames like bittersweet.f2.1stdibs.com $cur_host = str_replace(".f2.", ".", $HTTP_HOST); $cur_host = str_replace("www.".DOMAIN_NAME,"",$cur_host); $cur_host = str_replace(".".DOMAIN_NAME,"",$cur_host); $cur_host = str_replace("www.","",$cur_host); $supposed_host = str_replace("www.","",$dealer_obj->dibs_V_home); $supposed_host = str_replace("www.".DOMAIN_NAME,"",$supposed_host); $supposed_host = str_replace(".".DOMAIN_NAME,"",$supposed_host); $supposed_host = str_replace("www.","",$supposed_host); if($cur_host!=$supposed_host) { header("Location:http://".$dealer_obj->dibs_V_home."/store/furniture_search.php?FRID=".$FRID); exit(); } 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; } if($dealer_obj->dibs_V_20thleague=="Y") { $cur_tab = "TWTH"; } elseif($dealer_obj->dibs_V_aadla=="Y") { $cur_tab = "LEAGUE"; } $dealer_key = $dealer_obj->dibs_V_key; $dealer_open_hours = $dealer_obj->dibs_V_open_hours; $sellerID = $dealer_key; include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'FSD'; $track_data = "Dealer ".$decrypted." - page: ". (($rows>0)?(($start/$rows)+1):("1")); } else { if ($type==411) { $track_code = 'PR'; } else { $track_code = 'FS'; } $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="LEAGUE") { $track_code = "AADS"; } elseif($cur_tab=="TWTH") { $track_code = "TWDS"; } elseif($cur_tab=="PR") { $track_code = "PRDS"; } elseif($cur_tab=="SS") { $track_code = "SS"; } } } else { if ($type==411) { $track_code = 'PR'; } else { $track_code = 'FS'; } $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="LEAGUE") { $track_code = "AADS"; } elseif($cur_tab=="TWTH") { $track_code = "TWDS"; } elseif($cur_tab=="PR") { $track_code = "PRDS"; } elseif($cur_tab=="SD") { $track_code = "SOLD"; } elseif($cur_tab=="SS") { $track_code = "SS"; } } } } elseif (isset($FRID) && $FRID!="") { $decrypted = decrypt(($FRID),$crypt_key); //decrypts the data using the key if ($decrypted>0) { $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,dibs_V_home,dibs_V_open_hours from dibssellers where dibs_V_id='".$decrypted."'",$mylink); $dealer_nb = mysql_num_rows($dealer_info); if($dealer_nb==1) { $dealer_obj = mysql_fetch_object($dealer_info); if($HTTP_HOST!="www.".DOMAIN_NAME && $HTTP_HOST!=DOMAIN_NAME) { $cur_host = str_replace("www.".DOMAIN_NAME,"",$HTTP_HOST); $cur_host = str_replace(".".DOMAIN_NAME,"",$cur_host); $cur_host = str_replace("www.","",$cur_host); $supposed_host = str_replace("www.","",$dealer_obj->dibs_V_home); $supposed_host = str_replace("www.".DOMAIN_NAME,"",$supposed_host); $supposed_host = str_replace(".".DOMAIN_NAME,"",$supposed_host); $supposed_host = str_replace("www.","",$supposed_host); if($cur_host!=$supposed_host) { header("Location:http://".$dealer_obj->dibs_V_home."/store/furniture_search.php?FRID=".$FRID); exit(); } 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; } if($dealer_obj->dibs_V_20thleague=="Y") { $cur_tab = "TWTH"; } elseif($dealer_obj->dibs_V_aadla=="Y") { $cur_tab = "LEAGUE"; } $dealer_open_hours = $dealer_obj->dibs_V_open_hours; $dealer_key = $dealer_obj->dibs_V_key; $sellerID = $dealer_key; include("$pathtolibs/dealernavobjectkey.php"); $track_code = 'FSD'; $track_data = "Dealer ".$decrypted." - page: ". (($rows>0)?(($start/$rows)+1):("1")); } else { if ($type==411) { $track_code = 'PR'; } else { $track_code = 'FS'; } $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="LEAGUE") { $track_code = "AADS"; } elseif($cur_tab=="TWTH") { $track_code = "TWDS"; } elseif($cur_tab=="PR") { $track_code = "PRDS"; } elseif($cur_tab=="SS") { $track_code = "SS"; } } } else { if ($type==411) { $track_code = 'PR'; } else { $track_code = 'FS'; } $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="LEAGUE") { $track_code = "AADS"; } elseif($cur_tab=="TWTH") { $track_code = "TWDS"; } elseif($cur_tab=="PR") { $track_code = "PRDS"; } elseif($cur_tab=="SS") { $track_code = "SS"; } } } else { if ($type==411) { $track_code = 'PR'; } else { $track_code = 'FS'; } $track_data = "RL: $lastrelease - page: ". (($rows>0)?(($start/$rows)+1):("1")); if($cur_tab=="LEAGUE") { $track_code = "AADS"; } elseif($cur_tab=="TWTH") { $track_code = "TWDS"; } elseif($cur_tab=="PR") { $track_code = "PRDS"; } elseif($cur_tab=="SS") { $track_code = "SS"; } elseif($cur_tab=="SD") { $track_code = "SOLD"; } } if (!isset($i_creator) && !isset($section_decrypt) && !($section_decrypt>0) && $cur_tab!="NYDC" && $cur_tab!="LEAGUE" && $cur_tab!="NEW" && $cur_tab!="SS" && $cur_tab!="TWTH" && $cur_tab!="PR" && !$has_FRID && $stype!=2) { DEBUG::writeln("furniture search?"); if ($HTTP_HOST=="www2.".DOMAIN_NAME || $HTTP_HOST=="www.".DOMAIN_NAME || $HTTP_HOST==DOMAIN_NAME || $HTTP_HOST=="ag.".DOMAIN_NAME) { include("libraries/furniture_features.php"); } else { /* if(!isset($DIBSADD)) { $DIBSADD=rand(1,10); } else { $DIBSADD+=1; } setcookie("DIBSADD","$DIBSADD","0","/",COOKIE_SITE,0); */ } } else { /* if(!isset($DIBSADD)) { $DIBSADD=rand(1,10); } else { $DIBSADD+=1; } setcookie("DIBSADD","$DIBSADD","0","/",COOKIE_SITE,0); */ } 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"; $isreg = intval($isreg); $query = "select dibs_U_firstname,dibs_U_lastname,dibs_U_displaym from 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 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) { if ($cur_tab=="LEAGUE") { $numrows = 36; } elseif ($cur_tab=="TWTH") { $numrows = 36; } else { $numrows = 36; } } else { if ($cur_tab=="LEAGUE") { $numrows = 72; } elseif ($cur_tab=="TWTH") { $numrows = 75; } elseif ($cur_tab=="SD") { $numrows = 76; } elseif ($cur_tab=="NYDC") { $numrows = 84; } elseif ($cur_tab=="PR") { $numrows = 80; } else { $numrows = 120; } } if (isset($start) && isset($rows)) { $startlimit = $start; if($rows<=120) { $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=="TWTH" || $cur_tab=="LEAGUE") { if($i_creator!='' || $i_keyword!='' || (isset($maincat) && $maincat!=-1 && $maincat!="") || (isset($periodselect) && $periodselect!="" && $periodselect>0)) { $type = 2; } else { $type = 1; } } elseif($cur_tab=="PR") { $type = 1; } else { $type = 2; } } else { if(($cur_tab=="LEAGUE" || $cur_tab=="TWTH") && ($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($cur_tab=="LEAGUE") { $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)); } } 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"; if($cur_tab=="LEAGUE" && !($has_FRID)) { $ordering = " order by dibs_I_aadla_releasedate DESC,dibs_I_aadla_priority ASC"; } elseif($cur_tab=="TWTH" && !($has_FRID)) { $ordering = " order by dibs_I_20th_releasedate DESC,dibs_I_20th_priority ASC"; } elseif($cur_tab=="PR" && !($has_FRID)) { $ordering = " order by dibs_I_PR_releasedate DESC,dibs_I_PR_priority ASC"; } elseif($cur_tab=="NEW") { $ordering = " order by dibs_I_new_priority DESC"; } elseif($cur_tab=="NYDC") { $ordering = " order by dibs_I_nydc_priority DESC"; } elseif($cur_tab=="SS") { $ordering = " order by dibs_DA_dqID,dibs_DA_priority"; } 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), IF(dibs_I_currency='GBP',(dibs_I_price / $poundrate),dibs_I_price)) DESC,dibs_I_priority"; } 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($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"; } } } if ($cur_tab=="SS" || $cur_tab=="PR") { if($DQID<=0) { $DQID = SS_DQID; } if(!(isset($dqPage) && $dqPage>0)) { $dq_avail_chk = mysql_query("select SQL_CALC_FOUND_ROWS dibs_DA_id from designers_selections where dibs_DA_userID='{$DQID}' and dibs_DA_dqID=16 limit 0,1",$mylink); $dq_count_result = mysql_query("SELECT FOUND_ROWS() as total",$mylink); $dq_answer_nb = mysql_result($dq_count_result,0,"total"); if($dq_answer_nb>0) { $dqPage=16; } else { $dqPage=13; } } $DQID = intval($DQID); $adqs_query = "select * from designers_users where dibs_DU_id='{$DQID}'"; $adqs_result = mysql_query($adqs_query,$mylink); $adqs_nb = mysql_num_rows($adqs_result); if($adqs_nb==1) { $cur_userID = mysql_result($adqs_result,0,"dibs_DU_userID"); $ss_cur_name = mysql_result($adqs_result,0,"dibs_DU_label"); $cur_user_shopping_v2 = mysql_result($adqs_result,0,"dibs_DU_shopping_v2"); } else { $cur_userID = 23257; } if ($cur_tab == "SS" && $cur_user_shopping_v2 == 'Y') { header("Location: saturday_shopping.php?DQID=$DQID"); return; } // echo "cur_userID: $cur_userID
"; // echo 'search img:'.$cur_userID = mysql_result($adqs_result,0,"dibs_DU_search_img")."
"; if( $cur_tab=="PR") { $limit = " limit $startlimit,$endlimit"; } } else { $limit = " limit $startlimit,$endlimit"; } $item_search_constraints = ""; $solddate = $lastrelease - (86400*90); include("libraries/furniture_search_keys.php"); include("libraries/furniture_cat_keys.php"); // BEGIN REDIRECTS TO COMBINED SEARCHES // if (isset($section_decrypt) && $section_decrypt > 0) { if ($section_decrypt == 111) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/americana-folk-art-antiques-collectibles/"); } if ($section_decrypt == 24) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/scandinavian-design/"); } if ($section_decrypt == 76) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/mid-century-modern-vintage-american/"); } if ($section_decrypt == 28) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/rococo-furniture/"); } if ($section_decrypt == 29) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/neoclassical-furniture/"); } if ($section_decrypt == 23) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/biedermeier-furniture/"); } if ($section_decrypt == 27) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/regency-georgian-furniture-porcelain/"); } if ($section_decrypt == 34) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/italian-furniture-design/"); } if ($section_decrypt == 113) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/chinoiserie-asian-antiques/"); } if ($section_decrypt == 51) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/cabinet-of-curiosities/"); } if ($section_decrypt == 56) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/library/"); } if ($section_decrypt == 14) { header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.".DOMAIN_NAME."/collections/art-deco/"); } } // END REDIRECTS TO COMBINED SEARCHES // if(!$has_FRID && $cur_tab!="NEW") { $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 "; $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') "; $item_query .= " and dibs_I_onhold!='Y' "; if (!$has_FRID && $m!="A" && $cur_tab!="SD") { if($cur_tab=="SS" && $cur_userID>0 && $dqPage>0) { } elseif($cur_tab=="PR") { if($solds!=2) { $item_query .= " and ((dibs_I_status>0 and dibs_I_status<6 and dibs_V_display_solds='Y') or ( dibs_I_status=0 )) "; } else { $item_query .= " and dibs_I_status=0 "; } } elseif($cur_tab=="TWTH") { $item_query .= " and dibs_I_status=0 "; } elseif($cur_tab=="NYDC") { $item_query .= " and dibs_I_status=0 "; } else { if($cur_tab!="SS") { if($solds!=2) { if(isset($section_decrypt) && $section_decrypt>0) { $item_query .= " and ((dibs_I_status>0 and dibs_I_status<6 and dibs_V_display_solds='Y') or ( dibs_I_status=0 )) "; } else { $item_query .= " and ((dibs_I_status>0 and dibs_I_status<6 and dibs_I_releasedate>='{$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 { if($solds!=2) { if(isset($section_decrypt) && $section_decrypt>0) { $item_query .= " and ((dibs_I_status>0 and dibs_I_status<6 ".((!$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 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 "; } } } else { if($solds!=2) { if(isset($section_decrypt) && $section_decrypt>0) { //$item_query .= " and ((dibs_I_status>0 and dibs_I_status<6 and dibs_V_display_solds='Y') or ( dibs_I_status=0 )) "; } else { //$item_query .= " and ((dibs_I_status>0 and dibs_I_status<6 and dibs_I_releasedate>='{$solddate}' and dibs_V_display_solds='Y') or ( dibs_I_status=0 )) "; } } else { //$item_query .= " and dibs_I_status=0 "; } } if($cur_tab=="SS" && ($dqPage==4 || $dqPage==14)) { mysql_query("use stdib2;",$mylink); } elseif($cur_tab=="SS" && $dqPage==15) { mysql_query("use stdib3;",$mylink); } if(!$has_FRID && $cur_tab!="FD" && $cur_tab!="SS") { $count_dealers_query = "select dibs_I_sellerID " . $item_query . $item_search_constraints . $catkey . $subcatkey . $pkey . "group by dibs_I_sellerID"; //echo $count_dealers_query; 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"); $FRID = encrypt($cursearchsellerid,$crypt_key); $has_FRID = TRUE; $decrypted = $cursearchsellerid; $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_custom_priority,dibs_V_preferredlayout,dibs_V_home,dibs_V_open_hours from dibssellers where dibs_V_id='".$decrypted."'",$mylink); $dealer_nb = mysql_num_rows($dealer_info); if($dealer_nb==1) { $dealer_obj = mysql_fetch_object($dealer_info); if($dealer_obj->dibs_V_20thleague=="Y") { $cur_tab = "TWTH"; } elseif($dealer_obj->dibs_V_aadla=="Y") { $cur_tab = "LEAGUE"; } $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='$decrypted') "; 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_sellerID, dibs_I_storeID, dibs_I_hideprice, dibs_I_bargain, dibs_I_initialprice, dibs_I_price, dibs_I_creator, 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 ".(($cur_tab=="NYDC")?(",dibs_NYI_reference"):(""))." "; $item_query = "select SQL_CALC_FOUND_ROWS " . $item_columns . $item_query . $item_search_constraints . $catkey . $subcatkey . $pkey . $ordering . $limit; // echo " // // "; // $debug_str = htmlentities($item_query); //echo htmlentities($item_query).'
'; // DEBUG::lvar_dump("i_keyword:", $i_keyword); // DEBUG::lvar_dump("subSearchKey:", $subSearchKey); // DEBUG::lvar_dump("cur_tab ", $cur_tab); // DEBUG::lvar_dump("has_FRID: ", $has_FRID); // DEBUG::lvar_dump("section_decrypt: ", $section_decrypt); // DEBUG::lvar_dump("request ", $_REQUEST); if (USE_SOLR) { $use_solr = FALSE; //Hack for Solr search to translate the main cat passed to the page as a cat code into 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($I) && $I==1) $solr_maincat = "I"; if (isset($J) && $J==1) $solr_maincat = "J"; if (isset($K) && $K==1) $solr_maincat = "K"; if (isset($L) && $L==1) $solr_maincat = "L"; // echo "maincat: $maincat
"; // echo "subcat: $subcat
"; // var_dump($subcat_array); // var_dump($locations); // echo "
"; // echo "creator: $i_creator
"; // echo "cur_tab: $cur_tab
"; // echo "FRID: $has_FRID
"; // echo "section: $section_decrypt
"; // echo "st: $st
"; //If this IS a keyword search, NOT a cur_tab search, NOT a storefront, NOT a special search, and NOT a location search if(($type || $subSearchKey || ($locations) || $maincat || $subcat || count($subcat_array) > 0 || $eprice || $sprice) && $i_creator=='' && !$cur_tab && !$has_FRID && !$section_decrypt) { /** * SEARCH SOLR INSTEAD OF THE DB */ //Preapare solr params $use_solr = TRUE; $search_params = array( 'vertical' => "furniture", 'items_per_page' => $numresults ); if ($type == 1) $search_params['new_listings'] = 1; if ($subSearchKey) $search_params['keyword'] = $subSearchKey; if ($start > 0) $search_params['start'] = $start; 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; if (count($subcat_array) > 0) $search_params['subcat_array'] = $subcat_array; if ($periodselect && $periodselect != -1) { $search_params['period'] = $periodselect; } if ($sprice > 0) $search_params['minprice'] = $sprice; if ($eprice > 0) $search_params['maxprice'] = $eprice; if ($locations) $search_params['locations'] = $locations; if ($solds) $search_params['solds'] = $solds; if ($pricesort == "UP") { $sort_by = "sort_hide_price asc, sort_price asc, priority asc"; } else if ($pricesort == "DOWN") { $sort_by = "sort_hide_price asc, sort_price desc, priority asc"; } else { $sort_by = "sort_cs_status asc, releasedate desc, priority asc"; if ($pricesort == 'CONTACT') $search_params['hideprice'] = "Y"; } // if (($maincat && $maincat != -1) || ($subcat && $subcat != -1)) // $sort_by .= ", category asc"; $search_params['sort'] = $sort_by; //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); // echo "search_time: $search_time
"; } } } if (USE_SOLR === FALSE || $use_solr === FALSE) { /** * SEARCH THE DB */ //$query_start = microtime_float(); $item_result = mysql_query($item_query,$mylink); //$debug_str .= "

".($query_start - microtime_float()); $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 $item_total_nb; //Redirect to a specific item if there is only one result in the search if ($item_total_nb == 1 && $subSearchKey) { if ($item_objects && count($item_objects) == 1) { $itemID = $item_objects[0]->dibs_I_id; } else if ($item_result) { $itemID = mysql_result($item_result, 0, "dibs_I_id"); } if ($itemID > 0) { if ($has_FRID) { header("Location: /store/furniture_item_detail.php?id=$itemID"); } else { header("Location: /furniture_item_detail.php?id=$itemID"); } return; } } if($cur_tab=="SS" && ($dqPage==4 || $dqPage==14 || $dqPage==15)) { mysql_query("use stdib1;",$mylink); } 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; } // Build GA custom dealer var $custom_var['dealer'] = array(); if ($cur_tab != "SS") { if ($has_FRID) { if ($item_objects && count($item_objects) > 0) { $custom_var['dealer'][] = 'F'.$item_objects[0]->dibs_I_sellerID; } else if ($item_result) { $custom_var['dealer'][] = 'F'.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'][] = 'F'.$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'][] = 'F'.$dibs_I_sellerID; } else { break;} } mysql_data_seek($item_result, 0); } } } $pwform_count = 0; $formfields = ""; include("$pathtolibs/searchvars.php"); if (!$userreg && $cur_tab!="SS") { $file_mtime = filemtime(__FILE__); CacheControl::outputCacheHeaders($file_mtime); } ?> dibs_C_id])) { $sub_category_label = $cursubcat->dibs_C_label; break; } } mysql_data_seek($subcat_info, 0); } $curcatlabel = ""; $main_category_title = "Antique, Mid-century, Modern, Vintage Furniture and Lighting at 1stdibs"; $main_category_description = "Find vintage, mid-century, modern and antique furniture and lighting from the world's best dealers all on one site."; switch ($maincat) { case "A": $on_category_search = TRUE; $curcatlabel = "Seating"; $main_category_title = "Antique and Vintage Chairs at 1stdibs"; $main_category_description = "Find rare and beautiful vintage, mid-century, modern and antique chairs from the world's best dealers all on one site."; break; case "B": $on_category_search = TRUE; $curcatlabel = "Lighting"; $main_category_title = "Vintage Lamps, Lighting and Chandeliers at 1stdibs"; $main_category_description = "Find vintage, mid-century, modern and antique lamps, lighting and chandeliers from the world's best dealers all on one site."; break; case "C": $on_category_search = TRUE; $curcatlabel = "Tables"; $main_category_title = "Antique and Vintage Tables at 1stdibs"; $main_category_description = "Find rare and beautiful vintage, mid-century, modern and antique tables from the world's best dealers all on one site."; break; case "D": $on_category_search = TRUE; $curcatlabel = "Wall Decorations"; $main_category_title = "Vintage and Antique Wall Art and Decorations at 1stdibs"; $main_category_description = "Find beautiful and rare vintage and antique wall art and other decorations from the world's best dealers all on one site."; break; case "E": $on_category_search = TRUE; $curcatlabel = "Case Pieces"; $main_category_title = "Antique and Vintage Chests, Cabinets and Dressers at 1stdibs"; $main_category_description = "Find vintage, mid-century, modern and antique chests, cabinets, dressers and other set pieces from the world's best dealers all on one site."; break; case "F": $on_category_search = TRUE; $curcatlabel = "Building / Garden Elements"; $main_category_title = "Antique and Vintage Garden Furniture and Statuary at 1stdibs"; $main_category_description = "Find beautiful and rare antique and vintage garden furniture and other staturary from the world's best dealers all on one site."; break; case "G": $on_category_search = TRUE; $curcatlabel = "Other Categories"; $main_category_title = "Antique Figurines and Collectibles at 1stdibs"; $main_category_description = "Find rare and beautiful antique figurines and home collectibles from the world's best dealers all on one site."; break; case "H": $on_category_search = TRUE; $curcatlabel = "Serving / Ceramics / Porcelain / Glass"; $main_category_title = "Antique and Vintage Ceramics and Silver at 1stdibs"; $main_category_description = "Find vintage, mid-century, modern and antique ceramics, silver and other serving pieces from the world's best dealers all on one site."; break; case "I": $on_category_search = TRUE; $curcatlabel = "Folk Art"; $main_category_title = "Antique and Vintage Folk Art at 1stdibs"; $main_category_description = "Find rare and beautiful folk art and other Americana from the world's best dealers all on one site."; break; case "J": $on_category_search = TRUE; $curcatlabel = "Carpets"; $main_category_title = "Antique Rugs and Vintage Carpets at 1stdibs"; $main_category_description = "Find beautiful and rare antique rugs and vintage carpets from the world's best dealers all on one site."; break; case "K": $on_category_search = TRUE; $curcatlabel = "Mirrors"; $main_category_title = "Antique and Vintage Mirrors at 1stdibs"; $main_category_description = "Find beautiful and rare vintage, mid-century, modern and antique mirrors from the world's best dealers all on one site."; break; case "L": $on_category_search = TRUE; $curcatlabel = "Asian Art"; $main_category_title = "Antique Asian Art and Sculpture at 1stdibs"; $main_category_description = "Find rare and beautiful Asian art and sculpture from the world's best deailers all on one site."; break; } // END FIND MAIN AND SUB-CATEGORIES // ===================================================================================================================== 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"); } } $FRID_title = ''; $creator_title = ''; if ($i_creator!='') { if ($has_FRID) { $creator_title = (stripslashes($dealer_company)." Furniture Search: "); } else { //$creator_title = "1stdibs Furniture Search: "; } switch($i_creator) { case 'Jansen': $creator_title .= 'Maison Jansen'; break; case 'Paul Evans': $creator_title .= 'Paul Evans Furniture'; break; case 'Robsjohn Gibbings': $creator_title .= 'T.H. Robsjohn Gibbings'; default: $creator_title .= urldecode(stripslashes($i_creator)); break; } $creator_title .= ' Furniture and Pieces at 1stdibs'; echo "" . $creator_title; //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(stripslashes($i_creator))))))))." ".(($item_total_nb!=1)?("pieces"):("piece"))." for sale"; if($has_FRID && $m=="F") { echo " on 1stdibs"; } echo ""; } else { if($has_FRID) { $FRID_title = stripslashes($dealer_company); if (!($HTTP_HOST!="www.".DOMAIN_NAME && $HTTP_HOST!=DOMAIN_NAME)) { if (isset($dealernav_object->dibs_ST_city) && isset($dealernav_object->dibs_ST_state)) { $FRID_title .= " - " . $dealernav_object->dibs_ST_city . ', ' .$dealernav_object->dibs_ST_state; } } echo "". $FRID_title .""; } else { if($cur_tab=="LEAGUE") { echo "1STDIBS.COM - Antique, Mid-century, Modern, Vintage Furniture and Lighting - LEAGUE ". (($curcatlabel!="")?("Searching ".$curcatlabel):(((isset($oldst) && $oldst>0 && $cur_state_label!="")?("Searching ".$cur_state_label):("search results")))).""; } elseif($cur_tab=="NYDC") { echo "1STDIBS@NYDC - Antique, Mid-century, Modern, Vintage Furniture and Lighting - ".(($curcatlabel!="")?("Searching ".$curcatlabel):(((isset($oldst) && $oldst>0 && $cur_state_label!="")?("Searching ".$cur_state_label):("search results")))).""; } elseif($cur_tab=="TWTH") { echo "1STDIBS.COM - Antique, Mid-century, Modern, Vintage Furniture and Lighting - 20th century specialists ".(($curcatlabel!="")?("Searching ".$curcatlabel):((($type==1)?("featured items"):(((isset($oldst) && $oldst>0 && $cur_state_label!="")?("Searching ".$cur_state_label):("search results")))))).""; } else { if(isset($section_decrypt) && $section_decrypt>0) { $section_result = mysql_query("select * from dibssection where s_id='".$section_decrypt."'",$mylink); $section_nb = mysql_num_rows($section_result); if($section_nb==1) { $section_label = htmlentities(trim(stripslashes(mysql_result($section_result,0,"s_name")))); } else { $section_label = "Curated Search"; } if(!stripos($section_label,"furniture")) { $section_label .= " Furniture"; } /** * todo: remove this hard-coded hack once testing is complete * This file implements a temporary measure to test the effectiveness of title tag changes in PPC campaigns on * Google. See https://1stdibs.atlassian.net/browse/SEO-6 for the low-down. */ include('libraries/seo-6-hardcoded-test-titles.php'); renderHardcodedTestTitle($section_label, $pagenum, $section_decrypt, $item_total_nb); } else { if($cur_tab=="SS") { echo "1STDIBS.COM - Saturday Shopping with ".$ss_cur_name.""; } else { if ($on_category_search) { if (isset($sub_category_label)) { echo "Antique and Vintage ".$sub_category_label." at 1stdibs"; } else { echo "".$main_category_title.""; } } else { echo "Antique, Vintage, Mid-Century and Modern Furniture at 1stdibs"; // you should never do this! echo ( $curcatlabel != "" ? " - Searching ".$curcatlabel : ( isset($oldst) && $oldst > 0 && $cur_state_label != "" ? " - Searching ".$cur_state_label . ", page ".$pagenum : ( $cur_tab == "PR" ? "- Saturday Sale, page ".$pagenum : "" ) ) ); echo ""; } } } } } } ?> '; } else { $desc_suffix = "The world's best dealers are on 1stdibs."; if ($on_category_search) { if ($sub_category_label) { echo ''; } else { echo ''; } } else { echo ""; } } ?> 0 && $cur_state_label!="")?("Searching ".$cur_state_label):("search results")))).""; } elseif($cur_tab=="NYDC") { echo "1STDIBS@NYDC - Antique, Mid-century, Modern, Vintage Furniture and Lighting - ".(($curcatlabel!="")?("Searching ".$curcatlabel):(((isset($oldst) && $oldst>0 && $cur_state_label!="")?("Searching ".$cur_state_label):("search results")))).""; } elseif($cur_tab=="TWTH") { echo "1STDIBS.COM - Antique, Mid-century, Modern, Vintage Furniture and Lighting - 20th century specialists ".(($curcatlabel!="")?("Searching ".$curcatlabel):(((isset($oldst) && $oldst>0 && $cur_state_label!="")?("Searching ".$cur_state_label):("search results")))); } else { if(isset($section_decrypt) && $section_decrypt>0) { echo "1STDIBS.COM - ".$section_label." - ".$item_total_nb." items, page ".$pagenum; } else { if($cur_tab=="SS") { echo "1STDIBS.COM - Saturday Shopping with ".$ss_cur_name; } else { echo "1STDIBS.COM - Antique, Mid-century, Modern, Vintage Furniture and Lighting - ".(($curcatlabel!="")?("Searching ".$curcatlabel):(((isset($oldst) && $oldst>0 && $cur_state_label!="")?("Searching ".$cur_state_label):((($type==1)?("New Listings"):("Search Results")))))).", page ".$pagenum; } } } } } ?>"> "; } else { echo ""; } $menu_width = "1150px"; $menu_show_logo = TRUE; $menu_show_nl = FALSE; $menu_bg = "#000000"; $showSeparators = FALSE; $separatorColor = "#666666"; $mainTabPadding = "2px"; $mainTabWidth = "121px"; $menu_show_pad = TRUE; $menu_pad_width = "200px"; $menuFontSize = "11px"; $menu_selected_tab = "F"; require_once($pathtolibs."/general_menuBar_styles_new.php"); require_once("libraries/furniture_style.php"); if($has_FRID) { echo ""; } ?>
"; echo " "; include("libraries/furniture_ss.php"); echo " "; /*echo "
";*/ echo "
"; echo ""; if($adqs_nb==1) { echo mysql_result($adqs_result,0,"dibs_DU_imgmap"); } else { echo " "; } echo ""; echo ""; echo ""; echo ""; } ?> dibs_DQ_id; if($tmpdqCount>0) { mysql_query("use ".$dq_info->dibs_DQ_database,$mylink); $my_result = mysql_query("select * from designers_selections where dibs_DA_userID='{$cur_userID}' and dibs_DA_dqID='{$tmpdqCount}' order by dibs_DA_priority",$mylink); $my_nb = mysql_num_rows($my_result); if ($my_nb>0) { echo ""; } mysql_query("use stdib1",$mylink); } } } if($dqPage==13 || $dqPage==16) { if($dq_result = mysql_query("select dibs_DQ_id from designers_questions where dibs_DQ_status='ENABLED' and dibs_DQ_top='Y' and dibs_DQ_id!='$dqPage' order by dibs_DQ_priority",$mylink)) { while($dq_info = mysql_fetch_object($dq_result)) { $tmpdqCount = $dq_info->dibs_DQ_id; if($tmpdqCount>0) { mysql_query("use ".$dq_info->dibs_DQ_database,$mylink); $my_result = mysql_query("select * from designers_selections where dibs_DA_userID='{$cur_userID}' and dibs_DA_dqID='{$tmpdqCount}' order by dibs_DA_priority",$mylink); $my_nb = mysql_num_rows($my_result); if ($my_nb>0) { echo ""; } mysql_query("use stdib1",$mylink); } } } } } ?>
"; switch($tmpdqCount) { case "1": echo "
"; break; case "2": echo "
"; break; case "4": echo "
"; break; case "5": echo "
"; break; case "6": echo "
"; break; case "7": echo "
"; break; case "8": echo "
"; break; case "9": echo "
"; break; case "10": echo "
"; break; case "12": echo "
"; break; case "11": echo "
"; break; case "13": echo "
"; break; case "14": echo "
"; break; case "15": echo "
"; break; default: break; } echo "
"; $cur_dqPage = $tmpdqCount; include("libraries/furniture_sshopping.php"); echo "
 
"; switch($tmpdqCount) { case "1": echo "
"; break; case "2": echo "
"; break; case "4": echo "
"; break; case "5": echo "
"; break; case "6": echo "
"; break; case "7": echo "
"; break; case "8": echo "
"; break; case "9": echo "
"; break; case "10": echo "
"; break; case "12": echo "
"; break; case "11": echo "
"; break; case "13": echo "
"; break; case "14": echo "
"; break; case "15": echo "
"; break; default: break; } echo "
"; $cur_dqPage = $tmpdqCount; include("libraries/furniture_sshopping.php"); echo "
 
"; echo ""; echo "
"; $dqs_query = "select * from designers_users where dibs_DU_livestatus='ACTIVE' order by dibs_DU_priority"; $dqs_result = mysql_query($dqs_query,$mylink); $dqs_nb = mysql_num_rows($dqs_result); if($dqs_nb>0) { $dqs_count = 0; echo "
"; echo "

Saturday Shopping with:

"; echo "
"; echo ""; } echo ""; echo ""; 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 "
"; mysql_close($mylink); $time_end = microtime_float(); $time = $time_end - $time_start; echo "\n\n"; ?>