snubbr.com

Should I get a Verisign SSL for a personal website(from comodo)?

Get a Verisign SSL certificate for 30 days FREE. Click here to use coupon...

Get a free trial of Verisign SSL certificates. Click here for this special deal...
Got a question, hope someone can answer... Should I get a Verisign SSL for a personal website(from comodo)? Thanks for any answer or 2. My other question... Hello all. First let me begin by saying that this is my first time posting here, and I don't know if I'm posting in the right location. Anyhow my problem began right after the version of mySQL changed from 4 to 5.



My Website.

And then finding an item to click on (one of the fish for example) it gives me this big long error. I have spent a few hours reading posts on here on how to fix it, but to be honest, I tried doing a few of the changes, but there is just so much custom coding in there that I can't seem to fix it. Thanks..

J.

This post has been edited by.

Jan Zonjee.

: 23 November 2008, 22:41..

Comments (35)

I'm stumped. I'm not so sure what is the answer. I'll do some poking around and get back to you if I got an useful answer. You should email the people at Verisign as they probably could give you an answer..

Comment #1

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

// Begin - seo tags - meta_tags.php.

$content = CONTENT_PRODUCT_INFO;.

// End - seo tags - meta_tags.php.

Require(DIR_WS_LANGUAGES$language'/'FILENAME_PRODUCT_INFO);.

// jr - begin - product additional fields - include fields if it exists.

If (file_exists(DIR_WS_ADDITIONAL_FIELDS'_product_add_fields_variables_always.php')) {.

Include(DIR_WS_ADDITIONAL_FIELDS'_product_add_fields_variables_always.php'); }.

Else { $select_product_add_fields = " from "; }.

// jr - end - product additional fields - include fields if it exists.

$pid = $HTTP_GET_VARS['products_id'];.

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

?>.

<?php echo HTML_DOC_TYPE; ?>.

<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">.

<script language="javascript" src="includes/javascript/popupimage.js"></script>.

<script language="javascript" src="includes/javascript/popupimagewatermark.js"></script>.

<script language="javascript" src="includes/javascript/formfieldprogressbar.js"></script>.

<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').

}.

Function rowOverEffect(object) {.

If (object.className == 'moduleRow') object.className = 'moduleRowOver';.

}.

Function rowOutEffect(object) {.

If (object.className == 'moduleRowOver') object.className = 'moduleRow';.

}.

Function quantity_ordered(qty) {.

Document.cart_quantity_form.elements['cart_quantity'].value = qty;.

}.

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

<?php.

// iii 030813 added: File upload: 'enctype="multipart/form-data"'.

// explicitly state post so that the parameters sections can be set.

// It might be better to make this dependent on the presence of file fields.

// in the future..

?>.

<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity_form', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action'))'action=add_product'), 'POST', 'enctype="multipart/form-data"'); ?>.

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

<tr>.

<td><?php echo $messageStack->output('upload'); ?></td>.

</tr>.

<?php.

//echo '<b>env: <br>'print_r($_ENV);.

//echo '<b>pid: '$pid;.

// echo '<br>In Here: '$HTTP_GET_VARS['products_id'];.

If ($product_check['total'] < 1) {.

// echo '<br>In Here2: '$HTTP_GET_VARS['products_id'];.

?>.

<tr>.

<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>.

</tr>.

<tr>.

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>.

</tr>.

<tr>.

<td><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 {.

// jr - begin - product additional fields.

$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, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, "$select_product_add_fieldsTABLE_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 p.products_id = paf.products_id and pd.language_id = '"(int)$languages_id"'");.

// jr - end - product additional fields.

$product_info = tep_db_fetch_array($product_info_query);.

$prod_type = $product_info['prod_type'];.

//echo '<br>HTTP_GET_VARS: '$HTTP_GET_VARS['products_id'];.

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

// BOF Separate Price per Customer.

$lowest_price = get_lowest_price($product_info['products_id'], $product_info['products_price']);.

// $product_info['products_price'] = $lowest_price;.

// EOF Separate Pricing Per Customer.

If (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($lowest_price, tep_get_tax_rate($product_info['products_tax_class_id']))'</span>';.

// EOF Separate Price per Customer.

$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($lowest_price, tep_get_tax_rate($product_info['products_tax_class_id']))'</span>';.

}.

Else {.

$products_price = $currencies->display_price($lowest_price, tep_get_tax_rate($product_info['products_tax_class_id']));.

}.

$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id, $select_product_add_fields);.

// jr - add check for prod_type to existing if statement.

// if (tep_not_null($product_info['products_model']) && $product_info['prod_type'] == 'Product') {.

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><table border="0" width="100%" cellspacing="0" cellpadding="0">.

<tr>.

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>.

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>.

</tr>.

</table></td>.

</tr>.

<tr>.

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>.

</tr>.

<tr>.

<td class="main">.

<?.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True") {.

Echo '<table cellspacing="1" cellpadding="5" class="infoBox" width="100%">';.

// echo '<tr class="InfoBoxPageContent">';.

Echo '<tr class="infoBoxContentsLarge">';.

Echo '<td class="main">';.

}.

// jr - eof - display the product description in InfoBox format (helps when page has background pic).

?>.

<table border="0" cellspacing="0" cellpadding="2" align="right">.

<tr>.

<td align="center" class="smallText">.

<?php.

// jr - begin - if prod_type = product allow "click to enlarge" image.

// $prod_query = tep_db_query("select prod_type from "TABLE_PRODUCTS" where products_id = '"(int)$product_info['products_id']"'");.

// jr - begin - product additional fields.

$prod_query = tep_db_query("select prod_type from "TABLE_PRODUCTS_ADD_FIELDS" where products_id = '"(int)$product_info['products_id']"'");.

$query = tep_db_fetch_array($prod_query);.

// jr - begin - product additional fields .

// if ($query['prod_type'] == 'Product') { // dont enlarge image when not a product.

If (1 == 1) { // jr - always allow "click to enlarge otherwise uncomment above line and comment this instead.

//jr - begin - orig code.

// begin - quantity discount display.

If ($product_info['products_price1_qty'] > 0) {.

Echo '<table border="0" align="center" >';.

// echo '<tr><td align="center" class="pageHeading">'TEXT_QUANTITY_DISCOUNT'</td>';.

Echo '</td></tr></table>';.

Echo '<table border="1" cellpadding="1" cellspacing="0" align="center">';.

// echo '<tr class="infoBoxContentsLarge">';.

Echo '<tr class="QuantityDiscountBox">';.

Echo '<td class="tableHeading" align="center">&nbsp;&nbsp;<b>'TEXT_QUANTITY_DISCOUNT_QUANTITY'</b>&nbsp;&nbsp;</td>';.

Echo '<td class="tableHeading" align="center">&nbsp;&nbsp;<b>'TEXT_QUANTITY_DISCOUNT_PRICE'</b>&nbsp;&nbsp;</td>';.

Echo '</tr>';.

For ($i=1; $i<=6; $i++) {.

If ($product_info['products_price'$i'_qty'] > 0) {.

$qty = $product_info['products_price'$i'_qty'];.

$on_click = 'onclick="java script:quantity_ordered('$qty')"';.

// echo '<tr class="moduleRowOver" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)"'$on_click'>';.

Echo '<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)"'$on_click'>';.

Echo '<td class="main" align="center">'$product_info['products_price'$i'_qty']'</td>';.

Echo '<td class="main" align="center">'number_format($product_info['products_price'$i],2)'</td>';.

Echo '</tr>';.

}.

}.

Echo '</table>';.

// if ($product_info['products_qty_blocks'] == '1' && $product_info['products_price1_qty'] > 1) {.

If ($product_info['products_qty_blocks'] == '1') {.

Echo TEXT_QUANTITY_BLOCKS'<br>';.

}.

// echo '<a href="'tep_href_link(FILENAME_CONTACT_OWNER, tep_get_all_get_params())'">''<u><font color="'PAGE_HIGHLIGHT_TEXT_COLOR'">'TEXT_QUANTITY_INQUIRY'</u></font></a>';.

Echo '<a class="orderEdit" href="'tep_href_link(FILENAME_CONTACT_OWNER, tep_get_all_get_params())'">''<b>'TEXT_QUANTITY_INQUIRY'</b></a>';.

// echo TEXT_QUANTITY_INQUIRY;.

Echo '<br><br><br>';.

}.

// end - quantity discount display.

$products_name = $product_info['products_name'];.

$tmp_html = '';.

// if (1 == 2).

// if ($products_image_name == 'no_photo.gif').

// $tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" ')'<br>';.

$products_image_name = $product_info['products_image'];.

$products_image_name2 = $product_info['products_image2'];.

$products_image_name3 = $product_info['products_image3'];.

$products_image_name4 = $product_info['products_image4'];.

// display the products image(s).

If (($products_image_name != 'no_photo.gif') &&.

($products_image_name ||.

$products_image_name2 ||.

$products_image_name3 ||.

$products_image_name4 )).

{.

// jr - bof watermark image .

$watermark_image = 0;.

If (WATERMARK_IMAGE == 'true') {.

If (file_exists(DIR_FS_STORE_OWNER_AREA'images/watermark.png')).

$watermark_image = 1;.

$watermark_param = '&watermark='DIR_FS_STORE_OWNER_AREA'images/watermark.png&transparency='WATERMARK_TRANPARENCY;.

}.

// jr - eof watermark image .

// build html string.

If ($products_image_name) {.

// jr - bof watermark image .

If ($watermark_image).

$on_click = 'onclick="java script:popupImageWatermark('"'/watermark_image.php?main="DIR_FS_CATALOGDIR_WS_PRODUCT_IMAGES$products_image_name$watermark_param"','"$products_name"')"'"';.

Else.

$on_click = 'onclick="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name"','"$products_name"')"'"';.

// jr - eof watermark image.

$on_mouseover = 'onMouseOver="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name"','"$products_name"')"'"';.

$on_mouseout = 'onMouseOut="java script:imgWin.window.close()"';.

If (PRODUCT_IMAGE_ROLLOVER_DISPLAY == "True").

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click.$on_mouseover.$on_mouseout)'<br>';.

