Jump to content
Sign in to follow this  
joeri

Contribution: Category Descriptions

Recommended Posts

I have the same problem as everyone else.

 

Top categories work fine - sub-cats don't.

 

Data enters my database and then isn't pulled out by index.php

 

I've tried MPMD's fix and that didn't seem to work (although I'm not sure I understood the fix exactly).

 

Anyone got any ideas on this one?

 

Cheers

 

Take a look at my post (#32):

 

http://forums.oscommerce.com/index.php?s=&...t&p=1067121

 

This allows you to have a category description for a subcategory. I haven't tried having a sub-subcategory; however this works for my purposes, hopefully for yours, too. You may want to style the description so it looks prettier, however.

 

-monkster


==========

monkster

Share this post


Link to post
Share on other sites
Take a look at my post (#32):

 

http://forums.oscommerce.com/index.php?s=&...t&p=1067121

 

This allows you to have a category description for a subcategory. I haven't tried having a sub-subcategory; however this works for my purposes, hopefully for yours, too. You may want to style the description so it looks prettier, however.

 

-monkster

 

Hey thanks a lot, that seems to work.

 

Mr Monkster sir... you are a genius.

 

Cheers


Paul

Total Wargamer

Share this post


Link to post
Share on other sites

Great contrib. Installed it and everything seems to work like a charm. Really nice way to do some inpage seo and to give the visitors more info. Thanks a bunch!

Share this post


Link to post
Share on other sites

step one says something about an image update bug...

 

1) Locate the following line (approximately line 80) (image update bug repair provided in the bugs section on oscommerce.com): 
       if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

 

I cannot find the above line, the closest I have is:

 

if ($categories_image->parse() && $categories_image->save()) {
         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
       }

 

I tried to find the "image update bug repair" but could not.

 

Can someone point me in the right direction?

 

thanks,

 

Drew

www.NorthEastCoral.com

Share this post


Link to post
Share on other sites

I have a problem with step 7. CHANGES TO catalog/index.php as my file is much different. Please help me to do the changes:

 

<?php

 

/*

 

$Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

 

 

 

osCommerce, Open Source E-Commerce Solutions

 

http://www.oscommerce.com

 

 

 

Copyright © 2003 osCommerce

 

 

 

Released under the GNU General Public License

 

*/

 

 

 

 

 

 

 

 

 

require('includes/application_top.php');

// BOF Separate Pricing Per Customer

if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') {

$customer_group_id = $_SESSION['sppc_customer_group_id'];

} else {

$customer_group_id = '0';

}

// EOF Separate Pricing Per Customer

 

// 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

 

}

 

}

 

}

 

 

 

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

 

?>

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html <?php echo HTML_PARAMS; ?>>

 

<head>

 

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<script type="text/javascript" language="javascript">

<!--

 

 

// definicje pomocniczych zmiennych

var opoznienie = 2000; // czas (w milisek.) pokazywania banera

var nazwaodnosnika = "#banerrorator" // nazwa odnosnika, ktory bedzie sluzyl do zmiany banerow

 

var obrazek = new Array(); // dodawanie obrazkow jest analogiczne, wazne jest nadanie odpowiedniego numeru

obrazek[0] = new odnosnik(0,"http://rosliny-owadozerne.pl","http://rosliny-owadozerne.pl/images/bann1.jpg");

obrazek[1] = new odnosnik(1,"http://rosliny-owadozerne.pl","http://rosliny-owadozerne.pl/images/bann3.jpg");

obrazek[2] = new odnosnik(2,"http://rosliny-owadozerne.pl","http://rosliny-owadozerne.pl/images/bann2.jpg");

 

 

/////////////////////////////////////////////////////

// od tego miejsca nie musisz juz nic zmieniac //

/////////////////////////////////////////////////////

 

var pomocy; // potrzebna przy setTimeout

 

// wykonywana po zaladowaniu strony ///

function init() {

for (licznik = 0; licznik < document.links.length; licznik++) { // znajduje nr odnosnika na podstawie kotwicy

if ( document.links[licznik].hash == nazwaodnosnika ) { // "odnosnik" to nazwa odnosnika stworzonego przez <a href="plik.roz" name="#odnosnik">costam</a>

odnosi = licznik;

break; // przerwij w momencie znalezienia

}

}

zmien(0) //uruchamia funkcje zmiany banerow

}

 

// stworzenie nowego obrazka wraz z odnosnikiem //

function odnosnik(numer, odnosnik, obraz) {

this[numer] = new Image;

this.odnosnik = odnosnik;

this.src = obraz;

}

 

// zmienia obrazek na stronie i odnosnik ktory wskazuje //

function zmien(ktory) {

if ( ktory == (obrazek.length - 1) ) pomocy = 0;

else pomocy = ktory + 1;

document.images["obrazek"].src = obrazek[ktory].src;

document.links[odnosi].href = obrazek[ktory].odnosnik;

 

setTimeout ("zmien(pomocy)",opoznienie);

}

// -->

</script>

<title><?php echo TITLE; ?></title>

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

