public function postSearchUser(Request $request) { $keywords = $request->input('keywords'); $users = User::all(); $searchUsers = new \Illuminate\Database\Eloquent\Collection(); if ($keywords == null) { return view::make('admin.searchedUsers')->with('searchUsers', $users); } foreach ($users as $user) { if (Str_contains(Strtolower($user->username), Strtolower($keywords))) { $searchUsers->add($user); } } return view::make('admin.searchedUsers')->with('searchUsers', $searchUsers); }
public function postSearch(Request $request) { $keywords = \Request::input('keywords'); $tag = Tag::findOrFail($request->tag); $courses = $tag->courses()->published()->done()->latest('published_at')->get(); $searchCourses = new \Illuminate\Database\Eloquent\Collection(); if ($keywords == null) { return view::make('courses.searchedCourses')->with('searchCourses', $courses); } foreach ($courses as $course) { if (Str_contains(Strtolower($course->title), Strtolower($keywords))) { $searchCourses->add($course); } } return View::make('courses.searchedCourses')->with('searchCourses', $searchCourses); }
function get_validate_logs() { $valid_logs = array("err_color" => 0, "err_float" => 0); $this->color = strip_tags($this->color); $this->description = strip_tags($this->description); $this->color = Trim($this->color); $this->height = Trim($this->height); $this->width = Trim($this->width); $this->price = Trim($this->price); $this->color = Strtolower($this->color); $pattern_color = "/^\\D{4,}\$/i"; $pattern_float = "/^\\d+(\\.\\d+|)\$/i"; if (!preg_match($pattern_color, $this->color)) { $valid_logs["err_color"] = 1; } if (!preg_match($pattern_float, $this->height) or !preg_match($pattern_float, $this->width) or !preg_match($pattern_float, $this->price)) { $valid_logs["err_float"] = 1; } return $valid_logs; }
/** * Constructor of the object. * Generates the table for ANSEL to Unicode mapping. * @param String $conversionFile The name of the mapping file made by Heiner Eichmann. * The file can be downloaded FROM this URL: * http://www.heiner-eichmann.de/gedcom/ans2uni.con.zip */ public function __construct($conversion_file = 'ans2uni.con') { $temp_ini_file = 'mappings.ini'; // Name of temporary ini file if (File_exists($conversion_file)) { // Load file contents, convert into well-formed ini file for later parsing. // This is done because the original mapping file cannot be parsed by the // PHP function parse_ini_file. $file_contents = File_get_contents($conversion_file, 'FILE_BINARY'); // Load contents $file_contents = $this->strip_comments($file_contents, '#'); // Strip comments File_put_contents($temp_ini_file, $file_contents); // Save contents // Get ini contents $map = Parse_ini_file($temp_ini_file); // Parse ini file // Go through map to split up the mappings that contain more characters in the key, // so that mappings with one character goes into $this->mapping[1], those with two // characters goes to $this->mapping[2] etc. foreach ($map as $key => $value) { $characters = explode('+', $key); // Split string where '+' occurrs $num_chars = count($characters); // count number of characters $this->_mapping[$num_chars][Strtolower($key)] = $value; // Put mapping in right place } // Delete temporary ini file efterwards if exists if (File_exists($temp_ini_file)) { Unlink($temp_ini_file); } } else { echo '<p>No mapping file with name ' . $conversion_file . ' exists. Download this file ' . 'from <a href="http://www.heiner-eichmann.de/gedcom/ans2uni.con.zip">here</a>.'; } }
if ($x111022oo[0] == 'BD') { $x111022oo[0] = 'BG'; } ?> <tbody> <tr> <td> <?php echo $j + $startid; ?> </td> <td> <img src="https://www.cia.gov/library/publications/the-world-factbook/graphics/flags/large/<?php echo Strtolower($x111022oo[0]); ?> -lgflag.gif" border="0" title="Country : <?php echo $userp->country; ?> " height="16" width="24" > <?php echo $userp->login; ?> </td> <td> <b><font color="green" size="<?php echo 2 + $site->cash; ?> "> $ <?php echo $site->cash;
public function SetPanelSettings() { $count = 0; $output = ""; $params = $GLOBALS['ISC_CLASS_SEARCH']->_searchterms; $this->searchterms = $params; $path = GetConfig('ShopPath'); /* the below mmy links are passed to the breadcrumbs */ $mmy_links = ""; /*---------- This below section is for generating search phrase----------*/ $GLOBALS['Category'] = ""; $GLOBALS['MMY'] = ""; $GLOBALS['PQ'] = ""; $GLOBALS['VQ'] = ""; $GLOBALS['SearchPhrase'] = ""; $ext_links = ""; // this variable is passed to the product detail page $seo_delim = "&"; if ($GLOBALS['EnableSEOUrls'] == 1) { $seo_delim = "/"; } if (isset($GLOBALS['ISC_SRCH_CATG_NAME'])) { $GLOBALS['Category'] .= $GLOBALS['ISC_SRCH_CATG_NAME']; } if (isset($params['year'])) { $GLOBALS['MMY'] .= $params['year'] . "<br>"; $ext_links .= $seo_delim . "year=" . $params['year']; } if (isset($params['make'])) { $GLOBALS['MMY'] .= strtoupper($params['make']) . "<br>"; $ext_links .= $seo_delim . "make=" . $params['make']; } if (isset($_REQUEST['model']) && !empty($_REQUEST['model']) && (!isset($params['model_flag']) || $params['model_flag'] != 0)) { $GLOBALS['MMY'] .= strtoupper($_REQUEST['model']) . "<br>"; $ext_links .= $seo_delim . "model=" . strtoupper($params['model']); } else { if (isset($params['model'])) { $ext_links .= $seo_delim . "model=" . $params['model']; } } /* this condition has been added seperately here to show submodel at last */ if (isset($params['submodel'])) { $GLOBALS['MMY'] .= strtoupper($params['submodel']) . "<br>"; } /*if(isset($params['year'])) { $ext_links .= $seo_delim."year=".$params['year']; }*/ if (isset($params['dynfilters']) && !empty($params['dynfilters'])) { foreach ($params['dynfilters'] as $key => $value) { if (eregi('vq', $key)) { $key = str_ireplace('vq', '', $key); $GLOBALS['VQ'] .= ucfirst($key) . ": {$value}<br>"; } else { if (eregi('pq', $key)) { $key = str_ireplace('pq', '', $key); $GLOBALS['PQ'] .= ucfirst($key) . ": {$value}<br>"; } } } } $filter_var = array('vq', 'pq'); /* this below patch is used for getting description of the category. Here currently the selected category id will be last one in the $params['srch_category'] array. if input['category'] is used then it will be the first one */ if (!empty($params['srch_category'])) { if (isset($params['category'])) { $selected_catg = $params['srch_category'][0]; } else { $selected_catg = end($params['srch_category']); } $catg_desc_qry = "select catdesc from [|PREFIX|]categories where categoryid = " . $selected_catg; $catg_desc_res = $GLOBALS['ISC_CLASS_DB']->Query($catg_desc_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($catg_desc_res) > 0) { $catg_desc_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_desc_res); } /* this below patch is used to show the display name for the qualifiers from the qualifier association table */ $map_names = array(); $display_names = array(); $filter_names = "select qid , column_name , display_names from [|PREFIX|]qualifier_names where column_name regexp '^(pq|vq)'"; $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names); while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) { $map_names[$filter_row['qid']] = $filter_row['column_name']; $display_names[$filter_row['qid']] = $filter_row['display_names']; } $this->GetAssocDetails($selected_catg, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue); } // for breadcrumbs $this->_BuildBreadCrumbs(); /* the below line has been commented as client told to remove it */ //$GLOBALS['SearchPhrase'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchPhrase"); if ($GLOBALS['ISC_CLASS_SEARCH']->GetNumResults() > 30) { $msg_qry = "select value from [|PREFIX|]display where messageid = 1"; $msg_res = $GLOBALS['ISC_CLASS_DB']->Query($msg_qry); $msg_row = $GLOBALS['ISC_CLASS_DB']->FetchOne($msg_res); $GLOBALS['SearchPhrase'] = $msg_row; //$GLOBALS['SearchPhrase'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchPhrase"); } /*if(!empty($params['dynfilters'])) $GLOBALS['SearchPhrase'] .= " ".implode(" ",$params['dynfilters']); /*---------- Ending section for generating search phrase----------*/ $vq_column_title = ""; $GLOBALS['SearchResultList'] = ""; if ($GLOBALS['ISC_CLASS_SEARCH']->GetNumResults() > 0) { // We have at least one result, let's show it to the world! $GLOBALS['HideNoResults'] = "none"; // Only show the "compare" option if there are 2 or more products on this page if (GetConfig('EnableProductComparisons') == 0 || $GLOBALS['ISC_CLASS_DB']->CountResult($GLOBALS['SearchResults']) < 2) { $GLOBALS['HideCompareItems'] = "none"; } if (GetConfig('EnableProductReviews') == 0) { $GLOBALS['HideProductRating'] = "display: none"; } $GLOBALS['AlternateClass'] = ''; $counter = 1; $CurCatId = 0; $mmy_links = $this->GetYMMLinks($params); $mmy_links .= $this->GetOtherLinks($params); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($GLOBALS['SearchResults'])) { /* Added by Simha to check inf prodcucts comes from different categories*/ if (empty($params['srch_category']) || !isset($params['srch_category'])) { if ($CurCatId != $row['categoryid']) { $CurCatId = $row['categoryid']; $map_names = array(); $display_names = array(); $filter_names = "SELECT DISTINCT qn.qid, qn.column_name, qn.display_names from \n [|PREFIX|]qualifier_names qn\n LEFT JOIN [|PREFIX|]qualifier_associations qa ON qa.qualifierid = qn.qid\n WHERE (qa.categoryid = '{$CurCatId}') \n AND qn.column_name regexp '^(pq|vq)'"; // || qa.categoryid IN (SELECT catparentid FROM isc_categories WHERE categoryid = '$CurCatId') $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names); while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) { $map_names[$filter_row['qid']] = $filter_row['column_name']; $display_names[$filter_row['qid']] = $filter_row['display_names']; } $this->GetAssocDetails($CurCatId, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue); } } /* Added by Simha Ends */ $GLOBALS['SearchTrackClass'] = "TrackLink"; $imagefile = ""; if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $qry_string = $_SERVER['QUERY_STRING']; if (isset($_GET['page'])) { $page = "&page=" . $_GET['page']; $qry_string = str_ireplace($page, '', $qry_string); } if ($GLOBALS['EnableSEOUrls'] == 1) { if (isset($_GET['search_key'])) { $qry_string = str_ireplace('&search_key=' . $_GET['search_key'], '', $qry_string); } if (isset($params['search_query']) && !strstr($qry_string, 'search_query=')) { $qry_string .= "search_query=" . MakeURLSafe($params['search_query']); } if (isset($params['make']) && !strstr($qry_string, 'make=')) { $qry_string .= "&make=" . MakeURLSafe($params['make']); } if (isset($params['model']) && !strstr($qry_string, 'model=')) { $qry_string .= "&model=" . MakeURLSafe($params['model']); } if (isset($params['year']) && !strstr($qry_string, 'year=')) { $qry_string .= "&year=" . MakeURLSafe($params['year']); } if (isset($params['make']) && !strstr($qry_string, 'make=')) { $qry_string .= "&make=" . MakeURLSafe($params['make']); } if (isset($params['model_flag']) && !strstr($qry_string, 'model_flag=')) { $qry_string .= "&model_flag=" . MakeURLSafe($params['model_flag']); } if (isset($params['submodel']) && !strstr($qry_string, 'submodel=')) { $qry_string .= "&submodel=" . MakeURLSafe($params['submodel']); } } if (isset($params['partnumber']) || $params['flag_srch_category'] == 1 || isset($params['flag_srch_category']) && isset($GLOBALS['BRAND_SERIES_FLAG']) && $GLOBALS['BRAND_SERIES_FLAG'] == 1) { if (isset($params['srch_category'])) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of product listing page. } $GLOBALS['ProductCartQuantity'] = ''; if (isset($GLOBALS['CartQuantity' . $row['productid']])) { $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']]; } if ($counter % 2 == 0) { $GLOBALS['RowColor'] = 'grayrow'; } else { $GLOBALS['RowColor'] = 'whiterow'; } $counter++; $GLOBALS['ProductId'] = (int) $row['productid']; $GLOBALS['ProductName'] = isc_html_escape($row['prodname']); $GLOBALS['ProductLink'] = ProdLink($row['prodname']); $GLOBALS['ProductRating'] = (int) $row['prodavgrating']; $GLOBALS['BrandName'] = $row['brandname']; $GLOBALS['ProdCode'] = $row['prodcode']; //$GLOBALS['ProdDesc'] = $this->strip_html_tags($row['proddesc']); //$GLOBALS['ProdOptions'] = $row['productoption']; $GLOBALS['VehicleOptions'] = ""; $GLOBALS['ProdOptions'] = ""; foreach ($row as $key => $val) { if ($val != "" && $val != "~") { if (($qualifier_id = array_search($key, $map_names)) !== false) { if (eregi('^vq', $key)) { $val = trim($val, "~"); $val = preg_split('/[~;]+/', $val); $val = array_unique($val); $val = array_values($val); $val = implode(",", $val); /* -- Setting display name for qualifier name -- */ if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') { $key = $OwnAssoc[$qualifier_id][0]['qname']; } else { if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') { $key = $ParentAssoc[$qualifier_id][0]['qname']; } else { if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) { $key = $display_names[$qualifier_id]; } else { $key = ucfirst(str_ireplace($filter_var, "", $key)); } } } /* -- Setting display name for qualifier name ends -- */ /* -- Setting display name for qualifier value -- */ if (($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != "") { $val = $OwnAssoc[$qualifier_id][$m]['vname']; } else { if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentAssoc[$qualifier_id][$m]['vname'] != "") { $val = $ParentAssoc[$qualifier_id][$m]['vname']; } } /* -- Setting display name for qualifier value ends-- */ $GLOBALS['VehicleOptions'] .= $key . " : " . $val . "<br>"; } if (eregi('^pq', $key)) { $val = trim($val, "~"); $val = preg_split('/[~;]+/', $val); $val = array_unique($val); $val = array_values($val); $val = implode(",", $val); /* -- Setting display name for qualifier name -- */ if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') { $key = $OwnAssoc[$qualifier_id][0]['qname']; } else { if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') { $key = $ParentAssoc[$qualifier_id][0]['qname']; } else { if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) { $key = $display_names[$qualifier_id]; } else { $key = ucfirst(str_ireplace($filter_var, "", $key)); } } } /* -- Setting display name for qualifier name ends -- */ /* -- Setting display name for qualifier value -- */ if (isset($OwnValue[$qualifier_id]) && ($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != '') { $val = $OwnAssoc[$qualifier_id][$m]['vname']; } else { if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentValue[$qualifier_id][$m]['vname'] != '') { $val = $ParentAssoc[$qualifier_id][$m]['vname']; } } /* -- Setting display name for qualifier value ends-- */ $GLOBALS['ProdOptions'] .= $key . " : " . $val . "<br>"; } } } } if (isset($row['vehicleoption'])) { $GLOBALS['VehicleOptions'] = $row['vehicleoption']; } if (isset($row['productoption'])) { $GLOBALS['ProdOptions'] = $row['productoption']; } if (isset($row['catuniversal']) && $row['catuniversal'] == 1) { $GLOBALS['VehicleOptions'] = $GLOBALS['ProductName']; if ($vq_column_title == "") { $vq_column_title = "Product Name"; } else { if ($vq_column_title != "Product Name") { $vq_column_title = "Product Name / Vehicle Options"; } } } else { if ($vq_column_title == "") { $vq_column_title = "Vehicle Options"; } else { if ($vq_column_title != "Vehicle Options") { $vq_column_title = "Product Name / Vehicle Options"; } } } if (empty($GLOBALS['VehicleOptions'])) { $GLOBALS['VehicleOptions'] = " "; } if (empty($GLOBALS['ProdOptions'])) { $GLOBALS['ProdOptions'] = " "; } /*--- the below lines are added for back 2 search link in the product detail page. Also modified line no 56 & 60 --- */ if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductLink'] .= "/refer=true" . $ext_links; } else { $GLOBALS['ProductLink'] .= "&refer=true" . $ext_links; } ### Added by Simha for onsale addition // Determine the price of this product //$GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row); $GLOBALS['ProductPrice'] = CalculateProductPriceRetail($row); $FinalPrice = $GLOBALS['ProductPrice']; $SalePrice = $row['prodsaleprice']; //$DiscountAmount = $FinalPrice; if ((double) $SalePrice > 0 && $SalePrice < $FinalPrice) { $DiscountPrice = $SalePrice; } else { $DiscountPrice = $FinalPrice; $DiscountPrice = CalculateDiscountPrice($FinalPrice, $DiscountPrice, $row['categoryid'], $row['brandseriesid']); } /* foreach($DiscountInfo as $DiscountInfoSub) { if(isset($DiscountInfoSub['catids'])) { $catids = explode(",", $DiscountInfoSub['catids']); foreach($catids as $catid) { if($catid == $row['categoryid']) { $DiscountAmount = $FinalPrice * ((int)$DiscountInfoSub['amount']/100); if ($DiscountAmount < 0) { $DiscountAmount = 0; } $DiscountPrice = $FinalPrice - $DiscountAmount; } } } } */ if (isset($DiscountPrice) && $DiscountPrice < $FinalPrice) { //&& GetConfig('ShowOnSale') $GLOBALS['ProductPrice'] = '<strike>' . CurrencyConvertFormatPrice($FinalPrice) . '</strike>'; $GLOBALS['ProductPrice'] .= '<br>' . CurrencyConvertFormatPrice($DiscountPrice) . ''; $GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; if (GetConfig('ShowOnSale')) { $GLOBALS['ProductPrice'] .= '<br>' . $GLOBALS['ShowOnSaleImage'] . ''; } } else { $GLOBALS['ProductPrice'] = '' . CurrencyConvertFormatPrice($FinalPrice) . ''; } ### Added by Simha Ends // commented the below line by vikas //$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname'])); $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], $GLOBALS['ProductLink']); if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) { //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas $GLOBALS['ProductURL'] = $GLOBALS['ProductLink']; $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink'); } else { //$GLOBALS['ProductURL'] = CartLink($row['productid']); //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas $GLOBALS['ProductURL'] = $GLOBALS['ProductLink']; //blessen if (intval($row['prodretailprice']) <= 0) { //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); // commented by vikas on 15-7-09 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>"; } else { //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1'); // commented by vikas on 15-7-09 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>"; } //blessen // original $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); } if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) { $GLOBALS['HideActionAdd'] = ''; } else { $GLOBALS['HideActionAdd'] = 'none'; } $GLOBALS['HideProductVendorName'] = 'display: none'; $GLOBALS['ProductVendor'] = ''; if (GetConfig('ShowProductVendorNames') && $row['prodvendorid'] > 0) { $vendorCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Vendors'); if (isset($vendorCache[$row['prodvendorid']])) { $GLOBALS['ProductVendor'] = '<a href="' . VendorLink($vendorCache[$row['prodvendorid']]) . '">' . isc_html_escape($vendorCache[$row['prodvendorid']]['vendorname']) . '</a>'; $GLOBALS['HideProductVendorName'] = ''; } } $GLOBALS['CartURL'] = CartLink($row['productid']); $offer = $this->IsProductMakeanOffer($row['brandseriesid'], $row['brandname'], $row['categoryid']); if ($offer == 'yes') { $GLOBALS['HideOfferButton'] = 'block'; } else { $GLOBALS['HideOfferButton'] = 'none'; } $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItem"); } else { if ($GLOBALS['results_page_flag'] == 0) { $subcatg_link = $this->LeftCatLink($mmy_links, 'subcategory', $row['catname']); $link = "<a href='" . $subcatg_link . "'>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); for ($j = 0; $j < count($images); $j++) { if (!empty($images[$j])) { $imagefile = "{$link}<img src='{$path}/category_images/" . $images[$j] . "'></a>"; break; } } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$link}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; } } $GLOBALS['LeftImage'] = $imagefile; $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); //$GLOBALS['RelatedBrands'] = $row['brandname']; if (!empty($row['seriesname'])) { $row['brandname'] .= "<br>" . $row['seriesname']; } if ($row['seriesids'] != "") { $seriesids = str_ireplace("~", ",", $row['seriesids']); $seriesids_qry = "select brandname , seriesname from isc_brand_series bs left join isc_brands b on bs.brandid = b.brandid where seriesid in (" . $seriesids . ")"; $seriesids_res = $GLOBALS['ISC_CLASS_DB']->Query($seriesids_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($seriesids_res) > 0) { while ($seriesids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($seriesids_res)) { if (!isset($params['brand'])) { if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductsCount'] .= "<br><a href='" . $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "'>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $GLOBALS['ProductsCount'] .= "<br><a href='" . $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "'>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } else { if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductsCount'] .= "<br><a href='" . $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "'>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $GLOBALS['ProductsCount'] .= "<br><a href='" . $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "'>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } } } } $content = $row['brandname'] . "<br>"; if (!isset($params['category']) && (isset($params['srch_category']) || !isset($GLOBALS['BRAND_SERIES_FLAG']))) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of subcatg page. $content .= "<h3><a href='" . $path . "/search.php?{$qry_string}&subcategory=" . MakeURLSafe($row['catname']) . "'>" . $row['catname'] . "</a></h3>>"; $GLOBALS['TitleLink'] = "<h2><a href='" . $subcatg_link . "'>" . $row['catname'] . "</a></h2>"; } $content .= "Price starting from \$" . number_format($row['prodcalculatedprice'], 2, '.', '') . "<br>" . $imagefile; $GLOBALS['leftsidecontent'] = $content; $GLOBALS['PriceRange'] = "Price starting from \$" . number_format($row['prodcalculatedprice'], 2, '.', ''); $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $content = "{$link}<img src='{$path}/templates/default/images/view.gif'></a>"; $GLOBALS['ViewDetailsImage'] = $content; if (IsDiscountAvailable('category', $row['categoryid'])) { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } if ($this->IsMakeAnOffer('category', $row['categoryid']) == 'yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } $GLOBALS['lowersidecontent'] = $content; $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListing"); } else { $series_link = $this->LeftCatLink($mmy_links, 'series', $row['seriesname']); $link = "<a href='" . $series_link . "'>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); for ($j = 0; $j < count($images); $j++) { if (!empty($images[$j])) { $imagefile = "{$link}<img src='{$path}/category_images/" . $images[$j] . "'></a>"; break; } } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$link}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; } } $GLOBALS['LeftImage'] = $imagefile; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); $GLOBALS['RelatedBrands'] = $row['brandname']; if (isset($row['seriesname']) && !empty($row['seriesname']) && (!isset($params['srch_category']) || isset($params['category'])) && isset($GLOBALS['BRAND_SERIES_FLAG'])) { if (empty($row['imagefile']) || empty($imagefile)) { $GLOBALS['LeftImage'] = "{$link}<img src='{$path}/templates/default/images/ProductDefault.gif'></a>"; } else { $GLOBALS['LeftImage'] = "{$link}<img src='{$path}/series_images/" . $row['imagefile'] . "' width='140px'></a>"; } $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; //"<h3>".$row['catname']."</h3> $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $GLOBALS['RelatedBrands'] = "<ul class='featurepoints'>"; if (!empty($row['feature_points1'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points1'] . "</li>"; } if (!empty($row['feature_points2'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points2'] . "</li>"; } if (!empty($row['feature_points3'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points3'] . "</li>"; } if (!empty($row['feature_points4'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points4'] . "</li>"; } $GLOBALS['RelatedBrands'] .= "</ul>"; /*if(isset($row['brandlargefile']) && !empty($row['brandlargefile'])) { $brand_image_path = "product_images/".$row['brandlargefile']; if(file_exists($brand_image_path)) { $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandlargefile']."'>"; } else if(isset($row['brandimagefile']) && !empty($row['brandimagefile'])) { $brand_image_path = "product_images/".$row['brandimagefile']; if(file_exists($brand_image_path)) $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandimagefile']."'>"; } } else if(isset($row['brandimagefile']) && !empty($row['brandimagefile'])) { $brand_image_path = "product_images/".$row['brandimagefile']; if(file_exists($brand_image_path)) $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandimagefile']."'>"; }*/ } $GLOBALS['CatgDescandBrandImage'] = $row['branddescription']; if ($row['subcatgids'] != "") { $subcatgids = str_ireplace("~", ",", $row['subcatgids']); $subcatgids_qry = "select catname from [|PREFIX|]categories where categoryid in (" . $subcatgids . ")"; $subcatgids_res = $GLOBALS['ISC_CLASS_DB']->Query($subcatgids_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res) > 0) { while ($subcatgids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($subcatgids_res)) { if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductsCount'] .= "<br><a href='" . $series_link . "/subcategory/" . MakeURLSafe(Strtolower($subcatgids_arr['catname'])) . "'>" . $subcatgids_arr['catname'] . "</a>"; } else { $GLOBALS['ProductsCount'] .= "<br><a href='" . $series_link . "&subcategory=" . MakeURLSafe(Strtolower($subcatgids_arr['catname'])) . "'>" . $subcatgids_arr['catname'] . "</a>"; } } } } $content = $row['brandname'] . "<br>"; $content .= $row['catname'] . "<br>"; $content .= "Price starting from \$" . number_format($row['prodcalculatedprice'], 2, '.', ''); $GLOBALS['leftsidecontent'] = $content; $GLOBALS['PriceRange'] = "Price starting from \$" . number_format($row['prodcalculatedprice'], 2, '.', ''); $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $content = "{$link}<img src='{$path}/templates/default/images/view.gif'></a>"; $GLOBALS['ViewDetailsImage'] = $content; if (IsDiscountAvailable('series', $row['brandseriesid'])) { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } if ($this->IsMakeAnOffer('series', $row['brandseriesid']) == 'yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } $GLOBALS['lowersidecontent'] = $content; $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListing"); $GLOBALS['HideCompareItems'] = "none"; } } } $get_variables = $_GET; $sort_qry = "{$path}/search.php?search_query=" . urlencode($params['search_query']); unset($get_variables['orderby'], $get_variables['sort'], $get_variables['search_query'], $get_variables['sortby']); $i = 0; foreach ($get_variables as $key => $value) { $sort_qry .= "&{$key}={$value}"; } if (isset($_REQUEST['sortby']) && $_REQUEST['sortby'] == 'desc') { $sort = "asc "; $img = " <img src='{$path}/templates/default/images/ArrowDown.gif' border=0>"; } else { $sort = "desc "; $img = " <img src='{$path}/templates/default/images/ArrowUp.gif' border=0>"; } //$GLOBALS['SearchResults'] = $GLOBALS['SearchResultList']; // commented by vikas if (isset($params['partnumber']) || $params['flag_srch_category'] == 1 || isset($params['flag_srch_category']) && isset($GLOBALS['BRAND_SERIES_FLAG']) && $GLOBALS['BRAND_SERIES_FLAG'] == 1) { if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductBrand'] = "<a href='{$path}{$mmy_links}/orderby/brandname/sortby/{$sort}'>Brand</a>"; $GLOBALS['ProductPartNumber'] = "<a href='{$path}{$mmy_links}/orderby/prodcode/sortby/{$sort}'>Part Number</a>"; $GLOBALS['ProductPrice'] = "<a href='{$path}{$mmy_links}/orderby/prodcalculatedprice/sortby/{$sort}'>Price</a>"; } else { $GLOBALS['ProductBrand'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=brandname&sortby={$sort}'>Brand</a>"; $GLOBALS['ProductPartNumber'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=prodcode&sortby={$sort}'>Part Number</a>"; $GLOBALS['ProductPrice'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=prodcalculatedprice&sortby={$sort}'>Price</a>"; } if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'brandname') { $GLOBALS['ProductBrand'] .= $img; } $GLOBALS['ProductVQ'] = $vq_column_title; /*if(isset($_GET['orderby']) && $_GET['orderby'] == 'brandname') $GLOBALS['Product_VQ'] .= $img;*/ if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodcode') { $GLOBALS['ProductPartNumber'] .= $img; } $GLOBALS['ProductPQ'] = "Product Options"; /*if(isset($_GET['orderby']) && $_GET['orderby'] == 'productoption') $GLOBALS['SearchResults'] .= $img;*/ if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodcalculatedprice') { $GLOBALS['ProductPrice'] .= $img; } $GLOBALS['ProductDetails'] = "Details"; $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItemHeader"); } else { // $GLOBALS['SearchResults'] = "<div>".$GLOBALS['SearchResultList']."</div>"; $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListingMain"); } if ($GLOBALS['EnableSEOUrls'] == 1) { $back2url = $_SESSION['back2url'] = preg_replace("/^\\//", "", $_SERVER['REQUEST_URI']); } else { $back2url = $_SESSION['back2url'] = "search.php?" . $_SERVER['QUERY_STRING']; } ISC_SetCookie("back2search", $back2url, 0, "/"); // Showing the syndication option? if (GetConfig('RSSNewProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) { $GLOBALS['RSSURL'] = SearchLink($GLOBALS['ISC_CLASS_SEARCH']->GetQuery(), 0, false); $GLOBALS['SNIPPETS']['SearchResultsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchResultsFeed"); } } else { // No search results were found $GLOBALS['HideSearchResults'] = "none"; $GLOBALS['HidePanels'][] = 'SearchPageProducts'; } }
public function SetPanelSettings() { $path = GetConfig('ShopPath'); $params = array(); for ($i = 1; $i < count($GLOBALS['PathInfo']); $i += 2) { if ($GLOBALS['PathInfo'][$i + 1] != '') { $params[$GLOBALS['PathInfo'][$i]] = MakeURLNormal($GLOBALS['PathInfo'][$i + 1]); } } $catg_qry = "select * from [|PREFIX|]categories where catvisible=1 order by catparentid ASC , CHAR_LENGTH(catname) DESC"; $catg_res = $GLOBALS['ISC_CLASS_DB']->Query($catg_qry); $catgoryname = array(); // array for category names while ($catg_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_res)) { $catgoryname[$catg_arr['categoryid']]['catname'] = $catg_arr['catname']; $catgoryname[$catg_arr['categoryid']]['catparentid'] = $catg_arr['catparentid']; } $GLOBALS['categories_all'] = $catgoryname; @($lastSelection = $_COOKIE['last_search_selection']); if (!isset($params['make']) && isset($lastSelection['make']) && $lastSelection['make'] != "") { $params['make'] = $lastSelection['make']; if (!isset($params['model']) && isset($lastSelection['model']) && $lastSelection['model'] != "") { $params['model'] = $lastSelection['model']; } } if (!isset($params['year']) && isset($lastSelection['year']) && $lastSelection['year'] != "") { $params['year'] = $lastSelection['year']; } $where = ''; if (isset($params['make'])) { $where .= "AND ( v.prodmake = '" . $params['make'] . "' OR v.prodmake = 'NON-SPEC VEHICLE' ) "; } if (isset($params['model'])) { $where .= "AND ( v.prodmodel = '" . $params['model'] . "' OR v.prodmodel = 'ALL' ) "; } if (isset($params['year'])) { $year = $params['year']; $where .= "AND ( {$year} between v.prodstartyear and v.prodendyear OR v.prodstartyear = 'ALL' ) "; } /*if( !isset($params['make']) || !isset($params['model']) || !isset($params['year']) ) {*/ $GLOBALS['UniversalCat'] = isset($params['catuniversal']) ? $params['catuniversal'] : 0; $GLOBALS['YearList'] = $this->getYMMOptions($params, 'year'); $GLOBALS['MakeList'] = $this->getYMMOptions($params, 'make'); $GLOBALS['ModelList'] = $this->getYMMOptions($params, 'model'); $GLOBALS['YMMTable'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceYMMOptions"); //} $GLOBALS['ClearanceResults'] = "<div style='float:left'>" . $GLOBALS['YMMTable'] . "</div>"; $mmy_links = $this->GetYMMLinks($params); $query = $GLOBALS['ISC_CLASS_DB']->Query("SELECT * FROM [|PREFIX|]discounts WHERE discountname = 'Clearance' and discountenabled = 1 LIMIT 0 , 1 "); $flag = '0'; if ($GLOBALS['ISC_CLASS_DB']->CountResult($query) == 1) { $crow = $GLOBALS['ISC_CLASS_DB']->Fetch($query); $catid = unserialize($crow['configdata']); if (array_key_exists("var_catids", $catid)) { $flag = '1'; $category_id = $catid['var_catids']; } else { $flag = '2'; $brand_id = $catid['var_brandids']; $series_id = $catid['var_seriesids']; } } if ($flag == '1') { # For Category -- Baskaran $clearance_qry = "select c.catname , c.categoryid , c.catuniversal , c.catimagealt , c.featurepoints , group_concat(DISTINCT brandname separator '~') as brandname , group_concat(DISTINCT p.brandseriesid separator '~') as seriesids , min(fp.prodfinalprice) as prodminprice , max(fp.prodfinalprice) as prodmaxprice , c.catimagefile as imagefile , c.cathoverimagefile , p.proddesc , prodwarranty , bs.seriesname , p.brandseriesid , count(distinct p.productid) as totalproducts,floor(SUM(p.prodratingtotal)/SUM(p.prodnumratings)) AS prodavgrating from [|PREFIX|]products p LEFT JOIN [|PREFIX|]import_variations AS v ON v.productid = p.productid LEFT JOIN [|PREFIX|]categoryassociations ca on ca.productid = p.productid LEFT JOIN [|PREFIX|]categories c on c.categoryid = ca.categoryid and c.catvisible = 1 LEFT JOIN [|PREFIX|]brands b on prodbrandid = b.brandid LEFT JOIN [|PREFIX|]brand_series AS bs ON bs.seriesid = p.brandseriesid LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1) LEFT JOIN [|PREFIX|]product_finalprice fp ON p.productid = fp.productid WHERE 1=1 AND c.categoryid IN ({$category_id}) AND p.prodvisible='1' {$where} group by c.categoryid ORDER BY c.catdeptid ASC, c.catsort ASC, c.catname ASC"; $catquery = $GLOBALS['ISC_CLASS_DB']->Query($clearance_qry); $cnt = $GLOBALS['ISC_CLASS_DB']->CountResult($catquery); if ($cnt > '0') { while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($catquery)) { $cat_id = $row['categoryid']; $category_rating = 0; $cat_rating_res = $GLOBALS['ISC_CLASS_DB']->Query("SELECT floor(SUM(p.prodratingtotal)/SUM(p.prodnumratings))AS prodavgrating FROM [|PREFIX|]categoryassociations c INNER JOIN [|PREFIX|]products p on c.productid=p.productid where c.categoryid = '{$cat_id}'"); $cat_rating_arr = $GLOBALS['ISC_CLASS_DB']->FetchOne($cat_rating_res); if (isset($cat_rating_arr['prodavgrating'])) { $category_rating = (int) $cat_rating_arr['prodavgrating']; } $parentid = $GLOBALS['categories_all'][$row['categoryid']]['catparentid']; if ($parentid != 0) { if (isset($GLOBALS['categories_all'][$parentid])) { // if parent catg is not visible $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$parentid]['catname'])) . $mmy_links; } else { $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links; } } else { $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links; } $subcatg_link = $this->LeftCatLink($mmy_links_modified, 'subcategory', $row['catname']); $link = "<a href='" . $subcatg_link . "'>"; $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>"; $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title='' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { // $images = explode("~",$row['imagefile']); // for($j=0;$j<count($images);$j++) { // if(!empty($images[$j])) { $imagefile = "{$imagelink}<img src='{$path}/category_images/" . $row['imagefile'] . "' alt='" . isc_html_escape($row['catimagealt']) . "' title='" . isc_html_escape($row['catimagealt']) . "'></a>"; $imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>"; // break; // } // } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; $imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>"; } } $GLOBALS['LeftImage'] = $imagefile; $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); //$GLOBALS['RelatedBrands'] = $row['brandname']; if (!empty($row['seriesname'])) { $row['brandname'] .= "<br>" . $row['seriesname']; } $GLOBALS['CatgSeriesList'] = ""; if ($row['seriesids'] != "") { $seriesids = str_ireplace("~", ",", $row['seriesids']); $seriesids_qry = "select seriesid , brandname , seriesname from [|PREFIX|]brand_series bs left join [|PREFIX|]brands b on bs.brandid = b.brandid where seriesid in (" . $seriesids . ")"; $seriesids_res = $GLOBALS['ISC_CLASS_DB']->Query($seriesids_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($seriesids_res) > 0) { while ($seriesids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($seriesids_res)) { if ($GLOBALS['CatgSeriesList'] == "") { $GLOBALS['CatgSeriesList'] .= "<br><a href='javascript:' onclick=\"checkanimate('" . $row['categoryid'] . "')\">View Brands ></a><div id='" . $row['categoryid'] . "' style='display:block'>"; } else { $GLOBALS['CatgSeriesList'] .= "<br>"; } $tooltipscript = "onmouseover='createtip(" . $row['categoryid'] . $seriesids_arr['seriesid'] . ")' onmouseout='UnTip()'"; if (!isset($params['brand'])) { if ($GLOBALS['EnableSEOUrls'] == 1) { $series_link = $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $series_link = $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } else { if ($GLOBALS['EnableSEOUrls'] == 1) { $series_link = $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $series_link = $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } $GLOBALS['CatgSeriesList'] .= "<span id='span" . $row['categoryid'] . $seriesids_arr['seriesid'] . "' style='display:none'><a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $seriesids_arr['seriesid'] . "&catname=" . MakeURLSafe($row['catname']) . "&url=" . urlencode($series_link) . "' class='' ><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a></span>"; } $GLOBALS['CatgSeriesList'] .= "</br></div>"; } } $content = $row['brandname'] . "<br>"; if (!isset($params['category']) && (isset($params['srch_category']) || !isset($GLOBALS['BRAND_SERIES_FLAG']))) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of subcatg page. $GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; $content .= "<h3><a href='" . $path . "/search.php?{$qry_string}&subcategory=" . MakeURLSafe($row['catname']) . "'>" . $row['catname'] . "</a></h3>>"; $GLOBALS['TitleLink'] = "<h2><a href='" . $subcatg_link . "' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>" . $row['catname'] . "</a></h2>"; } /*$ProdStartPrice = GetStartingPrice($row['categoryid'], $row['prodcalculatedprice']); $content .= "Price starting from $".number_format($ProdStartPrice, 2, '.', '')."<br>".$imagefile;*/ $GLOBALS['leftsidecontent'] = $content; if (number_format($row['prodminprice'], 2) < number_format($row['prodmaxprice'], 2)) { $GLOBALS['PriceRange'] = "Price range from \$" . number_format($row['prodminprice'], 2, '.', '') . " to \$" . number_format($row['prodmaxprice'], 2, '.', ''); } else { $GLOBALS['PriceRange'] = "Available at \$" . number_format($row['prodminprice'], 2, '.', ''); } $GLOBALS['Rating'] = isset($row['prodavgrating']) ? $row['prodavgrating'] : 0; $GLOBALS['RatingVisible'] = $GLOBALS['Rating'] == 0 ? 'display:none' : ''; $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $GLOBALS['ViewDetailsImage'] = "<a href='{$path}/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' class='thickbox'><img src='{$path}/templates/default/images/fastlook_red.gif'></a> "; $content = "{$link}<img src='{$path}/templates/default/images/viewproducts.gif'></a>"; $GLOBALS['ViewDetailsImage'] .= $content; if (IsDiscountAvailable('category', $row['categoryid'])) { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/clearance.gif" alt="">'; } if ($category_rating != 0) { $GLOBALS['CatgDescandBrandImage'] .= "<br><h2>Rating : <img width='64' height='12' src='" . $GLOBALS['TPL_PATH'] . "/images/IcoRating{$category_rating}.gif' alt='' /></h2>"; } $GLOBALS['RatingHide'] = $category_rating == '0' ? 'none' : ''; /*if($this->IsMakeAnOffer('category', $row['categoryid'])=='yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; }*/ $GLOBALS['RelatedBrands'] = $row['featurepoints']; $GLOBALS['lowersidecontent'] = $content; $GLOBALS['ClearanceList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceCategoryListing"); } $GLOBALS['ClearanceResults'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceCategoryListingMain"); } else { $GLOBALS['ClearanceResults'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceNorecords"); } } else { if ($flag == '2') { # For brand and series -- Baskaran $brand_rating = 0; $serquery = $GLOBALS['ISC_CLASS_DB']->Query("select c.catname , c.categoryid , c.catuniversal , group_concat(DISTINCT ca.categoryid separator '~') as subcatgids , pa.catname as parentcatname , group_concat(DISTINCT brandname separator '~') as brandname , min(fp.prodfinalprice) as prodminprice , max(fp.prodfinalprice) as prodmaxprice , bs.seriesphoto as imagefile , p.proddesc , prodwarranty , bs.seriesname, p.brandseriesid , count(distinct p.productid) as totalproducts , bs.feature_points1 , bs.feature_points2 , bs.feature_points3 , bs.feature_points4 , bs.feature_points, b.brandimagefile , b.brandlargefile , b.branddescription , b.brandfooter, bs.serieshoverimagefile from [|PREFIX|]products p LEFT JOIN [|PREFIX|]import_variations AS v ON v.productid = p.productid LEFT JOIN [|PREFIX|]categoryassociations ca on ca.productid = p.productid LEFT JOIN [|PREFIX|]categories c on c.categoryid = ca.categoryid and c.catvisible = 1 LEFT JOIN [|PREFIX|]brands b on prodbrandid = b.brandid LEFT JOIN [|PREFIX|]brand_series AS bs ON bs.seriesid = p.brandseriesid LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1) LEFT JOIN [|PREFIX|]product_finalprice fp ON p.productid = fp.productid LEFT JOIN [|PREFIX|]categories pa on pa.categoryid = c.catparentid WHERE 1=1 AND c.categoryid is not null AND p.prodvisible='1' {$where} AND p.prodbrandid IN ({$brand_id}) AND p.brandseriesid IN ({$series_id}) group by p.brandseriesid ORDER BY bs.seriessort ASC , bs.seriesname ASC"); $cnt = $GLOBALS['ISC_CLASS_DB']->CountResult($serquery); if ($cnt > '0') { while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($serquery)) { $brand_rating_qry = "select avg(revrating) as rating from [|PREFIX|]reviews r left join [|PREFIX|]products p on r.revproductid = p.productid left join [|PREFIX|]brands b on p.prodbrandid = b.brandid where r.revstatus = 1 and b.brandname = '" . $row['brandname'] . "'"; $brand_rating_res = $GLOBALS['ISC_CLASS_DB']->Query($brand_rating_qry); $brand_rating_arr = $GLOBALS['ISC_CLASS_DB']->FetchOne($brand_rating_res); if (isset($brand_rating_arr['rating'])) { $brand_rating = (int) $brand_rating_arr['rating']; } $series_link = $this->LeftCatLink($mmy_links, 'series', $row['seriesname']); $link = "<a href='" . $series_link . "'>"; //$imagelink = "<a href='".$path."/catgbrand.php?seriesid=".$row['brandseriesid']."&catname=".MakeURLSafe($row['parentcatname'])."&url=$series_link' class='thickbox' title=''>"; $main_catg_link = ""; $catg_count = array(); $GLOBALS['CatgSeriesList'] = ""; if ($row['subcatgids'] != "") { $subcatgids = str_ireplace("~", ",", $row['subcatgids']); $subcatgids_qry = "select c.categoryid , c.catname as childcatname , p.categoryid as parentid , p.catname as parentcatname from [|PREFIX|]categories c left join [|PREFIX|]categories p on c.catparentid = p.categoryid where c.categoryid in (" . $subcatgids . ")"; $subcatgids_res = $GLOBALS['ISC_CLASS_DB']->Query($subcatgids_qry); //$catg_count = $GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res); if ($GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res) > 0) { while ($subcatgids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($subcatgids_res)) { if ($subcatgids_arr['parentid'] != 0) { $main_catg_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])); $catg_count[$subcatgids_arr['parentid']] = $subcatgids_arr['parentcatname']; } else { $catg_count[$subcatgids_arr['categoryid']] = $subcatgids_arr['childcatname']; } if ($GLOBALS['CatgSeriesList'] == "") { $GLOBALS['CatgSeriesList'] .= "<br><a href='javascript:' onclick=\"checkanimate('" . $row['brandseriesid'] . "')\">View Category ></a><div id='" . $row['brandseriesid'] . "' style='display:none'>"; } else { $GLOBALS['CatgSeriesList'] .= "<br>"; } $tooltipscript = "onmouseover='createtip(" . $subcatgids_arr['categoryid'] . $row['brandseriesid'] . ")' onmouseout='UnTip()'"; if ($GLOBALS['EnableSEOUrls'] == 1) { if ($subcatgids_arr['parentcatname'] == "") { $catgs_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } else { $catgs_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])) . "/subcategory/" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } $GLOBALS['CatgSeriesList'] .= "<a href='" . $catgs_link . "' {$tooltipscript}>" . $subcatgids_arr['childcatname'] . "</a>"; } else { if ($subcatgids_arr['parentcatname'] == "") { $catgs_link = $series_link . "&category=" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } else { $catgs_link = $series_link . "&category=" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])) . "&subcategory=" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } $GLOBALS['CatgSeriesList'] .= "<a href='" . $catgs_link . "' {$tooltipscript}>" . $subcatgids_arr['childcatname'] . "</a>"; } $GLOBALS['CatgSeriesList'] .= "<span id='span" . $subcatgids_arr['categoryid'] . $row['brandseriesid'] . "' style='display:none'><a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $subcatgids_arr['categoryid'] . "&url=" . urlencode($catgs_link) . "' class='' ><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a></span>"; } $GLOBALS['CatgSeriesList'] .= "</br></div>"; } } $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; if (count($catg_count) == 1) { $GLOBALS['TitleLink'] = "<h2><a href='" . $main_catg_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; } else { if (count($catg_count) > 1) { $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()' onclick='return checkcategoryselection()'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; } } $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . MakeURLSafe($row['parentcatname']) . "&url="; if (count($catg_count) == 1) { $tiplink .= urlencode($main_catg_link) . "'"; } else { if (count($catg_count) > 1) { $tiplink .= "#' "; } else { $tiplink .= urlencode($series_link) . "'"; } } $tiplink .= " title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>"; $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . MakeURLSafe($row['parentcatname']) . "&url="; if (count($catg_count) == 1) { $imagelink .= urlencode($main_catg_link) . "'"; } else { if (count($catg_count) > 1) { $imagelink .= "#' "; } else { $imagelink .= urlencode($series_link) . "'"; } } $imagelink .= " title='' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); // for($j=0;$j<count($images);$j++) { // if(!empty($images[$j])) { $imagefile = "{$imagelink}<img src='{$path}/series_images/" . $row['imagefile'] . "'></a>"; // break; // } // } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; } } $GLOBALS['LeftImage'] = $imagefile; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); $GLOBALS['RelatedBrands'] = $row['brandname']; if (isset($row['seriesname']) && !empty($row['seriesname']) && (!isset($params['srch_category']) || isset($params['category'])) && isset($GLOBALS['BRAND_SERIES_FLAG'])) { if (empty($row['imagefile']) || empty($imagefile)) { $GLOBALS['LeftImage'] = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' alt='" . isc_html_escape($row['seriesimagealt']) . "' title='" . isc_html_escape($row['seriesimagealt']) . "'></a>"; $GLOBALS['LeftImage'] .= "<span id='span" . $row['brandseriesid'] . "' style='display:none'>" . $tiplink . "</span>"; } else { $GLOBALS['LeftImage'] = "{$imagelink}<img src='{$path}/series_images/" . $row['imagefile'] . "' width='140px' alt='" . isc_html_escape($row['seriesimagealt']) . "' title='" . isc_html_escape($row['seriesimagealt']) . "'></a>"; $GLOBALS['LeftImage'] .= "<span id='span" . $row['brandseriesid'] . "' style='display:none'>" . $tiplink . "</span>"; } //"<h3>".$row['catname']."</h3> $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $GLOBALS['RelatedBrands'] = "<ul class='featurepoints'>"; if (!empty($row['feature_points1'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points1'] . "</li>"; } if (!empty($row['feature_points2'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points2'] . "</li>"; } if (!empty($row['feature_points3'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points3'] . "</li>"; } if (!empty($row['feature_points4'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points4'] . "</li>"; } $GLOBALS['RelatedBrands'] .= "</ul>"; } $GLOBALS['RelatedBrands'] = $row['feature_points']; $GLOBALS['CatgDescandBrandImage'] = $row['branddescription']; $GLOBALS['CatgBrandSeriesFooter'] = $row['brandfooter']; if ($brand_rating != 0) { $GLOBALS['CatgDescandBrandImage'] .= "<br><h2>Rating : <img width='64' height='12' src='" . $GLOBALS['TPL_PATH'] . "/images/IcoRating{$brand_rating}.gif' alt='' /></h2>"; } $GLOBALS['RatingHide'] = $brand_rating == '0' ? 'none' : ''; $content = $row['brandname'] . "<br>"; $content .= $row['catname'] . "<br>"; /*$ProdStartPriceSeries = GetStartingPriceForSeries($row['brandseriesid'], $row['prodcalculatedprice']); $content .= "Price starting from $".number_format($ProdStartPriceSeries, 2, '.', '');*/ $GLOBALS['leftsidecontent'] = $content; //$GLOBALS['PriceRange'] = "Price range from $".number_format($row['prodminprice'], 2, '.', '')." to $".number_format($row['prodmaxprice'], 2, '.', ''); if (number_format($row['prodminprice'], 2) < number_format($row['prodmaxprice'], 2)) { $GLOBALS['PriceRange'] = "Price range from \$" . number_format($row['prodminprice'], 2, '.', '') . " to \$" . number_format($row['prodmaxprice'], 2, '.', ''); } else { $GLOBALS['PriceRange'] = "Available at \$" . number_format($row['prodminprice'], 2, '.', ''); } $GLOBALS['Rating'] = isset($row['prodavgrating']) ? $row['prodavgrating'] : 0; $GLOBALS['RatingVisible'] = $GLOBALS['Rating'] == 0 ? 'display:none' : ''; $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $GLOBALS['ViewDetailsImage'] = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . MakeURLSafe($row['parentcatname']) . "&url="; if (count($catg_count) > 1) { $GLOBALS['ViewDetailsImage'] .= "#'"; } else { if (count($catg_count) == 1) { $GLOBALS['ViewDetailsImage'] .= urlencode($main_catg_link) . "'"; } else { $GLOBALS['ViewDetailsImage'] .= urlencode($series_link) . "'"; } } $GLOBALS['ViewDetailsImage'] .= "><img src='{$path}/templates/default/images/fastlook_red.gif'></a> "; $content = "{$link}"; if (count($catg_count) == 1) { $content = "<a href='" . $main_catg_link . "'>"; } else { if (count($catg_count) > 1) { $content = "<a href='" . $series_link . "' onclick='return checkcategoryselection()'>"; } } $content .= "<img src='{$path}/templates/default/images/viewproducts.gif'></a>"; $GLOBALS['ViewDetailsImage'] .= $content; if (IsDiscountAvailable('series', $row['brandseriesid'])) { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/clearance" alt="">'; } /* if($this->IsMakeAnOffer('series', $row['brandseriesid'])=='yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } */ $GLOBALS['lowersidecontent'] = $content; $GLOBALS['ClearanceList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceCategoryListing"); $GLOBALS['HideCompareItems'] = "none"; } $GLOBALS['ClearanceResults'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceCategoryListingMain"); } else { $GLOBALS['ClearanceResults'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceNorecords"); } } else { $GLOBALS['ClearanceResults'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ClearanceNorecords"); } } }
function ShowSeriesPage($mmy_links, $params, $brand_rating = 0) { $path = GetConfig('ShopPath'); $GLOBALS['AlternateClass'] = ''; $counter = 1; $CurCatId = 0; $seriesLanding = array(); $brandLanding = array(); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($GLOBALS['SearchResults'])) { $seriesLanding[] = $row; } $brand_arr = $GLOBALS['ISC_CLASS_NEWSEARCH']->GetBrandQuery(); $brand_query = $brand_arr['query']; $result = $GLOBALS['ISC_CLASS_DB']->query($brand_query); while ($rs = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { if (empty($rs['displayname'])) { $rs['displayname'] = "Other Products"; } if (empty($rs['seriesname'])) { $rs['seriesname'] = "Default"; } $brandLanding[] = $rs; } $seriesCount = $GLOBALS['ISC_CLASS_NEWSEARCH']->_numresults; if ($seriesCount == 16) { $brandSeriesLanding = array_merge($seriesLanding, $brandLanding); } else { if (count($seriesLanding) < 16) { $brandSeriesLanding = array_merge($seriesLanding, $brandLanding); } else { $brandSeriesLanding = $seriesLanding; } } //alandy_2012-2-29 $params['brand'] //while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($GLOBALS['SearchResults'])) { foreach ($brandSeriesLanding as $row) { $GLOBALS['SearchTrackClass'] = "TrackLink"; $imagefile = ""; if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $qry_string = $this->GetQueryString($params); if ($GLOBALS['results_page_flag'] == 0 && !isset($params['srch_category'])) { break; } //wirror_mark_condition3 $series_link = $this->LeftCatLink($mmy_links, 'series', $row['seriesname']); $link = "<a href='" . $series_link . "'>"; //$imagelink = "<a href='".$path."/catgbrand.php?seriesid=".$row['brandseriesid']."&catname=".MakeURLSafe($row['parentcatname'])."&url=$series_link' class='thickbox' title=''>"; $main_catg_link = ""; $catg_count = array(); $GLOBALS['CatgSeriesList'] = ""; if ($row['subcatgids'] != "") { $subcatgids = str_ireplace("~", ",", $row['subcatgids']); $subcatgids_qry = "select c.categoryid , c.catname as childcatname , p.categoryid as parentid , p.catname as parentcatname from [|PREFIX|]categories c left join [|PREFIX|]categories p on c.catparentid = p.categoryid where c.categoryid in (" . $subcatgids . ")"; $subcatgids_res = $GLOBALS['ISC_CLASS_DB']->Query($subcatgids_qry); //$catg_count = $GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res); if ($GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res) > 0) { while ($subcatgids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($subcatgids_res)) { if ($subcatgids_arr['parentid'] != 0) { $main_catg_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])); $catg_count[$subcatgids_arr['parentid']] = $subcatgids_arr['parentcatname']; } else { $catg_count[$subcatgids_arr['categoryid']] = $subcatgids_arr['childcatname']; } if ($GLOBALS['CatgSeriesList'] == "") { $GLOBALS['CatgSeriesList'] .= "<br><a href='javascript:' onclick=\"checkanimate('" . $row['brandseriesid'] . "')\">View Category ></a><div id='" . $row['brandseriesid'] . "' style='display:none'>"; } else { $GLOBALS['CatgSeriesList'] .= "<br>"; } $tooltipscript = "onmouseover='createtip(" . $subcatgids_arr['categoryid'] . $row['brandseriesid'] . ")' onmouseout='UnTip()'"; if ($GLOBALS['EnableSEOUrls'] == 1) { if ($subcatgids_arr['parentcatname'] == "") { $catgs_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } else { $catgs_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])) . "/subcategory/" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } if (isset($GLOBALS['SearchId'])) { $catgs_link .= '/SearchLogId/' . $GLOBALS['SearchId']; } $GLOBALS['CatgSeriesList'] .= "<a href='" . $catgs_link . "' {$tooltipscript}>" . $subcatgids_arr['childcatname'] . "</a>"; } else { if ($subcatgids_arr['parentcatname'] == "") { $catgs_link = $series_link . "&category=" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } else { $catgs_link = $series_link . "&category=" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])) . "&subcategory=" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } if (isset($GLOBALS['SearchId'])) { $catgs_link .= '&SearchLogId=' . $GLOBALS['SearchId']; } $GLOBALS['CatgSeriesList'] .= "<a href='" . $catgs_link . "' {$tooltipscript}>" . $subcatgids_arr['childcatname'] . "</a>"; } $GLOBALS['CatgSeriesList'] .= "<span id='span" . $subcatgids_arr['categoryid'] . $row['brandseriesid'] . "' style='display:none'><a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $subcatgids_arr['categoryid'] . "&url=" . urlencode($catgs_link) . "' class='' ><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a></span>"; } $GLOBALS['CatgSeriesList'] .= "</br></div>"; } } if (isset($GLOBALS['SearchId'])) { if (isset($GLOBALS['EnableSEOUrls']) && $GLOBALS['EnableSEOUrls'] == 1) { $main_catg_link .= '/SearchLogId/' . $GLOBALS['SearchId']; $catgs_link .= '/SearchLogId/' . $GLOBALS['SearchId']; $series_link .= '/SearchLogId/' . $GLOBALS['SearchId']; } else { $main_catg_link .= '&SearchLogId=' . $GLOBALS['SearchId']; $catgs_link .= '&SearchLogId=' . $GLOBALS['SearchId']; $series_link .= '&SearchLogId=' . $GLOBALS['SearchId']; } } //wirror_20100727:show the displayname from db $titleName = isset($row['displayname']) && $row['displayname'] != '' ? $row['displayname'] : $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname']; $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>" . $titleName . "</a></h2>"; if (count($catg_count) == 1) { $GLOBALS['TitleLink'] = "<h2><a href='" . $main_catg_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>" . $titleName . "</a></h2>"; } else { if (count($catg_count) > 1) { $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()' onclick='return checkcategoryselection()'>" . $titleName . "</a></h2>"; } } //wirror20100728: keep the catname consistent with the displayname $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . rawurlencode($row['parentcatname']) . "&url="; if (count($catg_count) == 1) { $tiplink .= urlencode($main_catg_link) . "'"; } else { if (count($catg_count) > 1) { $tiplink .= "#' "; } else { $tiplink .= urlencode($series_link) . "'"; } } $tiplink .= " title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>"; //wirror20100728: keep the catname consistent with the displayname $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . rawurlencode($row['parentcatname']) . "&url="; if (count($catg_count) == 1) { $imagelink .= urlencode($main_catg_link) . "'"; } else { if (count($catg_count) > 1) { $imagelink .= "#' "; } else { $imagelink .= urlencode($series_link) . "'"; } } $imagelink .= " title='' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); for ($j = 0; $j < count($images); $j++) { if (!empty($images[$j])) { $imagefile = "{$imagelink}<img src='{$path}/category_images/" . $images[$j] . "'></a>"; break; } } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; } } $GLOBALS['LeftImage'] = $imagefile; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); $GLOBALS['RelatedBrands'] = $row['brandname']; if (isset($row['seriesname']) && !empty($row['seriesname']) && (!isset($params['srch_category']) || isset($params['category'])) && isset($GLOBALS['BRAND_SERIES_FLAG'])) { if (empty($row['imagefile']) || empty($imagefile)) { $GLOBALS['LeftImage'] = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' alt='" . $row['seriesimagealt'] . "' title='" . $row['seriesimagealt'] . "'></a>"; $GLOBALS['LeftImage'] .= "<span id='span" . $row['brandseriesid'] . "' style='display:none'>" . $tiplink . "</span>"; } else { $GLOBALS['LeftImage'] = "{$imagelink}<img src='{$path}/series_images/" . $row['imagefile'] . "' width='140px' alt='" . $row['seriesimagealt'] . "' title='" . $row['seriesimagealt'] . "'></a>"; $GLOBALS['LeftImage'] .= "<span id='span" . $row['brandseriesid'] . "' style='display:none'>" . $tiplink . "</span>"; } //"<h3>".$row['catname']."</h3> $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $GLOBALS['RelatedBrands'] = "<ul class='featurepoints'>"; if (!empty($row['feature_points1'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points1'] . "</li>"; } if (!empty($row['feature_points2'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points2'] . "</li>"; } if (!empty($row['feature_points3'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points3'] . "</li>"; } if (!empty($row['feature_points4'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points4'] . "</li>"; } $GLOBALS['RelatedBrands'] .= "</ul>"; /*if(isset($row['brandlargefile']) && !empty($row['brandlargefile'])) { $brand_image_path = "product_images/".$row['brandlargefile']; if(file_exists($brand_image_path)) { $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandlargefile']."'>"; } else if(isset($row['brandimagefile']) && !empty($row['brandimagefile'])) { $brand_image_path = "product_images/".$row['brandimagefile']; if(file_exists($brand_image_path)) $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandimagefile']."'>"; } } else if(isset($row['brandimagefile']) && !empty($row['brandimagefile'])) { $brand_image_path = "product_images/".$row['brandimagefile']; if(file_exists($brand_image_path)) $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandimagefile']."'>"; }*/ } $GLOBALS['RelatedBrands'] = $row['feature_points']; $GLOBALS['CatgDescandBrandImage'] = $row['branddescription']; $GLOBALS['CatgBrandSeriesFooter'] = $row['brandfooter']; if (isset($params['make']) || isset($params['model']) || isset($params['year']) || isset($params['srch_category'])) { $GLOBALS['CatgBrandSeriesFooter'] = ""; } if ($brand_rating != 0) { //$GLOBALS['CatgDescandBrandImage'] .= "<br><h2>Rating : <img width='64' height='12' src='".$GLOBALS['TPL_PATH']."/images/IcoRating$brand_rating.gif' alt='' /></h2>"; } $content = $row['brandname'] . "<br>"; $content .= $row['catname'] . "<br>"; /*$ProdStartPriceSeries = GetStartingPriceForSeries($row['brandseriesid'], $row['prodcalculatedprice']); $content .= "Price starting from $".number_format($ProdStartPriceSeries, 2, '.', '');*/ $GLOBALS['leftsidecontent'] = $content; //$GLOBALS['PriceRange'] = "Price range from $".number_format($row['prodminprice'], 2, '.', '')." to $".number_format($row['prodmaxprice'], 2, '.', ''); if (number_format($row['prodminprice'], 2, '.', '') < number_format($row['prodmaxprice'], 2, '.', '')) { $GLOBALS['PriceRange'] = "Price range from \$" . number_format($row['prodminprice'], 2, '.', '') . " to \$" . number_format($row['prodmaxprice'], 2, '.', ''); } else { $GLOBALS['PriceRange'] = "Available at \$" . number_format($row['prodminprice'], 2, '.', ''); } //lguan_20100612: Show product ratings in brand/series page $GLOBALS['Rating'] = isset($row['prodavgrating']) ? $row['prodavgrating'] : 0; $GLOBALS['RatingVisible'] = $GLOBALS['Rating'] == 0 ? 'display:none' : ''; $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; //wirror20100727: show displayname for fastlook $GLOBALS['ViewDetailsImage'] = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . rawurlencode($row['parentcatname']) . "&url="; if (count($catg_count) > 1) { $GLOBALS['ViewDetailsImage'] .= "#'"; } else { if (count($catg_count) == 1) { $GLOBALS['ViewDetailsImage'] .= urlencode($main_catg_link) . "'"; } else { $GLOBALS['ViewDetailsImage'] .= urlencode($series_link); } } if (isset($GLOBALS['SearchId'])) { $GLOBALS['ViewDetailsImage'] .= '&SearchLogId=' . $GLOBALS['SearchId']; } $GLOBALS['ViewDetailsImage'] .= "' ><img src='{$path}/templates/default/images/fastlook_red.gif'></a> "; $content = "{$link}"; if (count($catg_count) == 1) { $content = "<a href='" . $main_catg_link . "'>"; } else { if (count($catg_count) > 1) { $content = "<a href='" . $series_link . "' onclick='return checkcategoryselection()'>"; } } $content .= "<img src='{$path}/templates/default/images/viewproducts.gif'></a>"; $GLOBALS['ViewDetailsImage'] .= $content; $discountname = ''; if (IsDiscountAvailable('series', $row['brandseriesid'], $discountname)) { if (strtolower($discountname) == "clearance") { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/clearance.gif" alt="">'; } else { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } } if ($this->IsMakeAnOffer('series', $row['brandseriesid']) == 'yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } $GLOBALS['lowersidecontent'] = $content; $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListing"); $GLOBALS['HideCompareItems'] = "none"; } }
public function SetPanelSettings() { $params = $GLOBALS['ISC_CLASS_ABTESTING']->_searchterms; $this->searchterms = $params; if ($GLOBALS['pagetype'] == 1) { return; } if ($GLOBALS['pagetype'] == 2 && isset($GLOBALS['pagecontent']) && $GLOBALS['pagecontent'] == 1) { $this->YMMSelectors($params); $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AbSubCategoryListingMain"); return; } if ($GLOBALS['ISC_CLASS_ABTESTING']->GetNumResults() == 0) { $this->YMMSelectors($params); $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AbSubCategoryListingMain"); return; } $count = 0; $output = ""; /* Checking the search string. If it is used in any search, will be retained. else it will not be retained - starts */ if (isset($this->searchterms['search'])) { $search_str = trim(str_ireplace($this->searchterms['search_string'], "", $this->searchterms['search'])); if ($search_str == '') { unset($this->searchterms['search'], $params['search']); } else { $this->searchterms['search'] = $params['search'] = $search_str; } } $path = GetConfig('ShopPath'); /* the below mmy links are passed to the breadcrumbs */ $mmy_links = ""; /*---------- This below section is for generating search phrase----------*/ $GLOBALS['Category'] = ""; $GLOBALS['MMY'] = ""; $GLOBALS['PQ'] = ""; $GLOBALS['VQ'] = ""; $GLOBALS['SearchPhrase'] = ""; $ext_links = ""; // this variable is passed to the product detail page $seo_delim = "&"; if ($GLOBALS['EnableSEOUrls'] == 1) { $seo_delim = "/"; } if (isset($GLOBALS['ISC_SRCH_CATG_NAME'])) { $GLOBALS['Category'] .= $GLOBALS['ISC_SRCH_CATG_NAME']; } if (isset($params['year'])) { $GLOBALS['MMY'] .= $params['year'] . "<br>"; $ext_links .= $seo_delim . "year=" . $params['year']; } if (isset($params['make'])) { $GLOBALS['MMY'] .= strtoupper($params['make']) . "<br>"; $ext_links .= $seo_delim . "make=" . MakeURLSafe($params['make']); } if (isset($params['model']) && (!isset($params['model_flag']) || $params['model_flag'] == 1)) { $GLOBALS['MMY'] .= strtoupper($params['model']) . "<br>"; $ext_links .= $seo_delim . "model=" . MakeURLSafe($params['model']); } /*else if(isset($params['model'])) $ext_links .= $seo_delim."model=".$params['model'];*/ /* this condition has been added seperately here to show submodel at last */ if (isset($params['submodel'])) { $GLOBALS['MMY'] .= MakeURLSafe($params['submodel']) . "<br>"; } /*if(isset($params['year'])) { $ext_links .= $seo_delim."year=".$params['year']; }*/ if (isset($params['dynfilters']) && !empty($params['dynfilters'])) { foreach ($params['dynfilters'] as $key => $value) { if (eregi('vq', $key)) { $key = str_ireplace('vq', '', $key); $GLOBALS['VQ'] .= ucfirst($key) . ": {$value}<br>"; } else { if (eregi('pq', $key)) { $key = str_ireplace('pq', '', $key); $GLOBALS['PQ'] .= ucfirst($key) . ": {$value}<br>"; } } } } $filter_var = array('vq', 'pq'); /* this below patch is used for getting description of the category. Here currently the selected category id will be last one in the $params['srch_category'] array. if input['category'] is used then it will be the first one */ if (!empty($params['srch_category'])) { if (isset($params['category'])) { $selected_catg = $params['srch_category'][0]; } else { $selected_catg = end($params['srch_category']); } //wirror_20100806: add selected files like pagecontenttype and customcontentid; $catg_desc_qry = "select pagecontenttype, customcontentid, catdesc , categoryfooter from [|PREFIX|]categories where categoryid = " . $selected_catg; $catg_desc_res = $GLOBALS['ISC_CLASS_DB']->Query($catg_desc_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($catg_desc_res) > 0) { $catg_desc_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_desc_res); } /* this below patch is used to show the display name for the qualifiers from the qualifier association table */ $map_names = array(); $display_names = array(); $filter_names = "select qid , column_name , display_names from [|PREFIX|]qualifier_names where column_name regexp '^(pq|vq)'"; $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names); while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) { $map_names[$filter_row['qid']] = $filter_row['column_name']; $display_names[$filter_row['qid']] = $filter_row['display_names']; } $this->GetAssocDetails($selected_catg, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue); } if (isset($params['brand'])) { $brand_desc_arr = array(); $brand_desc_qry = "select branddescription , brandfooter from [|PREFIX|]brands where brandname = '" . $params['brand'] . "'"; $brand_desc_res = $GLOBALS['ISC_CLASS_DB']->Query($brand_desc_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($brand_desc_res) > 0) { $brand_desc_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($brand_desc_res); } } // for breadcrumbs $this->_BuildBreadCrumbs(); /* the below line has been commented as client told to remove it */ //$GLOBALS['SearchPhrase'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchPhrase"); if ($GLOBALS['ISC_CLASS_ABTESTING']->GetNumResults() > 30) { $msg_qry = "select value from [|PREFIX|]display where messageid = 1"; $msg_res = $GLOBALS['ISC_CLASS_DB']->Query($msg_qry); $msg_row = $GLOBALS['ISC_CLASS_DB']->FetchOne($msg_res); $GLOBALS['SearchPhrase'] = $msg_row; //$GLOBALS['SearchPhrase'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchPhrase"); } /*if(!empty($params['dynfilters'])) $GLOBALS['SearchPhrase'] .= " ".implode(" ",$params['dynfilters']); /*---------- Ending section for generating search phrase----------*/ $vq_column_title = ""; $GLOBALS['SearchResultList'] = ""; if ($GLOBALS['ISC_CLASS_ABTESTING']->GetNumResults() > 0) { $brand_rating = 0; $category_rating = 0; if ($GLOBALS['results_page_flag'] == 1) { $brand_rating_qry = "select avg(revrating) as rating from [|PREFIX|]reviews r left join [|PREFIX|]products p on r.revproductid = p.productid left join [|PREFIX|]brands b on p.prodbrandid = b.brandid where r.revstatus = 1 and b.brandname = '" . $params['brand'] . "'"; $brand_rating_res = $GLOBALS['ISC_CLASS_DB']->Query($brand_rating_qry); $brand_rating_arr = $GLOBALS['ISC_CLASS_DB']->FetchOne($brand_rating_res); if (isset($brand_rating_arr['rating'])) { $brand_rating = (int) $brand_rating_arr['rating']; } } else { if ($GLOBALS['results_page_flag'] == 0 && isset($selected_catg)) { // 3rdAug2010: added the condition "isset($selected_catg)" as no need to show rating when only YMM is selected // lguan_20100612: Category page mode, calculate the rating $catquery = $GLOBALS['ISC_CLASS_DB']->Query("SELECT categoryid FROM [|PREFIX|]categories where catparentid = {$selected_catg}"); $catlistid = array(); while ($catrow = $GLOBALS['ISC_CLASS_DB']->Fetch($catquery)) { $catlistid[] = $catrow['categoryid']; } $catcountlist = implode(",", $catlistid); //lguan_20100612: Changed following codes to get product rating for categories if (count($catlistid) > 0) { $catcountlist = $selected_catg . "," . $catcountlist; } $cat_rating_res = $GLOBALS['ISC_CLASS_DB']->Query("SELECT floor(SUM(p.prodratingtotal)/SUM(p.prodnumratings))AS prodavgrating FROM [|PREFIX|]categoryassociations c INNER JOIN [|PREFIX|]products p on c.productid=p.productid where c.categoryid IN ({$catcountlist})"); $cat_rating_arr = $GLOBALS['ISC_CLASS_DB']->FetchOne($cat_rating_res); if (isset($cat_rating_arr['prodavgrating'])) { $category_rating = (int) $cat_rating_arr['prodavgrating']; } } } /* displaying the dropdowns for YMM */ if (!isset($params['make']) || !isset($params['year']) || !isset($params['model']) || isset($params['model_flag']) && $params['model_flag'] == 0) { $this->YMMSelectors($params); } // We have at least one result, let's show it to the world! $GLOBALS['HideNoResults'] = "none"; // Only show the "compare" option if there are 2 or more products on this page if (GetConfig('EnableProductComparisons') == 0 || $GLOBALS['ISC_CLASS_DB']->CountResult($GLOBALS['SearchResults']) < 2) { $GLOBALS['HideCompareItems'] = "none"; } if (GetConfig('EnableProductReviews') == 0) { $GLOBALS['HideProductRating'] = "display: none"; } $GLOBALS['AlternateClass'] = ''; $counter = 1; $CurCatId = 0; $mmy_links = $this->GetYMMLinks($params); $mmy_links .= $this->GetOtherLinks($params); //wirror_code_mark_begin //wirror_20100809: record the searched productids $searchedProductIds = array(); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($GLOBALS['SearchResults'])) { /* Added by Simha to check inf prodcucts comes from different categories*/ if (empty($params['srch_category']) || !isset($params['srch_category'])) { if ($CurCatId != $row['categoryid']) { $CurCatId = $row['categoryid']; $map_names = array(); $display_names = array(); $filter_names = "SELECT DISTINCT qn.qid, qn.column_name, qn.display_names from \n [|PREFIX|]qualifier_names qn\n LEFT JOIN [|PREFIX|]qualifier_associations qa ON qa.qualifierid = qn.qid\n WHERE (qa.categoryid = '{$CurCatId}') \n AND qn.column_name regexp '^(pq|vq)'"; // || qa.categoryid IN (SELECT catparentid FROM isc_categories WHERE categoryid = '$CurCatId') $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names); while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) { $map_names[$filter_row['qid']] = $filter_row['column_name']; $display_names[$filter_row['qid']] = $filter_row['display_names']; } $this->GetAssocDetails($CurCatId, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue); } } /* Added by Simha Ends */ $GLOBALS['SearchTrackClass'] = "TrackLink"; $imagefile = ""; if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $qry_string = $_SERVER['QUERY_STRING']; if (isset($_GET['page'])) { $page = "&page=" . $_GET['page']; $qry_string = str_ireplace($page, '', $qry_string); } if ($GLOBALS['EnableSEOUrls'] == 1) { if (isset($_GET['search_key'])) { $qry_string = str_ireplace('&search_key=' . $_GET['search_key'], '', $qry_string); } if (isset($params['search_query']) && !strstr($qry_string, 'search_query=')) { $qry_string .= "search_query=" . MakeURLSafe($params['search_query']); } if (isset($params['make']) && !strstr($qry_string, 'make=')) { $qry_string .= "&make=" . MakeURLSafe($params['make']); } if (isset($params['model']) && !strstr($qry_string, 'model=')) { $qry_string .= "&model=" . MakeURLSafe($params['model']); } if (isset($params['year']) && !strstr($qry_string, 'year=')) { $qry_string .= "&year=" . MakeURLSafe($params['year']); } if (isset($params['make']) && !strstr($qry_string, 'make=')) { $qry_string .= "&make=" . MakeURLSafe($params['make']); } if (isset($params['model_flag']) && !strstr($qry_string, 'model_flag=')) { $qry_string .= "&model_flag=" . MakeURLSafe($params['model_flag']); } if (isset($params['submodel']) && !strstr($qry_string, 'submodel=')) { $qry_string .= "&submodel=" . MakeURLSafe($params['submodel']); } } if ($GLOBALS['results_page_flag'] == 0 && !isset($params['srch_category'])) { break; } if ($GLOBALS['pagetype'] == 3) { //wirror_mark_condition1 /*if( isset($params['srch_category']) ) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of product listing page. }*/ /*if(isset($params['category']) || ( !isset($params['subcategory']) && isset($params['series']) )) { $GLOBALS['CatgDescandBrandImage'] = $row['seriesdescription']; //$GLOBALS['CatgBrandSeriesFooter'] = $row['seriesfooter']; $GLOBALS['CatgBrandSeriesFooter'] = ""; if( ( isset($params['category']) || isset($params['subcategory']) ) && $GLOBALS['CatgDescandBrandImage'] == "" ) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; //$GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = ""; } } else if(isset($params['srch_category'])) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; if( isset($params['series']) && $row['seriesdescription'] != "" ) { $GLOBALS['CatgDescandBrandImage'] = $row['seriesdescription']; //$GLOBALS['CatgBrandSeriesFooter'] = $row['seriesfooter']; $GLOBALS['CatgBrandSeriesFooter'] = ""; } if($GLOBALS['CatgDescandBrandImage'] == '' && $GLOBALS['CatgBrandSeriesFooter'] == '' && isset($params['brand'])) { $GLOBALS['CatgDescandBrandImage'] = isset($brand_desc_arr['branddescription']) ? $brand_desc_arr['branddescription'] : ''; //$GLOBALS['CatgBrandSeriesFooter'] = isset($brand_desc_arr['brandfooter']) ? $brand_desc_arr['brandfooter'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = ""; } } else if(isset($params['brand'])) { $GLOBALS['CatgDescandBrandImage'] = isset($brand_desc_arr['branddescription']) ? $brand_desc_arr['branddescription'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = isset($brand_desc_arr['brandfooter']) ? $brand_desc_arr['brandfooter'] : ''; }*/ /* No need to show footer description when YMM are selected */ /*if( isset($params['make']) || isset($params['model']) || isset($params['year']) ) { $GLOBALS['CatgBrandSeriesFooter'] = ""; }*/ $GLOBALS['ProductCartQuantity'] = ''; if (isset($GLOBALS['CartQuantity' . $row['productid']])) { $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']]; } if ($counter % 2 == 0) { $GLOBALS['RowColor'] = 'grayrow'; } else { $GLOBALS['RowColor'] = 'whiterow'; } $counter++; $GLOBALS['ProductId'] = (int) $row['productid']; $GLOBALS['ProductName'] = isc_html_escape($row['prodname']); $GLOBALS['ProductLink'] = ProdLink($row['prodname']); $GLOBALS['ProductRating'] = (int) $row['prodavgrating']; //$GLOBALS['BrandName'] = $row['brandname']; /* -- The below code is added to display the brand and series logo -- */ $GLOBALS['BrandName'] = ""; $brandlogo = realpath(ISC_BASE_PATH . '/product_images/' . $row['brandimagefile']); if ($row['brandimagefile'] != '' && file_exists($brandlogo)) { $GLOBALS['BrandName'] .= "<img src=\"" . $GLOBALS['ShopPath'] . "/product_images/" . $row['brandimagefile'] . "\" class=\"BrandSeriesLogo\" />"; } else { $GLOBALS['BrandName'] .= $row['brandname']; } $serieslogo = realpath(ISC_BASE_PATH . '/series_images/' . $row['serieslogoimage']); if ($row['serieslogoimage'] != '' && file_exists($serieslogo)) { $GLOBALS['BrandName'] .= "<br><img src=\"" . $GLOBALS['ShopPath'] . "/series_images/" . $row['serieslogoimage'] . "\" />"; } else { $GLOBALS['BrandName'] .= "<br>" . $row['seriesname']; } /* --- ends --- */ $GLOBALS['ProdCode'] = $row['prodcode']; //$GLOBALS['ProdDesc'] = $this->strip_html_tags($row['proddesc']); //$GLOBALS['ProdOptions'] = $row['productoption']; $GLOBALS['VehicleOptions'] = ""; $GLOBALS['ProdOptions'] = ""; foreach ($row as $key => $val) { if ($val != "" && $val != "~") { if (($qualifier_id = array_search($key, $map_names)) !== false) { if (eregi('^vq', $key)) { $val = trim($val, "~"); $val = preg_split('/[~;]+/', $val); $val = array_unique($val); $val = array_values($val); $val = implode(",", $val); /* -- Setting display name for qualifier name -- */ if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') { $key = $OwnAssoc[$qualifier_id][0]['qname']; } else { if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') { $key = $ParentAssoc[$qualifier_id][0]['qname']; } else { if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) { $key = $display_names[$qualifier_id]; } else { $key = ucfirst(str_ireplace($filter_var, "", $key)); } } } /* -- Setting display name for qualifier name ends -- */ /* -- Setting display name for qualifier value -- */ if (isset($OwnValue[$qualifier_id]) && ($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != "") { $val = $OwnAssoc[$qualifier_id][$m]['vname']; } else { if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentAssoc[$qualifier_id][$m]['vname'] != "") { $val = $ParentAssoc[$qualifier_id][$m]['vname']; } } /* -- Setting display name for qualifier value ends-- */ //$GLOBALS['VehicleOptions'] .= "<b>".$key."</b> : ".$val."<br>"; $GLOBALS['VehicleOptions'] .= "<div class='qualifierwrap'><div class='qualifiertitle'>" . $key . " :</div> " . $val . "</div>"; } if (eregi('^pq', $key)) { $val = trim($val, "~"); $val = preg_split('/[~;]+/', $val); $val = array_unique($val); $val = array_values($val); $val = implode(",", $val); /* -- Setting display name for qualifier name -- */ if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') { $key = $OwnAssoc[$qualifier_id][0]['qname']; } else { if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') { $key = $ParentAssoc[$qualifier_id][0]['qname']; } else { if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) { $key = $display_names[$qualifier_id]; } else { $key = ucfirst(str_ireplace($filter_var, "", $key)); } } } /* -- Setting display name for qualifier name ends -- */ /* -- Setting display name for qualifier value -- */ if (isset($OwnValue[$qualifier_id]) && ($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != '') { $val = $OwnAssoc[$qualifier_id][$m]['vname']; } else { if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentValue[$qualifier_id][$m]['vname'] != '') { $val = $ParentAssoc[$qualifier_id][$m]['vname']; } } /* -- Setting display name for qualifier value ends-- */ //$GLOBALS['ProdOptions'] .= "<b>".$key."</b> : ".$val."<br>"; $GLOBALS['ProdOptions'] .= "<div class='qualifierwrap'><div class='qualifiertitle'>" . $key . " :</div> " . $val . "</div>"; } } } } if (isset($row['vehicleoption'])) { $GLOBALS['VehicleOptions'] = $row['vehicleoption']; } if (isset($row['productoption'])) { $GLOBALS['ProdOptions'] = $row['productoption']; } if (isset($row['catuniversal']) && $row['catuniversal'] == 1) { $GLOBALS['VehicleOptions'] = $GLOBALS['ProductName']; if ($vq_column_title == "") { $vq_column_title = "Product Name"; } else { if ($vq_column_title != "Product Name") { $vq_column_title = "Product Name / Vehicle"; } } } else { if ($vq_column_title == "") { $vq_column_title = "Vehicle Options"; } else { if ($vq_column_title != "Vehicle Options") { $vq_column_title = "Product Name / Vehicle"; } } } if (empty($GLOBALS['ProdOptions']) && empty($GLOBALS['VehicleOptions'])) { $GLOBALS['ProdOptions'] = " "; } if (empty($GLOBALS['VehicleOptions'])) { $GLOBALS['VehicleOptions'] = " "; } /*--- the below lines are added for back 2 search link in the product detail page. Also modified line no 56 & 60 --- */ if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductLink'] .= "/refer=true" . $ext_links; if (isset($GLOBALS['SearchId'])) { $GLOBALS['ProductLink'] .= '/SearchLogId/' . $GLOBALS['SearchId']; } } else { $GLOBALS['ProductLink'] .= "&refer=true" . $ext_links; if (isset($GLOBALS['SearchId'])) { $GLOBALS['ProductLink'] .= '&SearchLogId=' . $GLOBALS['SearchId']; } } ### Added by Simha for onsale addition // Determine the price of this product //$GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row); $GLOBALS['ProductPrice'] = CalculateProductPriceRetail($row); $FinalPrice = $GLOBALS['ProductPrice']; $SalePrice = $row['prodsaleprice']; //$DiscountAmount = $FinalPrice; $discounttype = 0; $discountname = ''; if ((double) $SalePrice > 0 && $SalePrice < $FinalPrice) { $DiscountPrice = $SalePrice; } else { $DiscountPrice = $FinalPrice; $DiscountPrice = CalculateDiscountPrice($FinalPrice, $DiscountPrice, $row['categoryid'], $row['brandseriesid'], $discounttype, $discountname); /*if($discounttype == 0) { $DiscountPrice = $FinalPrice; }*/ } /* foreach($DiscountInfo as $DiscountInfoSub) { if(isset($DiscountInfoSub['catids'])) { $catids = explode(",", $DiscountInfoSub['catids']); foreach($catids as $catid) { if($catid == $row['categoryid']) { $DiscountAmount = $FinalPrice * ((int)$DiscountInfoSub['amount']/100); if ($DiscountAmount < 0) { $DiscountAmount = 0; } $DiscountPrice = $FinalPrice - $DiscountAmount; } } } } */ if (isset($DiscountPrice) && $DiscountPrice < $FinalPrice && $discounttype == 0) { //&& GetConfig('ShowOnSale') $GLOBALS['ProductPrice'] = '<strike>' . CurrencyConvertFormatPrice($FinalPrice) . '</strike>'; $GLOBALS['ProductPrice'] .= '<br><div class="finalprice">' . CurrencyConvertFormatPrice($DiscountPrice) . '</div> '; if (strtolower($discountname) == "clearance") { $GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/clearance.gif" alt="">'; } else { $GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } if (GetConfig('ShowOnSale')) { $GLOBALS['ProductPrice'] .= '' . $GLOBALS['ShowOnSaleImage'] . ''; } } else { $GLOBALS['ProductPrice'] = '<div class="finalprice">' . CurrencyConvertFormatPrice($FinalPrice) . '</div>'; } ### Added by Simha Ends // commented the below line by vikas //$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname'])); $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], $GLOBALS['ProductLink']); if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) { //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas $GLOBALS['ProductURL'] = $GLOBALS['ProductLink']; $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink'); } else { //$GLOBALS['ProductURL'] = CartLink($row['productid']); //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas $GLOBALS['ProductURL'] = $GLOBALS['ProductLink']; //blessen if (intval($row['prodretailprice']) <= 0) { //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); // commented by vikas on 15-7-09 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>"; } else { //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1'); // commented by vikas on 15-7-09 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>"; } //blessen // original $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); } if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) { $GLOBALS['HideActionAdd'] = ''; } else { $GLOBALS['HideActionAdd'] = 'none'; } $GLOBALS['HideProductVendorName'] = 'display: none'; $GLOBALS['ProductVendor'] = ''; if (GetConfig('ShowProductVendorNames') && $row['prodvendorid'] > 0) { $vendorCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Vendors'); if (isset($vendorCache[$row['prodvendorid']])) { $GLOBALS['ProductVendor'] = '<a href="' . VendorLink($vendorCache[$row['prodvendorid']]) . '">' . isc_html_escape($vendorCache[$row['prodvendorid']]['vendorname']) . '</a>'; $GLOBALS['HideProductVendorName'] = ''; } } $GLOBALS['CartURL'] = CartLink($row['productid']); if (isset($GLOBALS['SearchId'])) { $GLOBALS['CartURL'] .= '&SearchLogId=' . $GLOBALS['SearchId']; } $offer = $this->IsProductMakeanOffer($row['brandseriesid'], $row['brandname'], $row['categoryid']); if ($offer == 'yes') { $GLOBALS['HideOfferButton'] = 'block'; } else { $GLOBALS['HideOfferButton'] = 'none'; } $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItem"); } else { if ($GLOBALS['pagetype'] == 2) { //wirror_mark_condition2 $isDynamicPage = $catg_desc_arr['pagecontenttype'] == 0 ? true : false; $mmy_links_modified = $mmy_links; if (!isset($GLOBALS['ISC_SRCH_CATG_ID'])) { $parentid = $GLOBALS['categories_all'][$row['categoryid']]['catparentid']; if ($parentid != 0) { if (isset($GLOBALS['categories_all'][$parentid])) { // if parent catg is not visible $mmy_links_modified = $mmy_links; } else { $mmy_links_modified = $mmy_links; } } else { $mmy_links_modified = $mmy_links; } } $subcatg_link = $this->LeftCatLink($mmy_links_modified, 'subcategory', $row['catname']); $link = "<a href='" . $subcatg_link . "'>"; $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>"; $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title='' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>"; //$imagelink = "<a href='".$GLOBALS['ShopPath']."/catgbrand.php?categoryid=".$row['categoryid']."&url=$subcatg_link' class='thickbox' title=''>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); for ($j = 0; $j < count($images); $j++) { if (!empty($images[$j])) { $imagefile = "{$imagelink}<img src='{$path}/category_images/" . $images[$j] . "' alt='" . $row['catimagealt'] . "' title='" . $row['catimagealt'] . "'></a>"; $imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>"; break; } } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; $imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>"; } } $GLOBALS['LeftImage'] = $imagefile; $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); //$GLOBALS['RelatedBrands'] = $row['brandname']; if (!empty($row['seriesname'])) { $row['brandname'] .= "<br>" . $row['seriesname']; } $GLOBALS['CatgSeriesList'] = ""; if ($row['seriesids'] != "") { $seriesids = str_ireplace("~", ",", $row['seriesids']); $seriesids_qry = "select seriesid , brandname , seriesname from isc_brand_series bs left join isc_brands b on bs.brandid = b.brandid where seriesid in (" . $seriesids . ")"; $seriesids_res = $GLOBALS['ISC_CLASS_DB']->Query($seriesids_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($seriesids_res) > 0) { while ($seriesids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($seriesids_res)) { if ($GLOBALS['CatgSeriesList'] == "") { $GLOBALS['CatgSeriesList'] .= "<br><a href='javascript:' onclick=\"checkanimate('" . $row['categoryid'] . "')\">View Brands ></a><div id='" . $row['categoryid'] . "' style='display:block'>"; } else { $GLOBALS['CatgSeriesList'] .= "<br>"; } $tooltipscript = "onmouseover='createtip(" . $row['categoryid'] . $seriesids_arr['seriesid'] . ")' onmouseout='UnTip()'"; if (!isset($params['brand'])) { if ($GLOBALS['EnableSEOUrls'] == 1) { $series_link = $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $series_link = $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } else { if ($GLOBALS['EnableSEOUrls'] == 1) { $series_link = $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $series_link = $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } //wirror20100728: keep the catname consistent with the displayname $GLOBALS['CatgSeriesList'] .= "<span id='span" . $row['categoryid'] . $seriesids_arr['seriesid'] . "' style='display:none'><a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $seriesids_arr['seriesid'] . "&catname=" . rawurlencode($row['catname']) . "&url=" . urlencode($series_link) . "' class='' ><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a></span>"; } $GLOBALS['CatgSeriesList'] .= "</br></div>"; } } $content = $row['brandname'] . "<br>"; if (!isset($params['category']) && (isset($params['srch_category']) || !isset($GLOBALS['BRAND_SERIES_FLAG']))) { /*$GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; if( isset($params['make']) || isset($params['model']) || isset($params['year']) || isset($params['brand']) ) { $GLOBALS['CatgBrandSeriesFooter'] = ""; }*/ $content .= "<h3><a href='" . $path . "/search.php?{$qry_string}&subcategory=" . MakeURLSafe($row['catname']) . "'>" . $row['catname'] . "</a></h3>>"; $GLOBALS['TitleLink'] = "<h2><a href='" . $subcatg_link . "' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>" . $row['catname'] . "</a></h2>"; } /* copy the code to outer //lguan_20100612: Show overal product rating at category landing page if($category_rating != 0) { $GLOBALS['CatgDescandBrandImage'] .= "<br><h2>Rating : <img width='64' height='12' src='".$GLOBALS['TPL_PATH']."/images/IcoRating$category_rating.gif' alt='' /></h2>"; } */ /*$ProdStartPrice = GetStartingPrice($row['categoryid'], $row['prodcalculatedprice']); $content .= "Price starting from $".number_format($ProdStartPrice, 2, '.', '')."<br>".$imagefile;*/ $GLOBALS['leftsidecontent'] = $content; if (number_format($row['prodminprice'], 2, '.', '') < number_format($row['prodmaxprice'], 2, '.', '')) { $GLOBALS['PriceRange'] = "Price range from \$" . number_format($row['prodminprice'], 2, '.', '') . " to \$" . number_format($row['prodmaxprice'], 2, '.', ''); } else { $GLOBALS['PriceRange'] = "Available at \$" . number_format($row['prodminprice'], 2, '.', ''); } //lguan_20100612: Show product ratings in categories/sub-categories page $GLOBALS['Rating'] = isset($row['prodavgrating']) ? $row['prodavgrating'] : 0; $GLOBALS['RatingVisible'] = $GLOBALS['Rating'] == 0 ? 'display:none' : ''; $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $GLOBALS['ViewDetailsImage'] = "<a href='{$path}/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' class='thickbox'><img src='{$path}/templates/default/images/fastlook_red.gif'></a> "; $content = "{$link}<img src='{$path}/templates/default/images/viewproducts.gif'></a>"; $GLOBALS['ViewDetailsImage'] .= $content; $discountname = ''; if (IsDiscountAvailable('category', $row['categoryid'], $discountname)) { if (strtolower($discountname) == "clearance") { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/clearance.gif" alt="">'; } else { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } } if ($this->IsMakeAnOffer('category', $row['categoryid']) == 'yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } $GLOBALS['RelatedBrands'] = $row['featurepoints']; $GLOBALS['lowersidecontent'] = $content; $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListing"); } } } ///wirror_code_mark_end $get_variables = $_GET; $sort_qry = "{$path}/search.php?search_query=" . urlencode($params['search_query']); unset($get_variables['orderby'], $get_variables['sort'], $get_variables['search_query'], $get_variables['sortby']); $i = 0; foreach ($get_variables as $key => $value) { $sort_qry .= "&{$key}={$value}"; } if (isset($_REQUEST['sortby']) && $_REQUEST['sortby'] == 'desc') { $sort = "asc "; $img = " <img src='{$path}/templates/default/images/ArrowDown.gif' border=0>"; } else { $sort = "desc "; $img = " <img src='{$path}/templates/default/images/ArrowUp.gif' border=0>"; } //wirror_code_mark_begin //$GLOBALS['SearchResults'] = $GLOBALS['SearchResultList']; // commented by vikas if (isset($params['partnumber']) || $params['flag_srch_category'] == 1 || isset($params['flag_srch_category']) && isset($GLOBALS['BRAND_SERIES_FLAG']) && $GLOBALS['BRAND_SERIES_FLAG'] == 1) { $path = $path . "/a-b-testing"; if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductBrand'] = "<a href='{$path}{$mmy_links}/orderby/brandname/sortby/{$sort}'>Brand / Series</a>"; $GLOBALS['ProductPartNumber'] = "<a href='{$path}{$mmy_links}/orderby/prodcode/sortby/{$sort}'>Image / Part#</a>"; $GLOBALS['ProductDetails'] = "<a href='{$path}{$mmy_links}/orderby/prodfinalprice/sortby/{$sort}'>Price</a>"; } else { $GLOBALS['ProductBrand'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=brandname&sortby={$sort}'>Brand / Series</a>"; $GLOBALS['ProductPartNumber'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=prodcode&sortby={$sort}'>Image / Part#</a>"; $GLOBALS['ProductDetails'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=prodfinalprice&sortby={$sort}'>Price</a>"; } if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'brandname') { $GLOBALS['ProductBrand'] .= $img; } $GLOBALS['ProductVQ'] = $vq_column_title; /*if(isset($_GET['orderby']) && $_GET['orderby'] == 'brandname') $GLOBALS['Product_VQ'] .= $img;*/ if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodcode') { $GLOBALS['ProductPartNumber'] .= $img; } $GLOBALS['ProductPQ'] = "Product Options"; /*if(isset($_GET['orderby']) && $_GET['orderby'] == 'productoption') $GLOBALS['SearchResults'] .= $img;*/ if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodcalculatedprice') { $GLOBALS['ProductPrice'] .= $img; } if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodfinalprice') { $GLOBALS['ProductDetails'] .= $img; } $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AbSubCategoryProductsItemHeader"); } else { //lguan_20100612: Show overal product rating at category landing page /*if($category_rating != 0) { $GLOBALS['CatgDescandBrandImage'] .= "<br><h2>Rating : <img width='64' height='12' src='".$GLOBALS['TPL_PATH']."/images/IcoRating$category_rating.gif' alt='' /></h2>"; }*/ // $GLOBALS['SearchResults'] = "<div>".$GLOBALS['SearchResultList']."</div>"; $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AbSubCategoryListingMain"); if ($GLOBALS['results_page_flag'] == 0 && !isset($params['srch_category'])) { $GLOBALS['SearchLink'] = ""; if (isset($params['searchtext'])) { $GLOBALS['SearchLink'] .= "/searchtext/" . MakeURLSafe(strtolower($params['searchtext'])); } if (isset($params['search'])) { $GLOBALS['SearchLink'] .= "/searchtext/" . MakeURLSafe(strtolower($params['search'])); } if (isset($params['model']) && !isset($params['make'])) { $GLOBALS['SearchLink'] .= "/model/" . MakeURLSafe(strtolower($params['model'])); } if (isset($params['model_flag']) && $params['model_flag'] == 0 && !isset($params['make'])) { $GLOBALS['SearchLink'] .= "/model_flag/" . MakeURLSafe(strtolower($params['model_flag'])); } $GLOBALS['SearchResults'] = ""; if (isset($GLOBALS['YMMTable'])) { $GLOBALS['SearchResults'] .= "<div>" . $GLOBALS['YMMTable'] . "</div>"; } if ($_REQUEST['is_smart_search']) { $GLOBALS['SearchResults'] .= '<p class="ErrorMessage">' . GetLang('SearchYourSearch') . ' <strong>"' . htmlspecialchars($GLOBALS['OriginalSearchQuery']) . '"</strong> ' . GetLang('SearchDidNotMatch') . '</p>'; if ($GLOBALS['OriginalSearchQuery'] == '') { $GLOBALS['SearchTitle'] = ''; } else { $GLOBALS['SearchTitle'] = " " . sprintf(GetLang('SearchResultsFor'), $GLOBALS['OriginalSearchQuery']); } } //$GLOBALS['SearchResults'] .= "<div style='width:100%'><p class='InfoMessage'>Please choose a category or brand</p></div>"; $GLOBALS['CategoryBrandList'] = "%%Panel.StaticFeaturedCategories%%\n\t\t\t\t\t\t\t%%Panel.StaticFeaturedBrands%%"; $GLOBALS['HidePanels'][] = 'SearchPagingTop'; } } $GLOBALS['SearchResults'] .= "<script type=\"text/javascript\"> \$('.focushiddendiv').css({'position':'absolute', 'margin-top':'-200px', 'display':'block'}); </script>"; if ($GLOBALS['EnableSEOUrls'] == 1) { $back2url = $_SESSION['back2url'] = preg_replace("/^\\//", "", $_SERVER['REQUEST_URI']); } else { $back2url = $_SESSION['back2url'] = "search.php?" . $_SERVER['QUERY_STRING']; } ISC_SetCookie("back2search", $back2url, 0, "/"); } else { $this->YMMSelectors($params); $GLOBALS['SearchResults'] = "<div>" . $GLOBALS['YMMTable'] . "</div>"; $GLOBALS['CategoryBrandList'] = "%%Panel.StaticFeaturedCategories%%\n\t\t\t\t%%Panel.StaticFeaturedBrands%%"; // No search results were found // commented below code as need to show the favorite categories and brands as in homepage /*$GLOBALS['HideSearchResults'] = "none"; $GLOBALS['HidePanels'][] = 'SearchPageProducts';*/ } }
function LowerCaseSQL($term) { $term = UpperCaseSql($term); $term = Strtolower($term); return $term; }
function searchcategories($params, $selected_value) { $GLOBALS['ISC_CategoryBrandCache'] = GetClass('ISC_CACHECATEGORYBRANDS'); $cachedCategoryBrands = $GLOBALS['ISC_CategoryBrandCache']->getCategoryBrandsData(); $ValidCats = $GLOBALS['ISC_CategoryBrandCache']->GetValidCategories($cachedCategoryBrands); $output = ""; unset($params['brand'], $params['series']); // this is added as brand should not be selected when category is being selected $searchQueries = BuildProductSearchQuery($params); $mmy_links = ""; // this link is used for applying href links of MMY $brand = ""; if (isset($params['brand']) && isset($params['category'])) { $brand = $params['brand']; unset($params['brand']); } unset($params['category'], $params['srch_category']); $mmy_links = $this->GetYMMLinks($params); foreach ($this->items as $qkey => $qval) { if (preg_match("/^(pq|vq)/", $qkey)) { if ($qkey != 'vqsbedsize' && $qkey != 'vqscabsize') { if ($GLOBALS['EnableSEOUrls'] == 1) { $mmy_links .= "/" . strtolower($qkey) . "/" . MakeURLSafe(strtolower($qval)); } else { $mmy_links .= "&" . strtolower($qkey) . "=" . MakeURLSafe(strtolower($qval)); } } } } /* the below condition is applied as brand has to be assigned to get it in the where condition in general.php */ if ($brand != "") { $params['brand'] = $brand; } $categories = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('RootCategories'); /*echo "<a name='list'>LIST</a>"; echo "<p>Please click on any link from the below list.</p>"; echo "<div style='height:280px;overflow-y:auto;border:1px solid black'>";*/ $dept = array(); $cat_dept = array(); $cat_department = array(); /*$cat_dept_qry = "select categoryid , catdeptid , deptname from [|PREFIX|]categories c left join [|PREFIX|]department d on d.deptid = c.catdeptid where catparentid = 0 and catvisible = 1 order by deptname asc, catdeptid desc, catname"; $cat_dept_res = $GLOBALS['ISC_CLASS_DB']->Query($cat_dept_qry);*/ $CatsDepts = $GLOBALS['ISC_CategoryBrandCache']->GetCatDepts($cachedCategoryBrands); //while($cat_dept_row = $GLOBALS['ISC_CLASS_DB']->Fetch($cat_dept_res)) { foreach ($CatsDepts as $cat_dept_row) { //$cat_department[$cat_dept_row['categoryid']]['catdeptid'] = $cat_dept_row['deptname']; $dept[$cat_dept_row['catdeptid']] = $cat_dept_row['deptname']; $cat_dept[$cat_dept_row['categoryid']] = $cat_dept_row['catdeptid']; if (isset($categories[0][$cat_dept_row['categoryid']])) { $categories[0][$cat_dept_row['categoryid']]['catdeptid'] = $cat_dept_row['catdeptid']; } } //arsort($cat_dept); foreach ($cat_dept as $key => $value) { if (isset($categories[0][$key])) { $cat_department[0][$key] = $categories[0][$key]; } } $categories = $cat_department; $catg_list = array(); $catg_count_list = array(); $catg_qry = "select categoryid , catparentid from [|PREFIX|]categories"; $catg_res = $GLOBALS['ISC_CLASS_DB']->Query($catg_qry); while ($catg_row = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_res)) { $catg_list[$catg_row['categoryid']] = $catg_row['catparentid']; } $searchQueries = BuildProductSearchQuery($params); $searchQueries['query'] = str_replace('USE INDEX (categoryid)', 'USE INDEX (PRIMARY)', $searchQueries['query']); $searchQueries['query'] = str_replace($GLOBALS['srch_where'], " group_concat(DISTINCT c.categoryid separator '~') as categoryid ", $searchQueries['query']); $searchQueries['query'] .= " group by p.productid "; $catg_select_res = $GLOBALS['ISC_CLASS_DB']->Query($searchQueries['query']); //print_r($catgcount); while ($catg_select_row = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_select_res)) { $ids = explode('~', $catg_select_row['categoryid']); for ($k = 0; $k < count($ids); $k++) { if (!empty($ids[$k])) { if (!isset($catg_count_list[$ids[$k]])) { $catg_count_list[$ids[$k]] = 0; } if ($catg_list[$ids[$k]] == 0) { $catg_count_list[$ids[$k]] += 1; } else { if (!isset($catg_count_list[$catg_list[$ids[$k]]])) { $catg_count_list[$catg_list[$ids[$k]]] = 0; } $catg_count_list[$catg_list[$ids[$k]]] += 1; } } } } //$GLOBALS['ISC_CLASS_VALID_CATEGORIES'] = GetClass('ISC_VALID_CATEGORY'); //$GLOBALS['ISC_CLASS_VALID_CATEGORIES']->_ProcessCategories($categories); $output .= "<ul>"; $temp_dept = ""; foreach ($categories[0] as $rootCat) { if ($rootCat['categoryid'] != $selected_value) { // If we don't have permission to view this category then skip if (!CustomerGroupHasAccessToCategory($rootCat['categoryid'])) { continue; } if (!in_array($rootCat['categoryid'], $ValidCats)) { continue; } /*if(!isset($GLOBALS['ISC_CLASS_VALID_CATEGORIES']->_newcategoryids[$rootCat['categoryid']]))// not displaying the catg which are having zero products from main catg listing continue;*/ if ($temp_dept != $rootCat['catdeptid']) { if (!empty($temp_dept)) { $output .= "</ul>"; } if (!empty($dept[$rootCat['catdeptid']])) { $GLOBALS['deptname'] = $dept[$rootCat['catdeptid']]; } else { $GLOBALS['deptname'] = "Other Departments"; } $GLOBALS['deptid'] = "dept" . $rootCat['catdeptid']; $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CategoryDepartment"); $output .= "<ul id='" . $GLOBALS['deptid'] . "'>"; //$output .= "<ul><li style='background-color: rgb(255, 15, 25);font-size:12px'>".$dept[$rootCat['catdeptid']]."</li></ul><ul>"; $temp_dept = $rootCat['catdeptid']; } $GLOBALS['CategoryName'] = isc_html_escape($rootCat['catname']); $category_link = ""; if (isset($_REQUEST['abtesting']) && $_REQUEST['abtesting'] != "") { $RootCatName = $rootCat['catname']; } else { if ($brand == "") { $RootCatName = $rootCat['catname']; } else { $RootCatName = $brand; if ($GLOBALS['EnableSEOUrls'] == 1) { $category_link = "/category/" . MakeURLSafe(Strtolower($rootCat['catname'])); } else { $category_link = "&category=" . MakeURLSafe(Strtolower($rootCat['catname'])); } } } if (isset($_REQUEST['abtesting']) && $_REQUEST['abtesting'] != "") { //Modify 2010-10-19 Ronnie //$GLOBALS['CategoryLink'] = $this->path."/a-b-testing/".MakeURLSafe(strtolower($_REQUEST['abtesting']))."/category/".MakeURLSafe(strtolower($RootCatName)).$mmy_links; $GLOBALS['CategoryLink'] = $this->path . "/" . MakeURLSafe(strtolower($RootCatName)) . $mmy_links; } else { $GLOBALS['CategoryLink'] = $this->LeftCatLink($RootCatName) . $mmy_links . $category_link; } //$GLOBALS['CategoryLink'] = "$this->path/search.php?search_query=".urlencode($GLOBALS['CategoryName']).$mmy_links; if (!isset($catg_count_list[$rootCat['categoryid']])) { $catg_count_list[$rootCat['categoryid']] = 0; } //$GLOBALS['CategoryCount'] = "(".$catg_count_list[$rootCat['categoryid']].")"; $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryList"); } } $output .= "</ul>"; return $output; }
function fetch_word() { $query = "SELECT * FROM websites ORDER BY ID DESC"; $result = mysql_query($query); while ($displayInput = mysql_fetch_array($result)) { $data = file_get_contents($displayInput['link']); //$data = file_get_contents('http://feeds.bbci.co.uk/news/rss.xml'); //get all contents from the chosen website //$data2 = file_get_contents('http://hosted.ap.org/lineups/TOPHEADS.rss'); //get all contents from the chosen website //$data = $data + $data2; $data = simplexml_load_string($data); //load texts in a simple format //echo $data; //output texts are unorganized //print_r($data); //output texts are unorganized $articles = array(); //initialize variable articles as an array $bUserInputted = false; if (isset($_POST['searchWord'])) { $sFromUser = $_POST['searchWord']; $sFromUser = Strtolower($sFromUser); $sFromUser_split = Preg_split('/\\W/', $sFromUser, 0, PREG_SPLIT_NO_EMPTY); $bUserInputted = true; $counterFromUser = 0; foreach ($sFromUser_split as $Count) { $counterFromUser = $counterFromUser + 1; } } foreach ($data->channel->item as $item) { $media = $item->children('http://search.yahoo.com/mrss/'); $image = array(); if ($media->thumbnail && $media->thumbnail[0]->attributes()) { foreach ($media->thumbnail[0]->attributes() as $key => $value) { $image[$key] = (string) $value; } } // Get title and compare it with user input $sTitle = (string) $item->title; $sTitle = strtolower($sTitle); $sTitle_split = preg_split("/[^\\w]*([\\s]+[^\\w]*|\$)/", $sTitle, -1, PREG_SPLIT_NO_EMPTY); // Get description and compare it with user input. $wholeWord = (string) $item->description; $wholeWord = strtolower($wholeWord); $wholeWord_split = preg_split("/[^\\w]*([\\s]+[^\\w]*|\$)/", $wholeWord, -1, PREG_SPLIT_NO_EMPTY); if ($bUserInputted) { $counterFromTitle = 0; $counterFromDescription = 0; foreach ($sFromUser_split as $fromUser) { foreach ($sTitle_split as $fromTitle) { if ($fromTitle == $fromUser) { $counterFromTitle++; $counterFromDescription++; break; } else { foreach ($wholeWord_split as $fromDescription) { if ($fromDescription == $fromUser) { $counterFromDescription++; break; } } } } } if ($counterFromUser <= $counterFromTitle || $counterFromUser <= $counterFromDescription) { $articles[] = array('title' => (string) $item->title, 'description' => (string) $item->description, 'link' => (string) $item->link, 'date' => (string) $item->pubDate, 'image' => $image); } //echo $counterFromUser; //echo $counterFromTitle; //echo $counterFromDescription++; } else { $articles[] = array('title' => (string) $item->title, 'description' => (string) $item->description, 'link' => (string) $item->link, 'date' => (string) $item->pubDate, 'image' => $image); } } } return $articles; //print out all objects of "articles" }
public function SetPanelSettings() { $count = 0; $output = ""; $params = $GLOBALS['ISC_CLASS_SEARCH']->_searchterms; $this->searchterms = $params; $path = GetConfig('ShopPath'); /* the below mmy links are passed to the breadcrumbs */ $mmy_links = ""; /*---------- This below section is for generating search phrase----------*/ $GLOBALS['Category'] = ""; $GLOBALS['MMY'] = ""; $GLOBALS['PQ'] = ""; $GLOBALS['VQ'] = ""; $GLOBALS['SearchPhrase'] = ""; $ext_links = ""; // this variable is passed to the product detail page $seo_delim = "&"; if ($GLOBALS['EnableSEOUrls'] == 1) { $seo_delim = "/"; } if (isset($GLOBALS['ISC_SRCH_CATG_NAME'])) { $GLOBALS['Category'] .= $GLOBALS['ISC_SRCH_CATG_NAME']; } if (isset($params['year'])) { $GLOBALS['MMY'] .= $params['year'] . "<br>"; $ext_links .= $seo_delim . "year=" . $params['year']; } if (isset($params['make'])) { $GLOBALS['MMY'] .= strtoupper($params['make']) . "<br>"; $ext_links .= $seo_delim . "make=" . MakeURLSafe($params['make']); } if (isset($params['model']) && (!isset($params['model_flag']) || $params['model_flag'] == 1)) { $GLOBALS['MMY'] .= strtoupper($params['model']) . "<br>"; $ext_links .= $seo_delim . "model=" . MakeURLSafe($params['model']); } /*else if(isset($params['model'])) $ext_links .= $seo_delim."model=".$params['model'];*/ /* this condition has been added seperately here to show submodel at last */ if (isset($params['submodel'])) { $GLOBALS['MMY'] .= MakeURLSafe($params['submodel']) . "<br>"; } /*if(isset($params['year'])) { $ext_links .= $seo_delim."year=".$params['year']; }*/ if (isset($params['dynfilters']) && !empty($params['dynfilters'])) { foreach ($params['dynfilters'] as $key => $value) { if (eregi('vq', $key)) { $key = str_ireplace('vq', '', $key); $GLOBALS['VQ'] .= ucfirst($key) . ": {$value}<br>"; } else { if (eregi('pq', $key)) { $key = str_ireplace('pq', '', $key); $GLOBALS['PQ'] .= ucfirst($key) . ": {$value}<br>"; } } } } $filter_var = array('vq', 'pq'); /* this below patch is used for getting description of the category. Here currently the selected category id will be last one in the $params['srch_category'] array. if input['category'] is used then it will be the first one */ if (!empty($params['srch_category'])) { if (isset($params['category'])) { $selected_catg = $params['srch_category'][0]; } else { $selected_catg = end($params['srch_category']); } $catg_desc_qry = "select catdesc , categoryfooter from [|PREFIX|]categories where categoryid = " . $selected_catg; $catg_desc_res = $GLOBALS['ISC_CLASS_DB']->Query($catg_desc_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($catg_desc_res) > 0) { $catg_desc_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($catg_desc_res); } /* this below patch is used to show the display name for the qualifiers from the qualifier association table */ $map_names = array(); $display_names = array(); $filter_names = "select qid , column_name , display_names from [|PREFIX|]qualifier_names where column_name regexp '^(pq|vq)'"; $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names); while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) { $map_names[$filter_row['qid']] = $filter_row['column_name']; $display_names[$filter_row['qid']] = $filter_row['display_names']; } $this->GetAssocDetails($selected_catg, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue); } if (isset($params['brand'])) { $brand_desc_arr = array(); $brand_desc_qry = "select branddescription , brandfooter from [|PREFIX|]brands where brandname = '" . $params['brand'] . "'"; $brand_desc_res = $GLOBALS['ISC_CLASS_DB']->Query($brand_desc_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($brand_desc_res) > 0) { $brand_desc_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($brand_desc_res); } } // for breadcrumbs $this->_BuildBreadCrumbs(); /* the below line has been commented as client told to remove it */ //$GLOBALS['SearchPhrase'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchPhrase"); if ($GLOBALS['ISC_CLASS_SEARCH']->GetNumResults() > 30) { $msg_qry = "select value from [|PREFIX|]display where messageid = 1"; $msg_res = $GLOBALS['ISC_CLASS_DB']->Query($msg_qry); $msg_row = $GLOBALS['ISC_CLASS_DB']->FetchOne($msg_res); $GLOBALS['SearchPhrase'] = $msg_row; //$GLOBALS['SearchPhrase'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchPhrase"); } /*if(!empty($params['dynfilters'])) $GLOBALS['SearchPhrase'] .= " ".implode(" ",$params['dynfilters']); /*---------- Ending section for generating search phrase----------*/ $vq_column_title = ""; $GLOBALS['SearchResultList'] = ""; if ($GLOBALS['ISC_CLASS_SEARCH']->GetNumResults() > 0) { $brand_rating = 0; if ($GLOBALS['results_page_flag'] == 1) { $brand_rating_qry = "select avg(revrating) as rating from [|PREFIX|]reviews r left join [|PREFIX|]products p on r.revproductid = p.productid left join [|PREFIX|]brands b on p.prodbrandid = b.brandid where r.revstatus = 1 and b.brandname = '" . $params['brand'] . "'"; $brand_rating_res = $GLOBALS['ISC_CLASS_DB']->Query($brand_rating_qry); $brand_rating_arr = $GLOBALS['ISC_CLASS_DB']->FetchOne($brand_rating_res); if (isset($brand_rating_arr['rating'])) { $brand_rating = (int) $brand_rating_arr['rating']; } } /* displaying the dropdowns for YMM */ if (!isset($params['make']) || !isset($params['year']) || !isset($params['model']) || isset($params['model_flag']) && $params['model_flag'] == 0) { $this->YMMSelectors($params); } // We have at least one result, let's show it to the world! $GLOBALS['HideNoResults'] = "none"; // Only show the "compare" option if there are 2 or more products on this page if (GetConfig('EnableProductComparisons') == 0 || $GLOBALS['ISC_CLASS_DB']->CountResult($GLOBALS['SearchResults']) < 2) { $GLOBALS['HideCompareItems'] = "none"; } if (GetConfig('EnableProductReviews') == 0) { $GLOBALS['HideProductRating'] = "display: none"; } $GLOBALS['AlternateClass'] = ''; $counter = 1; $CurCatId = 0; $mmy_links = $this->GetYMMLinks($params); $mmy_links .= $this->GetOtherLinks($params); while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($GLOBALS['SearchResults'])) { /* Added by Simha to check inf prodcucts comes from different categories*/ if (empty($params['srch_category']) || !isset($params['srch_category'])) { if ($CurCatId != $row['categoryid']) { $CurCatId = $row['categoryid']; $map_names = array(); $display_names = array(); $filter_names = "SELECT DISTINCT qn.qid, qn.column_name, qn.display_names from \n [|PREFIX|]qualifier_names qn\n LEFT JOIN [|PREFIX|]qualifier_associations qa ON qa.qualifierid = qn.qid\n WHERE (qa.categoryid = '{$CurCatId}') \n AND qn.column_name regexp '^(pq|vq)'"; // || qa.categoryid IN (SELECT catparentid FROM isc_categories WHERE categoryid = '$CurCatId') $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names); while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) { $map_names[$filter_row['qid']] = $filter_row['column_name']; $display_names[$filter_row['qid']] = $filter_row['display_names']; } $this->GetAssocDetails($CurCatId, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue); } } /* Added by Simha Ends */ $GLOBALS['SearchTrackClass'] = "TrackLink"; $imagefile = ""; if ($GLOBALS['AlternateClass'] == 'Odd') { $GLOBALS['AlternateClass'] = 'Even'; } else { $GLOBALS['AlternateClass'] = 'Odd'; } $qry_string = $_SERVER['QUERY_STRING']; if (isset($_GET['page'])) { $page = "&page=" . $_GET['page']; $qry_string = str_ireplace($page, '', $qry_string); } if ($GLOBALS['EnableSEOUrls'] == 1) { if (isset($_GET['search_key'])) { $qry_string = str_ireplace('&search_key=' . $_GET['search_key'], '', $qry_string); } if (isset($params['search_query']) && !strstr($qry_string, 'search_query=')) { $qry_string .= "search_query=" . MakeURLSafe($params['search_query']); } if (isset($params['make']) && !strstr($qry_string, 'make=')) { $qry_string .= "&make=" . MakeURLSafe($params['make']); } if (isset($params['model']) && !strstr($qry_string, 'model=')) { $qry_string .= "&model=" . MakeURLSafe($params['model']); } if (isset($params['year']) && !strstr($qry_string, 'year=')) { $qry_string .= "&year=" . MakeURLSafe($params['year']); } if (isset($params['make']) && !strstr($qry_string, 'make=')) { $qry_string .= "&make=" . MakeURLSafe($params['make']); } if (isset($params['model_flag']) && !strstr($qry_string, 'model_flag=')) { $qry_string .= "&model_flag=" . MakeURLSafe($params['model_flag']); } if (isset($params['submodel']) && !strstr($qry_string, 'submodel=')) { $qry_string .= "&submodel=" . MakeURLSafe($params['submodel']); } } if (isset($params['partnumber']) || $params['flag_srch_category'] == 1 || isset($params['flag_srch_category']) && isset($GLOBALS['BRAND_SERIES_FLAG']) && $GLOBALS['BRAND_SERIES_FLAG'] == 1) { /*if( isset($params['srch_category']) ) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of product listing page. }*/ if (isset($params['category']) || !isset($params['subcategory']) && isset($params['series'])) { $GLOBALS['CatgDescandBrandImage'] = $row['seriesdescription']; $GLOBALS['CatgBrandSeriesFooter'] = $row['seriesfooter']; if ((isset($params['category']) || isset($params['subcategory'])) && $GLOBALS['CatgDescandBrandImage'] == "") { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; } } else { if (isset($params['srch_category'])) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; if (isset($params['series']) && $row['seriesdescription'] != "") { $GLOBALS['CatgDescandBrandImage'] = $row['seriesdescription']; $GLOBALS['CatgBrandSeriesFooter'] = $row['seriesfooter']; } if ($GLOBALS['CatgDescandBrandImage'] == '' && $GLOBALS['CatgBrandSeriesFooter'] == '' && isset($params['brand'])) { $GLOBALS['CatgDescandBrandImage'] = isset($brand_desc_arr['branddescription']) ? $brand_desc_arr['branddescription'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = isset($brand_desc_arr['brandfooter']) ? $brand_desc_arr['brandfooter'] : ''; } } else { if (isset($params['brand'])) { $GLOBALS['CatgDescandBrandImage'] = isset($brand_desc_arr['branddescription']) ? $brand_desc_arr['branddescription'] : ''; $GLOBALS['CatgBrandSeriesFooter'] = isset($brand_desc_arr['brandfooter']) ? $brand_desc_arr['brandfooter'] : ''; } } } $GLOBALS['ProductCartQuantity'] = ''; if (isset($GLOBALS['CartQuantity' . $row['productid']])) { $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']]; } if ($counter % 2 == 0) { $GLOBALS['RowColor'] = 'grayrow'; } else { $GLOBALS['RowColor'] = 'whiterow'; } $counter++; $GLOBALS['ProductId'] = (int) $row['productid']; $GLOBALS['ProductName'] = isc_html_escape($row['prodname']); $GLOBALS['ProductLink'] = ProdLink($row['prodname']); $GLOBALS['ProductRating'] = (int) $row['prodavgrating']; $GLOBALS['BrandName'] = $row['brandname']; $GLOBALS['ProdCode'] = $row['prodcode']; //$GLOBALS['ProdDesc'] = $this->strip_html_tags($row['proddesc']); //$GLOBALS['ProdOptions'] = $row['productoption']; $GLOBALS['VehicleOptions'] = ""; $GLOBALS['ProdOptions'] = ""; foreach ($row as $key => $val) { if ($val != "" && $val != "~") { if (($qualifier_id = array_search($key, $map_names)) !== false) { if (eregi('^vq', $key)) { $val = trim($val, "~"); $val = preg_split('/[~;]+/', $val); $val = array_unique($val); $val = array_values($val); $val = implode(",", $val); /* -- Setting display name for qualifier name -- */ if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') { $key = $OwnAssoc[$qualifier_id][0]['qname']; } else { if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') { $key = $ParentAssoc[$qualifier_id][0]['qname']; } else { if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) { $key = $display_names[$qualifier_id]; } else { $key = ucfirst(str_ireplace($filter_var, "", $key)); } } } /* -- Setting display name for qualifier name ends -- */ /* -- Setting display name for qualifier value -- */ if (($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != "") { $val = $OwnAssoc[$qualifier_id][$m]['vname']; } else { if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentAssoc[$qualifier_id][$m]['vname'] != "") { $val = $ParentAssoc[$qualifier_id][$m]['vname']; } } /* -- Setting display name for qualifier value ends-- */ $GLOBALS['VehicleOptions'] .= $key . " : " . $val . "<br>"; } if (eregi('^pq', $key)) { $val = trim($val, "~"); $val = preg_split('/[~;]+/', $val); $val = array_unique($val); $val = array_values($val); $val = implode(",", $val); /* -- Setting display name for qualifier name -- */ if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') { $key = $OwnAssoc[$qualifier_id][0]['qname']; } else { if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') { $key = $ParentAssoc[$qualifier_id][0]['qname']; } else { if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) { $key = $display_names[$qualifier_id]; } else { $key = ucfirst(str_ireplace($filter_var, "", $key)); } } } /* -- Setting display name for qualifier name ends -- */ /* -- Setting display name for qualifier value -- */ if (isset($OwnValue[$qualifier_id]) && ($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != '') { $val = $OwnAssoc[$qualifier_id][$m]['vname']; } else { if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentValue[$qualifier_id][$m]['vname'] != '') { $val = $ParentAssoc[$qualifier_id][$m]['vname']; } } /* -- Setting display name for qualifier value ends-- */ $GLOBALS['ProdOptions'] .= $key . " : " . $val . "<br>"; } } } } if (isset($row['vehicleoption'])) { $GLOBALS['VehicleOptions'] = $row['vehicleoption']; } if (isset($row['productoption'])) { $GLOBALS['ProdOptions'] = $row['productoption']; } if (isset($row['catuniversal']) && $row['catuniversal'] == 1) { $GLOBALS['VehicleOptions'] = $GLOBALS['ProductName']; if ($vq_column_title == "") { $vq_column_title = "Product Name"; } else { if ($vq_column_title != "Product Name") { $vq_column_title = "Product Name / Vehicle Options"; } } } else { if ($vq_column_title == "") { $vq_column_title = "Vehicle Options"; } else { if ($vq_column_title != "Vehicle Options") { $vq_column_title = "Product Name / Vehicle Options"; } } } if (empty($GLOBALS['VehicleOptions'])) { $GLOBALS['VehicleOptions'] = " "; } if (empty($GLOBALS['ProdOptions'])) { $GLOBALS['ProdOptions'] = " "; } /*--- the below lines are added for back 2 search link in the product detail page. Also modified line no 56 & 60 --- */ if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductLink'] .= "/refer=true" . $ext_links; } else { $GLOBALS['ProductLink'] .= "&refer=true" . $ext_links; } ### Added by Simha for onsale addition // Determine the price of this product //$GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row); $GLOBALS['ProductPrice'] = CalculateProductPriceRetail($row); $FinalPrice = $GLOBALS['ProductPrice']; $SalePrice = $row['prodsaleprice']; //$DiscountAmount = $FinalPrice; $discounttype = 0; if ((double) $SalePrice > 0 && $SalePrice < $FinalPrice) { $DiscountPrice = $SalePrice; } else { $DiscountPrice = $FinalPrice; $DiscountPrice = CalculateDiscountPrice($FinalPrice, $DiscountPrice, $row['categoryid'], $row['brandseriesid'], $discounttype); /*if($discounttype == 0) { $DiscountPrice = $FinalPrice; }*/ } /* foreach($DiscountInfo as $DiscountInfoSub) { if(isset($DiscountInfoSub['catids'])) { $catids = explode(",", $DiscountInfoSub['catids']); foreach($catids as $catid) { if($catid == $row['categoryid']) { $DiscountAmount = $FinalPrice * ((int)$DiscountInfoSub['amount']/100); if ($DiscountAmount < 0) { $DiscountAmount = 0; } $DiscountPrice = $FinalPrice - $DiscountAmount; } } } } */ if (isset($DiscountPrice) && $DiscountPrice < $FinalPrice && $discounttype == 0) { //&& GetConfig('ShowOnSale') $GLOBALS['ProductPrice'] = '<strike>' . CurrencyConvertFormatPrice($FinalPrice) . '</strike>'; $GLOBALS['ProductPrice'] .= '<br>' . CurrencyConvertFormatPrice($DiscountPrice) . ''; $GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; if (GetConfig('ShowOnSale')) { $GLOBALS['ProductPrice'] .= '<br>' . $GLOBALS['ShowOnSaleImage'] . ''; } } else { $GLOBALS['ProductPrice'] = '' . CurrencyConvertFormatPrice($FinalPrice) . ''; } ### Added by Simha Ends // commented the below line by vikas //$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname'])); $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], $GLOBALS['ProductLink']); if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) { //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas $GLOBALS['ProductURL'] = $GLOBALS['ProductLink']; $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink'); } else { //$GLOBALS['ProductURL'] = CartLink($row['productid']); //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas $GLOBALS['ProductURL'] = $GLOBALS['ProductLink']; //blessen if (intval($row['prodretailprice']) <= 0) { //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); // commented by vikas on 15-7-09 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>"; } else { //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1'); // commented by vikas on 15-7-09 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>"; } //blessen // original $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); } if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) { $GLOBALS['HideActionAdd'] = ''; } else { $GLOBALS['HideActionAdd'] = 'none'; } $GLOBALS['HideProductVendorName'] = 'display: none'; $GLOBALS['ProductVendor'] = ''; if (GetConfig('ShowProductVendorNames') && $row['prodvendorid'] > 0) { $vendorCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Vendors'); if (isset($vendorCache[$row['prodvendorid']])) { $GLOBALS['ProductVendor'] = '<a href="' . VendorLink($vendorCache[$row['prodvendorid']]) . '">' . isc_html_escape($vendorCache[$row['prodvendorid']]['vendorname']) . '</a>'; $GLOBALS['HideProductVendorName'] = ''; } } $GLOBALS['CartURL'] = CartLink($row['productid']); $offer = $this->IsProductMakeanOffer($row['brandseriesid'], $row['brandname'], $row['categoryid']); if ($offer == 'yes') { $GLOBALS['HideOfferButton'] = 'block'; } else { $GLOBALS['HideOfferButton'] = 'none'; } $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItem"); } else { if ($GLOBALS['results_page_flag'] == 0) { $mmy_links_modified = $mmy_links; if (!isset($GLOBALS['ISC_SRCH_CATG_ID'])) { $parentid = $GLOBALS['categories_all'][$row['categoryid']]['catparentid']; if ($parentid != 0) { if (isset($GLOBALS['categories_all'][$parentid])) { // if parent catg is not visible $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$parentid]['catname'])) . $mmy_links; } else { $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links; } } else { $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links; } } $subcatg_link = $this->LeftCatLink($mmy_links_modified, 'subcategory', $row['catname']); $link = "<a href='" . $subcatg_link . "'>"; $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>"; $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title='' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>"; //$imagelink = "<a href='".$GLOBALS['ShopPath']."/catgbrand.php?categoryid=".$row['categoryid']."&url=$subcatg_link' class='thickbox' title=''>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); for ($j = 0; $j < count($images); $j++) { if (!empty($images[$j])) { $imagefile = "{$imagelink}<img src='{$path}/category_images/" . $images[$j] . "' alt='" . isc_html_escape($row['catimagealt']) . "' title='" . isc_html_escape($row['catimagealt']) . "' class='subcat-image'></a>"; $imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>"; break; } } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0 class='subcat-image'></a>"; $imagefile .= "<span id='span" . $row['categoryid'] . "' style='display:none'>" . $tiplink . "</span>"; } } $GLOBALS['LeftImage'] = $imagefile; $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); //$GLOBALS['RelatedBrands'] = $row['brandname']; if (!empty($row['seriesname'])) { $row['brandname'] .= "<br>" . $row['seriesname']; } $GLOBALS['CatgSeriesList'] = ""; if ($row['seriesids'] != "") { $seriesids = str_ireplace("~", ",", $row['seriesids']); $seriesids_qry = "select seriesid , brandname , seriesname from isc_brand_series bs left join isc_brands b on bs.brandid = b.brandid where seriesid in (" . $seriesids . ")"; $seriesids_res = $GLOBALS['ISC_CLASS_DB']->Query($seriesids_qry); if ($GLOBALS['ISC_CLASS_DB']->CountResult($seriesids_res) > 0) { while ($seriesids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($seriesids_res)) { if ($GLOBALS['CatgSeriesList'] == "") { $GLOBALS['CatgSeriesList'] .= "<br><a href='javascript:' onclick=\"checkanimate('" . $row['categoryid'] . "')\">View Brands ></a><div id='" . $row['categoryid'] . "' style='display:block'>"; } else { $GLOBALS['CatgSeriesList'] .= "<br>"; } $tooltipscript = "onmouseover='createtip(" . $row['categoryid'] . $seriesids_arr['seriesid'] . ")' onmouseout='UnTip()'"; if (!isset($params['brand'])) { if ($GLOBALS['EnableSEOUrls'] == 1) { $series_link = $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "/brand/" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $series_link = $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "&brand=" . MakeURLSafe(Strtolower($seriesids_arr['brandname'])) . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } else { if ($GLOBALS['EnableSEOUrls'] == 1) { $series_link = $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "/series/" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } else { $series_link = $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])); $GLOBALS['CatgSeriesList'] .= "<a href='" . $subcatg_link . "&series=" . MakeURLSafe(Strtolower($seriesids_arr['seriesname'])) . "' {$tooltipscript}>" . $seriesids_arr['brandname'] . " " . $seriesids_arr['seriesname'] . "</a>"; } } $GLOBALS['CatgSeriesList'] .= "<span id='span" . $row['categoryid'] . $seriesids_arr['seriesid'] . "' style='display:none'><a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $seriesids_arr['seriesid'] . "&catname=" . MakeURLSafe($row['catname']) . "&url=" . urlencode($series_link) . "' class='' ><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a></span>"; } $GLOBALS['CatgSeriesList'] .= "</br></div>"; } } $content = $row['brandname'] . "<br>"; if (!isset($params['category']) && (isset($params['srch_category']) || !isset($GLOBALS['BRAND_SERIES_FLAG']))) { $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of subcatg page. $GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : ''; $content .= "<h3><a href='" . $path . "/search.php?{$qry_string}&subcategory=" . MakeURLSafe($row['catname']) . "'>" . $row['catname'] . "</a></h3>>"; $GLOBALS['TitleLink'] = "<h2><a href='" . $subcatg_link . "' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>" . $row['catname'] . "</a></h2>"; } /*$ProdStartPrice = GetStartingPrice($row['categoryid'], $row['prodcalculatedprice']); $content .= "Price starting from $".number_format($ProdStartPrice, 2, '.', '')."<br>".$imagefile;*/ $GLOBALS['leftsidecontent'] = $content; if (number_format($row['prodminprice'], 2) < number_format($row['prodmaxprice'], 2)) { $GLOBALS['PriceRange'] = "Price range from \$" . number_format($row['prodminprice'], 2, '.', '') . " to \$" . number_format($row['prodmaxprice'], 2, '.', ''); } else { $GLOBALS['PriceRange'] = "Available at \$" . number_format($row['prodminprice'], 2, '.', ''); } $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $GLOBALS['ViewDetailsImage'] = "<a href='{$path}/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' class='thickbox'><img src='{$path}/templates/default/images/fastlook_red.gif'></a> "; $content = "{$link}<img src='{$path}/templates/default/images/viewproducts.gif'></a>"; $GLOBALS['ViewDetailsImage'] .= $content; if (IsDiscountAvailable('category', $row['categoryid'])) { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } if ($this->IsMakeAnOffer('category', $row['categoryid']) == 'yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } $GLOBALS['RelatedBrands'] = $row['featurepoints']; $GLOBALS['lowersidecontent'] = $content; /* This below conditions is added to have different templates for tonneau covers page */ if (isset($params['srch_category']) && !empty($params['srch_category']) && $selected_catg == 4 && $GLOBALS['results_page_flag'] == 0) { $GLOBALS['rightsidecontent'] = $row['featurepoints']; $GLOBALS['warranty'] = ""; /*if( trim($row['prodwarranty']) != '' ) { $GLOBALS['warranty'] = "<img alt='Warranty' src='".$GLOBALS['ShopPath']."/images/warranty-icon.gif' style='margin-right: 7px;'/><strong>".$row['prodwarranty']."</strong>"; }*/ if ($GLOBALS['SearchResultList'] != "") { $GLOBALS['SearchResultList'] .= '<hr style="clear: left;"/>'; } $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("NewSubCategoryListing"); } else { $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListing"); } } else { $series_link = $this->LeftCatLink($mmy_links, 'series', $row['seriesname']); $link = "<a href='" . $series_link . "'>"; //$imagelink = "<a href='".$path."/catgbrand.php?seriesid=".$row['brandseriesid']."&catname=".MakeURLSafe($row['parentcatname'])."&url=$series_link' class='thickbox' title=''>"; $main_catg_link = ""; $catg_count = array(); $GLOBALS['CatgSeriesList'] = ""; if ($row['subcatgids'] != "") { $subcatgids = str_ireplace("~", ",", $row['subcatgids']); $subcatgids_qry = "select c.categoryid , c.catname as childcatname , p.categoryid as parentid , p.catname as parentcatname from [|PREFIX|]categories c left join [|PREFIX|]categories p on c.catparentid = p.categoryid where c.categoryid in (" . $subcatgids . ")"; $subcatgids_res = $GLOBALS['ISC_CLASS_DB']->Query($subcatgids_qry); //$catg_count = $GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res); if ($GLOBALS['ISC_CLASS_DB']->CountResult($subcatgids_res) > 0) { while ($subcatgids_arr = $GLOBALS['ISC_CLASS_DB']->Fetch($subcatgids_res)) { if ($subcatgids_arr['parentid'] != 0) { $main_catg_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])); $catg_count[$subcatgids_arr['parentid']] = $subcatgids_arr['parentcatname']; } else { $catg_count[$subcatgids_arr['categoryid']] = $subcatgids_arr['childcatname']; } if ($GLOBALS['CatgSeriesList'] == "") { $GLOBALS['CatgSeriesList'] .= "<br><a href='javascript:' onclick=\"checkanimate('" . $row['brandseriesid'] . "')\">View Category ></a><div id='" . $row['brandseriesid'] . "' style='display:none'>"; } else { $GLOBALS['CatgSeriesList'] .= "<br>"; } $tooltipscript = "onmouseover='createtip(" . $subcatgids_arr['categoryid'] . $row['brandseriesid'] . ")' onmouseout='UnTip()'"; if ($GLOBALS['EnableSEOUrls'] == 1) { if ($subcatgids_arr['parentcatname'] == "") { $catgs_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } else { $catgs_link = $series_link . "/category/" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])) . "/subcategory/" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } $GLOBALS['CatgSeriesList'] .= "<a href='" . $catgs_link . "' {$tooltipscript}>" . $subcatgids_arr['childcatname'] . "</a>"; } else { if ($subcatgids_arr['parentcatname'] == "") { $catgs_link = $series_link . "&category=" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } else { $catgs_link = $series_link . "&category=" . MakeURLSafe(Strtolower($subcatgids_arr['parentcatname'])) . "&subcategory=" . MakeURLSafe(Strtolower($subcatgids_arr['childcatname'])); } $GLOBALS['CatgSeriesList'] .= "<a href='" . $catgs_link . "' {$tooltipscript}>" . $subcatgids_arr['childcatname'] . "</a>"; } $GLOBALS['CatgSeriesList'] .= "<span id='span" . $subcatgids_arr['categoryid'] . $row['brandseriesid'] . "' style='display:none'><a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $subcatgids_arr['categoryid'] . "&url=" . urlencode($catgs_link) . "' class='' ><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a></span>"; } $GLOBALS['CatgSeriesList'] .= "</br></div>"; } } $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; if (count($catg_count) == 1) { $GLOBALS['TitleLink'] = "<h2><a href='" . $main_catg_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; } else { if (count($catg_count) > 1) { $GLOBALS['TitleLink'] = "<h2><a href='" . $series_link . "' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()' onclick='return checkcategoryselection()'>" . $row['brandname'] . " " . $row['seriesname'] . " " . $row['parentcatname'] . "</a></h2>"; } } $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . MakeURLSafe($row['parentcatname']) . "&url="; if (count($catg_count) == 1) { $tiplink .= urlencode($main_catg_link) . "'"; } else { if (count($catg_count) > 1) { $tiplink .= "#' "; } else { $tiplink .= urlencode($series_link) . "'"; } } $tiplink .= " title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>"; $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . MakeURLSafe($row['parentcatname']) . "&url="; if (count($catg_count) == 1) { $imagelink .= urlencode($main_catg_link) . "'"; } else { if (count($catg_count) > 1) { $imagelink .= "#' "; } else { $imagelink .= urlencode($series_link) . "'"; } } $imagelink .= " title='' onmouseover='createtip(" . $row['brandseriesid'] . ")' onmouseout='UnTip()'>"; if (isset($row['imagefile']) && !empty($row['imagefile'])) { $images = explode("~", $row['imagefile']); for ($j = 0; $j < count($images); $j++) { if (!empty($images[$j])) { $imagefile = "{$imagelink}<img src='{$path}/category_images/" . $images[$j] . "'></a>"; break; } } } else { if (empty($row['imagefile']) || empty($imagefile)) { $imagefile = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' border=0></a>"; } } $GLOBALS['LeftImage'] = $imagefile; $row['brandname'] = str_replace('~', ' , ', $row['brandname']); $GLOBALS['RelatedBrands'] = $row['brandname']; if (isset($row['seriesname']) && !empty($row['seriesname']) && (!isset($params['srch_category']) || isset($params['category'])) && isset($GLOBALS['BRAND_SERIES_FLAG'])) { if (empty($row['imagefile']) || empty($imagefile)) { $GLOBALS['LeftImage'] = "{$imagelink}<img src='{$path}/templates/default/images/ProductDefault.gif' alt='" . isc_html_escape($row['seriesimagealt']) . "' title='" . isc_html_escape($row['seriesimagealt']) . "'></a>"; $GLOBALS['LeftImage'] .= "<span id='span" . $row['brandseriesid'] . "' style='display:none'>" . $tiplink . "</span>"; } else { $GLOBALS['LeftImage'] = "{$imagelink}<img src='{$path}/series_images/" . $row['imagefile'] . "' width='140px' alt='" . isc_html_escape($row['seriesimagealt']) . "' title='" . isc_html_escape($row['seriesimagealt']) . "'></a>"; $GLOBALS['LeftImage'] .= "<span id='span" . $row['brandseriesid'] . "' style='display:none'>" . $tiplink . "</span>"; } //"<h3>".$row['catname']."</h3> $GLOBALS['ProductsCount'] = "(" . $row['totalproducts'] . ") Products Available"; $GLOBALS['RelatedBrands'] = "<ul class='featurepoints'>"; if (!empty($row['feature_points1'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points1'] . "</li>"; } if (!empty($row['feature_points2'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points2'] . "</li>"; } if (!empty($row['feature_points3'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points3'] . "</li>"; } if (!empty($row['feature_points4'])) { $GLOBALS['RelatedBrands'] .= "<li>" . $row['feature_points4'] . "</li>"; } $GLOBALS['RelatedBrands'] .= "</ul>"; /*if(isset($row['brandlargefile']) && !empty($row['brandlargefile'])) { $brand_image_path = "product_images/".$row['brandlargefile']; if(file_exists($brand_image_path)) { $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandlargefile']."'>"; } else if(isset($row['brandimagefile']) && !empty($row['brandimagefile'])) { $brand_image_path = "product_images/".$row['brandimagefile']; if(file_exists($brand_image_path)) $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandimagefile']."'>"; } } else if(isset($row['brandimagefile']) && !empty($row['brandimagefile'])) { $brand_image_path = "product_images/".$row['brandimagefile']; if(file_exists($brand_image_path)) $GLOBALS['CatgDescandBrandImage'] = "<img src='$path/product_images/".$row['brandimagefile']."'>"; }*/ } $GLOBALS['RelatedBrands'] = $row['feature_points']; $GLOBALS['CatgDescandBrandImage'] = $row['branddescription']; $GLOBALS['CatgBrandSeriesFooter'] = $row['brandfooter']; if ($brand_rating != 0) { $GLOBALS['CatgDescandBrandImage'] .= "<br><h2>Rating : <img width='64' height='12' src='" . $GLOBALS['TPL_PATH'] . "/images/IcoRating{$brand_rating}.gif' alt='' /></h2>"; } $content = $row['brandname'] . "<br>"; $content .= $row['catname'] . "<br>"; /*$ProdStartPriceSeries = GetStartingPriceForSeries($row['brandseriesid'], $row['prodcalculatedprice']); $content .= "Price starting from $".number_format($ProdStartPriceSeries, 2, '.', '');*/ $GLOBALS['leftsidecontent'] = $content; //$GLOBALS['PriceRange'] = "Price range from $".number_format($row['prodminprice'], 2, '.', '')." to $".number_format($row['prodmaxprice'], 2, '.', ''); if (number_format($row['prodminprice'], 2) < number_format($row['prodmaxprice'], 2)) { $GLOBALS['PriceRange'] = "Price range from \$" . number_format($row['prodminprice'], 2, '.', '') . " to \$" . number_format($row['prodmaxprice'], 2, '.', ''); } else { $GLOBALS['PriceRange'] = "Available at \$" . number_format($row['prodminprice'], 2, '.', ''); } $content = "<img src='{$path}/templates/default/images/free-shipping2.gif'><br>" . strip_tags($row['proddesc']) . "<br>" . $row['prodwarranty']; $GLOBALS['rightsidecontent'] = $content; $GLOBALS['ShippingImage'] = "<img src='{$path}/templates/default/images/free-shipping2.gif'>"; $GLOBALS['ProductWarranty'] = "<h3>" . $row['prodwarranty'] . "</h3>"; $GLOBALS['ViewDetailsImage'] = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?seriesid=" . $row['brandseriesid'] . "&catname=" . MakeURLSafe($row['parentcatname']) . "&url="; if (count($catg_count) > 1) { $GLOBALS['ViewDetailsImage'] .= "#'"; } else { if (count($catg_count) == 1) { $GLOBALS['ViewDetailsImage'] .= urlencode($main_catg_link) . "'"; } else { $GLOBALS['ViewDetailsImage'] .= urlencode($series_link) . "'"; } } $GLOBALS['ViewDetailsImage'] .= "><img src='{$path}/templates/default/images/fastlook_red.gif'></a> "; $content = "{$link}"; if (count($catg_count) == 1) { $content = "<a href='" . $main_catg_link . "'>"; } else { if (count($catg_count) > 1) { $content = "<a href='" . $series_link . "' onclick='return checkcategoryselection()'>"; } } $content .= "<img src='{$path}/templates/default/images/viewproducts.gif'></a>"; $GLOBALS['ViewDetailsImage'] .= $content; if (IsDiscountAvailable('series', $row['brandseriesid'])) { $GLOBALS['ViewDetailsImage'] .= '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">'; } if ($this->IsMakeAnOffer('series', $row['brandseriesid']) == 'yes') { $GLOBALS['ViewDetailsImage'] .= "<h3>Qualifies for Make an Offer!</h3>"; } $GLOBALS['lowersidecontent'] = $content; $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListing"); $GLOBALS['HideCompareItems'] = "none"; } } } $get_variables = $_GET; $sort_qry = "{$path}/search.php?search_query=" . urlencode($params['search_query']); unset($get_variables['orderby'], $get_variables['sort'], $get_variables['search_query'], $get_variables['sortby']); $i = 0; foreach ($get_variables as $key => $value) { $sort_qry .= "&{$key}={$value}"; } if (isset($_REQUEST['sortby']) && $_REQUEST['sortby'] == 'desc') { $sort = "asc "; $img = " <img src='{$path}/templates/default/images/ArrowDown.gif' border=0>"; } else { $sort = "desc "; $img = " <img src='{$path}/templates/default/images/ArrowUp.gif' border=0>"; } //$GLOBALS['SearchResults'] = $GLOBALS['SearchResultList']; // commented by vikas if (isset($params['partnumber']) || $params['flag_srch_category'] == 1 || isset($params['flag_srch_category']) && isset($GLOBALS['BRAND_SERIES_FLAG']) && $GLOBALS['BRAND_SERIES_FLAG'] == 1) { if ($GLOBALS['EnableSEOUrls'] == 1) { $GLOBALS['ProductBrand'] = "<a href='{$path}{$mmy_links}/orderby/brandname/sortby/{$sort}'>Brand</a>"; $GLOBALS['ProductPartNumber'] = "<a href='{$path}{$mmy_links}/orderby/prodcode/sortby/{$sort}'>Part Number</a>"; $GLOBALS['ProductPrice'] = "<a href='{$path}{$mmy_links}/orderby/prodcalculatedprice/sortby/{$sort}'>Price</a>"; } else { $GLOBALS['ProductBrand'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=brandname&sortby={$sort}'>Brand</a>"; $GLOBALS['ProductPartNumber'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=prodcode&sortby={$sort}'>Part Number</a>"; $GLOBALS['ProductPrice'] = "<a href='{$path}/search.php?search_query={$mmy_links}&orderby=prodcalculatedprice&sortby={$sort}'>Price</a>"; } if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'brandname') { $GLOBALS['ProductBrand'] .= $img; } $GLOBALS['ProductVQ'] = $vq_column_title; /*if(isset($_GET['orderby']) && $_GET['orderby'] == 'brandname') $GLOBALS['Product_VQ'] .= $img;*/ if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodcode') { $GLOBALS['ProductPartNumber'] .= $img; } $GLOBALS['ProductPQ'] = "Product Options"; /*if(isset($_GET['orderby']) && $_GET['orderby'] == 'productoption') $GLOBALS['SearchResults'] .= $img;*/ if (isset($_REQUEST['orderby']) && $_REQUEST['orderby'] == 'prodcalculatedprice') { $GLOBALS['ProductPrice'] .= $img; } $GLOBALS['ProductDetails'] = "Details"; $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItemHeader"); } else { // $GLOBALS['SearchResults'] = "<div>".$GLOBALS['SearchResultList']."</div>"; if (isset($params['srch_category']) && !empty($params['srch_category']) && $GLOBALS['results_page_flag'] == 0 && $selected_catg == 4) { $GLOBALS['FilterTitle'] = "Narrow by Category"; $GLOBALS['ResultTitle'] = "Category Details"; if (count($GLOBALS['SearchBrands']) > 0) { $GLOBALS['BrandsList'] = ""; $brandlistingqry = " select brandname , brandimagefile, brandlargefile, brandaltkeyword from [|PREFIX|]brands where brandid in (" . implode($GLOBALS['SearchBrands'], ",") . ")"; $brandlistingresult = $GLOBALS['ISC_CLASS_DB']->Query($brandlistingqry); while ($brandlisting_row = $GLOBALS['ISC_CLASS_DB']->Fetch($brandlistingresult)) { if (isset($params['brand'])) { $file = realpath(ISC_BASE_PATH . '/' . GetConfig('ImageDirectory') . '/' . $brandlisting_row['brandlargefile']); if (file_exists($file)) { $attribs = @getimagesize($file); $width = $attribs[0]; $height = $attribs[1]; if ($width > 240) { $width = "240"; } /*if( $height > 240 ) $height = "240";*/ $GLOBALS['BrandsList'] .= "<img alt='" . $brandlisting_row['brandaltkeyword'] . "' src='" . $GLOBALS['ShopPath'] . "/product_images/" . $brandlisting_row['brandlargefile'] . "' width='" . $width . "' /> "; $brandparams = $params; unset($brandparams['brand'], $brandparams['series']); $mmylinks = $this->GetYMMLinks($brandparams); $GLOBALS['BrandsList'] .= "<br><a href='" . $path . $mmylinks . "'>View All Brands</a>"; } } else { if (isset($params['srch_category'])) { $GLOBALS['BrandsList'] .= "<a href='" . $path . $mmy_links . "/brand/" . MakeURLSafe(strtolower($brandlisting_row['brandname'])) . "'>"; } else { $GLOBALS['BrandsList'] .= "<a href='" . $path . "/" . MakeURLSafe(strtolower($brandlisting_row['brandname'])) . $mmy_links . "'>"; } $GLOBALS['BrandsList'] .= "<img alt='" . $brandlisting_row['brandname'] . "' src='" . $GLOBALS['ShopPath'] . "/product_images/" . $brandlisting_row['brandimagefile'] . "'/></a>"; } } } else { $GLOBALS['BrandListStyle'] = "display:none"; } $GLOBALS['ResultCategories'] = ""; foreach ($GLOBALS['SearchCategories'] as $key => $catid) { $parentid = $GLOBALS['categories_all'][$catid]['catparentid']; if ($parentid != 0) { if (isset($params['srch_category'])) { $mmy_links_modified = $mmy_links; } else { if (isset($GLOBALS['categories_all'][$parentid])) { // if parent catg is not visible $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$parentid]['catname'])) . $mmy_links; } else { $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$catid]['catname'])) . $mmy_links; } } } else { $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$catid]['catname'])) . $mmy_links; } /*echo "<br>".$mmy_links; exit;*/ $subcatg_link = $this->LeftCatLink($mmy_links_modified, 'subcategory', $GLOBALS['categories_all'][$catid]['catname']); $GLOBALS['ResultCategories'] .= "<div class='button'><a href='" . $subcatg_link . "'>" . $GLOBALS['categories_all'][$catid]['catname'] . "</a></div>"; } $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("NewSubCategoryListingMain"); } else { $GLOBALS['SearchResults'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryListingMain"); } } $GLOBALS['SearchResults'] .= "<script type=\"text/javascript\"> \$('.focushiddendiv').css({'position':'absolute', 'margin-top':'-200px', 'display':'block'}); </script>"; if ($GLOBALS['EnableSEOUrls'] == 1) { $back2url = $_SESSION['back2url'] = preg_replace("/^\\//", "", $_SERVER['REQUEST_URI']); } else { $back2url = $_SESSION['back2url'] = "search.php?" . $_SERVER['QUERY_STRING']; } ISC_SetCookie("back2search", $back2url, 0, "/"); // Showing the syndication option? if (GetConfig('RSSNewProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) { $GLOBALS['RSSURL'] = SearchLink($GLOBALS['ISC_CLASS_SEARCH']->GetQuery(), 0, false); $GLOBALS['SNIPPETS']['SearchResultsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SearchResultsFeed"); } } else { $this->YMMSelectors($params); $GLOBALS['SearchResults'] = "<div style='float:left'>" . $GLOBALS['YMMTable'] . "</div>"; $GLOBALS['CategoryBrandList'] = "%%Panel.StaticFeaturedCategories%%\n\t\t\t\t%%Panel.StaticFeaturedBrands%%"; // No search results were found // commented below code as need to show the favorite categories and brands as in homepage /*$GLOBALS['HideSearchResults'] = "none"; $GLOBALS['HidePanels'][] = 'SearchPageProducts';*/ } }