Else {.

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '. $on_click)'<br>';.

}.

}.

If ($products_image_name2) {.

// jr - bof watermark image.

If ($watermark_image).

$on_click = 'onclick="java script:popupImageWatermark('"'/watermark_image.php?main="DIR_FS_CATALOGDIR_WS_PRODUCT_IMAGES$products_image_name2$watermark_param"','"$products_name"')"'"';.

Else .

$on_click = 'onclick="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name2"','"$products_name"')"'"';.

// jr - eof watermark image.

$on_mouseover = 'onMouseOver="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name2"','"$products_name"')"'"';.

$on_mouseout = 'onMouseOut="java script:imgWin.window.close()"';.

If (PRODUCT_IMAGE_ROLLOVER_DISPLAY == "True").

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name2, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click.$on_mouseover.$on_mouseout)'<br>';.

Else.

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name2, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click)'<br>';.

}.

If ($products_image_name3) {.

// jr - bof watermark image.

If ($watermark_image).

$on_click = 'onclick="java script:popupImageWatermark('"'/watermark_image.php?main="DIR_FS_CATALOGDIR_WS_PRODUCT_IMAGES$products_image_name3$watermark_param"','"$products_name"')"'"';.

Else .

$on_click = 'onclick="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name3"','"$products_name"')"'"';.

// jr - eof watermark image.

$on_mouseover = 'onMouseOver="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name3"','"$products_name"')"'"';.

$on_mouseout = 'onMouseOut="java script:imgWin.window.close()"';.

If (PRODUCT_IMAGE_ROLLOVER_DISPLAY == "True").

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name3, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click.$on_mouseover.$on_mouseout)'<br>';.

Else.

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name3, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click)'<br>';.

}.

If ($products_image_name4) {.

// jr - bof watermark image.

If ($watermark_image).

$on_click = 'onclick="java script:popupImageWatermark('"'/watermark_image.php?main="DIR_FS_CATALOGDIR_WS_PRODUCT_IMAGES$products_image_name4$watermark_param"','"$products_name"')"'"';.

Else .

$on_click = 'onclick="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name4"','"$products_name"')"'" ';.

// jr - eof watermark image.

$on_mouseover = 'onMouseOver="java script:popupImage('"'/"DIR_WS_PRODUCT_IMAGES$products_image_name4"','"$products_name"')"'" ';.

$on_mouseout = 'onMouseOut="java script:imgWin.window.close()"';.

If (PRODUCT_IMAGE_ROLLOVER_DISPLAY == "True").

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name4, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click.$on_mouseover.$on_mouseout)'<br>';.

Else.

$tmp_html .= tep_image(DIR_WS_PRODUCT_IMAGES$products_image_name4, $products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ' hspace="5" vspace="3" class="imageborder" '$on_click)'<br>';.

}.

If ($products_image_name != 'no_photo.gif').

$tmp_html .= TEXT_CLICK_TO_ENLARGE;.

}.

Echo $tmp_html;.

// jr - end - if prod_type != product do not display or allow "click to enlarge" image.

?>.

</td>.

</tr>.

</table>.

<?php.

}.

?>.

<?php.

// jr start - convert /nl, backslashes in description to appropriate chars to display correctly.

// check if the string contains HTML or regular text.

// string contains HTML chars.

If ((stristr($product_info['products_description'], '</table>')) ||.

(stristr($product_info['products_description'], '</tr>')) ||.

(stristr($product_info['products_description'], '</p>')) ||.

(stristr($product_info['products_description'], '<br>'))) {.

$product_info['products_description'] = $product_info['products_description'];.

}.

// string does not contain HTML chars.

Else {.

$product_info['products_description'] = nl2br(stripslashes($product_info['products_description']));.

}.

// jr end - convert /nl and backslashes to appropriate chars to display correctly.

?>.

<p><?php echo stripslashes($product_info['products_description']); ?></p>.

<?php.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

Echo '<table cellspacing="0" cellpadding="5" class="infoBox" width="0%">';.

// iii 030813 added: initialize $number_of_uploads.

$number_of_uploads = 0;.

$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) {.

?>.

<? //jr - added width ?>.

<table border="0" cellspacing="0" cellpadding="2" width="100%" align="left">.

<tr>.

<? // jr - do not display product options heading ?>.

<td class="main" colspan="1"><?php // echo TEXT_PRODUCT_OPTIONS; ?></td>.

</tr>.

<?php.

// option_type_feature_v1.7.zip begin to end of program.

//clr 030714 update query to pull option_type.

// jr -stort by atribute sort value.

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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"' group by patrib.attribute_sort order by patrib.attribute_sort");.