</head>

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

 

<!-- header //-->

 

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

 

<!-- header_eof //-->

 

 

 

<!-- body //-->

 

<table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<tr>

 

<td valign="top">

 

<!-- left_navigation //-->

 

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

 

<!-- left_navigation_eof //-->

 

</td>

 

<!-- body_text //-->

 

<?php

 

if ($category_depth == 'nested') {

 

 

 

 

$category_query = tep_db_query("select cd.categories_name, c.categories_image,cd.categories_description,cd.categories_heading_title from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$category = tep_db_fetch_array($category_query);

?>

 

<td width="100%" valign="top">

 

 

 

<? tep_draw_heading_top();?>

 

 

 

<? new contentBoxHeading_ProdNew($info_box_contents);?>

 

 

 

<? tep_draw_heading_top_1(); ?>

 

 

 

 

 

 

 

 

 

<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product"">

 

 

 

<tr>

 

<?php

 

if (isset($cPath) && strpos('_', $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++) {

 

$categories_query = tep_db_query("select count(*) as total 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 . "'");

 

$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.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']);

 

$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';

 

echo '

 

 

 

<td align="center" width="' . $width . '">'.tep_draw_prod_top().'

 

<table cellpadding="0" cellspacing="0" border="0" style="width:108px">

 

<tr><td height="9"></td></tr>

 

<tr>

 

<td>

 

<table cellpadding="0" cellspacing="0" border="0" style="height:16px ">

 

<tr>

 

<td>'.tep_image(DIR_WS_IMAGES.'q1.gif').'</td>

 

<td align="center" style="width:100%" bgcolor="#CFCFCF" class="vam"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a><br><br><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) . '</a></td>

 

<td>'.tep_image(DIR_WS_IMAGES.'q2.gif').'</td>

 

</tr>

 

</table>

 

</td>

 

</tr>

 

<tr>

 

 

 

</tr>

 

</table>

 

'.tep_draw_prod_bottom().'

 

 

 

</td>

 

 

 

' . "\n";

 

if ($col!=(MAX_DISPLAY_CATEGORIES_PER_ROW-1)){

 

echo '

 

<td>'.tep_draw_separator('spacer.gif', '10', '1').'</td>

 

';

 

}

 

else{

 

 

 

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {

 

echo '

 

</tr><tr><td colspan="'.(MAX_DISPLAY_CATEGORIES_PER_ROW + MAX_DISPLAY_CATEGORIES_PER_ROW -1).'">'.tep_draw_separator('spacer.gif', '1', '10').'</td></tr>' . "\n";

 

echo ' <tr>' . "\n";

 

}

 

}

 

if ($col==MAX_DISPLAY_CATEGORIES_PER_ROW-1){

 

$col=0;

 

}else{

 

$col++;

 

}

 

}

 

 

 

// needed for the new products module shown below

 

$new_products_category_id = $current_category_id;

 

?>

 

 

 

 

 

</table>

 

 

 

<? tep_draw_heading_bottom_1(); ?>

 

<? tep_draw_heading_bottom();?>

 

 

 

<?php tep_draw_separate(); ?> <!-- ///////// -->

 

 

 

<? tep_draw_heading_top();?>

 

 

 

<? new contentBoxHeading_WHATS_NEW($info_box_contents, true, false);?>

 

 

 

<? tep_draw_heading_top_3();?>

 

 

 

<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>

 

 

 

<? tep_draw_heading_bottom_3();?>

 

 

 

<? tep_draw_heading_bottom();?>

 

 

 

 

 

 

 

</td>

 

 

 

<?php

 

} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {

 

// create column list

 

$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,

 

'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,

 

'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,

 

'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,

 

'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,

 

'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,

 

'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,

 

'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 

 

 

asort($define_list);

 

 

 

$column_list = array();

 

reset($define_list);

 

while (list($key, $value) = each($define_list)) {

 

if ($value > 0) $column_list[] = $key;

}

// BOF Separate Pricing Per Customer

// this will build the table with specials prices for the retail group or update it if needed

// this function should have been added to includes/functions/database.php

if ($customer_group_id == '0') {

tep_db_check_age_specials_retail_table();

}

$status_product_prices_table = false;

$status_need_to_get_prices = false;

 

// find out if sorting by price has been requested

if ( (isset($HTTP_GET_VARS['sort'])) && (ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) && (substr($HTTP_GET_VARS['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){

$_sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {

$status_need_to_get_prices = true;

}

}

 

if ($status_need_to_get_prices == true && $customer_group_id != '0') {

$product_prices_table = TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id;

// the table with product prices for a particular customer group is re-built only a number of times per hour

// (setting in /includes/database_tables.php called MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE, in minutes)

// to trigger the update the next function is called (new function that should have been

// added to includes/functions/database.php)

tep_db_check_age_products_group_prices_cg_table($customer_group_id);

$status_product_prices_table = true;

 

} // end if ($status_need_to_get_prices == true && $customer_group_id != '0')

// EOF Separate Pricing Per Customer

 

$select_column_list = '';

 

 

 

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

 

switch ($column_list[$i]) {

 

case 'PRODUCT_LIST_MODEL':

 

$select_column_list .= 'p.products_model, ';

 

break;

 

case 'PRODUCT_LIST_NAME':

 

$select_column_list .= 'pd.products_name, ';

 

break;

 

case 'PRODUCT_LIST_MANUFACTURER':

 

$select_column_list .= 'm.manufacturers_name, ';

 

break;

 

case 'PRODUCT_LIST_QUANTITY':

 

$select_column_list .= 'p.products_quantity, ';

 

break;

 

case 'PRODUCT_LIST_IMAGE':

 

$select_column_list .= 'p.products_image, ';

 

break;

 

case 'PRODUCT_LIST_WEIGHT':

 

$select_column_list .= 'p.products_weight, ';

 

break;

 

}

 

}

 

 

 

// show the products of a specified manufacturer

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

 

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

 

// We are asked to show only a specific category

// BOF Separate Pricing Per Customer

if ($status_product_prices_table == true) { // ok in mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd , " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

} else { // either retail or no need to get correct special prices -- changed for mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";

} // end else { // either retail...

// EOF Separate Pricing Per Customer

} else {

 

// We show them all

// BOF Separate Pricing Per Customer

if ($status_product_prices_table == true) { // ok in mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

} else { // either retail or no need to get correct special prices -- changed for mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

} // end else { // either retail...

// EOF Separate Pricing Per Customer

}

 

} else {

 

// show the products in a given categorie

 

if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {

 

// We are asked to show only specific catgeory

// BOF Separate Pricing Per Customer

if ($status_product_prices_table == true) { // ok for mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} else { // either retail or no need to get correct special prices -- ok in mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} // end else { // either retail...

// EOF Separate Pricing Per Customer

} else {

 

// We show them all

// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility

if ($status_product_prices_table == true) {

// original, no need to change for mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} else { // either retail or no need to get correct special prices -- changed for mysql 5

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

} // end else { // either retail...

// EOF Separate Pricing per Customer

}

 

}

 

 

 

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

 

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

 

if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

 

$HTTP_GET_VARS['sort'] = $i+1 . 'a';

 

$listing_sql .= " order by pd.products_name";

 

break;

 

}

 

}

 

} else {

 

$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);

 

$sort_order = substr($HTTP_GET_VARS['sort'], 1);

 

$listing_sql .= ' order by ';

 

switch ($column_list[$sort_col-1]) {

 

case 'PRODUCT_LIST_MODEL':

 

$listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

 

break;

 

case 'PRODUCT_LIST_NAME':

 

$listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');

 

break;

 

case 'PRODUCT_LIST_MANUFACTURER':

 

$listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

 

break;

 

case 'PRODUCT_LIST_QUANTITY':

 

$listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

 

break;

 

case 'PRODUCT_LIST_IMAGE':

 

$listing_sql .= "pd.products_name";

 

break;

 

case 'PRODUCT_LIST_WEIGHT':

 

$listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

 

break;

 

case 'PRODUCT_LIST_PRICE':

 

$listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";

 

break;

 

}

 

}

 

