if ($pfrom > 0) {
        $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double) $pfrom . ")";
    }
    if ($pto > 0) {
        $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double) $pto . ")";
    }
} else {
    if ($pfrom > 0) {
        $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= " . (double) $pfrom . ")";
    }
    if ($pto > 0) {
        $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= " . (double) $pto . ")";
    }
}
if (INSTALLED_VERSION_TYPE == 'B2B') {
    $where_str .= tep_get_access_sql('p.products_group_access', $customer_group_array);
}
// Eversun mod end for group_access check
if (DISPLAY_PRICE_WITH_TAX == 'true' && (tep_not_null($pfrom) || tep_not_null($pto))) {
    $where_str .= " group by p.products_id, tr.tax_priority";
}
if (!isset($_GET['sort']) || !ereg('[1-8][ad]', $_GET['sort']) || substr($_GET['sort'], 0, 1) > sizeof($column_list)) {
    for ($i = 0, $n = sizeof($column_list); $i < $n; $i++) {
        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
            $_GET['sort'] = $i + 1 . 'a';
            $order_str = ' order by pd.products_name';
            break;
        }
    }
} else {
    $sort_col = substr($_GET['sort'], 0, 1);
<?php 
        // BOF: Lango Added for template MOD
    } else {
        $header_text = HEADING_TITLE;
    }
    // EOF: Lango Added for template MOD
    ?>





<?php 
    if (INSTALLED_VERSION_TYPE == 'B2B') {
        $group_access_link_categories = tep_get_access_sql('lc.products_group_access', $customer_group_array);
    } else {
        $group_access_link_categories = '';
    }
    $categories_query = tep_db_query("select lc.link_categories_id, lcd.link_categories_name, lcd.link_categories_description, lc.link_categories_image from " . TABLE_LINK_CATEGORIES . " lc, " . TABLE_LINK_CATEGORIES_DESCRIPTION . " lcd where lc.link_categories_id = lcd.link_categories_id and lc.link_categories_status = '1' and lcd.language_id = '" . (int) $languages_id . "' " . $group_access_link_categories . " order by lcd.link_categories_name");
    $number_of_categories = tep_db_num_rows($categories_query);
    if ($number_of_categories > 0) {
        $rows = 0;
        while ($categories = tep_db_fetch_array($categories_query)) {
            $rows++;
            $lPath_new = 'lPath=' . $categories['link_categories_id'];
            $width = (int) (100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
            echo '                <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">';
            if (tep_not_null($categories['link_categories_image'])) {
                echo tep_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>';
            } else {
        <td><?php 
        echo tep_draw_separator('pixel_trans.gif', '100%', '10');
        ?>
</td>
      </tr>
      <?php 
    }
    ?>
    <tr>
      <td class="pageHeading main "><?php 
    echo '<b>' . TEXT_CURRENT_ARTICLES . '</b>';
    ?>
</td>
    </tr>
    <?php 
    $group_access_current_articles = tep_get_access_sql('a.products_group_access', $customer_group_array);
    $articles_all_array = array();
    $articles_all_query_raw = "SELECT a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name\n                               from " . TABLE_ARTICLES . " a,\n                                    " . TABLE_AUTHORS . " au,\n                                    " . TABLE_ARTICLES_DESCRIPTION . " ad,\n                                    " . TABLE_ARTICLES_TO_TOPICS . " a2t,\n                                    " . TABLE_TOPICS_DESCRIPTION . " td\n                               WHERE a.articles_status = '1'\n                                 and (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now()))\n                                 and a.authors_id = au.authors_id\n                                 and a.articles_id = a2t.articles_id\n                                 and a.articles_id = ad.articles_id\n                                 and a2t.topics_id = td.topics_id\n                                 and ad.language_id = '" . (int) $languages_id . "'\n                                 and td.language_id = '" . (int) $languages_id . "' " . $group_access_current_articles . "\n                              ORDER BY a.articles_date_added desc, ad.articles_name";
    $articles_all_split = new splitPageResults($articles_all_query_raw, MAX_ARTICLES_PER_PAGE);
    if ($articles_all_split->number_of_rows > 0 && (ARTICLE_PREV_NEXT_BAR_LOCATION == 'top' || ARTICLE_PREV_NEXT_BAR_LOCATION == 'both')) {
        ?>
 <div class="product-listing-module-pagination margin-bottom">
        <div class="pull-left large-margin-bottom page-results"><?php 
        echo $articles_all_split->display_count(TEXT_DISPLAY_NUMBER_OF_ARTICLES);
        ?>
</div>
        <div class="pull-right large-margin-bottom no-margin-top">
          <ul class="pagination no-margin-top no-margin-bottom">
           <?php 
        echo $articles_all_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y')));
        ?>
function tep_show_category3($cid, $cpath, $COLLAPSABLE, $level = 0)
{
    global $categories_string3, $languages_id, $categories;
    $selectedPath = array();
    // Get all of the categories on this level
    $level++;
    $customer_group_array = array();
    if (!isset($_SESSION['sppc_customer_group_id'])) {
        $customer_group_array[] = 'G';
    } else {
        $customer_group_array = tep_get_customers_access_group($_SESSION['customer_id']);
    }
    $categories_query_raw = "SELECT c.categories_id, cd.categories_name, c.parent_id\r\n                             from " . TABLE_CATEGORIES . " c,\r\n                                  " . TABLE_CATEGORIES_DESCRIPTION . " cd\r\n                           WHERE c.parent_id = '" . $cid . "'\r\n                             and c.categories_id = cd.categories_id\r\n                             and cd.language_id='" . $languages_id . "'";
    $categories_query_raw .= tep_get_access_sql('c.products_group_access', $customer_group_array);
    $categories_query_raw .= " ORDER BY sort_order, cd.categories_name";
    $categories_query = tep_db_query($categories_query_raw);
    while ($categories = tep_db_fetch_array($categories_query)) {
        if (!isset($categories[$level]['parent_id']) || $categories[$level]['parent_id'] == "") {
            $categories[$level]['parent_id'] = 0;
        }
        $categories[$level]['categories_id'] = $categories[$level]['parent_id'] + 1;
        // Add category link to $categories_string3
        for ($a = 1; $a < $level; $a++) {
            $categories_string3 .= "&nbsp;&nbsp;";
        }
        $categories_string3 .= '<a href="';
        $cPath_new = $cpath;
        // if ($categories[$level]['parent_id'] > 0) {
        if ($categories['parent_id'] > 0) {
            $cPath_new .= "_";
        }
        $cPath_new .= $categories['categories_id'];
        // added for CDS CDpath support
        $CDpath = isset($_SESSION['CDpath']) ? '&CDpath=' . $_SESSION['CDpath'] : '';
        $cPath_new_text = "cPath=" . $cPath_new . $CDpath;
        $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
        $categories_string3 .= '">';
        if ($_GET['cPath']) {
            $selectedPath = explode("_", $_GET['cPath']);
        }
        if (in_array($categories['categories_id'], $selectedPath)) {
            $categories_string3 .= '<b>';
        }
        if ($categories[$level]['categories_id'] == 1) {
            $categories_string3 .= '<u>';
        }
        $categories_string3 .= tep_db_decoder($categories['categories_name']);
        if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) {
            $categories_string3 .= ' ->';
        }
        if ($categories[$level]['categories_id'] == 1) {
            $categories_string3 .= '</u>';
        }
        if (in_array($categories['categories_id'], $selectedPath)) {
            $categories_string3 .= '</b>';
        }
        $categories_string3 .= '</a>';
        if (SHOW_COUNTS) {
            $products_in_category = tep_count_products_in_category($categories['categories_id']);
            if ($products_in_category > 0) {
                $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
            }
        }
        $categories_string3 .= '<br>';
        // If I have subcategories, get them and show them
        if (tep_has_category_subcategories($categories['categories_id'])) {
            if ($COLLAPSABLE) {
                if (in_array($categories['categories_id'], $selectedPath)) {
                    tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE, $level);
                }
            } else {
                tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE, $level);
            }
        }
    }
}
      <div class="box-header small-margin-bottom small-margin-left"><?php 
echo BOX_HEADING_REVIEWS;
?>
</div>
    <?php 
$customer_group_array = array();
if (!isset($_SESSION['sppc_customer_group_id'])) {
    $customer_group_array[] = 'G';
} else {
    $customer_group_array[] = tep_get_customers_access_group($_SESSION['customer_id']);
}
$random_select = "SELECT r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name\r\n                        from " . TABLE_REVIEWS . " r,\r\n                             " . TABLE_REVIEWS_DESCRIPTION . " rd,\r\n                             " . TABLE_PRODUCTS . " p,\r\n                             " . TABLE_PRODUCTS_DESCRIPTION . " pd\r\n                      WHERE p.products_status = '1'\r\n                        and p.products_id = r.products_id\r\n                        and r.reviews_id = rd.reviews_id\r\n                        and rd.languages_id = '" . (int) $languages_id . "'\r\n                        and p.products_id = pd.products_id\r\n                        and pd.language_id = '" . (int) $languages_id . "'";
if (isset($_GET['products_id'])) {
    $random_select .= " and p.products_id = '" . (int) $_GET['products_id'] . "'";
}
$random_select .= tep_get_access_sql('p.products_group_access', $customer_group_array);
$random_select .= " order by r.reviews_id desc limit " . MAX_RANDOM_SELECT_REVIEWS;
$random_product = tep_random_select($random_select);
if ($random_product) {
    // display random review box
    $review_query = tep_db_query("SELECT substring(reviews_text, 1, 60) as reviews_text\r\n                                      from " . TABLE_REVIEWS_DESCRIPTION . "\r\n                                    WHERE reviews_id = '" . (int) $random_product['reviews_id'] . "'\r\n                                      and languages_id = '" . (int) $languages_id . "'");
    $review = tep_db_fetch_array($review_query);
    $review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');
    echo '<div align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product['products_image'], $random_product['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><br><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $random_product['products_id'] . '&amp;reviews_id=' . $random_product['reviews_id']) . '">' . $review . ' ..</a><br><br><div align="center">' . tep_image(DIR_WS_IMAGES . 'stars_' . $random_product['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $random_product['reviews_rating'])) . '</div></br>';
} elseif (isset($_GET['products_id'])) {
    if (tep_customer_access_product($customer_group_array, (int) $_GET['products_id'])) {
        // display 'write a review' box
        if (DESIGN_BUTTON_REVIEWS == 'true') {
            echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . (int) $_GET['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) . '</a><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . (int) $_GET['products_id']) . '">' . BOX_REVIEWS_WRITE_REVIEW . '</a>';
        } else {
            echo '';