Hi there and thanks for the quick answer .. here are the first 68 lines of my index.php (right before the doctype starts)
<?php
/*
$Id: index.php 1739 2007-12-20 00:52:16Z hpdl $
osCommerce, Open Source E-Commerce Solutions
[url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]
Copyright © 2003 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
//get current category tags when a category is selected
$cat_tags_query = tep_db_query("SELECT categories_name, title_tag, desc_tag, keywords_tag FROM " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' AND language_id = '" . (int)$languages_id . "'");
$cat_tags = tep_db_fetch_array($cat_tags_query);
$categories_name = $cat_tags['categories_name'];
$title_tag = $cat_tags['title_tag'];
$desc_tag = $cat_tags['desc_tag'];
$keywords_tag = $cat_tags['keywords_tag'];
//set default
$kws_home_default = $categories_name;
$desc_home_default = $categories_name;
$title_home_default = $categories_name;
} else {
//no category is selected: randomly select category names as keywords
$cat_names_query = tep_db_query("SELECT categories_name FROM " . TABLE_CATEGORIES_DESCRIPTION . " WHERE language_id = '" . (int)$languages_id . "'" . " ORDER BY RAND()");
$kws_home_default = "";
$num_rows = tep_db_num_rows($cat_names_query);
if ($num_rows > 20){
$i = rand(1,$num_rows);
for ($count = $i; $count < $i + 20; $count++) {
$cat_names = tep_db_fetch_array($cat_names_query);
$kws_home_default .= $cat_names['categories_name'] . ', ';
}
} else {
while ($cat_names = tep_db_fetch_array($cat_names_query)){
$kws_home_default .= $cat_names['categories_name'] . ', ';
}
}
//default title tag for the index (home) page
$title_home_default = "ENTER YOUR DEFAULT TITLE TEXT HERE";
//default keywords for the index (home) page
$kws_home_default .= STORE_NAME;
//default Description for the index (home) page
$desc_home_default = "ENTER YOUR DEFAULT DESCRIPTION TAG TEXT HERE FOR THE HOME PAGE";
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>