?>

 

<td width="100%" valign="top">

 

 

 

 

 

 

 

<? tep_draw_heading_top();?>

 

 

 

 

 

 

 

<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont">

 

<tr>

 

<?php

 

// optional Product List Filter

 

/* if (PRODUCT_LIST_FILTER > 0) {

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

 

$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";

 

} else {

 

$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";

 

}

 

$filterlist_query = tep_db_query($filterlist_sql);

 

if (tep_db_num_rows($filterlist_query) > 1) {

 

echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

 

echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);

 

$options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));

 

} else {

 

echo tep_draw_hidden_field('cPath', $cPath);

 

$options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));

 

}

 

echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);

 

while ($filterlist = tep_db_fetch_array($filterlist_query)) {

 

$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);

 

}

 

echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');

 

echo '</form></td>' . "\n";

 

}

 

}*/

 

 

 

// Get the right image for the top-right

 

$image = DIR_WS_IMAGES . 'table_background_list.gif';

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) {

 

$image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

 

$image = tep_db_fetch_array($image);

 

$image = $image['manufacturers_image'];

 

} elseif ($current_category_id) {

 

$image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

 

$image = tep_db_fetch_array($image);

 

$image = $image['categories_image'];

 

$name = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "'");

 

$name = tep_db_fetch_array($name);

 

$name = $name['categories_name'];

 

}

 

?>

 

 

 

</tr>

</table>

<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont">

<tr><td align="center" valign="top"><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td></tr>

</table>

 

<? tep_draw_heading_bottom_3();?>

 

<? tep_draw_heading_bottom(); ?>

 

</td>

 

