Jump to content

Archived

This topic is now archived and is closed to further replies.

mugitty

Put main body of page before column_left

Recommended Posts

Mark had a good point about the left column appearing to the search engines before the main body of a page:

http://forums.oscommerce.com/index.php?sho...=0entry420745

When you view source, you'll see that the description is half way down the page. Lots of stuff above it, this gives the keywords less significiance. osCommerce puts the left menu bar above the description, you need to add a row to the top of the table, then for the first row and first column have a zero height cell, then the second column in the first row would have your description, and the third column in the same row would be zero height. Then the second row would have your left and right menus

Here is a step-by-step on how to achieve this for the product_info.php page:

(line numbers refer to an unamended MS2 product_info.php file)

 

!!!BACKUP FIRST!!!

 

1) FIND (starting at line 38, immediately below <!-- header_eof //-->)

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top">

CHANGE TO

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td height="0" width="<?php echo BOX_WIDTH; ?>" valign="top"></td>
<!-- body_text //-->
   <td rowspan"2" width="100%" valign="top">

2) FIND (starting at line 236)

<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

CHANGE TO

<!-- body_text_eof //-->
   <td height="0" width="<?php echo BOX_WIDTH; ?>" valign="top"></td>
 </tr>
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

Here is the result of the change in a search engine simulator:

(in the interest of saving (a little) space, header and footer information has been removed)

BEFORE

LEFT COLUMN: QuikSearch Enter keywords, part or model numbers Advanced Search Product Lines Power Equipment Accessories/Other Small Engines Horizontal Shaft Vertical Shaft Go Cart Snow Engines Water Cooled Short Blocks Service Manuals/Books Parts Maintenance Kits Manufacturers Please Select Agri-Fab Ariens AYP (Sears) BearCat Billy Goat Bolens Briggs & Stratton Briggs Power Product Country Home Product Dixon Echo Exmark Gates Belts Generac Homelite Honda Husqvarna Hydro-Gear Kawasaki Kohler Kwik products Lawn-Boy Little Wonder Mantis McCulloch McLane MTD Murray Noram Oregon Bars/Chain Oregon Parts (OEP) Other Manufacturers Parker Sweepers Poulan/Weedeater RedMax Robin Subaru Rotary Ryobi Scag Snapper Stanley Stens Sutech (Stealth) Tecumseh Toro Troy-Bilt Walbro Wedco Zama Information Manufacturer InfoPages Shipping & Returns Privacy Notice Conditions of Use Contact Us Latest News : New Products Added! : Husqvarna Recall : Ariens, Exmark added! : Snow Engines in stock News Categories Login Here Welcome, Guest! E-Mail address: Password: Forgot your password? First Time Here? Create new account

MAIN BODY: Previous Item Product 1 of 4 Next Item Back to Product List 6 hp Tecumseh OHH60 Power Sport OHV Representative image Actual model may differ 6 hp Tecumseh OHH60 Power Sport OHV $256.19 $239.00 item #: TE_206122A Quantity: Shipping weight: 38.00 lbs. To see shipping estimates, just 'Add To Cart' This item normally ships within 48 hours If delayed, we will email you for instructions Tecumseh 6 hp OHH60-71119F Enduro OHV PowerSport engine Tecumseh item # 206122 or 206122A replaces 206106 Application: Go carts and mini-bikes MSRP:$272.95 Crankshaft: 3/4" diameter x 2-3/8" long, tapped 5/16-24; cast iron cylinder sleeve; recoil starter; progressive port carburetor; muffler guard; RV control OHH60 Model Series Features Overhead Valve Design Kleen-Aire? Filtration System Ultra Quiet Muffler Electronic Ignition Premium Mechanical Governor Easy Pull Recoil Quick Start Primer In-Tank Fuel Screen Large 3 Qt. Plus Fuel Tank Cast Iron Sleeve * Muffler Guard * Ball Bearing PTO * Low Oil Sensor * Emission Certified *on selected models D:082603:50 All items subject to availability. Pricing subject to change without notice.

