Jump to content



Photo
* * * * * 3 votes

Simply Hide Products (SHP)


  • Please log in to reply
90 replies to this topic

#21   bhbilbao

bhbilbao
  • Members
  • 307 posts
  • Real Name:BLACKHOLE
  • Gender:Male
  • Location:Spain

Posted 05 January 2010 - 10:32

in catalog/includes/column_left.php

ref:
if ((USE_CACHE == 'true') && empty($SID)) {
    echo tep_cache_categories_box();
  } else {
    include(DIR_WS_BOXES . 'categories.php');
//    include(DIR_WS_BOXES . 'ul_categories.php');
  }

  if ((USE_CACHE == 'true') && empty($SID)) {
    echo tep_cache_manufacturers_box();
  } else {
    include(DIR_WS_BOXES . 'manufacturers.php');
  }


Should be categories.php.

I tried diferent fixes to fix the error.

Disablig other contrib RESTRICTED CATEGORIES from application_top.php
ref:
/* START restricted category */
  
$restricted_category = 925;	# Change number to your restricted category - look at the bottom of your browser for ...?cPath="number"
if ($cPath_array[0] == $restricted_category) { 
	
	if (!tep_session_is_registered('customer_id')) { 
		$navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); # redirect to login
	}
}

/*  END restricted category */

For
error 1064
these ones from other posts:
See if using the older query line works in your case. You should have in your advanced_search_result.php this code:

  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id";

  $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";


You need to change

$this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

to

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


so ...
just download the first release of Total B2B
and upload the sql file of this package
The fact is that the new package is for Mysql5.xxx++++
fuck 1and1 ...

Para mi la solucion a ese error fue editar la base de datos en mysql.
1. Entre a "mysql" mediante "phpadmin"
2. Click en "manufacturers"
3. Click en el tab que dise "insert"
4. En "manufacturers_id" puse (1) y en "manufacturers_name" puse una letra (a)
5. y eso fue todo... luego fui al panel de administracion de oscommerce y edite la informacion del manufacturero.

Esto tambien funciona si usted borro todas las categorias en el panel de administracion de oscommerce y le sale este error. (1064 - You have an error in your SQL syntax). AƱadir valor en la base de datos produce que oscommerce pueda leer de la base de datos y no produsca un error.

In admin/includes/classes find split_page_results.php and - BACK IT UP then find the lines

$offset = ($max_rows_per_page * ($current_page_number - 1));
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

change to

$offset = ($max_rows_per_page * ($current_page_number - 1));
if ($offset < 0)
{
$offset = 0 ;
}
$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;


See, My link

No one of the above solutions worked for me. The contrib is now installed but if I restrict only one product or category it gets the 1064 error on the main page.

#22   bhbilbao

bhbilbao
  • Members
  • 307 posts
  • Real Name:BLACKHOLE
  • Gender:Male
  • Location:Spain

Posted 05 January 2010 - 10:45

In my categories table:
categories_id categories_image parent_id sort_order date_added last_modified
920 null 0 20 08/12/2009 0:43 08/12/2009 0:50
240 null 924 240 08/12/2009 0:43 08/12/2009 0:50
....etc

In my categories_description table:
categories_id language_id categories_name
920 2 PDA
920 3 PDA
920 1 PDA
240 2 CD/DVD
240 3 CD/DVD
240 1 CD/DVD
....etc

All cetegories are right.

#23   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 07 January 2010 - 01:35

You have to find the sql query which causes the error. If you copy it here into this thread I will fix it.
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#24   bhbilbao

bhbilbao
  • Members
  • 307 posts
  • Real Name:BLACKHOLE
  • Gender:Male
  • Location:Spain

Posted 12 January 2010 - 21:01

You said from includes/application_top.php????

or other file???

#25   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 12 January 2010 - 21:16

You said from includes/application_top.php????

or other file???


I mean the the sql query you mentioned in your post on 4 january: http://forums.oscomm...ost__p__1471287

I don't know where this query is in your shop, you have to search for it. Note: In a clean osCommerce installation this contribution works without a problem, so it must be a query which has been modified.
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#26   bhbilbao

