Thread: hideCategories

Results 1 to 10 of 487

Threaded View

  1. #11
    Join Date
    Feb 2005
    Location
    Captain Cook, Hawaii
    Posts
    179
    Plugin Contributions
    0

    Default Re: hideCategories

    Quote Originally Posted by niccol View Post
    admin/categories.php

    The most recent version of this addon still contains the line ;

    Code:
      require(DIR_WS_MODULES . 'prod_cat_header_code.php');
    I don't think recent versions (>= 1.5.6) of Zen have that file.

    Attached is a version of categories.php that is working for me at the moment. Just a hacked together version of previous code in a way that doesn't conflict. Still developing the site so I guess I may come up with other glitches.
    I am running 1.5.7c and installed the downloaded ZIP files. All worked fine and I could make an existing Category hidden. However, when I tried to create a new category I got an error at the bottom of the page saying:

    WARNING: An Error occurred, please refresh the page and try again.If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

    The error in my log is:

    PHP Fatal 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 'LIMIT 1' at line 4 :: select visibility_status
    FROM zen_hide_categories
    WHERE categories_id =
    LIMIT 1 ==> (as called by) on line 419 <== in /home/www/mysite.org/store/includes/classes/db/mysql/query_factory.php on line 170.


    Since I had downloaded the revised CATEGORIES.PHP mentioned in this post, I sent NICCOL a message and he replied with the following suggestion (which appears to have solved the problem).

    =====

    Try replacing this:

    Code:

    //Begin hideCategories code
    $sql = "select visibility_status
    FROM " . TABLE_HIDE_CATEGORIES . "
    WHERE categories_id = " . $cInfo->categories_id . "
    LIMIT 1";
    $hide_status = $db->Execute($sql);
    switch ($hide_status->fields['visibility_status']) {
    case 1:
    $hide_category_normal = false;
    $hide_category_nomenu = true;
    $hide_category_hidden = false;
    break;
    case 2:
    $hide_category_normal = false;
    $hide_category_nomenu = false;
    $hide_category_hidden = true;
    break;
    default:
    $hide_category_normal = true;
    $hide_category_nomenu = false;
    $hide_category_hidden = false;
    break;
    }

    With this:

    Code:

    if($cInfo->categories_id > 0) {
    $sql = "select visibility_status
    FROM " . TABLE_HIDE_CATEGORIES . "
    WHERE categories_id = " . $cInfo->categories_id . "
    LIMIT 1";
    $hide_status = $db->Execute($sql);
    switch ($hide_status->fields['visibility_status']) {
    case 1:
    $hide_category_normal = false;
    $hide_category_nomenu = true;
    $hide_category_hidden = false;
    break;
    case 2:
    $hide_category_normal = false;
    $hide_category_nomenu = false;
    $hide_category_hidden = true;
    break;
    default:
    $hide_category_normal = true;
    $hide_category_nomenu = false;
    $hide_category_hidden = false;
    break;
    }

    }
    Last edited by mshultise; 24 Jun 2021 at 08:16 AM.
    Aloha from Hawaii! (its a dirty job, but SOMEBODY has to live here...)

 

 

Similar Threads

  1. how to get hidecategories an dual pricing to work
    By davidweaver88 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 4 Jun 2012, 03:35 PM
  2. anyone using HideCategories in 1.3.9d??
    By redheads in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 8 Jun 2010, 06:54 AM
  3. HideCategories problem...
    By ShadowAngel in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Nov 2009, 10:17 PM
  4. hideCategories Module
    By marcusimages in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 25 Aug 2009, 06:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg