<?php
/*
  $Id: links.php,v 1.2 2004/03/12 19:28:57 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

// define our link functions
  require(DIR_WS_FUNCTIONS . 'links.php');

// calculate link category path
  if (isset($_GET['lPath'])) {
    $lPath = (int)$_GET['lPath'];
    $current_category_id = $lPath;
    $display_mode = 'links';
  } elseif (isset($_GET['links_id'])) {
    $lPath = tep_get_link_path($_GET['links_id']);
  } else {
    $lPath = '';
    $display_mode = 'categories';
  }

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LINKS);

  // links breadcrumb
  $link_categories_query = tep_db_query("select link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where link_categories_id = '" . (int)$lPath . "' and language_id = '" . (int)$languages_id . "'");
  $link_categories_value = tep_db_fetch_array($link_categories_query);

  if ($display_mode == 'links') {
    if (MODULE_ADDONS_ULTIMATESEO_STATUS == 'True') {  
      $breadcrumb->add(NAVBAR_TITLE, 'links.html'); 
    } else {  
      $breadcrumb->add(NAVBAR_TITLE, FILENAME_LINKS);
    }
    if (MODULE_ADDONS_ULTIMATESEO_STATUS == 'True') {
      $breadcrumb->add($link_categories_value['link_categories_name'], 'links.html?lPath=' . $lPath);
    } else {  
      $breadcrumb->add($link_categories_value['link_categories_name'], FILENAME_LINKS . '?lPath=' . $lPath);
    }
  } else {
    if (MODULE_ADDONS_ULTIMATESEO_STATUS == 'True') {  
      $breadcrumb->add(NAVBAR_TITLE, 'links.html'); 
    } else {  
      $breadcrumb->add(NAVBAR_TITLE, FILENAME_LINKS);
    }
  }

  $content = CONTENT_LINKS;

  require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

?>