While ($products_options_name = tep_db_fetch_array($products_options_name_query)) {.

// jr - translate char which cause errors in url. Need after contrib 'optionsTypeFeatures CLR'.

$cart_key = $HTTP_GET_VARS['products_id'];.

// echo '<br>cartKey1='$cart_key;.

// $cart_key = href_unsafe($HTTP_GET_VARS['products_id']);.

// $cart_key = $HTTP_GET_VARS['products_id'];.

// echo '<br>cartKey1='$cart_key;.

// $cart_key = href_unsafe($HTTP_GET_VARS['products_id']);.

// echo '<br>cartKey2='$cart_key;.

//clr 030714 add case statement to check option type.

Switch ($products_options_name['products_options_type']) {.

Case PRODUCTS_OPTIONS_TYPE_TEXT:.

//CLR 030714 Add logic for text option.

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from "TABLE_PRODUCTS_ATTRIBUTES" patrib where patrib.products_id='"(int)$HTTP_GET_VARS['products_id']"' and patrib.options_id = '"$products_options_name['products_options_id']"'");.

$products_attribs_array = tep_db_fetch_array($products_attribs_query);.

$products = $cart->get_products();.

For ($i=0, $n=sizeof($products); $i<$n; $i++) {.

// Push all attributes information in an array.

If (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {.

While (list($option, $value) = each($products[$i]['attributes'])) {.

}}}.

$tmp_html = '<input type="text" name ="id['TEXT_PREFIX$products_options_name['products_options_id']']" size="'$products_options_name['products_options_length'] .'" maxlength="'$products_options_name['products_options_length']'" value="'$cart->contents[$cart_key]['attributes_values'][$products_options_name['products_options_id']] .'"> ';.

$tmp_html .= '<i> '$products_options_name['products_options_comment']'</i>';.

If ($products_attribs_array['options_values_price'] != 0) {.

$tmp_html .= '<i> ('$products_attribs_array['price_prefix']$currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')</i>';.

}.

?>.

<tr>.

<td class="mainColorBold" width="1%"><?php echo $products_options_name['products_options_name']':'; ?></td>.

<td class="main"><?php echo $tmp_html; ?></td>.

</tr>.

<?php.

Break;.

Case PRODUCTS_OPTIONS_TYPE_TEXTAREA:.

//CLR 030714 Add logic for text option.

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from "TABLE_PRODUCTS_ATTRIBUTES" patrib where patrib.products_id='"(int)$HTTP_GET_VARS['products_id']"' and patrib.options_id = '"$products_options_name['products_options_id']"'");.

$products_attribs_array = tep_db_fetch_array($products_attribs_query);.

// jr - begin preload field if data previously entered.

If ($cart->contents[$cart_key]['attributes_values'][$products_options_name['products_options_id']]) {.

$s = $cart->contents[$cart_key]['attributes_values'][$products_options_name['products_options_id']]; }.

Else {.

$s = ''; }.

// jr - end preload field if data previously entered.

// jr - calc text area row height.

$rows = round($products_options_name['products_options_length'] / 75);.

If ($rows > 25) {.

$rows = 25; }.

$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar'$products_options_name['products_options_id']'\','$products_options_name['products_options_length']')".

OnKeyUp="textCounter(this,\'progressbar'$products_options_name['products_options_id']'\','$products_options_name['products_options_length']')".

OnFocus="textCounter(this,\'progressbar'$products_options_name['products_options_id']'\','$products_options_name['products_options_length']')".

Wrap="soft".

Name="id['TEXT_PREFIX$products_options_name['products_options_id']']".

Rows=" '$rows'".

Id="id['TEXT_PREFIX$products_options_name['products_options_id']']".

>'$s'</textarea>.

<div id="progressbar'$products_options_name['products_options_id']'" class="progress"></div>.

<script>textCounter(document.getElementById("id['TEXT_PREFIX$products_options_name['products_options_id']']"),"progressbar'$products_options_name['products_options_id']'",'$products_options_name['products_options_length']')</script>'; .

// <! DDB - 041031 - Form Field Progress Bar //>.

$tmp_html2 = '';.

If ($products_options_name['products_options_comment']) {.

$tmp_html2 .= '<i>'$products_options_name['products_options_comment']'</i> '; }.

If ($products_attribs_array['options_values_price'] != 0) {.

$tmp_html2 .= '<i>('$products_attribs_array['price_prefix']$currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id']))')</i>'; }.

If ($tmp_html2) {.

$tmp_html2 .= '<br><br>'; }.

?>.

<tr>.

<td class="mainColorBold" valign="center" width="1%">.

<?php echo $products_options_name['products_options_name']':'; ?>.

</td>.

<td class="main" width="100%"><?php echo $tmp_html$tmp_html2; ?></td>.

</tr>.

<?php.

Break;.

Case PRODUCTS_OPTIONS_TYPE_RADIO:.

//CLR 030714 Add logic for radio buttons.

// jr - add sort by attribute_sort to query.

$tmp_html = '<table>';.

$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 = '"$products_options_name['products_options_id']"' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '"$languages_id"' order by pa.attribute_sort");.

$selected = false;.

// jr - begin if previous selected, load selected.

If (isset($cart->contents[$cart_key]['attributes'][$products_options_name['products_options_id']])) {.

$selected = $cart->contents[$cart_key]['attributes'][$products_options_name['products_options_id']];.

}.

// jr - end if previous selected, load selected.

While ($products_options_array = tep_db_fetch_array($products_options_query)) {.

// jr - buttons on single line.

$tmp_html .= '<td class="main">';.

// jr -buttons on seperate lines.

// $tmp_html .= '<tr><td class="main" width="1%">';.

// jr - begin if previous selected, load selected.

If ($products_options_array['products_options_values_id'] == $selected) {.

$checked = true; }.

Else {.

$checked = false;.

}.

// jr - end if previous selected, load selected.

$tmp_html .= tep_draw_radio_field('id['$products_options_name['products_options_id']']', $products_options_array['products_options_values_id'], $checked);.

$tmp_html .= $products_options_array['products_options_values_name'];.

// $tmp_html .= ' <i>'$products_options_name['products_options_comment']'</i>';.

If ($products_options_array['options_values_price'] != 0) {.

$tmp_html .= ' <i>('$products_options_array['price_prefix']$currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')</i>';.

}.

// jr - buttons on single line.

$tmp_html .= '</td>';.

// jr -buttons on seperate lines.

// $tmp_html .= '</tr></td>';.

}.

$tmp_html .= '</table>';.

?>.

<tr>.

<? // jr - buttons on single remove <td valign"top"> or insert for seperate lines ?>.

<td class="mainColorBold" ><?php echo $products_options_name['products_options_name']':'; ?></td>.

<td class="main"><?php echo $tmp_html; ?></td>.

</tr>.

<?php.

Break;.

Case PRODUCTS_OPTIONS_TYPE_CHECKBOX:.

//CLR 030714 Add logic for checkboxes.

// jr - add sort by attribute_sort to query.

$products_attribs_query = tep_db_query("select distinct 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 = '"$products_options_name['products_options_id']"' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '"$languages_id"' order by pa.attribute_sort");.

// $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from "TABLE_PRODUCTS_ATTRIBUTES" patrib where patrib.products_id='"(int)$HTTP_GET_VARS['products_id']"' and patrib.options_id = '"$products_options_name['products_options_id']"' order by pa.attribute_sort");.

$products_attribs_array = tep_db_fetch_array($products_attribs_query);.

Echo '<tr><td class="mainColorBold" width="1%" >'$products_options_name['products_options_name']': </td><td class="main">';.

// jr - begin if previous selected, load selected.

If (isset($cart->contents[$cart_key]['attributes'][$products_options_name['products_options_id']])) {.

$checked = true; }.

Else {.

$checked = false; }.

Echo tep_draw_checkbox_field('id['$products_options_name['products_options_id']']', $products_attribs_array['options_values_id'], $checked);.

// jr - end if previous selected, load selected.

Echo ' <i>'$products_options_name['products_options_comment']'</i>';.

If ($products_attribs_array['options_values_price'] != 0) {.

Echo ' <i>('$products_attribs_array['price_prefix']$currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')</i>';.

}.

Echo '</td></tr>';.

Break;.

// iii 030813 added: support for file fields.

Case PRODUCTS_OPTIONS_TYPE_FILE:.

$number_of_uploads++;.

$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from "TABLE_PRODUCTS_ATTRIBUTES" patrib where patrib.products_id='"(int)$HTTP_GET_VARS['products_id']"' and patrib.options_id = '"$products_options_name['products_options_id']"'");.

$products_attribs_array = tep_db_fetch_array($products_attribs_query);.

$products = $cart->get_products();.

For ($i=0, $n=sizeof($products); $i<$n; $i++) {.

// Push all attributes information in an array.

If (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {.

While (list($option, $value) = each($products[$i]['attributes'])) {.

}}}.

$tmp_html = '<input type="file" name=id['TEXT_PREFIX$products_options_name['products_options_id']'] size="'$products_options_name['products_options_length']'"> ';.

$tmp_html .= tep_draw_hidden_field(UPLOAD_PREFIX$number_of_uploads, $products_options_name['products_options_id'])tep_draw_hidden_field(TEXT_PREFIXUPLOAD_PREFIX$number_of_uploads, $cart->contents[$cart_key]['attributes_values'][$products_options_name['products_options_id']]);.

// $tmp_html .= tep_draw_hidden_field(UPLOAD_PREFIX$number_of_uploads, $products_options_name['products_options_id']);.

// $tmp_html .= tep_draw_hidden_field(TEXT_PREFIXUPLOAD_PREFIX$number_of_uploads, $cart->contents[$cart_key]['attributes_values'][$products_options_name['products_options_id']]);.

$tmp_html .= '<i> '$products_options_name['products_options_comment']'&nbsp;&nbsp;(Types: 'FILE_UPLOAD_TYPES'&nbsp;&nbsp;MaxSize: 'FILE_UPLOAD_MAX_SIZE' bytes)</i>';.

If ($products_attribs_array['options_values_price'] != 0) {.

$tmp_html .= '<i> ('$products_attribs_array['price_prefix']$currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')</i>';.

}.

// jr - if previous filename inputed then display it.

$current_filename_path = $cart->contents[$cart_key]['attributes_values'][$products_options_name['products_options_id']];.

$current_filename = $current_filename_path;.

// jr - strip off the internal filename number which it is stored on disk as.

If ($current_filename) {.

$found = strpos($current_filename, ' ');.

If ($found) {.

$current_filename = substr($current_filename, $found);.

}.

// jr start - build link for uploaded filename for clivk to view link.

// jr - get filename number.

$v = $current_filename_path;.

$found = strpos($v, '.');.

If ($found) {.

$filename_num = substr($v, 0, $found);.

} .

// jr - get filename extension.

$found = strrpos($v, '.');.

If ($found) {.

$file_extension = substr($v, $found);.

}.

Clearstatcache();.

$ws_uploaded_file = DIR_WS_UPLOADS$filename_num$file_extension;.

$fs_uploaded_file = DIR_FS_UPLOADS$filename_num$file_extension;.

$on_click = '"java script:popupImage('"'/"$ws_uploaded_file"','"$current_filename"')"'"';.

$tmp_html .= "<br>""<a href="$on_click. "><font color='#0000FF'><u>"$current_filename"</font></u></a>""&nbsp;&nbsp;-&nbsp;&nbsp;<i>"CURRENT_UPLOAD"</i>";.

}.

?>.

<tr>.

<td class="mainColorBold" width="1%"><?php echo $products_options_name['products_options_name']':'; ?></td>.

<td class="main"><?php echo $tmp_html; ?></td>.

</tr>.

<?php.

Break;.

Default:.

//clr 030714 default is select list.

//clr 030714 reset selected_attribute variable.

$selected_attribute = false;.

$products_options_array = array();.

//jr - clr - order attrubute drop-down menu entries by attribute sort value.

$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"' order by pa.attribute_sort");.

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) {.

$products_options_array[sizeof($products_options_array)-1]['text'] .= '&nbsp;&nbsp;('$products_options['price_prefix']$currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';.

}.

}.

If (isset($cart->contents[$cart_key]['attributes'][$products_options_name['products_options_id']])) {.

$selected_attribute = $cart->contents[$cart_key]['attributes'][$products_options_name['products_options_id']];.

} else {.

$selected_attribute = false;.

}.

?>.

<tr>.

<td class="mainColorBold" width="1%"><?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)"<i> "$products_options_name['products_options_comment']; ?></i></td>.