RIGHT COLUMN: Help Desk Do you need help? Submit an Inquiry PartSearch Part Addition Request Shopping Cart more... 0 items Manufacturer Info Tecumseh - Tecumseh Homepage - Other products Tell A Friend Tell someone you know about this product. enter friend's email click to continue Bestsellers .: 6 hp Tecumseh OHH60 Power Sport OHV New Products more... Spring, extension Spring, extension $1.56 We gladly accept VISA - MasterCard accepted Check/Money Order

and the same product page

AFTER

MAIN BODY: Previous Item Product 1 of 4 Next Item Back to Product List 6 hp Tecumseh OHH60 Power Sport OHV Representative image Actual model may differ 6 hp Tecumseh OHH60 Power Sport OHV $256.19 $239.00 item #: TE_206122A Quantity: Shipping weight: 38.00 lbs. To see shipping estimates, just 'Add To Cart' This item normally ships within 48 hours If delayed, we will email you for instructions Tecumseh 6 hp OHH60-71119F Enduro OHV PowerSport engine Tecumseh item # 206122 or 206122A replaces 206106 Application: Go carts and mini-bikes MSRP:$272.95 Crankshaft: 3/4" diameter x 2-3/8" long, tapped 5/16-24; cast iron cylinder sleeve; recoil starter; progressive port carburetor; muffler guard; RV control OHH60 Model Series Features Overhead Valve Design Kleen-Aire? Filtration System Ultra Quiet Muffler Electronic Ignition Premium Mechanical Governor Easy Pull Recoil Quick Start Primer In-Tank Fuel Screen Large 3 Qt. Plus Fuel Tank Cast Iron Sleeve * Muffler Guard * Ball Bearing PTO * Low Oil Sensor * Emission Certified *on selected models D:082603:50 All items subject to availability. Pricing subject to change without notice.

LEFT COLUMN: QuikSearch Enter keywords, part or model numbers Advanced Search Product Lines Power Equipment Accessories/Other Small Engines Horizontal Shaft Vertical Shaft Go Cart Snow Engines Water Cooled Short Blocks Service Manuals/Books Parts Maintenance Kits Manufacturers Please Select Agri-Fab Ariens AYP (Sears) BearCat Billy Goat Bolens Briggs & Stratton Briggs Power Product Country Home Product Dixon Echo Exmark Gates Belts Generac Homelite Honda Husqvarna Hydro-Gear Kawasaki Kohler Kwik products Lawn-Boy Little Wonder Mantis McCulloch McLane MTD Murray Noram Oregon Bars/Chain Oregon Parts (OEP) Other Manufacturers Parker Sweepers Poulan/Weedeater RedMax Robin Subaru Rotary Ryobi Scag Snapper Stanley Stens Sutech (Stealth) Tecumseh Toro Troy-Bilt Walbro Wedco Zama Information Manufacturer InfoPages Shipping & Returns Privacy Notice Conditions of Use Contact Us Latest News : New Products Added! : Husqvarna Recall : Ariens, Exmark added! : Snow Engines in stock News Categories Login Here Welcome, Guest! E-Mail address: Password: Forgot your password? First Time Here? Create new account

RIGHT COLUMN: Help Desk Do you need help? Submit an Inquiry PartSearch Part Addition Request Shopping Cart more... 0 items Manufacturer Info Tecumseh - Tecumseh Homepage - Other products Tell A Friend Tell someone you know about this product. enter friend's email click to continue Bestsellers .: 6 hp Tecumseh OHH60 Power Sport OHV New Products more... Short block, Kohler CV15-CV16 Short block, Kohler CV15-CV16 $539.92 We gladly accept VISA - MasterCard accepted Check/Money Order

As you can see, the main content appears much earlier in what the search engine sees.

 

There are other pages to which one might want to apply this change:

 

!!!BACKUP FIRST!!!

 

index.php (be careful if you do this one, as there are 3 separate segments that call the middle cell that will need to be changed to rowspan="2". In the unmodified index.php, they are at rows 62, 228 and 286)

featured_products.php

products_new.php

specials.php

allprods.php (if installed)

... and possibly others


... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Share this post


Link to post
Share on other sites

There is a missing "=" in the instructions above - Step 1 CHANGE TO should read

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
  <td height="0" width="<?php echo BOX_WIDTH; ?>" valign="top"></td>
<!-- body_text //-->
  <td rowspan="2" width="100%" valign="top">

Thanks to Mark for the heads up!


... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Share this post


Link to post
Share on other sites

yep!


... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Share this post


Link to post
Share on other sites

I changed a two of my files. product_info.php and index.php. I changed product_info.php first and it worked fine. But, after I changed index.php, it gave me an error message,

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/home/yangyan9/public_html/Products/index.php on line 39

 

The line is:

 

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

 

Now, my index.php pages doesn't load up. Any clues?

 

Thanks,

 

Larry

Share this post


Link to post
Share on other sites

Matter of opinion, I suppose...

 

Personally, since a spider will pick up all of my pages, I'd much rather have the first stuff to appear be the specifics relating to each individual item in my catalog rather than all of the stuff that appears in column_left. There are plenty of other pages in the catalog that haven't been changed as noted above in the tip which will provide adequate opportunity for the left column stuff to appear first.


... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Share this post


Link to post
Share on other sites
Surely it is better for the left to be spidered first so that the keywords on those links will be given a higher ranking?

If a page is set up correctly for the SE's, the center column should be the one loaded with your keyword. And since the SE's give extra credit for items cloer to the top of the page, putting the center column before the left column makes sense. If the page isn't optimized properly, then it is better to leave it as is for the reason you mention.

 

Jack

Share this post


Link to post
Share on other sites
If a page is set up correctly for the SE's, the center column should be the one loaded with your keyword.  And since the SE's give extra credit for items cloer to the top of the page, putting the center column before the left column makes sense.  If the page isn't optimized properly, then it is better to leave it as is for the reason you mention.

 

Jack

 

Those links on the left (names of categories) carry the most weight. Therefore, leave things as they are IMHO as they are counted as relevant links, and are high up the page (so rank well).

Share this post


Link to post
Share on other sites

If a page is optimized correctly, they would actually hurt you. Although it is so small a hurt it is not worth talking about but, technically speaking, you optimize a page for one or two keywords. Not all of the ones listed in categories.

 

Jack

Share this post


Link to post
Share on other sites

This works great.

 

Just one problem though......

I have the search box in my header.

This makes the spiders find 'Advanced Search', before the main text.

Can anybody instruct me on how to change this please?

 

Thanks,

Steve

Share this post


Link to post
Share on other sites

I've modified my products_info.php file which works great, but I'm having trouble getting it into my index file. The tables displayed are all over the place. Can someone tell me where I'm being stupid??? :blink:

 

Here's the code:-

 