bhbilbao
  • Members
  • 307 posts
  • Real Name:BLACKHOLE
  • Gender:Male
  • Location:Spain

Posted 12 January 2010 - 21:58

This could be dificult for me.

I have 142contributions installed and in any moment this going to blow up. When I install a new contrib other 2 or 3 begins to fault.

Im a semi-coder not programer.

Where do you thing the querie error are?? On what archive???

application_top.php
cache.php
database.php
split_page_results.php

#27   bhbilbao

bhbilbao
  • Members
  • 307 posts
  • Real Name:BLACKHOLE
  • Gender:Male
  • Location:Spain

Posted 12 January 2010 - 22:18

Also the index.php archive.

I look this:
// 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
      }
    }
  }

application_top.php
// custom product builder add to cart from builder_info page
      case 'add_build' :      if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                                if ($_POST['uncloaked_build'] == '0') {
                                  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1' where products_id = '" . $_POST['products_id'] . "' and products_quantity > '" . $cart->get_quantity(tep_get_uprid($_POST['products_id'],$_POST['id'])) . "'");
                                }
                                $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                                if ($_POST['disable_build'] == '1' or $_POST['uncloaked_build'] =='0') {
                                  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . $_POST['products_id'] . "'");
                                }
                              }
                              tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                              break;

// add category names or the manufacturer name to the breadcrumb trail
  if (isset($cPath_array)) {
    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
      $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
      if (tep_db_num_rows($categories_query) > 0) {
        $categories = tep_db_fetch_array($categories_query);
        $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
      } else {
        break;
      }
    }
  } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
    $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
    if (tep_db_num_rows($manufacturers_query)) {
      $manufacturers = tep_db_fetch_array($manufacturers_query);
      $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
    }
  }

// add the products model to the breadcrumb trail
  if (isset($HTTP_GET_VARS['products_id'])) {
    $model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
    if (tep_db_num_rows($model_query)) {
      $model = tep_db_fetch_array($model_query);
      $breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
    }
  }

cache.php
//! Cache the categories box
// Cache the categories box
  function tep_cache_categories_box($auto_expire = false, $refresh = false) {
    global $cPath, $language, $languages_id, $tree, $cPath_array, $categories_string;

    $cache_output = '';

    if (($refresh == true) || !read_cache($cache_output, 'categories_box-' . $language . '.cache' . $cPath, $auto_expire)) {
      ob_start();
      include(DIR_WS_BOXES . 'categories.php');
      $cache_output = ob_get_contents();
      ob_end_clean();
      write_cache($cache_output, 'categories_box-' . $language . '.cache' . $cPath);
    }

    return $cache_output;
  }


The 1064 error says ".....describe categories status where categories_id not in(924, 240,...."

Loking the database tables there is any column named as "category_status" or "status"

#28   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 12 January 2010 - 22:36

Sorry, but I can't see the ".....describe categories status where categories_id not in(924, 240,...." in you code snippet.

Please go through each file of your shop and find the query -> use an editor which scans all files for the word "describe".
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#29   bhbilbao

bhbilbao
  • Members
  • 307 posts
  • Real Name:BLACKHOLE
  • Gender:Male
  • Location:Spain

Posted 12 January 2010 - 22:57

editor which scans all files


ok, i will find for it tomorrow.

Thanks for your moment Prounx.

Im thinking that the problem could be "Custom Computer Creator" or "Custom Product Builder".
These contributions creates "extrange virtual" products in catalog.

#30   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 27 January 2010 - 22:58

I've received the following question via mail:

---------------------------------------------------------------
Hi here!

I would like to know how it would be possible to hide products without an assigned category.

I want to hide products from the main store but make them available to those that link directly to them.

This would be used for google advertising.

Thank you
---------------------------------------------------------------

Answer:
Yes, you can hide products without an assigned category. BUT: you must define the customer(s) who can see the products (you have to select this customres in the admin for each product)
So I'm not sure if this is the right contribution for your scenario.
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#31   zoran23

zoran23
  • Members
  • 4 posts
  • Real Name:Zoran

