zoran23
-
Posts
5 -
Joined
-
Last visited
Posts posted by zoran23
-
-
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
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).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 = ' (' . $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 = ' (' . $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 //-->
-
I have no idea what went wrong, but I'm guessing the SQL file wasn't (properly) executed...
Go into your phpMyAdmin, and check the table "configuration_group" for the Option Types entry, and note the "configuration_group_id" number.
Then check the table "configuration", and find the Option Type values (use progress bars?, Upload File Prefix, Delete Uploads older than, upload directory and temporary directory)
These probably don't have the correct configuration_group_id... Set it to the value found in configuration_group
Lat me know if it works out.
We'll try another fix if it doesn't.
It worked out very well , but attributes disappearing when quantity is updated in shopping cart.
-
I have no idea what went wrong, but I'm guessing the SQL file wasn't (properly) executed...
Go into your phpMyAdmin, and check the table "configuration_group" for the Option Types entry, and note the "configuration_group_id" number.
Then check the table "configuration", and find the Option Type values (use progress bars?, Upload File Prefix, Delete Uploads older than, upload directory and temporary directory)
These probably don't have the correct configuration_group_id... Set it to the value found in configuration_group
Lat me know if it works out.
We'll try another fix if it doesn't.
It worked well . Thanks a lot.
-
HTTP Server: Microsoft-IIS/6.0
PHP Version:5.2.3 (Zend: 2.2.0)
Databas: MySQL 5.0.45
PHPMyAdmin 3.1.3.1
It says : Temporary Uploads folder is automatically cleaned. How old the files must be for deletion, can be set via Admin.
When i go in Admin and open Option Types ther is nothing there to be set. Title, Value, Action. Everything is emty.
Whot i did wrong ??? Help ""
Contribution is just beutiful. Great Thanks !!!
Simply Hide Products (SHP)
in General Add-Ons Support
Posted