<?php
/*
 $Id: product_info.php,v 1.97 2003/07/01 14:34:54 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');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$cat_title_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION  . " where categories_id = '" . (int)$cat_id['categories_id'] . "'");
$cat_title = tep_db_fetch_array($cat_title_query);
 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php include ('includes/ssl_provider.js.php'); ?>
<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,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- coolMenu //-->
<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>
<!-- coolMenu_eof //-->
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
  <td height="0" width="125" valign="top"></td>
<!-- body_text //-->
  <td rowspan="2" width="100%" valign="top">
<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($product_check['total'] < 1) {
?>
     <tr>
       <td colspan="3"><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
       </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td colspan="3"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
   $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_pop, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
   }
?>
     <tr>
       <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="0">
           <tr>
             <td align="center" valign="top" class="pageHeading"><?php echo $products_name; ?></td>
             </tr>
       </table></td>
       </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td width="15" class="main"> </td>
       <td class="main">
<?php
   if (tep_not_null($product_info['products_image'])) {
?>
         
<table align="right" border="1" cellspacing="3" cellpadding="3">
 <tr>
   <td align="center" bordercolor="#FFCC33" class="smallText"><script language="javascript"><!--
document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript></td>
 </tr>
 <tr>
   <td align="center" bordercolor="#FFCC33" class="main"><?php echo $products_price; ?><br><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
 </tr>
</table>

<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
        if (tep_session_is_registered('customer_id'))
         {
          	 $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->format(tep_add_tax($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) * 1 ).') ';
         }
      	 else
         {
          	 $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->format(tep_add_tax($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) * 1 ).' inc VAT) (' . $products_options['price_prefix'] . $currencies->format($products_options['options_values_price'] * 1 ).' ex VAT) ';
           }
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
<?php
   }
?>
       </td>
       <td width="10" class="main"> </td>
     </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
  <tr>
    <td colspan="3">
         <?php require(DIR_WS_MODULES . FILENAME_ADDITIONAL_IMAGES); ?>        </td>
       </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td colspan="3" class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
       </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
<?php
   }

   if (tep_not_null($product_info['products_url'])) {
?>
     <tr>
       <td colspan="3" class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
       </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
<?php
   }
?>
     <tr>
       <td colspan="3" align="center" class="smallText"></td>
       </tr>
<?php
   }
?>
     <tr>
       <td colspan="3" align="center"></td>
       </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td colspan="3"><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
                               <td><a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS); ?></a></td>
               <?php
    	 $back = sizeof($navigation->path)-2;
     if (isset($navigation->path[$back])) {
  	 ?>
   <td width="34%" align="center"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<?php } else {?>
               <td width="34%" align="center"><a href="javascript:history.go(-1)"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td>
  	 <?php
  	 }
  	 ?>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_blank">' . tep_image('images/pdf.gif') .'</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td colspan="3">        
 <?php
//// Begin Reviews on Product Information page hack

if (MAX_REVIEWS_IN_PRODUCT_INFO > 0) {
?>
       <?php
 $reviews_query = tep_db_query("select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and rd.reviews_id = r.reviews_id and rd.languages_id = '" . $languages_id . "' order by r.reviews_id DESC");
 $num_rows = tep_db_num_rows($reviews_query);

 if ($num_rows > 0) {
   $row = 0;
   while (($reviews_values = tep_db_fetch_array($reviews_query)) && ($row < MAX_REVIEWS_IN_PRODUCT_INFO)) {
     $row++;
     $date_added = tep_date_short($reviews_values['date_added']);
?>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td colspan="3" valign="top" class="main"><?php echo sprintf(tep_image(DIR_WS_IMAGES . 'stars_' . $reviews_values['reviews_rating'] . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $reviews_values['reviews_rating']))) . ' – <i>' . $reviews_values['customers_name'] . ', ' . $date_added . '</i><br>' . htmlspecialchars($reviews_values['reviews_text']) ?></td>
       </tr>
<?php
   }
?>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td colspan="3" class="smallText"><?php echo sprintf(TEXT_DISPLAY_NUMBER_OF_REVIEWS, '1', $row, $num_rows); ?></td>
       </tr>
<?php
   if ($num_rows > MAX_REVIEWS_IN_PRODUCT_INFO) {
?>
     <tr>
       <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
       </tr>
     <tr>
       <td colspan="3"><a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo tep_image_button('button_more_reviews.gif', IMAGE_BUTTON_MORE_REVIEWS); ?></a></td>
       </tr>
<?php
   }
 } else {
?>
   <tr>
     <td colspan="3"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
   <tr>
     <td colspan="3" class="smallText"><?php echo TEXT_NO_REVIEWS; ?></td>
     </tr>
   <tr>
     <td colspan="3" class="smallText"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 }
} else {
?>
<?php
}

//// End Reviews on Product Information page hack
?>
   
      <tr>
        <td colspan="3">

          <?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 ?>        </td> 
       </tr>
   </table>
   </form></td>
<!-- body_text_eof //-->
  <td height="0" width="125" valign="top"></td>
</tr>
<tr>
  <td width="125" valign="top" background="images/columnbkg.gif"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
  </table></td>
  <td width="125" valign="top" background="images/columnbkg.gif"><table border="0" width="125" cellspacing="0" cellpadding="0">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
  </table></td>
</tr>
</table>
<!-- body_eof //-->

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

 

Any help would be much appreciated thanks :thumbsup:

Share this post


Link to post
Share on other sites

Take a look at the link I gave you in the other thread regarding this. It has a complete edited file I posted. You should be able to match yours to it without too much difficulty.

 

Jack

Share this post


Link to post
Share on other sites
Those links on the left (names of categories) carry the most weight. Therefore, leave things as they are IMHO as they are counted as relevant links, and are high up the page (so rank well).

 

assuming you have your categories in the left column.


Treasurer MFC

Share this post


Link to post
Share on other sites

Yeah I tried that Jack, the above code is my attempt at merging that index code with mine, looks like I didn't manage to match it with mine without too much difficulty :blush: lol

Take a look at the link I gave you in the other thread regarding this. It has a complete edited file I posted. You should be able to match yours to it without too much difficulty.

 

Jack

Share this post


Link to post
Share on other sites

 

the first change is just after the body :

 

<?php

require(DIR_WS_INCLUDES . 'header.php');

echo '<table border="0" width="100%" cellspacing= "' . MAJOR_PADDING . '" cellpadding= "' . MAJOR_PADDING . '">';

?>

// from here

<tr>

<td width="<?php echo BOX_WIDTH; ?>"></td>

// to here

<?php

if ($category_depth == 'nested') {

// and the rowspan below

?>

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

 

 

the next change is a little lower (rowspan):

 

 

case 'PRODUCT_LIST_PRICE':

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

break;

}

}

// START

?>

<td rowspan="2" 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 '<H1>' . $parent_name . $sep . $category[categories_name] . '</H1>'; ?></td>

 

 

 

then the next one is for the default page at (rowspan):

 

<?php

} else { // default page

?>

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

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

<tr>

<td>

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

 

 

and then at the bottom just after the final </td> which closes the center column:

 

<?php

}

echo '<td></td>'; // empty right column

echo '</tr>'; // close the first row

echo '<tr>'; // new row

echo '<td valign="top">

<table border="0" width="' . BOX_WIDTH . 'px" cellspacing="0" cellpadding="0">';

require(DIR_WS_INCLUDES . 'column_left.php');

echo '</table>

</td>'; // right column filled

 

if (SHOW_RIGHT_COLUMN) { // show or hide right column

echo '<td width="' . BOX_WIDTH . 'px" valign="top">

<table border="0" width="' . BOX_WIDTH . 'px" cellspacing="0" cellpadding="0">';

require(DIR_WS_INCLUDES . 'column_right.php');

echo '</table></td>';

}

 

echo '</tr></table>';


Treasurer MFC

Share this post


Link to post
Share on other sites

Cheers Boxtel :thumbsup:

 

Changed my code to the following and it's as sweet as a nut, thanks

 

All I gotta do now is try to get the cool menu code to appear below my center content, rather than before it as it is now. and theres lots of it :(

 

<?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>
<script LANGUAGE="JavaScript1.2" SRC="includes/menu_animation.js"></SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 
<?php
// RJW Begin Meta Tags Code
if (file_exists(DIR_WS_INCLUDES . 'meta_tags.php')) {
 require(DIR_WS_INCLUDES . 'meta_tags.php');
} else {
?> 
 <title><?php echo TITLE ?></title>
<?php
}
// RJW End Meta Tags Code
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php include ('includes/ssl_provider.js.php'); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- coolMenu //-->
<?php require(DIR_WS_INCLUDES . 'coolmenu.php'); ?>
<!-- coolMenu_eof //-->
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
    <td width="125" height="0" valign="top" background="images/columnbkg.gif"></td>
<?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 rowspan="2" 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><h1><?php echo $category['categories_name']; ?></h1></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>
<?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" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n";
     if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
       echo '              </tr>' . "\n";
       echo '              <tr>' . "\n";
     }
   }

// needed for the new products module shown below
   $new_products_category_id = $current_category_id;
?>
             </tr>
           </table></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr class="infoBoxContents">
           <?php
    	 $back = sizeof($navigation->path)-2;
     if (isset($navigation->path[$back])) {
  	 ?>
   <td align="center" class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<?php } else {?>
               <td align="center" class="main"><a href="javascript:history.go(-1)"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td>
  	 <?php
  	 }
  	 ?>
         </tr>
   <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
         </tr>
       </table></td>
     </tr>
   </table></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_INFO' => PRODUCT_LIST_INFO,
                        '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_INFO':
  $select_column_list .= 'pd.products_info, ';
         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, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id 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, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id 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, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.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 . "'";
    } 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id 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 p.products_price";
         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_INFO':
         $listing_sql .= "pd.products_info ". ($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;
     }
   }
$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " 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 rowspan="2" 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><h1><?php echo $category['categories_name']; ?></h1></td>
<?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'];
   }
?>
           <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>
<?php
 } else { // default page
$category_query = tep_db_query("select c.category_head_title_tag 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  rowspan="2" 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><h1><?php echo $category['category_head_title_tag']; ?></h1></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', 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><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="main"><?php echo tep_customer_greeting(); ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE); ?></td>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
           <td><?php include(DIR_WS_MODULES . FILENAME_MAIN_CATEGORIES);?></td>
	 <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);?></td>
         </tr> 
<?php
 /*  include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); */
