Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help me make sure I am doing something right?


bad_lemming

Recommended Posts

I am trying to take advantage of the My Account info portion of the login box with account info contri. This is how I have done it so far... Will this work well, or should I go delete the login box part from loginbox.php file as well?

 

Sorry I know it is kinda kludgey, but I don't know either php or OSC well enough to be much more clean. Thanks in advance

 

if (tep_session_is_registered('customer_id'))  {

     if ((USE_CACHE == 'true') && empty($SID)) {
        echo tep_cache_categories_box();
     } else {
        include(DIR_WS_BOXES . 'categories.php');
     }

     require(DIR_WS_BOXES . 'shopping_cart.php');
     
     // BOF: WebMakers Added: Login Box My Account
     require(DIR_WS_BOXES . 'loginbox.php');
     // EOF: WebMakers Added: Login Box My Account
     
     require(DIR_WS_BOXES . 'information.php');
 
} else {
     
      if ((USE_CACHE == 'true') && empty($SID)) {
         echo tep_cache_categories_box();
       } else {
         include(DIR_WS_BOXES . 'categories.php');
       }
     // BOF: WebMakers Added: Login Box My Account
     //require(DIR_WS_BOXES . 'loginbox.php');
     // EOF: WebMakers Added: Login Box My Account
     
      require(DIR_WS_BOXES . 'shopping_cart.php');
     
      require(DIR_WS_BOXES . 'information.php');
}
?>

Link to comment
Share on other sites

I thought I would post the contents of my login_box.php while I am asking for help. I was wondering if the stuff in the first post would be sufficient, or sould i tamper with the first if statement below?

 

(i really don't want ot change too much since I am not completely sure of the ramifications of what I am doing)

 

<?php
/* 
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 IMPORTANT NOTE:

 This script is not part of the official osC distribution
 but an add-on contributed to the osC community. Please
 read the README and  INSTALL documents that are provided
 with this file for further information and installation notes.

 loginbox.php -   Version 5.4
 This puts a login request in a box with a login button.
 If already logged in, will not show anything.

 Modified to utilize SSL to bypass Security Alert
*/

// WebMakers.com Added: Do not show if on login or create account or PWA screen

if ((!strstr($_SERVER['PHP_SELF'],'login.php'))
and
(!strstr($_SERVER['PHP_SELF'],'create_account.php'))
and
(!strstr($_SERVER['PHP_SELF'],'Order_Info.php'))
and
(!strstr($_SERVER['PHP_SELF'],'Order_Info_Process.php'))
and
(!tep_session_is_registered('customer_id')))
{
?>
<!-- loginbox //-->
<?php
   if (!tep_session_is_registered('customer_id')) {
?>
         <tr>
           <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text'  => BOX_HEADING_LOGIN_BOX);

   new SideLoginBoxHeading($info_box_contents, false, false);

$loginboxcontent =
        tep_customer_greeting(); 

 $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text'  => $loginboxcontent);
   new SideLoginBox($info_box_contents);
?>
           </td>
         </tr>
<?php
 } else {
 // If you want to display anything when the user IS logged in, put it
 // in here...  Possibly a "You are logged in as :" box or something.
 }
?>
<!-- loginbox_eof //-->
<?php
// WebMakers.com Added: My Account Info Box (but not for PWA clients
} else {
 if ((tep_session_is_registered('customer_id')) && (!tep_session_is_registered('noaccount')))
 {
?>

<!-- my_account_info //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                              'text'  => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT);
 new SideAccountBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                              'text'  =>
                                         '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'SSL') . '">' . LOGIN_BOX_PRODUCTS_NEW . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>');
 new SideAccountBox($info_box_contents);
?>
           </td>
         </tr>
<!-- my_account_info_eof //-->

<?php
 }

}

?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...