Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010
    Location
    The Netherlands
    Posts
    24
    Plugin Contributions
    1

    Idea or Suggestion FAQ Manager - FAQs multiple times displayed

    LS,
    I just downloaded and installed the FAQ Manager Module. It worked directly with ZenCart 1.3.9h (except for the SQL-script which I had to change manually since my table structure isn't standard, almost nothing any module can do about this).

    I only had one problem: Every FAQ was displayed three times.
    However: We also have three languages on our site (Dutch, English and French), so this connection was quickly made.

    I changed one line in
    includes\templates\<myTemplate>\templates\tpl_faqs_all_default.php

    Line 41/42 has become:
    Code:
        $faqs_all_query_raw = "select f.*, fd.*, fcd.faq_categories_name from " . TABLE_FAQS . " f, " . TABLE_FAQS_DESCRIPTION . " fd, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " fcd, " . TABLE_FAQ_CATEGORIES . " fc " .
                "where f.faqs_status = '1' and f.faqs_id = fd.faqs_id and fd.language_id = '" . (int) $_SESSION['languages_id'] . "' and fd.language_id = fcd.language_id and f.master_faq_categories_id = fcd.faq_categories_id and f.master_faq_categories_id = fc.faq_categories_id and fc.faq_categories_status='1' ";
    adding the
    Code:
    and fd.language_id = fcd.language_id
    solved my problem.

    I've already PM-ed this to the latest uploader of this module (sunnycoolboy) but wanted to share this knowledge directly with all of you too.

    With kind regards,

    Fred Schenk

    PS: I haven't checked to see if this is the only place where the language-check should be extended.

  2. #2
    Join Date
    Sep 2010
    Location
    The Netherlands
    Posts
    24
    Plugin Contributions
    1

    Idea or Suggestion Re: FAQ Manager - FAQs multiple times displayed

    OK, just continuing working with the FAQ and found another case of the language multiplier. In another template:
    tpl_faqs_new_default.php

    I found the following at lines 62/63/64:
    Code:
      $faqs_new_query_raw = "select f.*, fd.*, fcd.faq_categories_name from " . TABLE_FAQS . " f, " . TABLE_FAQS_DESCRIPTION . " fd, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " fcd, " . TABLE_FAQ_CATEGORIES . " fc " .
                            "where f.faqs_status = '1' and f.faqs_id = fd.faqs_id and fd.language_id = '" . (int)$_SESSION['languages_id'] . "' and f.master_faq_categories_id = fcd.faq_categories_id and f.master_faq_categories_id = fc.faq_categories_id and fc.faq_categories_status='1' " .
    						$order_by;
    and changed it to:
    Code:
      $faqs_new_query_raw = "select f.*, fd.*, fcd.faq_categories_name from " . TABLE_FAQS . " f, " . TABLE_FAQS_DESCRIPTION . " fd, " . TABLE_FAQ_CATEGORIES_DESCRIPTION . " fcd, " . TABLE_FAQ_CATEGORIES . " fc " .
                            "where f.faqs_status = '1' and f.faqs_id = fd.faqs_id and fd.language_id = '" . (int)$_SESSION['languages_id'] . "' and fd.language_id = fcd.language_id and f.master_faq_categories_id = fcd.faq_categories_id and f.master_faq_categories_id = fc.faq_categories_id and fc.faq_categories_status='1' " .
    						$order_by;
    So here too, adding the
    Code:
    and fd.language_id = fcd.language_id
    solved my problem...

    With kind regards,

    Fred Schenk

  3. #3
    Join Date
    Sep 2010
    Location
    The Netherlands
    Posts
    24
    Plugin Contributions
    1

    Idea or Suggestion Re: FAQ Manager - FAQs multiple times displayed

    OK, since I didn't "trust" the code I decided to search all the php-files for
    PHP Code:
    $_SESSION['language 
    to see if some other changes had to be made. And I found one other file where I had to add the
    PHP Code:
     and fd.language_id fcd.language_id 
    code:
    \includes\templates\ScrappedLives\templates\tpl_faq_default.php (line 40)

    If I'm not mistaking, I now have found all the files/queries to make this problem disappear. Too bad the queries are all over the code and not in one place...

    With kind regards,

    Fred Schenk

 

 

Similar Threads

  1. FAQ Manager - Can't add new FAQs from Admin
    By spacerace in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 24 Jun 2010, 01:28 PM
  2. FAQ manager
    By louisapple in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 8 Apr 2009, 03:08 PM
  3. FAQ Categories / FAQs
    By Adds in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 26 Oct 2006, 11:18 AM
  4. FAQ Manager
    By ccn1 in forum General Questions
    Replies: 0
    Last Post: 9 Oct 2006, 09:26 PM

Bookmarks

Posting Permissions

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