Results 1 to 2 of 2
  1. #1
    Join Date
    May 2010
    Posts
    4
    Plugin Contributions
    0

    Default Moving Welcome Guest Text to Sidebox

    Hello,

    I am trying to move the Welcome Guest! Would you like to log yourself in? text from the main center column to a sidebox. I have a black sidebox installed and am able to get the define statements from the index.php for the Welcome Guest Text, but when it displays in the side box I get Hello %s! When logged in.

    Does anyone know how to change the %s to the actual Session Variable or get the %s to actually work? What files or text do I need to include? In my sidebox defines.php file I include the following code:

    if (STORE_STATUS == '0') {
    define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s">log yourself in</a>?');
    } else {
    define('TEXT_GREETING_GUEST', 'Welcome, please enjoy our online showcase.');
    }
    //define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>! Would you like to see our <a href="%s">newest additions</a>?');

    define('TEXT_GREETING_PERSONAL', 'Hello <span class="greetUser">%s</span>!');

    this is how I output the defined statement:

    $content .= '<p>' . TEXT_GREETING_PERSONAL . '</p>';

    ANY help you can provide would be much appreciated!!

    Thank you!
    Natalie <><

  2. #2
    Join Date
    May 2010
    Posts
    4
    Plugin Contributions
    0

    Default Re: Moving Welcome Guest Text to Sidebox

    Well I figured it out!!!

    First I installed a blank side box

    Then I edited the files to be called welcome_sidebox_
    You will have to edit inside the files to replace blank with welcome.

    I then activated the sidebox in the admin-->Tools-->Layout Boxes and made it the top entry.

    I commented out all of the div's in the sidebox files so that it would look like it was just at the top without a header.

    In the templates/CUSTOM/sideboxes/tpl_welcome_sidebox.php the following code is the only active code, everything else is commented out.
    Code:
    if (SHOW_CUSTOMER_GREETING == 1) {
    echo "<div class='greeting'>" . zen_customer_greeting() . "</div>";
    }
    The define statements are in includes/languages/english/extra_definitions/CUSTOM/welcome_sidebox_defines.php

    Code:
    if (STORE_STATUS == '0') {
      define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span><br><a href="%s">Log In</a>');
    } else {
      define('TEXT_GREETING_GUEST', 'Welcome, please enjoy our online showcase.');
    }
    
    define('TEXT_GREETING_PERSONAL', 'Welcome %s!<br><a href="%s">Log Out</a>');
    This is the code from includes/modules/sideboxes/CUSTOM/welcome_sidebox.php
    Code:
    $show_welcome_sidebox = true;
    
      if ($show_welcome_sidebox == true) {
          require($template->get_template_dir('tpl_welcome_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_welcome_sidebox.php');
    For the Log Out link to actually go to the log off page I had to edit functions_customers.php in the functions folder. I didn't want to do this because when I upgrade it will be overwritten if I don't remember but I couldn't find a way to make a custom functions file.

    Line 140 in includes/functions/functions_customers.php:
    Code:
    $greeting_string = sprintf(TEXT_GREETING_PERSONAL, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_LOGOFF));
    So now I have a very nice Welcome Guest! Log In in the sidebox or a personalized Welcome Friend! Log Off in the sidebox.

    I hope that saves someone hours of looking around I know it would have saved me!!!

 

 

Similar Threads

  1. Moving this: Welcome Guest! Would you like to log yourself in?
    By kitcorsa in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 12 Mar 2010, 11:49 PM
  2. Need help changing text size for: "Congratulations" & "Welcome Guest" on main page
    By STFlats in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 16 Apr 2007, 04:32 AM

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