</tr>.

<?php.

} //clr 030714 end switch.

} //clr 030714 end while.

?>.

</table>.

<?php.

} //clr 030714 end if.

?>.

</td>.

</tr>.

<?.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td>';.

Else.

$s = '<tr class="main"><td>';.

Echo $step_draw_separator('pixel_trans.gif', '10%', '10')'</td></tr>';.

$reviews_query = tep_db_query("select count(*) as count from "TABLE_REVIEWS" where approved = 1 and products_id = '"(int)$HTTP_GET_VARS['products_id']"'");.

$reviews = tep_db_fetch_array($reviews_query);.

//jr - start - always display reviews count.

// orig if ($reviews['count'] > 0) {.

If ($reviews['count'] > -1) {.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td>';.

Else.

$s = '<tr class="main"><td>';.

Echo $sTEXT_CURRENT_REVIEWS' '$reviews['count']'</td></tr>';.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td>';.

Else.

$s = '<tr class="main"><td>';.

Echo $step_draw_separator('pixel_trans.gif', '10%', '10')'</td></tr>';.

} // if ($reviews['count'] > -1) {.

If (tep_not_null($product_info['products_url'])) {.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td>';.

Else.

$s = '<tr class="main"><td>';.

Echo $ssprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto='urlencode($product_info['products_url']), 'NONSSL', true, false))'</td></tr>';.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td>';.

Else.

$s = '<tr class="main"><td>';.

Echo $ssprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto='urlencode($product_info['products_url']), 'NONSSL', true, false))'</td></tr>';.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td>';.

Else.

$s = '<tr class="main"><td>';.

Echo $step_draw_separator('pixel_trans.gif', '10%', '10')'</td></tr>';.

} // if (tep_not_null($product_info['products_url'])) {.

$s = '';.

If ($prod_type == 'Product' && STOCK_CHECK == 'true' && $product_info['products_quantity'] <= 0) {.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td align="left" class="markProductOutOfStock">';.

Else.

$s = '<tr class="main"><td align="left" class="markProductOutOfStock">';.

Echo $sTEXT_OUT_OF_STOCK'</td></tr>';.

If ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td align="left" class="stockWarning">';.

Else.

$s = '<tr class="main"><td align="left" class="stockWarning">';.

Echo $ssprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']))'</td></tr>';.

}.

}.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

$s = '<tr class="infoBoxContentsLarge"><td align="left" class="smallText">';.

Else.

$s = '<tr class="main"><td align="left" class="smallText">';.

//echo $ssprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added']))'</td></tr>';;.

// jr - bof - display the product description in InfoBox format (helps when page has background pic).

If (DISPLAY_PAGE_CONTENT_IN_INFOBOX == "True").

Echo "</table></table>";.

// jr - eof - display the product description in InfoBox format (helps when page has background pic).

?>.

<tr>.

<td><?php echo tep_draw_separator('pixel_trans.gif', '10%', '10'); ?></td>.

</tr>.

<tr>.

<td><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 class="main"><?php echo '<a href="'tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())'">'tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS)'</a>'; ?></td>.

<?php.

// jr - if product type != product then display Contact Owner button intead of Buy button.

If ($prod_type == 'Product') {.

$align = 'center'; }.

// jr bof - remove inquiry button if product_type not a product - for saltwater.com to limit emails..

Else { $align = 'right'; }.

?>.

<?.

// jr bof - added next line so no inquiry button non-product types. Comment out line to allow iniquiries when product_type='Info'.

If ($prod_type == 'Product') {.

?>.

<td class="main" align="<? echo $align; ?>"><?php echo '<a href="'tep_href_link(FILENAME_CONTACT_OWNER, tep_get_all_get_params())'">'tep_image_button('button_inquiry.gif', IMAGE_BUTTON_CONTACT)'</a>'; ?></td>.

<?.

}.

// jr eof - remove inquiry button if product_type not a product - for saltwater.com to limit emails..

// jr - start - quantity discount.

// <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); </td>.

?>.

<?.

// jr add notifdy me button for out-of-stock products.

If ($prod_type == 'Product') {.

If (tep_get_products_stock($product_info['products_id']) <= 0) {.

// display notify button.

?>.

<td class="main" align="right"><?php echo '<a href="'tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))'action=notify&products_id='$product_info['products_id'])'">'tep_image_button('button_email_notify_me.gif', 'Notify me via email when in stock')'</a>'; ?></td>.

<?.

}.

Elseif ($product_info['products_price1_qty'] > 0) {.

?>.

<td class="main" align="right">.

<table border="0" align="right" >.

<tr><td align="center" class="infoBoxContentsLarge" style="border-style: solid; border-width: 1px">.

<?php echo '<b>'TEXT_ENTER_QUANTITY": </b>"tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?>.

</td></tr>.

<tr><td align="center">.

<?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>.

</td>.

<?.

}.

Else {.

?>.

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>.

<?.

}.

} // if ($prod_type == 'Product') {.

?>.

<? // jr - end - quantity discount ?>.

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>.

</tr>.

</table></td>.

</tr>.

</table></td>.

</tr>.

<tr>.