?>
       </table></td>
     </tr>
   </table></td>
<?php
 }
?>
<!-- body_text_eof //-->
<td width="125" height="0" valign="top" background="images/columnbkg.gif"></td>
</tr>
<tr>
 <td width="125" valign="top" background="images/columnbkg.gif"><table border="0" width="125" cellspacing="0" cellpadding="0">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
 </table></td>
 <td width="125" valign="top" background="images/columnbkg.gif"><table border="0" width="125" cellspacing="0" cellpadding="0">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
 </table></td>
</tr>
</table>
<!-- body_eof //-->

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

 

the first change is just after the body :

 

Share this post


Link to post
Share on other sites

dont know if its of any use, and I cant remember the exact methodology i used, but if you call the coolmenu code in your footer (leave menu_animation in the header) and set up a div in you r stylesheet.css, you can move all the menu and category bumpf down the page - i did this and the search engines really took notice. I heard they ignore content after x amount of charachters, and with all my categories, I had over 5000 characters of coolmenu code, so my site was pretty much ignored. The second I moved the code to the footer, bingo! Anyway, sorry I couldn't post specifics, but hope that helps.


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites

Hello! I had a number of people contact me for the code for my coolmenu tip above. Whilst I have replied to all of them, this is obviously something which may help others, so heres a copy of what I sent them:

 

 

