Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    40
    Plugin Contributions
    0

    Default Login and Logout

    Hi there,
    Here is a toughy for me, which hopefully someone could shed some light on.

    My site is here.

    I recently posted a question about getting my Log In greeting into the header and having it work. Here is the post.

    Now I have the 'Welcome Guest, would you like to log yourself in?', which is great.

    When I click on it and log myself in I get this, 'Hello *****! Would you like to see our newest additions?'.

    I would like to change this to 'Hello *****! When your finished you can log out here.', or something like that.

    Refer to the post to see what code I put in the header.

    I'm pretty sure this is what I have to change, located in '/popoutportraits.com/cart/includes/functions/functions_customers.php'

    Code:
    // Return a customer greeting
      function zen_customer_greeting() {
    
        if (isset($_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
          $greeting_string = sprintf(TEXT_GREETING_PERSONAL, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_PRODUCTS_NEW));
        } else {
          $greeting_string = sprintf(TEXT_GREETING_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
        }
    
        return $greeting_string;
      }
    
      function zen_count_customer_orders($id = '', $check_session = true) {
        global $db;
    
        if (is_numeric($id) == false) {
          if ($_SESSION['customer_id']) {
            $id = $_SESSION['customer_id'];
          } else {
            return 0;
          }
        }
    
        if ($check_session == true) {
          if ( ($_SESSION['customer_id'] == false) || ($id != $_SESSION['customer_id']) ) {
            return 0;
          }
        }
    Any help or suggestions would be appreciated.

    Thanks again,
    Happyworker

  2. #2
    Join Date
    Sep 2006
    Posts
    40
    Plugin Contributions
    0

    Default Re: Login and Logout

    I have now changed my site not to include the above. I found that this would take too much work in changing multiple files in PHP which I'm not all that familiar with.

    I have gone back to the login/logoff #navmain, and just moved it over with the css. This is giving me a cleaner code and a cleaner look.

    As for the 'Welcome message', well I ended up moving this back and taking out some text.

    I just wanted to give an update so that I avoid any question of 'what are you talking about, your site isn't matching what you asked'.

    I believe that the intial question is still a good one, and no doubt a hard one. It would be interesting to find out how it works....if someone is keen to work it out.

    Cheers,
    Happyworker

  3. #3
    Join Date
    Mar 2006
    Location
    Rosebud, Victoria, Australia
    Posts
    310
    Plugin Contributions
    2

    Default Re: Login and Logout

    G'day Happyworker,

    Came across your posts while looking into something similar myself.

    The text that is output is TEXT_GREETING_PERSONAL which is defined in /includes/languages/english/your-template/index.php. You would need to change this text.

    The zen_customer_greeting function in /includes/functions/functions_customer.php uses that text to output the page content.

    You would need to come up with a replacement for the part of that function which provides the link details. That is,

    Code:
    zen_href_link(FILENAME_PRODUCTS_NEW)
    Best Regards, Lloyd Borrett.
    Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

 

 

Similar Threads

  1. Login and Logout Issues
    By Youngblood in forum General Questions
    Replies: 3
    Last Post: 2 Jun 2010, 06:21 PM
  2. How to Display Login/logout and My Account?
    By johnwey in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 23 Apr 2010, 11:26 AM
  3. Login and Logout pages- WORK but BLANK
    By Naregnemyes in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 8 Jul 2009, 02:43 AM
  4. Login And Logout Issue With Ssl
    By virtue in forum General Questions
    Replies: 22
    Last Post: 6 Jun 2006, 10:21 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