<?php

} else { // default page

?>

<td width="100%" valign="top">

<?php require(DIR_WS_BOXES . 'panel_top.php'); ?>

 

<? tep_draw_heading_top();?>

 

<? /* new contentBoxHeading_ProdNew($info_box_contents); */?>

 

<? tep_draw_heading_top_3();?>

 

 

 

 

<? tep_draw_heading_bottom_3();?>

 

<? tep_draw_heading_bottom();?>

 

</td>

<?php

}

?>

<!-- body_text_eof //-->

<td valign="top">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Share this post


Link to post
Share on other sites

Hi All

 

I have a bit of a problem with this contrib..

 

My data from admin/categories is not all coming to the database..

 

The Caategory titel is coming to the database, but the description is not..

 

I use spaw as an editor for my textarea forms.. can this be a problem ?

And if it is.. how do i get around it ?

 

Hope to find a solution..

 

Yours,

Allan

Share this post


Link to post
Share on other sites

adding this to rc2.2 gives me a problem:

everything displays right, title and description

when i want to click on any subcategory it takes me to the index.php page

but on the categories box (column left) i see the real path...any ideas?

i am also using subcategory textbox

Share this post


Link to post
Share on other sites

I just installed this contrib and I get this at the top of my pages:

$cat_description_query = tep_db_query ("select categories_heading_title, categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $cat_description = tep_db_fetch_array ($cat_description_query); ?>

 

Any ideas? I do have the show all categries contrib installed. Not sure if that would affect it.

Share this post


Link to post
Share on other sites
I just installed this contrib and I get this at the top of my pages:

$cat_description_query = tep_db_query ("select categories_heading_title, categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $cat_description = tep_db_fetch_array ($cat_description_query); ?>

 

Any ideas? I do have the show all categries contrib installed. Not sure if that would affect it.

You may have a

<?

 

in the file instead of a

 

<?php


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
You may have a

<?

 

in the file instead of a

 

<?php

Nope, I checked the files and they all seem to be ok in that reguard. Any other ideas?

Share this post


Link to post
Share on other sites
Nope, I checked the files and they all seem to be ok in that reguard. Any other ideas?

Nevermind I got it! I found an error in my install. Thank you.

Share this post


Link to post
Share on other sites
step one says something about an image update bug...

 

1) Locate the following line (approximately line 80) (image update bug repair provided in the bugs section on oscommerce.com): 
       if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

 

I cannot find the above line, the closest I have is:

 

if ($categories_image->parse() && $categories_image->save()) {
         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
       }

 

I tried to find the "image update bug repair" but could not.

 

Can someone point me in the right direction?

 

thanks,

 

Drew

www.NorthEastCoral.com

 

I had the same problem, but then I found the following code:

 

// copy image only if modified
	$products_image = new upload('products_image');
	$products_image->set_destination(DIR_FS_CATALOG_IMAGES);
	if ($products_image->parse() && $products_image->save()) {
	  $products_image_name = $products_image->filename;
	} else {
 $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');

 

which almost matched the replacing text, so I replaced that instead and it seems to work fine. (I'm posting in the middle of installing the contrib, otherwise I might not find the code again!!

 

In future, it'd be really helpful for this contrib to have the entire files available in a zip file or something. then if we haven't modified them in any other way we can just drop in the new version. Thanks,

 

 

Dan


bugrit! millenium hand and shrimp - I told 'em!

Share this post


Link to post
Share on other sites

Hi. I have this contribution working - thank you!

 

I am using fckeditor as my wisywig but when I change the tep_draw_textarea_field in admin/categories.php to tep_draw_fckeditor I have a couple of problems. I understand that there are two places to change this, and have done so, as well as change the width and height.

 

Problems:

 

1. The fckeditor goes to the top and does not go to full width - no matter how wide I set it.

 

2. When I do enter content with fckeditor and save, the results are not shown on the site. When I revert back to textarea_field, then content is blank and I enter new content and that saves and displays on the site.

 

Any suggestions?

Share this post


Link to post
Share on other sites

I love this contribution. There's one problem I have. The lady I am setting up this website for wants a description on the main page as well as descriptions for each category. If I put a description for TEXT_MAIN, it also shows up on the category pages as well. Here's an example of my problem:

 

Main Site with description:

http://onestopmommy.com/osc

 

Baby Bedding Category (category description appears below text_main):

http://onestopmommy.com/osc/index.php/cPath/31

 

How can I get that TEXT_MAIN to only show up on the main page?

Share this post


Link to post
Share on other sites
Good evening everyone

 

I'm trying to add the Category Description contribution, but the problem I'm having is that the index.php has heavy modifications done to it and the lines I need to replaced just aren't there as such.

 

I am not looking for the easy option of a free fix but if anyone help me figure this out or just point me in the right direction as to what changes to make to this custom index.php page then i would be most gratefull.

 

Step 7 is where i am at a stop. I have posted DR Edwiser step 7 for anyone to look at first, followed by my index.php

 

7. CHANGES TO catalog/index.php

CAREFUL: These are not trivial changes. There is a lot of code here.

1) Locate the following lines (approximately line 59):
   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>

 REPLACE above lines with the following lines:



   $category_query = tep_db_query("select cd.categories_name, c.categories_image,cd.categories_description,cd.categories_heading_title from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" valign="top"><?php echo (!empty($category['categories_heading_title']) ? $category['categories_heading_title'] : HEADING_TITLE); ?></td>
         </tr>
	  <tr>
           <TD COLSPAN="2" CLASS="main">
           <?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, 'ALIGN=right'); ?>
           <?php echo $category['categories_description']; ?>
		</TD>
	  </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>



2) Locate the following lines (approximately line 230):
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 REPLACE above lines with the following lines:
 	$cat_description_query = tep_db_query ("select categories_heading_title, categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $current_category_id . "' and language_id = '" . (int)$languages_id . "'");
$cat_description = tep_db_fetch_array ($cat_description_query);
?>
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo (!empty($cat_description['categories_heading_title']) ? $cat_description['categories_heading_title'] : HEADING_TITLE); ?></td>


3) Locate the following lines (approximately line 277):
           <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
     </tr>
   </table></td>

 REPLACE above lines with the following lines:
         </tr>
	  <tr><TD> </TD></TR>
	  <tr>
           <TD COLSPAN="2" CLASS="main">
           <?php echo tep_image(DIR_WS_IMAGES . $image, (!empty($cat_description['categories_heading_title']) ? $cat_description['categories_heading_title'] : HEADING_TITLE), HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT, 'ALIGN=right'); ?>
           <?php echo $cat_description['categories_description']; ?>
		</TD>
	  </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
     </tr>
   </table></td>


===============================================================================
Thats It, Enjoy!!!

--------------------------------------------------------------------------------------------------------------------------------------------------

My index.php

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce
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
     }
   }
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">

