function vam_get_categoriesstatus_for_product($product_id) { $categorie_query = "SELECT\n\t categories_id\n\t FROM " . TABLE_PRODUCTS_TO_CATEGORIES . "\n\t WHERE products_id='" . $product_id . "'"; $categorie_query = vamDBquery($categorie_query); while ($categorie_data = vam_db_fetch_array($categorie_query, true)) { if (vam_check_categories_status($categorie_data['categories_id']) >= 1) { return 1; } else { return 0; } echo $categorie_data['categories_id']; } }
$category_depth = "products"; // } } } /* sorting from page */ $sort = ''; if (isset($_GET['sort'])) { if ($_GET['sort'] == 'name') { $sort = ' ORDER BY pd.products_name ' . $_GET['direction']; } if ($_GET['sort'] == 'price') { $sort = ' ORDER BY p.products_price ' . $_GET['direction']; } } /* /sorting */ if (vam_check_categories_status($current_category_id) >= 1) { $error = CATEGORIE_NOT_FOUND; include DIR_WS_MODULES . FILENAME_ERROR_HANDLER; } else { if ($category_depth == 'nested') { if (GROUP_CHECK == 'true') { $group_check = "and c.group_permission_" . $_SESSION['customers_status']['customers_status_id'] . "=1 "; } $category_query = "select\n cd.categories_description,\n cd.categories_name,\n cd.categories_heading_title, \n c.categories_template,\n c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd\n where c.categories_id = '" . $current_category_id . "'\n and cd.categories_id = '" . $current_category_id . "'\n " . $group_check . "\n and cd.language_id = '" . (int) $_SESSION['languages_id'] . "'"; $category_query = vamDBquery($category_query); $category = vam_db_fetch_array($category_query, true); if (isset($cPath) && preg_match('/_/', $cPath)) { // check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for ($i = 0, $n = sizeof($category_links); $i < $n; $i++) { if (GROUP_CHECK == 'true') {