$categories = tep_db_fetch_array($categories_query); if ($categories['total'] < 1) { // do nothing, go through the loop } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = 1 and c.parent_id = '" . (int) $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.categories_name"); break; // we've found the deepest category the customer is in } } } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = 1 and c.parent_id = '" . (int) $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.categories_name"); } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $cPath_new = tep_get_path($categories['categories_id']); $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $display_categories[$rows]['width'] = $width; $display_categories[$rows]['link'] = tep_href_link(FILENAME_DEFAULT, $cPath_new); $display_categories[$rows]['name'] = $categories['categories_name']; $display_categories[$rows]['image'] = tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT); $rows++; } $xoopsTpl->assign("display_categories", $display_categories); // needed for the new products module shown below $new_products_category_id = $current_category_id; /* Auslesen der neuen Produkte */ $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $xoopsTpl->assign("width", $width);
// $cPath_new = tep_get_path($categories['categories_id']); // do nothing, go through the loop - Optimized tep_get-path } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, pcategories.parent_id as grand_parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES . " AS pcategories, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int) $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' and pcategories.categories_id = '" . (int) $category_links[$i] . "' order by c.sort_order, cd.categories_name"); break; // we've found the deepest category the customer is in } } } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, pcategories.parent_id as grand_parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES . " AS pcategories, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int) $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' and pcategories.categories_id = '" . (int) $current_category_id . "' order by c.sort_order, cd.categories_name"); } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id'], $categories['parent_id'], $categories['grand_parent_id']); // End Optimized tep_get_path $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ($rows / MAX_DISPLAY_CATEGORIES_PER_ROW == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) && $rows != $number_of_categories) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } // needed for the new products module shown below $new_products_category_id = $current_category_id; ?> </tr> </table></td> </tr> <tr>
$cPath = $categories['parent_id']; } if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || isset($HTTP_GET_VARS['cID']) && $HTTP_GET_VARS['cID'] == $categories['categories_id']) && !isset($cInfo) && substr($action, 0, 3) != 'new') { $category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id'])); $category_products = array('products_count' => tep_products_in_category_count($categories['categories_id'])); $cInfo_array = array_merge($categories, $category_childs, $category_products); $cInfo = new objectInfo($cInfo_array); } if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> <b>' . $categories['categories_name'] . '</b>'; ?> </td> <td class="dataTableContent" align="center"> <?php if ($categories['categories_status'] == '1') { echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setcategoriesflag&flag=0&cID=' . $categories['categories_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=setcategoriesflag&flag=1&cID=' . $categories['categories_id'] . '&cPath=' . $cPath) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); } ?> </td> <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', '');
$category_products = array('products_count' => tep_products_in_category_count($categories['categories_id'])); $cInfo_array = array_merge($categories, $category_childs, $category_products); $cInfo = new objectInfo($cInfo_array); } if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('gift_certs.php', 'pclass=' . $pClass . '&' . tep_get_path($categories['categories_id'])) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('gift_certs.php', 'pclass=' . $pClass . '&cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent" align="center" style="width:60px;"><?php echo '<a href="' . tep_href_link('gift_certs.php', 'pclass=' . $pClass . '&' . tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>'; ?> </td> <td class="dataTableContent" align="center"><?php echo '<a href="' . tep_href_link('gift_certs.php', 'pclass=' . $pClass . '&' . tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', 'View Category') . '</a>'; ?> </td> <td class="dataTableContent" style="width:330px;"><?php echo '<b>' . $categories['categories_name'] . '</b>'; ?> </td> <td class="dataTableContent" align="center" style="width:115px;"> <!-- CHANGE THIS TO CATEGORY DISABLE / ENABLE --> <?php if ($categories['categories_status']) { echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . ' <a href="' . tep_href_link('gift_certs.php', 'pclass=' . $pClass . '&action=setflag&flag=0&cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>'; } else { echo '<a href="' . tep_href_link('gift_certs.php', 'pclass=' . $pClass . '&action=setflag&flag=1&cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10); } ?>
$Qcheck->execute(); if ($Qcheck->fetch() === false) { // do nothing, go through the loop } else { $deepest_category_id = $category_links[$i]; break; // we've found the deepest category the customer is in } } } $Qcategories = $OSCOM_Db->prepare('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id order by sort_order, cd.categories_name'); $Qcategories->bindInt(':parent_id', $deepest_category_id); $Qcategories->bindInt(':language_id', $_SESSION['languages_id']); $Qcategories->execute(); while ($Qcategories->fetch()) { $cPath_new = tep_get_path($Qcategories->valueInt('categories_id')); echo '<div class="col-xs-6 col-sm-4">'; echo ' <div class="text-center">'; echo ' <a href="' . OSCOM::link('index.php', $cPath_new) . '">' . HTML::image(DIR_WS_IMAGES . $Qcategories->value('categories_image'), $Qcategories->value('categories_name'), SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>'; echo ' <div class="caption text-center">'; echo ' <h5><a href="' . OSCOM::link('index.php', $cPath_new) . '">' . $Qcategories->value('categories_name') . '</a></h5>'; echo ' </div>'; echo ' </div>'; echo '</div>'; } // needed for the new products module shown below $new_products_category_id = $current_category_id; ?> </div> <div class="clearfix"></div>
$cPath = $categories['parent_id']; } if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || isset($HTTP_GET_VARS['cID']) && $HTTP_GET_VARS['cID'] == $categories['categories_id']) && !isset($cInfo) && substr($action, 0, 3) != 'new') { $category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id'])); $category_products = array('products_count' => tep_products_in_category_count($categories['categories_id'])); $cInfo_array = array_merge($categories, $category_childs, $category_products); $cInfo = new objectInfo($cInfo_array); } if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('categories.php', tep_get_path($categories['categories_id'])) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link('categories.php', 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . tep_href_link('categories.php', tep_get_path($categories['categories_id'])) . '">' . tep_image('images/icons/folder.gif', ICON_FOLDER) . '</a> <strong>' . $categories['categories_name'] . '</strong>'; ?> </td> <td class="dataTableContent" align="center"> </td> <td class="dataTableContent" align="right"><?php if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo tep_image('images/icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link('categories.php', 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image('images/icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } $products_count = 0;
$customer_group_id = $_SESSION['sppc_customer_group_id']; } $query_cat = "select\r\n c.categories_id,\r\n cd.categories_name,\r\n c.categories_image,\r\n c.parent_id from\r\n " . TABLE_CATEGORIES . " c,\r\n " . TABLE_CATEGORIES_DESCRIPTION . " cd\r\n where\r\n c.parent_id = '0'\r\n and c.categories_id = cd.categories_id\r\n and cd.language_id='" . $languages_id . "'\r\n and c.products_group_access like '%" . $customer_group_id . "%'\r\n order by sort_order, cd.categories_name"; $categories_query_cat = tep_db_query($query_cat); // Initiate tree traverse $categories_string_cat = ''; preorder_mc(0, 0, $foo_cat, ''); ////////// // Display box contents ////////// $info_box_contents = array(); $row = 0; $col = 0; while ($categories_cat = tep_db_fetch_array($categories_query_cat)) { if ($categories_cat['parent_id'] == 0) { $cpath_cat_new = tep_get_path($categories_cat['categories_id']); $text_subcategories = ''; $subcategories_query_cat = tep_db_query($query_cat); while ($subcategories_cat = tep_db_fetch_array($subcategories_query_cat)) { if ($subcategories_cat['parent_id'] == $categories_cat['categories_id']) { $cPath_new_sub = "cPath=" . $categories_cat['categories_id'] . "_" . $subcategories_cat['categories_id']; $text_subcategories .= '• <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '">'; $text_subcategories .= $subcategories_cat['categories_name'] . '</a>' . " "; } // if ($subcategories['parent_id'] == $categories['categories_id']) } // while ($subcategories = tep_db_fetch_array($subcategories_query)) echo '<div class="product-listing-module-container"><div class="product-listing-module-items"><div class="col-sm-4 col-lg-4 with-padding"><div class="thumbnail align-center large-padding-top" style="height: 250px;"><h3 style="line-height:1.1;"><a href="' . tep_href_link(FILENAME_DEFAULT, $cpath_cat_new) . '">' . tep_image(DIR_WS_IMAGES . $categories_cat['categories_image'], $categories_cat['categories_name'], 200) . '<br>' . $categories_cat['categories_name'] . '</a></h3></div></div></div></div>'; // determine the column position to see if we need to go to a new row $col++; if ($col > $item_column_number - 1) {
if ($categories['total'] < 1) { // do nothing, go through the loop } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int) $category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.categories_name"); break; // we've found the deepest category the customer is in } } } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int) $current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by sort_order, cd.categories_name"); } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id'] . $params); $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <div class="product-listing-module-container"><div class="product-listing-module-items"><div class="col-sm-4 col-lg-4 with-padding"><div class="thumbnail align-center large-padding-top" style="height: 220px;"><h3 style="line-height:1.1;"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], 200) . '<br>' . $categories['categories_name'] . '</a></h3></div></div></div></div>' . "\n"; if ($rows / MAX_DISPLAY_CATEGORIES_PER_ROW == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) && $rows != $number_of_categories) { } } // needed for the new products module shown below $new_products_category_id = $current_category_id; ?> </div> <div class="clearfix"></div> <?php if (INCLUDE_MODULE_ONE == 'new_products.php' || INCLUDE_MODULE_TWO == 'new_products.php' || INCLUDE_MODULE_THREE == 'new_products.php' || INCLUDE_MODULE_FOUR == 'new_products.php' || INCLUDE_MODULE_FIVE == 'new_products.php' || INCLUDE_MODULE_SIX == 'new_products.php') { if (file_exists(TEMPLATE_FS_CUSTOM_MODULES . FILENAME_NEW_PRODUCTS)) { require TEMPLATE_FS_CUSTOM_MODULES . FILENAME_NEW_PRODUCTS; } else { require DIR_FS_TEMPLATE_MAINPAGES . FILENAME_NEW_PRODUCTS;
$cPath = $categories['parent_id']; } if ((!isset($HTTP_GET_VARS['cID']) && !isset($HTTP_GET_VARS['pID']) || isset($HTTP_GET_VARS['cID']) && $HTTP_GET_VARS['cID'] == $categories['categories_id']) && !isset($cInfo) && substr($action, 0, 3) != 'new') { $category_childs = array('childs_count' => tep_childs_in_category_count($categories['categories_id'])); $category_products = array('products_count' => tep_products_in_category_count($categories['categories_id'], true)); $cInfo_array = array_merge($categories, $category_childs, $category_products); $cInfo = new objectInfo($cInfo_array); } if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $tPath . '&' . tep_get_path($categories['categories_id'])) . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $tPath . '&cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent" colspan="3"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $tPath . '&' . tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER, '16', '16', 'style="margin: 2px 0 -2px 0;"') . '</a> [' . $categories['sort_order'] . '] <strong>' . $categories['categories_name'] . '</strong>'; ?> </td> <td class="dataTableContent" align="center"> <?php if ($categories['categories_status'] == '1') { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_all_get_params(array('action', 'flag', 'cID')) . 'action=setflag&flag=0&cID=' . $categories['categories_id']) . '" onClick="this.href += \'&other=\'+(confirm(\'' . WARNING_SUBSTATUS_OFF . '\') ? 1 : 0);">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_all_get_params(array('action', 'flag', 'cID')) . 'action=setflag&flag=1&cID=' . $categories['categories_id']) . '" onClick="this.href += \'&other=\'+(confirm(\'' . WARNING_SUBSTATUS_ON . '\') ? 1 : 0);">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10) . '</a>'; } if ($categories['categories_listing_status'] == '1') { echo ' <a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_all_get_params(array('action', 'flag', 'cID')) . 'action=setflag&listing_flag=0&cID=' . $categories['categories_id']) . '" onClick="this.href += \'&other=\'+(confirm(\'' . WARNING_SUBSTATUS_LISTING_OFF . '\') ? 1 : 0);">' . tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '</a>'; } else { echo ' <a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_all_get_params(array('action', 'flag', 'cID')) . 'action=setflag&listing_flag=1&cID=' . $categories['categories_id']) . '" onClick="this.href += \'&other=\'+(confirm(\'' . WARNING_SUBSTATUS_LISTING_ON . '\') ? 1 : 0);">' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10) . '</a>'; } if ($categories['categories_xml_status'] == '1') {
if (isset($_GET['manufacturers_id'])) { $products_ids = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p where p.products_status = '1' and find_in_set('" . $customer_group_id . "', p.products_hide_from_groups) = '0' and p.manufacturers_id = '" . (int) $_GET['manufacturers_id'] . "'"); $category_name_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int) $_GET['manufacturers_id'] . "'"); $category_name_row = tep_db_fetch_array($category_name_query); $prev_next_in = $category_name_row['manufacturers_name']; $fPath = 'manufacturers_id=' . (int) $_GET['manufacturers_id']; } else { if (!$current_category_id) { $cPath_query = tep_db_query("select categories_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int) $_GET['products_id'] . "'"); $cPath_row = tep_db_fetch_array($cPath_query); $current_category_id = $cPath_row['categories_id']; } $products_ids = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and find_in_set('" . $customer_group_id . "', p.products_hide_from_groups) = '0' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int) $current_category_id . "'"); $category_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int) $current_category_id . "' and language_id = '" . (int) $languages_id . "'"); $category_name_row = tep_db_fetch_array($category_name_query); $prev_next_in = ' <a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($current_category_id = '')) . '">' . $category_name_row['categories_name'] . '</a>'; $fPath = 'cPath=' . $cPath; } // Check if there is at least 1 product if ($product_row = tep_db_fetch_array($products_ids)) { $position = 1; $counter = tep_db_num_rows($products_ids); // Just in case there is no other product, previous and next will be the same as the current product $previous = $next_item = $product_row['products_id']; // First row is the current product, so previous product will be the last one if ($product_row['products_id'] == (int) $_GET['products_id']) { // Set the next row if ($product_row = tep_db_fetch_array($products_ids)) { $previous = $next_item = $product_row['products_id']; while ($product_row = tep_db_fetch_array($products_ids)) { $previous = $product_row['products_id'];
$cInfo = new objectInfo($cInfo_array); } if (isset($cInfo) && is_object($cInfo) && $categories['categories_id'] == $cInfo->categories_id) { echo '<tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&' . tep_get_path($categories['categories_id'])) . (!empty($_GET['status']) ? '&status=' . $_GET['status'] : '') . '\'">' . "\n"; } else { echo '<tr class="dataTableRow ' . ($ct++ & 1 ? 'tabEven' : 'tabOdd') . '" onclick="document.location.href=\'' . tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&cPath=' . $cPath . '&cID=' . $categories['categories_id'] . (!empty($_GET['status']) ? '&status=' . $_GET['status'] : '')) . '\'">' . "\n"; } ?> <td class="dataTableContent" align="center" style="width:60px;"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&' . tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>'; ?> </td> <td class="dataTableContent" align="center" style="padding-left:4px; padding-right:4px; width:30px;"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&' . tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', 'View Category') . '</a>'; ?> </td> <td class="dataTableContent" style="padding-left:5px; width:320px;"><?php echo '<b>' . $categories['categories_name'] . '</b>'; ?> </td> <td class="dataTableContent" align="center" style="width:50px;"> <?php if ($categories['categories_status']) { echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&action=setflag&flag=0&cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'pclass=' . $pClass . '&action=setflag&flag=1&cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a> ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);
while ($Qcategories->fetch()) { // Get parent_id for subcategories if search if (isset($_GET['search'])) { $cPath = $Qcategories->valueInt('parent_id'); } $category_path_string = ''; $category_path = tep_generate_category_path($Qcategories->valueInt('categories_id')); for ($i = sizeof($category_path[0]) - 1; $i > 0; $i--) { $category_path_string .= $category_path[0][$i]['id'] . '_'; } $category_path_string = substr($category_path_string, 0, -1); ?> <tr> <td><?php echo '<a href="' . OSCOM::link(FILENAME_CATEGORIES, tep_get_path($Qcategories->valueInt('categories_id'))) . '"><i class="fa fa-play"></i> ' . $Qcategories->value('categories_name') . '</a>'; ?> </td> <td></td> <td></td> <td class="text-right"></td> <td class="action"><?php echo '<a href="' . OSCOM::link(FILENAME_CATEGORIES, 'cPath=' . $category_path_string . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=edit_category') . '"><i class="fa fa-pencil" title="' . OSCOM::getDef('image_edit') . '"></i></a> <a href="' . OSCOM::link(FILENAME_CATEGORIES, 'cPath=' . $category_path_string . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=delete_category') . '"><i class="fa fa-trash" title="' . OSCOM::getDef('image_delete') . '"></i></a> <a href="' . OSCOM::link(FILENAME_CATEGORIES, 'cPath=' . $category_path_string . '&cID=' . $Qcategories->valueInt('categories_id') . '&action=move_category') . '"><i class="fa fa-share" title="' . OSCOM::getDef('image_move') . '"></i></a>'; ?> </td> </tr> <?php }