<link href="../headerblueborder.css" rel="stylesheet" type="text/css" />
<link href="headerblueborder.css" rel="stylesheet" type="text/css">
<script language="javascript"><!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,l
e
ft=150')
}
//--></script>
<script type="text/javascript" src="lightbox/prototype.js"></script>
<script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script>
<link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen">
<script type="text/javascript" src="lightbox/builder.js"></script>
<script type="text/javascript" src="lightbox/lightbox.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="indexblueborder">
<tr>
 	<td valign="top" bgcolor="#FFFFFF">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->	</td>
<!-- body_text //-->
<?php
 if ($category_depth == 'nested') {
   $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   $category = tep_db_fetch_array($category_query);
?>
   <td width="100%" valign="top" bgcolor="#FFFFFF">

<?  tep_draw_heading_top();?>

<? new contentBoxHeading_ProdNew($info_box_contents);?>

<?  tep_draw_heading_top_3();?>




  <br style="line-height:10px;">
                   <table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product">
					<tr>
<?php
if (isset($cPath) && strpos('_', $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++) {
	$categories_query = tep_db_query("select count(*) as total 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 . "'");
	$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.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']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '               

		<td  align="center" width="' . $width . '">
				<table cellspacing="0" cellpadding="0" border="0" >
					<tr>
						<td align="center">'.tep_draw_prod_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) . '</a>'.tep_draw_prod_bottom().'<br style="line-height:7px">
						<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>
						<br style="line-height:1px;"><br style="line-height:30px;"></td>
					</tr>
				</table>		





		</td>

  ' . "\n";
			  if ($col!=(MAX_DISPLAY_CATEGORIES_PER_ROW-1)){
			  echo '
										<td>'.tep_draw_separator('spacer.gif', '8', '1').'</td>
					';
			  }
			 else{	

  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '              
</tr><tr><td colspan="'.(MAX_DISPLAY_CATEGORIES_PER_ROW + MAX_DISPLAY_CATEGORIES_PER_ROW -1).'">'.tep_draw_separator('spacer.gif', '1', '10').'</td></tr>' . "\n";
	echo '              <tr>' . "\n";
  }
}
if ($col==MAX_DISPLAY_CATEGORIES_PER_ROW-1){
$col=0;
}else{
$col++;
}
}	

// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>
			</table>

<?  tep_draw_heading_bottom_3();?>				
<? tep_draw_heading_bottom();?>

<?php tep_draw_separate(); ?>  <!--  /////////  -->

<? tep_draw_heading_top();?>

<? /*new contentBoxHeading_WHATS_NEW($info_box_contents, true, false);*/?>

<? tep_draw_heading_top_3();?>			

	<?php /* include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); */?>

<? tep_draw_heading_bottom_3();?>

<? tep_draw_heading_bottom();?></td>

<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

   asort($define_list);

   $column_list = array();
   reset($define_list);
   while (list($key, $value) = each($define_list)) {
     if ($value > 0) $column_list[] = $key;
   }

   $select_column_list = '';

   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     switch ($column_list[$i]) {
       case 'PRODUCT_LIST_MODEL':
         $select_column_list .= 'p.products_model, ';
         break;
       case 'PRODUCT_LIST_NAME':
         $select_column_list .= 'pd.products_name, ';
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $select_column_list .= 'm.manufacturers_name, ';
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $select_column_list .= 'p.products_quantity, ';
         break;
       case 'PRODUCT_LIST_IMAGE':
         $select_column_list .= 'p.products_image, ';
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $select_column_list .= 'p.products_weight, ';
         break;
     }
   }

// show the products of a specified manufacturer
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
     }
   } else {
// show the products in a given categorie
     if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     } else {
// We show them all
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
     }
   }

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
         $HTTP_GET_VARS['sort'] = $i+1 . 'a';
         $listing_sql .= " order by pd.products_name";
         break;
       }
     }
   } else {
     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
     $sort_order = substr($HTTP_GET_VARS['sort'], 1);
     $listing_sql .= ' order by ';
     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':
         $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_NAME':
         $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
         break;
       case 'PRODUCT_LIST_MANUFACTURER':
         $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_QUANTITY':
         $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_IMAGE':
         $listing_sql .= "pd.products_name";
         break;
       case 'PRODUCT_LIST_WEIGHT':
         $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
       case 'PRODUCT_LIST_PRICE':
         $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
         break;
     }
   }