<td><?php echo tep_draw_separator('p.

Comment #2

Hmm, it won't let me put it in a codebox...

Comment #3

We need to find the file that contains this code.

Select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, 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,paf.products_image2, paf.products_image3, paf.products_image4, paf.prod_type, paf.customers_id, paf.direct_contact, paf.products_qty_blocks, paf.products_price1, paf.products_price2, paf.products_price3, paf.products_price4, paf.products_price5, paf.products_price6, paf.products_price1_qty, paf.products_price2_qty, paf.products_price3_qty, paf.products_price4_qty, paf.products_price5_qty, paf.products_price6_qty, paf.products_id_source, paf.products_source_price, paf.products_source_price_multiplier, paf.products_notification_code from products_add_fields paf, products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = '62' and p.products_id = paf.products_id and pd.products_id = '62' and pd.language_id = '1'.

I thought it may be product_info.php, but it's not. Do you perhaps have a featured.php normally in catalog\includes\modules\..

Comment #4

Actually looking at the code it must be another modification that is causing the error. If you can find the file post it here...

Comment #5

<?php.

/*.

OsCommerce, Open Source E-Commerce Solutions.

Http://www.oscommerce.com.

Copyright (c) 2002 osCommerce.

Released under the GNU General Public License.

Featured Products V1.1.

Displays a list of featured products, selected from admin.

For use as an Infobox instead of the "New Products" Infobox.

*/.

?>.

<! featured_products //>.

<?php.

// get all featured proucts.

// get featured products in current and below cats.

// jr - start - get all subcategories products.

$subcategories_array = array();.

Tep_get_subcategories($subcategories_array, $new_products_category_id);.

If ($new_products_category_id) {.

$products_category_id_list = $new_products_category_id;.

}.

Else {.

$products_category_id_list = '0';.

}.

For ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {.

$products_category_id_list .= ','$subcategories_array[$i];.

}.

// BOF Separate Pricing per Customer.

Global $sppc_customer_group_id;.

If(!tep_session_is_registered('sppc_customer_group_id')) {.

$customer_group_id = '0'; }.

Else { $customer_group_id = $sppc_customer_group_id; }.

// BOF Separate Pricing per Customer .

// BOF Separate Pricing per Customer.

// jr bof - category disable.

$featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_TO_CATEGORIES" p2c, "TABLE_FEATURED" f, "TABLE_CATEGORIES" c where categories_status = '1' and p.products_id = f.products_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id in ("$products_category_id_list") and p.products_status = '1' order by rand() desc limit ". MAX_DISPLAY_FEATURED);.

// $featured_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from "TABLE_PRODUCTS" p, "TABLE_PRODUCTS_TO_CATEGORIES" p2c, "TABLE_FEATURED" f, "TABLE_CATEGORIES" c where p.products_id = f.products_id and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id in ("$products_category_id_list") and p.products_status = '1' order by rand() desc limit ". MAX_DISPLAY_FEATURED);.

// jr eof - category disable.

$row = 0;.

$col = 0;.

$num = 0;.

// calc exact column width to support number of columns defined in admin area.

$col_width = round(100/LARGEINFOBOX_COLUMNS);.

$info_box_contents = array();.