Rather than send you the whole thing 'cos my code is hacked to pieces and probably wont make sense at all unless you have a couple of spare hours to try and put it back in order, but this is how I've done it:

 

in stylesheet.css, add this before the footer:

#menu {position:absolute; width:700px; height: 20px; z-index:500; left:50%; top: 104px; margin-left: -398px;}

 

Bear in mind that the settings in the code above are for my centred store.

 

The at the end of your includes/footer.php file, jsut before the appliaction_bottom part of the code, insert the following:

<div id="menu"><!-- coolMenu //-->

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

<!-- coolMenu_eof //--></div>

 

 

Now remove the code from your header.php which refers to coolmenu - leave in the part about menu_animation. Your menu will now show in the correct place, but the code comes out at the bottom of your html file. Search Engines happy, humans happy!

 

I'm pretty sure thats all thats needed, but if this doesnt work just post back on the forums. I will copy this to the forums so anybody else can find the methodology too - and maybe make it better or fix it if I'm wrong. I did this over 18 months ago, so its quite possible I have forgotten something.

 

Good luck!

 

If somebody could let me know if this works, I'll update the contrib so it works like this for everyone - unless somebody else out there has a good reason why I shouldn't use this method......?


Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Share this post


Link to post
Share on other sites

Hi people,

 

i have done something like that in my own shop. But i completly kicked the table layout out of my template (I use BTS) and did it with divs and the css float option to bring the content before the navigation. Here is my Site, if you want you can look at the code... (:

 

http://www.hapo.de (note: The site is not ready for English usage, although the language option is activated. So if you encounter any errors dont think too much about it. Other language than german are still experimental in this store...)

Share this post


Link to post
Share on other sites

×