?>
   <td width="100%" valign="top" bgcolor="#FFFFFF">



<? tep_draw_heading_top();?>	  



<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont">
		  		<tr>
<?php
// optional Product List Filter
 /*  if (PRODUCT_LIST_FILTER > 0) {
     if (isset($HTTP_GET_VARS['manufacturers_id'])) {
       $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
     } else {
       $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
     }
     $filterlist_query = tep_db_query($filterlist_sql);
     if (tep_db_num_rows($filterlist_query) > 1) {
       echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
       if (isset($HTTP_GET_VARS['manufacturers_id'])) {
         echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
         $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
       } else {
         echo tep_draw_hidden_field('cPath', $cPath);
         $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
       }
       echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
       while ($filterlist = tep_db_fetch_array($filterlist_query)) {
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
       }
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
       echo '</form></td>' . "\n";
     }
   }*/

// Get the right image for the top-right
   $image = DIR_WS_IMAGES . 'table_background_list.gif';
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['manufacturers_image'];
   } elseif ($current_category_id) {
     $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  $image = tep_db_fetch_array($image);
     $image = $image['categories_image'];
  $name = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "'");
  $name = tep_db_fetch_array($name);
     $name = $name['categories_name'];
   }
?>
				</tr>
  </table>
			<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont">
				<tr><td align="center" valign="top" bgcolor="#FFFFFF"><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
			  </tr>
			</table>

<? tep_draw_heading_bottom_3();?>

<? tep_draw_heading_bottom(); ?>	</td>

<?php
 } else { // default page
?>
   <td width="100%" valign="top" bgcolor="#FFFFFF">
<?php /*  require(DIR_WS_BOXES . 'panel_top.php');  */ ?>

<? tep_draw_heading_top();?>

<? new contentBoxHeading_ProdNew($info_box_contents);?>

<? tep_draw_heading_top_3();?>


				<?php include(DIR_WS_MODULES . FILENAME_MAIN_CATEGORIES); ?>
				<?php include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS); ?>


<? tep_draw_heading_bottom_3();?>
<?php require(DIR_WS_BOXES . 'panel_bottom.php'); ?>					
<? tep_draw_heading_bottom();?>	</td>
<?php
 }
?>
<!-- body_text_eof //-->
   <td valign="top" bgcolor="#FFFFFF">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->    </td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

I am having the EXACT same problem as this guy. Step 7 i have hit a brick wall. I am told to look for a block of code which doesnt exist in my index.php. i even tried searching for a very small section of the code

<?php echo HEADING_TITLE; ?>

and that doesnt even exist in my index.php

 

here is a copy of my index.php

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $

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

 Copyright (c) 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
  }
}
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style type="text/css">
<!--
.style1 {font-size: 12px}
.style2 {
font-size: 11px;
font-weight: bold;
}
-->
</style>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<td valign="top" class="col_left">
<!-- left_navigation //--><?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->	</td>
<!-- body_text //-->
<?php
 if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);
?>
<td width="100%" class="col_center">


<?  tep_draw_heading_top();?>

<? new contentBoxHeading_ProdNew1($info_box_contents);?>

<?  tep_draw_heading_top_5();?>


				<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product">
					<tr>
<?php
if (isset($cPath) && strpos('_', $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++) {
	$categories_query = tep_db_query("select count(*) as total 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 . "'");
	$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.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)) {

$p_pic_sub = '<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) . '</a>';

$p_name_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>';



  $rows++;
  $cPath_new = tep_get_path($categories['categories_id']);
  $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
  echo '			   

	<td  align="center" width="' . $width . '">
			<table cellpadding="0" cellspacing="0" border="0">
				 <tr>
					<td style="height:16px " align="center" class="vam"><span>'.$p_name_sub.'</span></td>
				</tr>
				<tr>
					<td style="height:95px " align="center" class="pic" >'.tep_draw_prod_pic_top().''.$p_pic_sub.''.tep_draw_prod_pic_bottom().'</td>
				</tr>
			</table> 
	</td>
  ' . "\n";
			  if ($col!=(MAX_DISPLAY_CATEGORIES_PER_ROW-1)){
			  echo '
					<td class="bg_line_y">'.tep_draw_separator('spacer.gif', '1', '1').'</td>					
					';
			  }
			 else{	

  if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
	echo '			  
</tr><tr><td class="bg_line_x" colspan="'.(MAX_DISPLAY_CATEGORIES_PER_ROW + MAX_DISPLAY_CATEGORIES_PER_ROW -1).'">'.tep_draw_separator('spacer.gif', '1', '10').'</td></tr>' . "\n";
	echo '			  <tr>' . "\n";
  }
}
if ($col==MAX_DISPLAY_CATEGORIES_PER_ROW-1){
$col=0;
}else{
$col++;
}
}	

// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>					

			</table>

<?  tep_draw_heading_bottom_5();?>

<?  /*  tep_draw_heading_bottom();  */  ?>

<?php tep_draw_separate(); ?>  <!--  /////////  -->

<?   /*  tep_draw_heading_top();  */  ?>

<? new contentBoxHeading_WHATS_NEW($info_box_contents, true, false);?>

<? tep_draw_heading_top_3();?>			

		<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

<? tep_draw_heading_bottom_3();?>

<? tep_draw_heading_bottom();?>		

</td>
<?php
 } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
					 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
					 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
					 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
					 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
					 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
					 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
					 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

asort($define_list);

$column_list = array();
reset($define_list);
while (list($key, $value) = each($define_list)) {
  if ($value > 0) $column_list[] = $key;
}

$select_column_list = '';

for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
  switch ($column_list[$i]) {
	case 'PRODUCT_LIST_MODEL':
	  $select_column_list .= 'p.products_model, ';
	  break;
	case 'PRODUCT_LIST_NAME':
	  $select_column_list .= 'pd.products_name, ';
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $select_column_list .= 'm.manufacturers_name, ';
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $select_column_list .= 'p.products_quantity, ';
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $select_column_list .= 'p.products_image, ';
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $select_column_list .= 'p.products_weight, ';
	  break;
  }
}

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
  } else {
// We show them all
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } else {
// We show them all
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  }
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('^[1-8][ad]$', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
  for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
	if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
	  $HTTP_GET_VARS['sort'] = $i+1 . 'a';
	  $listing_sql .= " order by pd.products_name";
	  break;
	}
  }
} else {
  $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
  $sort_order = substr($HTTP_GET_VARS['sort'], 1);

  switch ($column_list[$sort_col-1]) {
	case 'PRODUCT_LIST_MODEL':
	  $listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_NAME':
	  $listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
	  break;
	case 'PRODUCT_LIST_MANUFACTURER':
	  $listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_QUANTITY':
	  $listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_IMAGE':
	  $listing_sql .= " order by pd.products_name";
	  break;
	case 'PRODUCT_LIST_WEIGHT':
	  $listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
	case 'PRODUCT_LIST_PRICE':
	  $listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
	  break;
  }
}
?>
<td width="100%" class="col_center">

<? tep_draw_heading_top();?>		





<?php
// optional Product List Filter
/*	  if (PRODUCT_LIST_FILTER > 0) {
  if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
  } else {
	$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
  }
  $filterlist_query = tep_db_query($filterlist_sql);
  if (tep_db_num_rows($filterlist_query) > 1) {
	echo '			<td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' ';
	if (isset($HTTP_GET_VARS['manufacturers_id'])) {
	  echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
	} else {
	  echo tep_draw_hidden_field('cPath', $cPath);
	  $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
	}
	echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
	while ($filterlist = tep_db_fetch_array($filterlist_query)) {
	  $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
	}
	echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
	echo tep_hide_session_id() . '</form></td>' . "\n";
  }
}
 */
// Get the right image for the top-right
$image = DIR_WS_IMAGES . 'table_background_list.gif';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['manufacturers_image'];
} elseif ($current_category_id) {
  $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  $image = tep_db_fetch_array($image);
  $image = $image['categories_image'];
}
?>
  <?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?>

<? tep_draw_heading_bottom_3();?>

<? tep_draw_heading_bottom();?>		

</td>
<?php
 } else { // default page
?>
<td width="100%" class="col_center"><? tep_draw_heading_top();?>
  <?php require(DIR_WS_BOXES . 'panel_top.php'); ?>
  <?   new contentBoxHeading_ProdNew($info_box_contents);  ?>
  <? tep_draw_heading_top_3();?>
  <DIV class="style1">
	<div align="center" class="style2">Welcome to the Love and Marriage Website, thank you for logging in. Our fantastic 'SALE OFFERS' will commence from Monday 11th August   2008. </div>
  </DIV>
  <DIV></DIV>
  <?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>
  <?php include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS); ?>
  <? tep_draw_heading_bottom_3();?>
  <? tep_draw_heading_bottom();?></td>
<?php
 }
?>
<!-- body_text_eof //-->
<td class="col_right">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