Posted 10 March 2010 - 20:51

You have to find the sql query which causes the error. If you copy it here into this thread I will fix it.


Hi Pronux , this contribution is just great. When I tested it I have got the same error:

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 'where categories_id not in(113, 112)' at line 1
Select count(*) as count, parent_id from categories GROUP BY parent_id where categories_id not in(113, 112)

Then I found out that I am using category_css menu contribution for STS which is causing problem . If I use category.php instead of category_css.php everything works jus fine. I wonder if there is any way to have my categery_css together with this beautiful contribution. Here is how this file looks like.

<?php
/*
$Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $

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

Copyright © 2003 osCommerce

Released under the GNU General Public License
*/
?>
<?php
// cssMenu - Begin of configuration //
$cssMenuConfig = array();
$cssMenuConfig['ShowEmptyCategories'] = true;
$cssMenuConfig['includeProducts'] = false; // Should CSSMenu show products
$cssMenuConfig['maxProductsInMenu'] = 8; // Maximum number of products to show in a menu ( stops massive menus being created )
$cssMenuConfig['moreText'] = "More...."; // Maximum number of products to show in a menu ( stops massive menus being created )
$cssMenuConfig['showSubMenu'] = true; // Show category dependent menu
// $cssMenuConfig['idSubMenu'] = array('619', '620'); // Category id for the dependent menu

// cssMenu - End of configuration //

$categories_subs = array();
$categories_start = array();

$categories_subs_query = tep_db_query("select count(*) as count, parent_id from " . TABLE_CATEGORIES . " GROUP BY parent_id");
while($row = tep_db_fetch_array($categories_subs_query)) {
$categories_subs[$row['parent_id']] = $row['count'];
}

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name");
while($row = tep_db_fetch_array($categories_query)) {
$categories_start['S_' . $row['categories_id'] . '_' . $row['parent_id'] . '_E'] = $row;
}

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

//SuckerTree Vertical Menu (Aug 4th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/

var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas

function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}

if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)

</script>
<?php


function PrintProducts( $category_id, $categories_string , $includeul, $languageID)
{
global $cssMenuConfig;

$product_path="product_info.php?cPath=".$category_id."&products_id=";
$products_query = tep_db_query("select pc.products_id, pc.categories_id from products_to_categories pc, products p where pc.categories_id = " . $category_id . " and p.products_id = pc.products_id and products_status=1 order by products_price");

$productsDisplay=mysql_num_rows( $products_query );
$addMore= false;

if ( $includeul && $productsDisplay > 0 ) {
$returnval .= "<ul>";

}

if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) {
$productsDisplay=$cssMenuConfig['maxProductsInMenu'];
$addMore= true;
}

$count_string = '';

if (SHOW_COUNTS == 'true') {
if ($totalitemsincategory > 0) {
$count_string = '&nbsp;(' . $totalitemsincategory . ')';
}
}

$i=0;
while ($i < $productsDisplay) {
$products = tep_db_fetch_array($products_query);
$product_query = tep_db_query("select products_name from products_description where products_id = " . $products['products_id'] . " AND language_id = ".$languageID );
$product = tep_db_fetch_array($product_query);
$returnval .= "<li><a href='".$product_path.$products['products_id']."'>".$product['products_name']."</a></li>\n";
$i++;
}

if ( $addMore ) {
$returnval .= "<li><a href='".$categories_string."'>".$cssMenuConfig['moreText']."</a></li>\n";
}

if ( $productsDisplay > 0 || !$includeul ) {
$returnval .= "</ul>";
}

return $returnval;
}

function PrintSubMenus( $parentID, $languageID, $start_path ){

global $cssMenuConfig, $categories_subs, $categories_start;

$returnval = '';
if (($start_path == '') && ($parentID > 0)) {
$start_path = $parentID;
} else {
if ($parentID > 0) $start_path .= "_" . $parentID;
}
if ($parentID != 0) {
$returnval .= "<ul>";
} else {
$returnval .= "<div class='suckerdiv'>";
$returnval .= "<ul id='suckertree1'>";
}
// $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name");
$cat_subs = array();
foreach($categories_start as $key => $value) {
if(strstr($key, '_' . $parentID . '_E')) {
$cat_subs[$parentID][] = substr($key, 2, strpos($key, "_", 2) - 2);
}
}

// if (!isset($_GET['cPath'])) {

foreach ($cat_subs[$parentID] as $v) { //$categories = tep_db_fetch_array($categories_query)
$categories = $categories_start['S_' . $v . '_' . $parentID . '_E'];

if ($start_path == "") {
$grouppath = $categories['categories_id'];
} else {
$grouppath = $start_path . "_" . $categories['categories_id'];
}
$cPath_new = 'cPath=' . $grouppath;
$categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new);
$totalitemsincategory = tep_count_products_in_category($categories['categories_id']);

$count_string = '';

if ((SHOW_COUNTS == 'true') && ($totalitemsincategory > 0) ){
$count_string = '&nbsp;(' . $totalitemsincategory . ')';
}

if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) {
$returnval .= "<li><a href='".$categories_string."'>".$categories['categories_name'].$count_string."</a>\n";
}

if (array_key_exists($categories['categories_id'], $categories_subs)) { //tep_has_category_subcategories($categories['categories_id'])
$returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path );
if ( $cssMenuConfig['includeProducts'] ) {
$returnval .= PrintProducts($categories['categories_id'],$categories_string, false, $languageID);
}
} else {
if ( $cssMenuConfig['includeProducts'] ) {
$returnval .= PrintProducts($categories['categories_id'],$categories_string, true, $languageID);
}
}
if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) {
$returnval .= "</li>";
}
}
// }
if ( !$cssMenuConfig['includeProducts'] ) {
$returnval .= "</ul>";
}
if ($parentID == 0) $returnval .= "</div>";
return $returnval;
}

function cssMenu_ShowCategory( $switch, $products) {
if ( $switch == 1 ) {
return true;
} else {
if ($products > 0) {
return true;
} else {
return false;
}
}
}
?>
<!-- categories //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);

new infoBoxHeading($info_box_contents, true, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => PrintSubMenus( 0, $languages_id, '' ));


new infoBox($info_box_contents);

?>
</td>
</tr>
<!-- MenuConfigategories_eof //-->

#32   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 13 April 2010 - 01:06

Hi Zoran

I have made a small update on SHP which should solve your described problem: Download SHP 1.4

hope it helps
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#33   fernyburn

fernyburn
  • Members
  • 139 posts
  • Real Name:Ronnie

Posted 13 April 2010 - 20:26

Hi
Just started to implement this contribution - just wondering - is there another way to search for the customers like a text box to write there surname in, instead of the drop down menu.

I have about 10000 customers in my database, so scrolling through all the b ' s to get to a name is a bit of a chore !!

thanks

#34   fernyburn

fernyburn
  • Members
  • 139 posts
  • Real Name:Ronnie

Posted 13 April 2010 - 21:09

I am also receiving the error

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 'where categories_id not in(36, 36)' at line 1

describe categories status where categories_id not in(36, 36)

not sure what it corresponds to but it only appears in my /shop/index.php page

help ?

Edited by fernyburn, 13 April 2010 - 21:10.


#35   fernyburn

fernyburn
  • Members
  • 139 posts
  • Real Name:Ronnie

Posted 13 April 2010 - 21:39

ok ....

have whittered it down to this piece of code in database.php

//START SHP
if(stristr($query, ' '.TABLE_PRODUCTS.' ') && !strstr($query, ' shp.products_id ') && isset($_SESSION['hidden_products']))
{
if(strlen($_SESSION['hidden_products']) > 1)
{
$prefix = "";
if(stristr($query, " ".TABLE_PRODUCTS." p"))
{
$prefix = "p.";
}

$shp = " where ".$prefix."products_id not in(".mysql_real_escape_string($_SESSION['hidden_products']).")";

if(stristr($query, " where "))
{
$query = str_ireplace(" where ", $shp." and ", $query);
}
else
{
$query .= $shp;
}
}
}