While ($products = tep_db_fetch_array($featured_products_query)) {.

$num ++;.

$products['products_name'] = tep_get_products_name($products['products_id']);.

$lowest_price = get_lowest_price($products['products_id'], $products['products_price']);.

If(tep_get_products_special_price($products['products_id'])) {.

$info_box_contents[$row][$col] = array('align' => 'center',.

'params' => 'class="smallText" width="'$col_width'%"valign="top"',.

'text' => '<a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$products['products_id'])'">'tep_image(DIR_WS_PRODUCT_IMAGES$products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class=imageborder')'</a><br><a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$products['products_id'])'">'$products['products_name']'</a><br><s>'$currencies->display_price($products['products_price'], tep_get_tax_rate($products['products_tax_class_id']))'</s>&nbsp;&nbsp;<span class="productSpecialPriceInfoBox">'$currencies->display_price($lowest_price, tep_get_tax_rate($products['products_tax_class_id']))'</span>');.

} // end if.

Else {.

$info_box_contents[$row][$col] = array('align' => 'center',.

'params' => 'class="smallText" width="'$col_width'%"valign="top"',.

'text' => '<a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$products['products_id'])'">'tep_image(DIR_WS_PRODUCT_IMAGES$products['products_image'], $products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class=imageborder')'</a><br><a href="'tep_href_link(FILENAME_PRODUCT_INFO, 'products_id='$products['products_id'])'">'$products['products_name']'</a><br>'$currencies->display_price($lowest_price, tep_get_tax_rate($products['products_tax_class_id'])));.

} .

$col ++;.

If ($col > LARGEINFOBOX_COLUMNS-1) { // display this many columns which defined in admin section.

$col = 0;.

$row ++;.

}.

} // end while.

// display the results.

$displayed_box = 0; .

If($num) {.

$displayed_box = 1;.

$info_box_contents_heading[] = array('align' => 'left', 'text' => '<a class="headerNavigation" href="'tep_href_link(FILENAME_FEATURED_PRODUCTS, 'categories_id='$new_products_category_id)'">'TABLE_HEADING_FEATURED_PRODUCTS'</a>');.

New contentBoxHeading($info_box_contents_heading);.

New contentBox($info_box_contents);.

}.

?>.

<! featured_products_eof //>..

Comment #6

I've looked through so many files and have used the "Find" feature to look for parts of the code, but nothing. Anyone have any ideas as to what files this might be in? There is just sooo many files to look through. It could be a full time job doing that..

Any more help would be very appreciated. Thanks...

Comment #7

More info on how to fix a 1054 error is here.

How to fix 1054 error.

Http://addons.oscommerce.com/info/4654.

Look at the error output and try to figure out which modification of yours it may be that is causing the error. Then search in those files. I suggest looking in includes\modules\..

Comment #8

I'll do that and let you know what I find. Thanks...

Comment #9

Jan, YES that is the one. Here it is. Now that I have it though, what should I do?.

<?php.

/*.

$Id: PriceFormatter.php,v 1.6 2003/06/25 08:29:26 petri Exp $.

OsCommerce, Open Source E-Commerce Solutions.

[url="http://www.oscommerce.com"]http://www.oscommerce.com[/url].

Copyright © 2003 osCommerce.

Released under the GNU General Public License.

*/.

/*.

PriceFormatter.php - module to support quantity pricing.

Created 2003, Beezle Software based on some code mods by WasaLab Oy (Thanks!).

*/.

Class PriceFormatter {.

Var $hiPrice;.

Var $lowPrice;.

Var $quantity;.

Var $hasQuantityPrice;.

Function PriceFormatter($prices=NULL) {.

$this->productsID = -1;.

$this->hasQuantityPrice=false;.

$this->hasSpecialPrice=false;.

$this->hiPrice=-1;.

$this->lowPrice=-1;.

For ($i=1; $i<=6; $i++){.

$this->quantity[$i] = -1;.

$this->prices[$i] = -1;.

}.

$this->thePrice = -1;.

$this->specialPrice = -1;.

$this->qtyBlocks = 1;.

If($prices) {.

$this->parse($prices);.

}.

}.

Function encode() {.

$str = $this->productsID":".

(($this->hasQuantityPrice == true) ? "1" : "0")":".

(($this->hasSpecialPrice == true) ? "1" : "0")":".

$this->quantity[1]":".

$this->quantity[2]":".

$this->quantity[3]":".

$this->quantity[4]":".

$this->quantity[5]":".

$this->quantity[6]":".

$this->price[1]":".

$this->price[2]":".

$this->price[3]":".

$this->price[4]":".

$this->price[5]":".

$this->price[6]":".

$this->thePrice":".

$this->specialPrice":".

$this->qtyBlocks":".

$this->taxClass':'.

$this->lowestPrice;.

Return $str;.

}.

Function decode($str) {.

List($this->productsID,.

$this->hasQuantityPrice,.

$this->hasSpecialPrice,.

$this->quantity[1],.

$this->quantity[2],.

$this->quantity[3],.

$this->quantity[4],.

$this->quantity[5],.

$this->quantity[6],.

$this->price[1],.

$this->price[2],.

$this->price[3],.

$this->price[4],.

$this->price[5],.

$this->price[6],.

$this->thePrice,.

$this->specialPrice,.

$this->qtyBlocks,.

$this->taxClass) = explode(":", $str);.

$this->hasQuantityPrice = (($this->hasQuantityPrice == 1) ? true : false);.

$this->hasSpecialPrice = (($this->hasSpecialPrice == 1) ? true : false);.

}.

Function parse($prices) {.

$this->productsID = $prices['products_id'];.

$this->hasQuantityPrice=false;.

$this->hasSpecialPrice=false;.

$this->quantity[1]=$prices['products_price1_qty'];.

$this->quantity[2]=$prices['products_price2_qty'];.

$this->quantity[3]=$prices['products_price3_qty'];.

$this->quantity[4]=$prices['products_price4_qty'];.

$this->quantity[5]=$prices['products_price5_qty'];.

$this->quantity[6]=$prices['products_price6_qty'];.

$this->thePrice=$prices['products_price'];.

$this->specialPrice=tep_get_products_special_price($prices['products_id']);.

$this->hasSpecialPrice=tep_not_null($this->specialPrice);.

$this->price[1]=$prices['products_price1'];.

$this->price[2]=$prices['products_price2'];.

$this->price[3]=$prices['products_price3'];.

$this->price[4]=$prices['products_price4'];.

$this->price[5]=$prices['products_price5'];.

$this->price[6]=$prices['products_price6'];.

// jr added to support Quantity Priceing and Group Pricing.

$this->lowestPrice = get_lowest_price($prices['products_id'], $prices['products_price']);.

/*.

Change support special prices.

If any price level has a price greater than the special.

Price lower it to the special price.

*/.

If ($this->hasSpecialPrice == true) {.

For($i=1; $i<=6; $i++) {.

If ($this->price[$i] > $this->specialPrice).

$this->price[$i] = $this->specialPrice;.

}.

}.

//end changes to support special prices.

// BOF Separate Pricing per Customer.

// global variable (session) $sppc_customer_group_id -> local variable customer_group_id .

// global $sppc_customer_group_id;.

// if(!tep_session_is_registered('sppc_customer_group_id')) {.

// $customer_group_id = '0'; }.

// else { $customer_group_id = $sppc_customer_group_id; }.

// get all customers_group_prices for products with the particular customer_group_id.

// however not necessary for customer_group_id = 0.

// if ($customer_group_id != '0') {.

// $customer_group_price_query = tep_db_query("select customers_group_price as price from "TABLE_PRODUCTS_GROUPS" pg where products_id = '"$prices['products_id'] ."' and customers_group_id = '".$customer_group_id."'");.

// if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {.

// if ($this->thePrice > $customer_group_price['price']) {.

// $this->thePrice = $customer_group_price['price'];.

// }.

// } .

// }.

// BOF Separate Pricing per Customer.

$this->qtyBlocks=$prices['products_qty_blocks'];.

$this->taxClass=$prices['products_tax_class_id'];.

If ($this->quantity[1] > 0) {.

$this->hasQuantityPrice = true;.

$this->hiPrice = $this->thePrice;.

$this->lowPrice = $this->thePrice;.

For($i=1; $i<=6; $i++) {.

If($this->quantity[$i] > 0) {.

If ($this->price[$i] > $this->hiPrice) {.

$this->hiPrice = $this->price[$i];.

}.

If ($this->price[$i] < $this->lowPrice) {.

$this->lowPrice = $this->price[$i];.

}.

}.

} // end for.

}.

}.

Function loadProduct($product_id, $language_id=1).

{.

// jr - begin - product additional fields..

Global $select_product_add_fields;.

// jr - end - product additional fields..

// jr - begin - product additional fields - include fields if it exists.

If (!isset($select_product_add_fields)) {.

If (file_exists(DIR_WS_ADDITIONAL_FIELDS'_product_add_fields_variables_always.php')) {.

Include(DIR_WS_ADDITIONAL_FIELDS'_product_add_fields_variables_always.php'); }.

Else { $select_product_add_fields = " from "; }.

}.

// jr - end - product additional fields - include fields if it exists .

$sql="select pd.products_name, p.products_model, p.products_image, p.products_id," ..

" p.manufacturers_id, p.products_price, p.products_weight," ..

" 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,"$select_product_add_fields ..

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 = '"(int)$product_id"'" ..

// jr - start - product additional fields.

" and p.products_id = paf.products_id ".

// jr - end - product additional fields.

" and pd.products_id = '"(int)$product_id"'" ..

" and pd.language_id = '". (int)$language_id ."'";.

$product_info_query = tep_db_query($sql);.

$product_info = tep_db_fetch_array($product_info_query);.

$this->parse($product_info);.

Return $product_info;.

}.

Function computePrice($qty).

{.

$qty = $this->adjustQty($qty);.

// Compute base price, taking into account the possibility of a special.

$price = ($this->hasSpecialPrice === TRUE) ? $this->specialPrice : $this->thePrice;.

For ($i=1; $i<=6; $i++).

If (($this->quantity[$i] > 0) && ($qty >= $this->quantity[$i])).

$price = $this->price[$i];.

// jr added to support Quantity Priceing and Group Pricing.

If ($price > $this->lowestPrice).

$price = $this->lowestPrice;.

Return $price;.

}.

Function adjustQty($qty) {.

// Force QTY_BLOCKS granularity.

$qb = $this->getQtyBlocks();.

If ($qty < 1).

$qty = 1;.

// jr - start - mod.

If ($qb == 1) {.

For ($i=1; $i<=6; $i++) {.

If ($qty <= $this->quantity[$i]) {.

$qty = $this->quantity[$i];.

$i = 7;.

}.

}.

}.

// jr - end - mod.

Return $qty;.

}.

Function getQtyBlocks() {.

Return $this->qtyBlocks;.

}.

Function getPrice() {.

Return $this->thePrice;.

}.

Function getLowPrice() {.

Return $this->lowPrice;.

}.

Function getHiPrice() {.

Return $this->hiPrice;.

}.

Function hasSpecialPrice() {.

Return $this->hasSpecialPrice;.

}.

Function hasQuantityPrice() {.

Return $this->hasQuantityPrice;.

}.

Function getPriceString($style='productPriceInBox') {.

Global $currencies;.

If ($this->hasSpecialPrice == true) {.

$lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">';.

$lc_text .= '<tr><td align="center" class='$style. ' colspan="2">';.

$lc_text .= '&nbsp;<s>'.

$currencies->display_price($this->thePrice,.

Tep_get_tax_rate($this->taxClass)).

'</s>&nbsp;&nbsp;<span class="productSpecialPrice">'.

$currencies->display_price($this->specialPrice,.

Tep_get_tax_rate($this->taxClass)).

'</span>&nbsp;'.

.'</td></tr>';.

}.

Else.

{.

$lc_text = '<table align="top" border="1" cellspacing="0" cellpadding="0">';.

$lc_text .= '<tr><td align="center" class='$style. ' colspan="2">'.

$currencies->display_price($this->thePrice,.

Tep_get_tax_rate($this->taxClass)).

'</td></tr>';.

}.

// If you want to change the format of the price/quantity table.

// displayed on the product information page, here is where you do it..

If($this->hasQuantityPrice == true) {.

For($i=1; $i<=6; $i++) {.

If($this->quantity[$i] > 0) {.

$lc_text .= '<tr><td class='.$style.'>'.

$this->quantity[$i].

.'+&nbsp;</td><td class='.$style.'>'.

$currencies->display_price($this->price[$i],.

Tep_get_tax_rate($this->taxClass)).

.'</td></tr>';.

}.

}.

$lc_text .= '</table>';.

}.

Else {.

If ($this->hasSpecialPrice == true) {.

$lc_text = '&nbsp;<s>'.

$currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)).

'</s>&nbsp;&nbsp;<span class="productSpecialPrice">'.

$currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)).

'</span>&nbsp;';.

}.

Else {.

$lc_text = '&nbsp;'.

$currencies->display_price($this->thePrice,.

Tep_get_tax_rate($this->taxClass)).

'&nbsp;';.

}.

}.

Return $lc_text;.

}.

Function getPriceStringShort() {.

Global $currencies;.

$lc_text = '';.

If ($this->hasSpecialPrice == true) {.

$lc_text = '&nbsp;<s>'.

$currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass)).

'</s>&nbsp;&nbsp;<span class="productSpecialPrice">'.

//$currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass)).

$currencies->display_price($this->lowestPrice, tep_get_tax_rate($this->taxClass)).

'</span>&nbsp;';.

}.

If (!tep_not_null($lc_text)) {.

If($this->hasQuantityPrice == true) {.

$lc_text = '&nbsp;'.

$currencies->display_price($this->lowPrice, tep_get_tax_rate($this->taxClass)).

' - '.

$currencies->display_price($this->hiPrice, tep_get_tax_rate($this->taxClass)).

'&nbsp;';.

}.

}.

If (!tep_not_null($lc_text)) {.

$lc_text = '&nbsp;'.

$currencies->display_price($this->lowestPrice, tep_get_tax_rate($this->taxClass)).

'&nbsp;';.

}.

Return $lc_text;.

}.

}.

?>..

Comment #10

Hi,.

I'm having a problem and have please can anyone help me, I have been searching for ages to fix this but without any success. Below is my error, please can someone tell me what it means. I only get this when I click a category that has sub categories..

My error is below:.

1054 - Unknown column 'p.manufacturers_id' in 'on clause'.

Select distinct p.products_id, p.products_image, p.products_model, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price, mnf.manufacturers_name, rvw.reviews_rating from (products p) left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join manufacturers mnf on p.manufacturers_id = mnf.manufacturers_id left join reviews rvw on p.products_id = rvw.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '42' and p.products_status = '1' order by p.products_date_added desc limit 2.

[TEP STOP].

I can still see the categories and they are clickable and it all works as normal however the box below which usually has new products for that month for example "New products for november" has the error code in it..

I hope someone can help me!..

Comment #11

I've noticed that out of the 3 posts you've posted, all 3 have been hijacks. Why not open your own thread asking for help?..

Comment #12

Sorry I'm new to this, didn't know that I could open a new thread! Apologies. I've managed the sort it by reading the many posts. It seems that my problem lay in my includes/modules/new_products.php file. I have sucessfully modified with all the advice given and now is working like a charm..

Thanks..

Comment #13

Glad to hear it's working. And, not a problem, just noticed that although our problems looked similair, I believe they are a bit different is all...

Comment #14

The contents of includes/classes/PriceFormatter.php doesn't match the error output.

Select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, 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,paf.products_image2, paf.products_image3, paf.products_image4, paf.prod_type, paf.customers_id, paf.direct_contact, paf.products_qty_blocks, paf.products_price1, paf.products_price2, paf.products_price3, paf.products_price4, paf.products_price5, paf.products_price6, paf.products_price1_qty, paf.products_price2_qty, paf.products_price3_qty, paf.products_price4_qty, paf.products_price5_qty, paf.products_price6_qty, paf.products_id_source, paf.products_source_price, paf.products_source_price_multiplier, paf.products_notification_code from products_add_fields paf, products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = '62' and p.products_id = paf.products_id and pd.products_id = '62' and pd.language_id = '1'.

I don't see that in there...

Comment #15

I guess it is rather hidden due to the.

$select_product_add_fields.

Looks like a match to me though:.

$sql="select pd.products_name, p.products_model, p.products_image, p.products_id," ..

" p.manufacturers_id, p.products_price, p.products_weight," ..

" 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,"$select_product_add_fields ..

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 = '"(int)$product_id"'" ..

// jr - start - product additional fields.

" and p.products_id = paf.products_id ".

// jr - end - product additional fields.

" and pd.products_id = '"(int)$product_id"'" ..

" and pd.language_id = '". (int)$language_id ."'";..

Comment #16

BACKUP YOUR FILE FIRST THEN REPLACE IT COMPLETELY WITH THE CODE BELOW. I ADDED THE BRACKETS ACCORDING TO INSTRUCTION FOR 1054 FIX...

Comment #17

Ok, after putting that in, I now get a different error. Here it is:.

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products' at line 23.

Select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, 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,paf.products_image2, paf.products_image3, paf.products_image4, paf.prod_type, paf.customers_id, paf.direct_contact, paf.products_qty_blocks, paf.products_price1, paf.products_price2, paf.products_price3, paf.products_price4, paf.products_price5, paf.products_price6, paf.products_price1_qty, paf.products_price2_qty, paf.products_price3_qty, paf.products_price4_qty, paf.products_price5_qty, paf.products_price6_qty, paf.products_id_source, paf.products_source_price, paf.products_source_price_multiplier, paf.products_notification_code from products_add_fields paf, products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = '516' and p.products_id = paf.products_id and pd.products_id = '516' and pd.language_id = '1'.

[TEP STOP]..

Comment #18

Have a look.

HERE.

For the 1064 error. Remember to BACKUP before making changes...

Comment #19

Well, I gave it a shot. The files are as it says to do in that post and nothing. I believe the error is the same. Here it is:.

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products' at line 23.

Select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, 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,paf.products_image2, paf.products_image3, paf.products_image4, paf.prod_type, paf.customers_id, paf.direct_contact, paf.products_qty_blocks, paf.products_price1, paf.products_price2, paf.products_price3, paf.products_price4, paf.products_price5, paf.products_price6, paf.products_price1_qty, paf.products_price2_qty, paf.products_price3_qty, paf.products_price4_qty, paf.products_price5_qty, paf.products_price6_qty, paf.products_id_source, paf.products_source_price, paf.products_source_price_multiplier, paf.products_notification_code from products_add_fields paf, products_description pd, products p) left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c) left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = '470' and p.products_id = paf.products_id and pd.products_id = '470' and pd.language_id = '1'.

[TEP STOP].

Would the fact that it says "line 23" and not line 1 have anything to do with it?..

Comment #20

<?php.

/*.

$Id: split_page_results.php,v 1.15 2003/06/09 22:35:34 hpdl Exp $.

OsCommerce, Open Source E-Commerce Solutions.

[url="http://www.oscommerce.com"]http://www.oscommerce.com[/url].

Copyright © 2003 osCommerce.

Released under the GNU General Public License.

*/.

Class splitPageResults {.

Var $sql_query, $number_of_rows, $current_page_number, $number_of_pages, $number_of_rows_per_page, $page_name;.

/* class constructor */.

Function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {.

Global $HTTP_GET_VARS, $HTTP_POST_VARS;.

$this->sql_query = $query;.

$this->page_name = $page_holder;.

If (isset($HTTP_GET_VARS[$page_holder])) {.

$page = $HTTP_GET_VARS[$page_holder];.

} elseif (isset($HTTP_POST_VARS[$page_holder])) {.

$page = $HTTP_POST_VARS[$page_holder];.

} else {.

$page = '';.

}.

If (empty($page) || !is_numeric($page)) $page = 1;.

$this->current_page_number = $page;.

$this->number_of_rows_per_page = $max_rows;.

$pos_to = strlen($this->sql_query);.

$pos_from = strpos($this->sql_query, ' from', 0);.

$pos_group_by = strpos($this->sql_query, ' group by', $pos_from);.

If (($pos_group_by < $pos_to) && ($pos_group_by != false)) $pos_to = $pos_group_by;.

$pos_having = strpos($this->sql_query, ' having', $pos_from);.

If (($pos_having < $pos_to) && ($pos_having != false)) $pos_to = $pos_having;.

$pos_order_by = strpos($this->sql_query, ' order by', $pos_from);.

If (($pos_order_by < $pos_to) && ($pos_order_by != false)) $pos_to = $pos_order_by;.

If (strpos($this->sql_query, 'distinct') || strpos($this->sql_query, 'group by')) {.

$count_string = 'distinct 'tep_db_input($count_key);.

} else {.

$count_string = tep_db_input($count_key);.

}.

$count_query = tep_db_query("select count("$count_string") as total "substr($this->sql_query, $pos_from, ($pos_to - $pos_from)));.

$count = tep_db_fetch_array($count_query);.

$this->number_of_rows = $count['total'];.

$this->number_of_pages = ceil($this->number_of_rows / $this->number_of_rows_per_page);.

If ($this->current_page_number > $this->number_of_pages) {.

$this->current_page_number = $this->number_of_pages;.

}.

$offset = ($this->number_of_rows_per_page * ($this->current_page_number - 1));.

$this->sql_query .= " limit "max($offset, 0)", "$this->number_of_rows_per_page;.

}.

/* class functions */.

// display split-page-number-links.

Function display_links($max_page_links, $parameters = '') {.

Global $PHP_SELF, $request_type;.

$display_links_string = '';.

$class = 'class="pageResults"';.

If (tep_not_null($parameters) && (substr($parameters, -1) != '&')) $parameters .= '&';.

// previous button - not displayed on first page.

If ($this->current_page_number > 1) $display_links_string .= '<a href="'tep_href_link(basename($PHP_SELF), $parameters$this->page_name'='($this->current_page_number - 1), $request_type)'" class="pageResults" title=" 'PREVNEXT_TITLE_PREVIOUS_PAGE' "><u>'PREVNEXT_BUTTON_PREV'</u></a>&nbsp;&nbsp;';.

// check if number_of_pages > $max_page_links.

$cur_window_num = intval($this->current_page_number / $max_page_links);.

If ($this->current_page_number % $max_page_links) $cur_window_num++;.

$max_window_num = intval($this->number_of_pages / $max_page_links);.

If ($this->number_of_pages % $max_page_links) $max_window_num++;.

// previous window of pages.

If ($cur_window_num > 1) $display_links_string .= '<a href="'tep_href_link(basename($PHP_SELF), $parameters$this->page_name'='(($cur_window_num - 1) * $max_page_links), $request_type)'" class="pageResults" title=" 'sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links)' ">...</a>';.

// page nn button.

For ($jump_to_page = 1 + (($cur_window_num - 1) * $max_page_links); ($jump_to_page <= ($cur_window_num * $max_page_links)) && ($jump_to_page <= $this->number_of_pages); $jump_to_page++) {.

If ($jump_to_page == $this->current_page_number) {.

$display_links_string .= '&nbsp;<b>'$jump_to_page'</b>&nbsp;';.

} else {.

$display_links_string .= '&nbsp;<a href="'tep_href_link(basename($PHP_SELF), $parameters$this->page_name'='$jump_to_page, $request_type)'" class="pageResults" title=" 'sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page)' "><u>'$jump_to_page'</u></a>&nbsp;';.

}.

}.