- if anybody can get this working for me, i will pay them for their time, PLEASE HELP.

Share this post


Link to post
Share on other sites

I installed the contrib and it works fine. Thanks!

 

The text entered into the Category Description however does not seem to get indexed by the standard osC search function. What lines in advanced_search_result.php need alteration to fix this?

 

I hope anyone can help me out on this one.

 

Cheers!

Share this post


Link to post
Share on other sites

I had this contribution working perfectly but now that my host has upgraded to MySQL 5.0.51 and PHP Version 5.2.5 ( Register_globals are enabled ), I always get a "500 Internal Server Error" when trying to save category descriptions.

 

I am using 01/30/2008 osCommerce Online Merchant 2.2 RC2a and I have not had any problems other than this.

 

Does anyone have any ideas as to what this could be?

Share this post


Link to post
Share on other sites
I've added this contribution, but my descriptions do not show up. I am a new osCommerce user, and have not added any other contributions (yet!). I have verified, using PHPmyAdmin, that the new columns have been added and they do contain the descriptions (& titles) that I entered using the admin pages (as modified by this contribution).

 

As mentioned by another user (craigf, on 4/14), the piece of code - <?php echo $cat_description['categories_description']; ?> does not appear to be retrieving the category description (I put in debug echo statements that produced null strings). The same is true of the <?php echo $cat_description['categories_heading_title']; ?> statement. However, it doesn't even work for the main categories for me (I only have 5 categories & no subcategories).

 

Can somebody tell me where this array is supposed to be initialized? (I did a search of the catalog folder & all subfolders and could not find it (searching for string: "cat_description").

 

I am still stuck with Radagast's issue...the description does not show up. Any suggestions? Many thanks,

Share this post


Link to post
Share on other sites
Hi. I have this contribution working - thank you!

 

I am using fckeditor as my wisywig but when I change the tep_draw_textarea_field in admin/categories.php to tep_draw_fckeditor I have a couple of problems. I understand that there are two places to change this, and have done so, as well as change the width and height.

 

Problems:

 

1. The fckeditor goes to the top and does not go to full width - no matter how wide I set it.

 

2. When I do enter content with fckeditor and save, the results are not shown on the site. When I revert back to textarea_field, then content is blank and I enter new content and that saves and displays on the site.

 

Any suggestions?

 

I have this same issue, I would love to have FCKeditor work with this. is there an answer at all? I do't really mind the FCK editor being at the top of the screen if it would only work as an html editor

Edited by CharlieM

Share this post


Link to post
Share on other sites

Hi,

 

same with me. i would realy like to have FCKeditor - did someone found the solution for this?

 

i changed the code to:

 

. tep_draw_fckeditor('categories_description[' . $languages[$i]['id'] . ']','600','300', $cat_descriptions ['categories_description'][$languages[$i]['id']]);

 

but it wont work - somehow it is not realy saving in the database. actualy when saving it will delete anything that was add to the database previously.

 

any help would be appriciated

 

thanks

caitanya

Share this post


Link to post
Share on other sites

Hi all,

 

I have it working with Dynamenu Horizontal Drop-down menu.

 

Having used fck_autoinstaller I can use fck editor in ordinary Category input screens.

 

However, Category Descriptions input screens are skewed to the right of Categories/Products Action Status and are only about 400 px wide. There are no fck editor bars at the top of this input screen. Output is fine.

 

Are there any modifications that I should make?

 

Regards,

peter_of_stirling

Share this post


Link to post
Share on other sites

I'm trying to install this contribution and ran across some instructions that don't relate to our code:

 

6. CHANGES TO admin/categories.php

 

CAREFUL: These are not trivial changes. There is a lot of code here.

 

1) Locate the following line (approximately line 80) (image update bug repair provided in the bugs section on oscommerce.com):

if ($categories_image = new upload('categories_image', DIR_FS_CATALOG_IMAGES)) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");

}

 

REPLACE those 3 lines with the following 5 lines:

$categories_image = new upload('categories_image');

$categories_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($categories_image->parse() && $categories_image->save()) {

tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");

}

 

The code in our file appears like this:

 

         if ($action == 'insert_category') {
           $insert_sql_data = array('categories_id' => $categories_id,
                                    'language_id' => $languages[$i]['id']);

           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

           tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array);
         } elseif ($action == 'update_category') {
           tep_db_perform(TABLE_CATEGORIES_DESCRIPTION, $sql_data_array, 'update', "categories_id = '" . (int)$categories_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");
         }
       }

       $categories_image = new upload('categories_image');
       $categories_image->set_destination(DIR_FS_CATALOG_IMAGES);

       if ($categories_image->parse() && $categories_image->save()) {
         tep_db_query("update " . TABLE_CATEGORIES . " set categories_image = '" . tep_db_input($categories_image->filename) . "' where categories_id = '" . (int)$categories_id . "'");
       }

       if (USE_CACHE == 'true') {
         tep_reset_cache_block('categories');
         tep_reset_cache_block('also_purchased');
       }

       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
       break;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×