if(stristr($query, ' '.TABLE_CATEGORIES.' ') && !strstr($query, ' shp.categories_id ') && isset($_SESSION['hidden_categories']))
{
if(strlen($_SESSION['hidden_categories']) > 1)
{
$prefix = "";
if(stristr($query, " ".TABLE_CATEGORIES." c"))
{
$prefix = "c.";
}

$shp = " where ".$prefix."categories_id not in(".mysql_real_escape_string($_SESSION['hidden_categories']).")";

if(stristr($query, " where "))
{
$query = str_ireplace(" where ", $shp." and ", $query);
}
else
{
$query .= $shp;
}
}
}
//END SHP


this is what is causing the database error

#36   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 14 April 2010 - 15:16

hi fernyburn

Can you post the complete query which fails please (you can do this by placing echo $query; at database.php before //START SHP

Just started to implement this contribution - just wondering - is there another way to search for the customers like a text box to write there surname in, instead of the drop down menu.

I have about 10000 customers in my database, so scrolling through all the b ' s to get to a name is a bit of a chore !!


I know, but we have no time at the moment, sorry.
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#37   fernyburn

fernyburn
  • Members
  • 139 posts
  • Real Name:Ronnie

Posted 14 April 2010 - 16:28

hi fernyburn

Can you post the complete query which fails please (you can do this by placing echo $query; at database.php before //START SHP

ok

on database.php

I have showing at the very top of the page (up before the header)

select configuration_key as cfgKey, configuration_value as cfgValue from configurationselect value from sessions where sesskey = 'a1487fd9968d54d2919d4ca98e768278' and expiry > '1271262053'
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/****/public_html/shop/includes/functions/database.php:43) in /home/****/public_html/shop/includes/functions/sessions.php on line 102
select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currenciesSELECT unixtime FROM hidden_products WHERE unixtime > 1271259570delete from whos_online where time_last_click < '1271261153'select count(*) as count from whos_online where session_id = 'a1487fd9968d54d2919d4ca98e768278'insert into whos_online (customer_id, full_name, session_id, ip_address, hostname, time_entry, time_last_click, last_page_url, http_referer, user_agent) values ('0', 'Guest', 'a1487fd9968d54d2919d4ca98e768278', '79.64.167.75', '79-64-167-75.dynamic.dsl.as9105.com', '1271262053', '1271262053', '/shop/', 'http://www.****.co.uk/shop/' 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)')select banners_id, date_scheduled from banners where date_scheduled != ''select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from banners b, banners_history bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_idselect specials_id from specials where status = '1' and now() >= expires_date and expires_date > 0


and then actually on the index page

describe categories status1064 - 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 'where categories_id not in(39, 38, 21)' at line 1

describe categories status where categories_id not in(39, 38, 21)

[TEP STOP]

select count(*) as total from sessions where sesskey = 'a1487fd9968d54d2919d4ca98e768278'update sessions set expiry = '1271276453', value = 'cart|O:12:\"shoppingCart\":7:{s:8:\"contents\";a:1:{i:65;a:1:{s:3:\"qty\";i:1;}}s:5:\"total\";d:40;s:6:\"weight\";d:2000;s:6:\"cartID\";s:5:\"95721\";s:12:\"content_type\";s:8:\"physical\";s:13:\"total_virtual\";d:40;s:14:\"weight_virtual\";d:979976;}language|s:7:\"english\";languages_id|s:1:\"1\";currency|s:3:\"GBP\";navigation|O:17:\"navigationHistory\":2:{s:4:\"path\";a:1:{i:0;a:4:{s:4:\"page\";s:9:\"index.php\";s:4:\"mode\";s:6:\"NONSSL\";s:3:\"get\";a:0:{}s:4:\"post\";a:0:{}}}s:8:\"snapshot\";a:4:{s:4:\"page\";s:11:\"account.php\";s:4:\"mode\";s:6:\"NONSSL\";s:3:\"get\";a:0:{}s:4:\"post\";a:0:{}}}hidden_products|s:62:\"28, 29, 39, 42, 47, 91, 74, 75, 76, 77, 83, 84, 87, 88, 89, 94\";hidden_categories|s:10:\"39, 38, 21\";hidden_products_timestamp|i:1271262153;referral_id|s:0:\"\";cartID|R:7;onepage|a:6:{s:4:\"info\";a:4:{s:14:\"payment_method\";s:0:\"\";s:15:\"shipping_method\";s:0:\"\";s:8:\"comments\";s:0:\"\";s:6:\"coupon\";s:0:\"\";}s:8:\"customer\";a:16:{s:9:\"firstname\";N;s:8:\"lastname\";N;s:7:\"company\";N;s:14:\"street_address\";N;s:6:\"suburb\";N;s:4:\"city\";N;s:8:\"postcode\";N;s:5:\"state\";N;s:7:\"zone_id\";N;s:7:\"country\";a:4:{s:2:\"id\";N;s:5:\"title\";N;s:10:\"iso_code_2\";N;s:10:\"iso_code_3\";N;}s:9:\"format_id\";N;s:9:\"telephone\";s:0:\"\";s:13:\"email_address\";s:0:\"\";s:8:\"password\";s:0:\"\";s:10:\"newsletter\";s:0:\"\";s:10:\"country_id\";N;}s:8:\"delivery\";a:12:{s:9:\"firstname\";N;s:8:\"lastname\";N;s:7:\"company\";N;s:14:\"street_address\";N;s:6:\"suburb\";N;s:4:\"city\";N;s:8:\"postcode\";N;s:5:\"state\";N;s:7:\"zone_id\";N;s:7:\"country\";a:4:{s:2:\"id\";N;s:5:\"title\";N;s:10:\"iso_code_2\";N;s:10:\"iso_code_3\";N;}s:10:\"country_id\";N;s:9:\"format_id\";N;}s:7:\"billing\";a:12:{s:9:\"firstname\";N;s:8:\"lastname\";N;s:7:\"company\";N;s:14:\"street_address\";N;s:6:\"suburb\";N;s:4:\"city\";N;s:8:\"postcode\";N;s:5:\"state\";N;s:7:\"zone_id\";N;s:7:\"country\";a:4:{s:2:\"id\";N;s:5:\"title\";N;s:10:\"iso_code_2\";N;s:10:\"iso_code_3\";N;}s:10:\"country_id\";N;s:9:\"format_id\";N;}s:14:\"create_account\";b:0;s:15:\"shippingEnabled\";b:1;}payment|b:0;billto|N;sendto|N;' where sesskey = 'a1487fd9968d54d2919d4ca98e768278'


Any clues ?

#38   fernyburn

fernyburn
  • Members
  • 139 posts
  • Real Name:Ronnie

Posted 14 April 2010 - 19:00

hI
Can any one help with the below error

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 'where categories_id not in(36, 36)' at line 1

describe categories status where categories_id not in(36, 36)


I have done the split results code changes - but it doesn't make any difference.
I have installed the Simply hide products contribution this is what gives the error .... but it only shows on /shop/index.php - the error doesnt show on any other page.

Any help pleeeeeze

#39   Pronux

Pronux
  • Members
  • 98 posts
  • Real Name:Pronux
  • Gender:Male
  • Location:Switzerland

Posted 15 April 2010 - 00:57

hey fernyburn,

go into the file catalog/includes/functions/database.php and REPLACE:

if(stristr($query, " where "))

WITH:

if(substr($query, 0, 8) == 'describe')
{
    //do not modify query
}
else if(stristr($query, " where "))

(2 times: near line 53 and near line 93)

does it help ?
Specialist in end-to-end integration between osCommerce and Microsoft Dynamics NAV ERP System
About Pronux | Pronux Contributions and Add-Ons

#40   fernyburn

fernyburn
  • Members
  • 139 posts
  • Real Name:Ronnie

Posted 15 April 2010 - 09:21

hey fernyburn,

go into the file catalog/includes/functions/database.php and REPLACE:

if(stristr($query, " where "))

WITH:

if(substr($query, 0, 8) == 'describe')
{
    //do not modify query
}
else if(stristr($query, " where "))

(2 times: near line 53 and near line 93)

does it help ?