// next window of pages.

If ($cur_window_num < $max_window_num) $display_links_string .= '<a href="'tep_href_link(basename($PHP_SELF), $parameters$this->page_name'='(($cur_window_num) * $max_page_links + 1), $request_type)'" class="pageResults" title=" 'sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links)' ">...</a>&nbsp;';.

// next button.

If (($this->current_page_number < $this->number_of_pages) && ($this->number_of_pages != 1)) $display_links_string .= '&nbsp;<a href="'tep_href_link(basename($PHP_SELF), $parameters'page='($this->current_page_number + 1), $request_type)'" class="pageResults" title=" 'PREVNEXT_TITLE_NEXT_PAGE' "><u>'PREVNEXT_BUTTON_NEXT'</u></a>&nbsp;';.

Return $display_links_string;.

}.

// display number of total products found.

Function display_count($text_output) {.

$to_num = ($this->number_of_rows_per_page * $this->current_page_number);.

If ($to_num > $this->number_of_rows) $to_num = $this->number_of_rows;.

$from_num = ($this->number_of_rows_per_page * ($this->current_page_number - 1));.

If ($to_num == 0) {.

$from_num = 0;.

} else {.

$from_num++;.

}.

Return sprintf($text_output, $from_num, $to_num, $this->number_of_rows);.

}.

}.

?>..

Comment #21

Line no 23 of your product_info.php file refers to this file:.

_product_add_fields_variables_always.php.

Maybe check that file for the 1054 fix...

Comment #22

So here is that file. It's not even that big so I searched for the infamous "left join" and found nothing. So should my index page also contain the 1054 fix?.

<?php.

//.

// jr - John Redman.

//.

// Instructions for adding additional product fields.

//.

//.

//.

// To add product fields perform:.

//.

// See DIR_WS_ADDITIONAL_FIELDSReadme-HowToAddAdditionalProductFields.txt.

//.

//.

// Files in which this file is automatically included (search for below filename throughout store):.

// - filename: _product_add_fields_variables_always.php.

// jr - begin - product additional fields - update here when adding fields to TABLE_PRODUCTS_ADD_FIELDS.

// that will always be used in the base package such as those below..

// The fields must be in the order as they occur in the db.

// ********************************************************************************.

*******.

// begin - used throughout the package, defines additional fields permanently incorporated.

// ********************************************************************************.

*******.

// *****************.

// Main Code - Begin.

// *****************.

// fields must be in the order as they occur in the db - used throughout the package.

$select_product_add_fields =.

"paf.products_image2,.

Paf.products_image3,.

Paf.products_image4,.

Paf.prod_type,.

Paf.customers_id,.

Paf.direct_contact,.

Paf.products_qty_blocks,.

Paf.products_price1,.

Paf.products_price2,.

Paf.products_price3,.

Paf.products_price4,.

Paf.products_price5,.

Paf.products_price6,.

Paf.products_price1_qty,.

Paf.products_price2_qty,.

Paf.products_price3_qty,.

Paf.products_price4_qty,.

Paf.products_price5_qty,.

Paf.products_price6_qty,.

Paf.products_id_source,.

Paf.products_source_price,.

Paf.products_source_price_multiplier,.

Paf.products_notification_code";.

// jr - begin - Include additional fields. Used throughout the package..

Clearstatcache();.

// Include additional field defines from file. Fields specific to an implementation and not permanent in base package..

If (file_exists(DIR_WS_ADDITIONAL_FIELDS'product_add_fields_variables_1.php')) {.

Include(DIR_WS_ADDITIONAL_FIELDS'product_add_fields_variables_1.php');.

$select_product_add_fields .= ','$product_add_fields_variables_1_1;.

}.

$select_product_add_fields .= " from "TABLE_PRODUCTS_ADD_FIELDS" paf, " ;.

// jr - end - Include additional fields. Used throughout the package..

// *****************.

// Main Code - End.

// *****************.

// ********************************************************************************.

*******.

// end - used throughout the package, defines additional fields permanently incorporated.

// ********************************************************************************.

*******.

?>.

This post has been edited by.

Saltaquatics.

: 27 November 2008, 22:00..

Comment #23

Your Index.php may call modules that require the fix. For example FEATURED_PRODUCTS. It is difficult to say since I don't know what mods you have..

Comment #24

Also see this thread if your version of OsCommerce is old..

Http://www.oscommerc...e-20051113.html..

Comment #25

I think this might work in PriceFormatter.php (you don't query the manufacturers name nor do you use the category so these tables could be left out in my opinion):.

$sql="select pd.products_name, p.products_model, p.products_image, p.products_id," ..

" p.manufacturers_id, p.products_price, p.products_weight," ..

" 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,"$select_product_add_fields ..

TABLE_PRODUCTS_DESCRIPTION" pd," ..

" "TABLE_PRODUCTS" p left join "TABLE_SPECIALS" s on p.products_id = s.products_id," ..

" where p.products_status = '1'" ..

" and p.products_id = '"(int)$product_id"'" ..

// jr - start - product additional fields.

" and p.products_id = paf.products_id ".

// jr - end - product additional fields.

" and pd.products_id = '"(int)$product_id"'" ..

" and pd.language_id = '". (int)$language_id ."'";..

Comment #26

FYI - I just fixed my 1054 error... I fixed the left join problem in all of the suggested files and still no luck. I searched for hours for a solution, and it turned out it was just another file that needed the left join fix.. It was home.php that did the trick..

I am using a template that I purchased, so I'm not sure how many others will have this problem in home.php but I figured I'd share just in case..

Hope that helps someone else!..

Comment #27


This question was taken from a support group/message board and re-posted here so others can learn from it.

 

Categories: Home | Diet & Weight Management | Vitamins & Supplements | Herbs & Cleansing |

Sexual Health | Medifast Support | Nutrisystem Support | Medifast Questions |

Web Hosting | Web Hosts | Website Hosting | Hosting |

Web Hosting | GoDaddy | Digital Cameras | Best WebHosts |

Web Hosting FAQ | Web Hosts FAQ | Hosting FAQ | Hosting Group |

Hosting Questions | Camera Tips | Best Cameras To Buy | Best Cameras This Year |

Camera Q-A | Digital Cameras Q-A | Camera Forum | Nov 2010 - Cameras |

Oct 2010 - Cameras | Oct 2010 - DSLRs | Oct 2010 - Camera Tips | Sep 2010 - Cameras |

Sep 2010 - DSLRS | Sep 2010 - Camera Tips | Aug 2010 - Cameras | Aug 2010 - DSLR Tips |

Aug 2010 - Camera Tips | July 2010 - Cameras | July 2010 - Nikon Cameras | July 2010 - Canon Cameras |

July 2010 - Pentax Cameras | Medifast Recipes | Medifast Recipes Tips | Medifast Recipes Strategies |

Medifast Recipes Experiences | Medifast Recipes Group | Medifast Recipes Forum | Medifast Support Strategies |

Medifast Support Experiences |

 

(C) Copyright 2010 All rights reserved.