Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Posts
    10
    Plugin Contributions
    0

    Default Ask A Question module

    I've got a problem with the Ask A Question module.

    If I leave in the option to check to see if a guest is allowed to post, people not logged in can post a question, but customers logged in can't. Also, if I remove the checking for that because it's not setup to use it, I can get it to redirect to the login page, but customers who are logged in still can't post a question. A blank page loads instead of the form.

    Any ideas what's wrong?

    Thanks!

  2. #2
    Join Date
    Feb 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Ask A Question module

    I fixed the problem! For those who also encounter this problem, there was an error with the sql statement that pulls the user's information. I had to edit the following file:

    includes/modules/pages/ask_a_question/header_php.php

    At the very top, I change the if statement from:

    Code:
      if (!$_SESSION['customer_id'] && (ALLOW_GUEST_TO_ASK_A_QUESTION == 'false')) {
        $_SESSION['navigation']->set_snapshot();
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
      }
    to:

    Code:
      if (!$_SESSION['customer_id'] && (ALLOW_GUEST_TO_ASK_A_QUESTION != 'true')) {
        $_SESSION['navigation']->set_snapshot();
        zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
      }
    Later down in the code I changed the first customer_id sql statement from:

    Code:
          $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
                  FROM " . TABLE_CUSTOMERS . " 
                  WHERE customers_id = :customersID";
          
          $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer');
    to:

    Code:
          $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
                  FROM " . TABLE_CUSTOMERS . " 
                  WHERE customers_id = " . (int)$_SESSION['customer_id'] . "";
    Then the next customer_id sql statement I changed from:

    Code:
      $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = :customerID";
    to:

    Code:
      $sql = "SELECT customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id 
              FROM " . TABLE_CUSTOMERS . " 
              WHERE customers_id = " . (int)$_SESSION['customer_id'] . "";
    Uploaded the file to the server and was good to go. Of course, this assumes you are using the 1.3 version of the module and with PHP 5 and MySQL 5.

    I hope that helps someone!

 

 

Similar Threads

  1. Ask a question module
    By mera in forum General Questions
    Replies: 0
    Last Post: 25 Jul 2008, 05:52 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR