コード例 #1
0
         oos_get_subcategories($subcategories_array, $_GET['categories_id']);
         $where_str .= " AND\n                           p2c.products_id = p.products_id AND\n                           p2c.products_id = pd.products_id AND\n                           (p2c.categories_id = '" . intval($_GET['categories_id']) . "'";
         for ($i = 0, $n = count($subcategories_array); $i < $n; $i++) {
             $where_str .= " OR p2c.categories_id = '" . intval($subcategories_array[$i]) . "'";
         }
         $where_str .= ")";
     } else {
         $where_str .= " AND\n                           p2c.products_id = p.products_id AND\n                           p2c.products_id = pd.products_id AND\n                           pd.products_languages_id = '" . intval($nLanguageID) . "' AND\n                           p2c.categories_id = '" . intval($_GET['categories_id']) . "'";
     }
 }
 if (isset($_GET['manufacturers_id']) && oos_is_not_null($_GET['manufacturers_id'])) {
     $manufacturers_id = intval($_GET['manufacturers_id']);
     $where_str .= " AND m.manufacturers_id = '" . intval($manufacturers_id) . "'";
 }
 if (isset($_GET['keywords']) && oos_is_not_null($_GET['keywords'])) {
     if (oos_parse_search_string(stripslashes($_GET['keywords']), $search_keywords)) {
         $where_str .= " AND (";
         for ($i = 0, $n = count($search_keywords); $i < $n; $i++) {
             switch ($search_keywords[$i]) {
                 case '(':
                 case ')':
                 case 'and':
                 case 'or':
                     $where_str .= " " . $search_keywords[$i] . " ";
                     break;
                 default:
                     $where_str .= "   (pd.products_name LIKE '%" . addslashes($search_keywords[$i]) . "%'\n                              OR p.products_model LIKE '%" . addslashes($search_keywords[$i]) . "%'\n                              OR p.products_ean LIKE '%" . addslashes($search_keywords[$i]) . "%'\n                              OR m.manufacturers_name LIKE '%" . addslashes($search_keywords[$i]) . "%'";
                     if (isset($_GET['search_in_description']) && $_GET['search_in_description'] == '1') {
                         $where_str .= " OR pd.products_description LIKE '%" . addslashes($search_keywords[$i]) . "%'";
                     }
                     $where_str .= ')';
コード例 #2
0
      } else {
        $where_str .= " AND
                           p2c.products_id = p.products_id AND
                           p2c.products_id = pd.products_id AND
                           pd.products_languages_id = '" .  intval($nLanguageID) . "' AND
                           p2c.categories_id = '" . intval($_GET['categories_id']) . "'";
      }
    }

    if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) {
      $nManufacturersID = (int)$_GET['manufacturers_id'];
      $where_str .= " AND m.manufacturers_id = '" . intval($nManufacturersID) . "'";
    }

    if (isset($_GET['keywords']) && !empty($_GET['keywords'])) {
      if (oos_parse_search_string(stripslashes($sKeywords), $search_keywords)) {
        $where_str .= " AND (";

        $nCountSearchKeywords = count($search_keywords);
        for ($i=0, $n=$nCountSearchKeywords; $i<$n; $i++ ) {
          switch ($search_keywords[$i]) {
            case '(':
            case ')':
            case 'and':
            case 'or':
              $where_str .= " " . $search_keywords[$i] . " ";
              break;

            default:
              $sEntitiesKeyword = htmlentities($search_keywords[$i]);
            	$sEntitiesKeyword = ($sEntitiesKeyword != $search_keywords[$i]) ? addslashes($sEntitiesKeyword) : false;