Page 8 of 27 FirstFirst ... 67891018 ... LastLast
Results 71 to 80 of 270
  1. #71

    Default Re: Ocean Front Template Support Thread

    Clyde, I have added the Personalized My Account Link to the header and it works when someone is logged in, but when one is not logged in, there is a extra tab. I have posted the code below...what do I need to modify to correct this? Thanks! www.babygiftbasketstores.com is the site :)

    [SCR]
    PHP Code:
    <?php
    /**
     * Common Template - tpl_header.php
     *
     * this file can be copied to /templates/your_template_dir/pagename<br />
     * example: to override the privacy page<br />
     * make a directory /templates/my_template/privacy<br />
     * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
     * to override the global settings and turn off the footer un-comment the following line:<br />
     * <br />
     * $flag_disable_header = true;<br />
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
     */
    ?>

    <?php
      
    // Display all header alerts via messageStack:
      
    if ($messageStack->size('header') > 0) {
        echo 
    $messageStack->output('header');
      }
      if (isset(
    $_GET['error_message']) && zen_not_null($_GET['error_message'])) {
      echo 
    htmlspecialchars(urldecode($_GET['error_message']));
      }
      if (isset(
    $_GET['info_message']) && zen_not_null($_GET['info_message'])) {
       echo 
    htmlspecialchars($_GET['info_message']);
    } else {

    }
    ?>


    <!--bof-header logo and navigation display-->
    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>

    <div id="headerWrapper">
    <!--bof-branding display-->
    <div id="logoWrapper">
    <div id="navMainSearch"><?php require(DIR_WS_MODULES 'sideboxes/search_header.php'); ?></div>
        <div id="logo"><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">' zen_image($template->get_template_dir(HEADER_LOGO_IMAGEDIR_WS_TEMPLATE$current_page_base,'images'). '/' HEADER_LOGO_IMAGEHEADER_ALT_TEXT) . '</a>'?></div>
    <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2))) { ?>
        <div id="taglineWrapper">
    <?php
                  
    if (HEADER_SALES_TEXT != '') {
    ?>
          <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
    <?php
                  
    }
    ?>
    <?php
                  
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2)) {
                    if (
    $banner->RecordCount() > 0) {
    ?>
          <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static'$banner);?></div>
    <?php
                    
    }
                  }
    ?>

        </div>
    <?php // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
    </div>
    <br class="clearBoth" />
    <!--eof-branding display-->

    <!--bof-navigation display-->
    <div id="navMainWrapper">
    <div id="navMain">
        <ul class="back">
        <li><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?></a></li>
    <?php if ($_SESSION['customer_id']) { ?>
        <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF'''SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF?></a></li>
    <?php
          
    } else {
            if (
    STORE_STATUS == '0') {
    ?>
        <li><a href="<?php echo zen_href_link(FILENAME_LOGIN'''SSL'); ?>"><?php echo HEADER_TITLE_LOGIN?></a></li>
    <?php } } ?>
    </ul>
    <ul class="forward">
    <li class="contact"><a href="<?php echo zen_href_link(FILENAME_CONTACT_US'''SSL'); ?>"><?php echo BOX_INFORMATION_CONTACT?></a></li>
        <li><?php if (SHOW_CUSTOMER_GREETING == '1') { ?><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a><?php ?></li>
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT?></a></li>
    <?php }?>
        <li class="viewCart"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART'''NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS?></a></li>
    </ul>

    </div>
    <!--<div id="navMainSearch"><?php // require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>-->
    <br class="clearBoth" />
    </div>
    <!--eof-navigation display-->


    <!--eof-header logo and navigation display-->

    <!--bof-optional categories tabs navigation display-->
    <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
    <!--eof-optional categories tabs navigation display-->

    <!--bof-header ezpage links-->
    <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE$_SERVER['REMOTE_ADDR'])))) { ?>
    <?php 
    require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE$current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
    <?php 
    ?>
    <!--eof-header ezpage links-->
    </div>
    <?php ?>
    [/SCR]

  2. #72
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by Doodlebuckets View Post
    Clyde, I have added the Personalized My Account Link to the header and it works when someone is logged in, but when one is not logged in, there is a extra tab. I have posted the code below...what do I need to modify to correct this? Thanks! www.babygiftbasketstores.com is the site :)
    Looks like a mis-placed li tag

    Code:
    <ul class="forward">
    <li class="contact"><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>"><?php echo BOX_INFORMATION_CONTACT; ?></a></li>
        <li><?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a><?php } ?></li>
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
    <?php }?>
        <li class="viewCart"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    </ul>
    delete the bolded highlighted tag and insert the lighter highlighted tag.

    I think that should correct the problem.

  3. #73
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by clydejones View Post
    Looks like a mis-placed li tag

    Code:
    <ul class="forward">
    <li class="contact"><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>"><?php echo BOX_INFORMATION_CONTACT; ?></a></li>
        <li><?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a><?php } ?></li>
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
    <?php }?>
        <li class="viewCart"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    </ul>
    delete the bolded highlighted tag and insert the lighter highlighted tag.

    I think that should correct the problem.
    Actually scratch this recomendation and try the following:

    replace this entire section:

    Code:
        <li><?php if (SHOW_CUSTOMER_GREETING == '1') { ?><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a><?php } ?></li>
    with the following:

    Code:
        <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a></li><?php } ?>

  4. #74

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by clydejones View Post
    Actually scratch this recomendation and try the following:

    replace this entire section:

    Code:
        <li><?php if (SHOW_CUSTOMER_GREETING == '1') { ?><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a><?php } ?></li>
    with the following:

    Code:
        <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a></li><?php } ?>
    I'm afraid the extra tab is still there...

  5. #75
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by Doodlebuckets View Post
    I'm afraid the extra tab is still there...
    Have you cleared your browser cache?

    I just checked the site and didn't see the extra tab.

  6. #76

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by clydejones View Post
    Have you cleared your browser cache?

    I just checked the site and didn't see the extra tab.
    That's because I was messing around, trying to fix it and broke the whole site! So I put the original tpl_header.php file back. I have put it as it was when I did the code change you suggested and you can see the extra tab is still there...

  7. #77
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by clydejones View Post
    Have you cleared your browser cache?

    I just checked the site and didn't see the extra tab.
    Amy can you post the code for this function

    zen_customer_store_account()

  8. #78

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by clydejones View Post
    Amy can you post the code for this function

    zen_customer_store_account()
    Here it is:

    [scr]
    PHP Code:
    <?php
    /**
     * functions_customers
     *
     * @package functions
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: functions_customers.php 4793 2006-10-20 05:25:20Z ajeh $
     */

    ////
    // Returns the address_format_id for the given country
    // TABLES: countries;
      
    function zen_get_address_format_id($country_id) {
        global 
    $db;
        
    $address_format_query "select address_format_id as format_id
                                 from " 
    TABLE_COUNTRIES "
                                 where countries_id = '" 
    . (int)$country_id "'";

        
    $address_format $db->Execute($address_format_query);

        if (
    $address_format->RecordCount() > 0) {
          return 
    $address_format->fields['format_id'];
        } else {
          return 
    '1';
        }
      }

    ////
    // Return a formatted address
    // TABLES: address_format
      
    function zen_address_format($address_format_id$address$html$boln$eoln) {
        global 
    $db;
        
    $address_format_query "select address_format as format
                                 from " 
    TABLE_ADDRESS_FORMAT "
                                 where address_format_id = '" 
    . (int)$address_format_id "'";

        
    $address_format $db->Execute($address_format_query);
        
    $company zen_output_string_protected($address['company']);
        if (isset(
    $address['firstname']) && zen_not_null($address['firstname'])) {
          
    $firstname zen_output_string_protected($address['firstname']);
          
    $lastname zen_output_string_protected($address['lastname']);
        } elseif (isset(
    $address['name']) && zen_not_null($address['name'])) {
          
    $firstname zen_output_string_protected($address['name']);
          
    $lastname '';
        } else {
          
    $firstname '';
          
    $lastname '';
        }
        
    $street zen_output_string_protected($address['street_address']);
        
    $suburb zen_output_string_protected($address['suburb']);
        
    $city zen_output_string_protected($address['city']);
        
    $state zen_output_string_protected($address['state']);
        if (isset(
    $address['country_id']) && zen_not_null($address['country_id'])) {
          
    $country zen_get_country_name($address['country_id']);

          if (isset(
    $address['zone_id']) && zen_not_null($address['zone_id'])) {
            
    $state zen_get_zone_code($address['country_id'], $address['zone_id'], $state);
          }
        } elseif (isset(
    $address['country']) && zen_not_null($address['country'])) {
          if (
    is_array($address['country'])) {
            
    $country zen_output_string_protected($address['country']['countries_name']);
          } else {
          
    $country zen_output_string_protected($address['country']);
          }
        } else {
          
    $country '';
        }
        
    $postcode zen_output_string_protected($address['postcode']);
        
    $zip $postcode;

        if (
    $html) {
    // HTML Mode
          
    $HR '<hr />';
          
    $hr '<hr />';
          if ( (
    $boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
            
    $CR '<br />';
            
    $cr '<br />';
            
    $eoln $cr;
          } else { 
    // Use values supplied
            
    $CR $eoln $boln;
            
    $cr $CR;
          }
        } else {
    // Text Mode
          
    $CR $eoln;
          
    $cr $CR;
          
    $HR '----------------------------------------';
          
    $hr '----------------------------------------';
        }

        
    $statecomma '';
        
    $streets $street;
        if (
    $suburb != ''$streets $street $cr $suburb;
        if (
    $country == '') {
          if (
    is_array($address['country'])) {
            
    $country zen_output_string_protected($address['country']['countries_name']);
          } else {
          
    $country zen_output_string_protected($address['country']);
          }
        }
        if (
    $state != ''$statecomma $state ', ';

        
    $fmt $address_format->fields['format'];
        eval(
    "\$address_out = \"$fmt\";");

        if ( (
    ACCOUNT_COMPANY == 'true') && (zen_not_null($company)) ) {
          
    $address_out $company $cr $address_out;
        }

        return 
    $address_out;
      }

    ////
    // Return a formatted address
    // TABLES: customers, address_book
      
    function zen_address_label($customers_id$address_id 1$html false$boln ''$eoln "\n") {
        global 
    $db;
        
    $address_query "select entry_firstname as firstname, entry_lastname as lastname,
                                 entry_company as company, entry_street_address as street_address,
                                 entry_suburb as suburb, entry_city as city, entry_postcode as postcode,
                                 entry_state as state, entry_zone_id as zone_id,
                                 entry_country_id as country_id
                          from " 
    TABLE_ADDRESS_BOOK "
                          where customers_id = '" 
    . (int)$customers_id "'
                          and address_book_id = '" 
    . (int)$address_id "'";

        
    $address $db->Execute($address_query);

        
    $format_id zen_get_address_format_id($address->fields['country_id']);
        return 
    zen_address_format($format_id$address->fields$html$boln$eoln);
      }

    ////
    // Return a customer greeting
      
    function zen_customer_greeting() {

        if (isset(
    $_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
          
    $greeting_string sprintf(TEXT_GREETING_PERSONALzen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_PRODUCTS_NEW));
        } else {
          
    $greeting_string sprintf(TEXT_GREETING_GUESTzen_href_link(FILENAME_LOGIN'''SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT'''SSL'));
        }

        return 
    $greeting_string;
      }
    /// bof Personalized My Account Link by bigjoed
      
    function zen_customer_store_account() {

        if (isset(
    $_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
          
    $store_account_string sprintf(TEXT_STORE_ACCOUNT_PERSONALzen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_ACCOUNT));
        } else {
          
    $store_account_string sprintf(TEXT_STORE_ACCOUNT_GUESTzen_href_link(FILENAME_LOGIN'''SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT'''SSL'));
        }

        return 
    $store_account_string;
      }  
    /// eof Personalized My Account Link by bigjoed
      
    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;
          }
        }

        
    $orders_check_query "select count(*) as total
                               from " 
    TABLE_ORDERS "
                               where customers_id = '" 
    . (int)$id "'";

        
    $orders_check $db->Execute($orders_check_query);

        return 
    $orders_check->fields['total'];
      }

      function 
    zen_count_customer_address_book_entries($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;
          }
        }

        
    $addresses_query "select count(*) as total
                            from " 
    TABLE_ADDRESS_BOOK "
                            where customers_id = '" 
    . (int)$id "'";

        
    $addresses $db->Execute($addresses_query);

        return 
    $addresses->fields['total'];
      }

    ////
    // validate customer matches session
      
    function zen_get_customer_validate_session($customer_id) {
        global 
    $db$messageStack;
        
    $zc_check_customer $db->Execute("SELECT customers_id from " TABLE_CUSTOMERS " WHERE customers_id=" . (int)$customer_id);
        if (
    $zc_check_customer->RecordCount() <= 0) {
          
    $db->Execute("DELETE from " TABLE_CUSTOMERS_BASKET " WHERE customers_id= " $customer_id);
          
    $db->Execute("DELETE from " TABLE_CUSTOMERS_BASKET_ATTRIBUTES " WHERE customers_id= " $customer_id);
          unset(
    $_SESSION['customer_id']);
          
    $messageStack->add_session('header'ERROR_CUSTOMERS_ID_INVALID'error');
          return 
    false;
        }
        return 
    true;
      }
    ?>
    [/scr]

  9. #79
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by Doodlebuckets View Post
    Here it is:

    [scr]
    PHP Code:
    <?php
    /**
     * functions_customers
     *
     * @package functions
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: functions_customers.php 4793 2006-10-20 05:25:20Z ajeh $
     */

    ////
    // Returns the address_format_id for the given country
    // TABLES: countries;
      
    function zen_get_address_format_id($country_id) {
        global 
    $db;
        
    $address_format_query "select address_format_id as format_id
                                 from " 
    TABLE_COUNTRIES "
                                 where countries_id = '" 
    . (int)$country_id "'";

        
    $address_format $db->Execute($address_format_query);

        if (
    $address_format->RecordCount() > 0) {
          return 
    $address_format->fields['format_id'];
        } else {
          return 
    '1';
        }
      }

    ////
    // Return a formatted address
    // TABLES: address_format
      
    function zen_address_format($address_format_id$address$html$boln$eoln) {
        global 
    $db;
        
    $address_format_query "select address_format as format
                                 from " 
    TABLE_ADDRESS_FORMAT "
                                 where address_format_id = '" 
    . (int)$address_format_id "'";

        
    $address_format $db->Execute($address_format_query);
        
    $company zen_output_string_protected($address['company']);
        if (isset(
    $address['firstname']) && zen_not_null($address['firstname'])) {
          
    $firstname zen_output_string_protected($address['firstname']);
          
    $lastname zen_output_string_protected($address['lastname']);
        } elseif (isset(
    $address['name']) && zen_not_null($address['name'])) {
          
    $firstname zen_output_string_protected($address['name']);
          
    $lastname '';
        } else {
          
    $firstname '';
          
    $lastname '';
        }
        
    $street zen_output_string_protected($address['street_address']);
        
    $suburb zen_output_string_protected($address['suburb']);
        
    $city zen_output_string_protected($address['city']);
        
    $state zen_output_string_protected($address['state']);
        if (isset(
    $address['country_id']) && zen_not_null($address['country_id'])) {
          
    $country zen_get_country_name($address['country_id']);

          if (isset(
    $address['zone_id']) && zen_not_null($address['zone_id'])) {
            
    $state zen_get_zone_code($address['country_id'], $address['zone_id'], $state);
          }
        } elseif (isset(
    $address['country']) && zen_not_null($address['country'])) {
          if (
    is_array($address['country'])) {
            
    $country zen_output_string_protected($address['country']['countries_name']);
          } else {
          
    $country zen_output_string_protected($address['country']);
          }
        } else {
          
    $country '';
        }
        
    $postcode zen_output_string_protected($address['postcode']);
        
    $zip $postcode;

        if (
    $html) {
    // HTML Mode
          
    $HR '<hr />';
          
    $hr '<hr />';
          if ( (
    $boln == '') && ($eoln == "\n") ) { // Values not specified, use rational defaults
            
    $CR '<br />';
            
    $cr '<br />';
            
    $eoln $cr;
          } else { 
    // Use values supplied
            
    $CR $eoln $boln;
            
    $cr $CR;
          }
        } else {
    // Text Mode
          
    $CR $eoln;
          
    $cr $CR;
          
    $HR '----------------------------------------';
          
    $hr '----------------------------------------';
        }

        
    $statecomma '';
        
    $streets $street;
        if (
    $suburb != ''$streets $street $cr $suburb;
        if (
    $country == '') {
          if (
    is_array($address['country'])) {
            
    $country zen_output_string_protected($address['country']['countries_name']);
          } else {
          
    $country zen_output_string_protected($address['country']);
          }
        }
        if (
    $state != ''$statecomma $state ', ';

        
    $fmt $address_format->fields['format'];
        eval(
    "\$address_out = \"$fmt\";");

        if ( (
    ACCOUNT_COMPANY == 'true') && (zen_not_null($company)) ) {
          
    $address_out $company $cr $address_out;
        }

        return 
    $address_out;
      }

    ////
    // Return a formatted address
    // TABLES: customers, address_book
      
    function zen_address_label($customers_id$address_id 1$html false$boln ''$eoln "\n") {
        global 
    $db;
        
    $address_query "select entry_firstname as firstname, entry_lastname as lastname,
                                 entry_company as company, entry_street_address as street_address,
                                 entry_suburb as suburb, entry_city as city, entry_postcode as postcode,
                                 entry_state as state, entry_zone_id as zone_id,
                                 entry_country_id as country_id
                          from " 
    TABLE_ADDRESS_BOOK "
                          where customers_id = '" 
    . (int)$customers_id "'
                          and address_book_id = '" 
    . (int)$address_id "'";

        
    $address $db->Execute($address_query);

        
    $format_id zen_get_address_format_id($address->fields['country_id']);
        return 
    zen_address_format($format_id$address->fields$html$boln$eoln);
      }

    ////
    // Return a customer greeting
      
    function zen_customer_greeting() {

        if (isset(
    $_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
          
    $greeting_string sprintf(TEXT_GREETING_PERSONALzen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_PRODUCTS_NEW));
        } else {
          
    $greeting_string sprintf(TEXT_GREETING_GUESTzen_href_link(FILENAME_LOGIN'''SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT'''SSL'));
        }

        return 
    $greeting_string;
      }
    /// bof Personalized My Account Link by bigjoed
      
    function zen_customer_store_account() {

        if (isset(
    $_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
          
    $store_account_string sprintf(TEXT_STORE_ACCOUNT_PERSONALzen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_ACCOUNT));
        } else {
          
    $store_account_string sprintf(TEXT_STORE_ACCOUNT_GUESTzen_href_link(FILENAME_LOGIN'''SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT'''SSL'));
        }

        return 
    $store_account_string;
      }  
    /// eof Personalized My Account Link by bigjoed
      
    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;
          }
        }

        
    $orders_check_query "select count(*) as total
                               from " 
    TABLE_ORDERS "
                               where customers_id = '" 
    . (int)$id "'";

        
    $orders_check $db->Execute($orders_check_query);

        return 
    $orders_check->fields['total'];
      }

      function 
    zen_count_customer_address_book_entries($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;
          }
        }

        
    $addresses_query "select count(*) as total
                            from " 
    TABLE_ADDRESS_BOOK "
                            where customers_id = '" 
    . (int)$id "'";

        
    $addresses $db->Execute($addresses_query);

        return 
    $addresses->fields['total'];
      }

    ////
    // validate customer matches session
      
    function zen_get_customer_validate_session($customer_id) {
        global 
    $db$messageStack;
        
    $zc_check_customer $db->Execute("SELECT customers_id from " TABLE_CUSTOMERS " WHERE customers_id=" . (int)$customer_id);
        if (
    $zc_check_customer->RecordCount() <= 0) {
          
    $db->Execute("DELETE from " TABLE_CUSTOMERS_BASKET " WHERE customers_id= " $customer_id);
          
    $db->Execute("DELETE from " TABLE_CUSTOMERS_BASKET_ATTRIBUTES " WHERE customers_id= " $customer_id);
          unset(
    $_SESSION['customer_id']);
          
    $messageStack->add_session('header'ERROR_CUSTOMERS_ID_INVALID'error');
          return 
    false;
        }
        return 
    true;
      }
    ?>
    [/scr]
    AH, HAH -

    This is what you have in the navbar:
    <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a></li><?php } ?>

    This is the function:

    /// bof Personalized My Account Link by bigjoed
    function zen_customer_store_account() {

    if (isset($_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
    $store_account_string = sprintf(TEXT_STORE_ACCOUNT_PERSONAL, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_ACCOUNT));
    } else {
    $store_account_string = sprintf(TEXT_STORE_ACCOUNT_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
    }

    return $store_account_string;
    }
    /// eof Personalized My Account Link by bigjoed

    You're actually calling the link twice in the navbar and that's why you get the double tab.

    Try replacing this:

    Code:
     <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a></li><?php } ?>
    with just this:

    Code:
     <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_customer_store_account(); ?></a></li><?php } ?>

  10. #80

    Default Re: Ocean Front Template Support Thread

    Quote Originally Posted by clydejones View Post
    AH, HAH -

    This is what you have in the navbar:
    <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a></li><?php } ?>

    This is the function:

    /// bof Personalized My Account Link by bigjoed
    function zen_customer_store_account() {

    if (isset($_SESSION['customer_id']) && $_SESSION['customer_first_name']) {
    $store_account_string = sprintf(TEXT_STORE_ACCOUNT_PERSONAL, zen_output_string_protected($_SESSION['customer_first_name']), zen_href_link(FILENAME_ACCOUNT));
    } else {
    $store_account_string = sprintf(TEXT_STORE_ACCOUNT_GUEST, zen_href_link(FILENAME_LOGIN, '', 'SSL'), zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
    }

    return $store_account_string;
    }
    /// eof Personalized My Account Link by bigjoed

    You're actually calling the link twice in the navbar and that's why you get the double tab.

    Try replacing this:

    Code:
     <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT); ?>"><?php echo zen_customer_store_account(); ?></a></li><?php } ?>
    with just this:

    Code:
     <?php if (SHOW_CUSTOMER_GREETING == '1') { ?><li><a href="<?php echo zen_customer_store_account(); ?></a></li><?php } ?>
    Uh Oh! Now there is no tab at all!

 

 
Page 8 of 27 FirstFirst ... 67891018 ... LastLast

Similar Threads

  1. Lavender Template Support Thread
    By kobra in forum Addon Templates
    Replies: 262
    Last Post: 13 May 2015, 01:00 AM
  2. Scuro Template Support Thread
    By brandonturpin in forum Addon Templates
    Replies: 11
    Last Post: 12 Mar 2015, 09:45 PM
  3. Rustic Template Support Thread
    By clydejones in forum Addon Templates
    Replies: 320
    Last Post: 20 May 2013, 10:47 AM
  4. Watermelon Template Support Thread
    By LissaE in forum Addon Templates
    Replies: 22
    Last Post: 14 Oct 2011, 04:03 AM
  5. strange characters displayingn using ocean front template
    By bishop999 in forum General Questions
    Replies: 1
    Last Post: 28 Jul 2008, 07:43 AM

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