Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

LoginboxV5.4 With Simple Templet System


Recommended Posts

Thanks for the reply Dennis,


I have set the variable below:


sts_user_code.php Code


$sts_block_name = 'header';


require(DIR_WS_INCLUDES . 'header.php');


$template['header'] = strip_unwanted_tags($sts_block['header'], 'header');



and put $header at sts_template.html, But it still show nothing from the header

should I put those code in different PHP file instead of header.php??

and, how about the change for english.php file?

Please advise. Thank you so much!!



Yea, you need to make it a variable and then include it on your template.  Example $loginbox.  But you have to setup the variable.



Link to comment
Share on other sites

I think the variable "$header" is already in use... and if you added another one it would pose a problem. Is all your wanting a login box? I would make it it's own variable and call it from DIR BOXES or something. If that contribution doesn't seem to work there is another login box that will.



Link to comment
Share on other sites

Yes, I just need a login box at either left column or header,

Does there has any other support by Simple Template System?

Thanks again





I think the variable "$header" is already in use... and if you added another one it would pose a problem.  Is all your wanting a login box?  I would make it it's own variable and call it from DIR BOXES or something.  If that contribution doesn't seem to work there is another login box that will.



Link to comment
Share on other sites

Dennis, it's me again


I tried to make it it's own file, but still don't show from the header. could you help me out... ;)


following are the files I have made the change:


Step 1. Add loginbox.php and put it in the boxes folder


<!-- // BEGIN LOGIN BOX <td align="right"> -->

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

 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
 LoginboxV5.4_header http://avzwebdesign.nl/oscommerce/

if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) 
)   {
<!-- loginbox //-->
   if (!tep_session_is_registered('customer_id')) {
<table width="310"><tr> <td>
$loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'))
         . '<table width="310" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="3" class="smallText">'
        .'<tr><td class="smallText">'
        . tep_draw_separator('pixel_trans.gif', '2', '1') 
        . '</td><td  class="smallText" colspan="3">'
         . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"') 
        .'</td></tr><tr><td class="smallText">'
        . tep_draw_separator('pixel_trans.gif', '2', '1') 
        . '</td><td class="smallText">'
        . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"')
        . '</td><td class="smallText">'
        . '<a href="'
        . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')
        . '">'
        . '</a></td></tr><tr><td class="smallText" colspan="3">'
        . tep_draw_separator('pixel_trans.gif', '5', '25')
        . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN)
          . '</form>'
        . tep_draw_separator('pixel_trans.gif', '5', '1')
        . '<a href="'
        . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')
        . '">'
        . '</a></td></tr></table>' 
$info_box_contents = array();
   $info_box_contents[] = array('align' => '',
                                'text'  => $loginboxcontent);
   new infoBox($info_box_contents);
 } 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 //-->
// WebMakers.com Added: My Account Info Box
} else {
 if (tep_session_is_registered('customer_id')) {

<!-- my_account_info //-->
 <table width="310"><tr>

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                              'text'  => '<table width="310" border="0" cellspacing="0" cellpadding="0"><tr><td class="smallText" colspan="2">'
         . tep_draw_separator('pixel_trans.gif', '2', '1')
         . '<b><center>' 
         . tep_customer_greeting() 
         .'</b></center></td></tr><tr><td class="smallText">'
         . '<tr><td class="smallText" colspan="2">'
         . tep_draw_separator('pixel_trans.gif', '2', '20')
         . '<b>' 
         .'</b></td></tr><tr><td class="smallText">'
         . tep_draw_separator('pixel_trans.gif', '2', '15') .
 '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') .'">' . LOGIN_BOX_MY_ACCOUNT . '</a><td class="smallText">' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') .'">' . LOGIN_BOX_ACCOUNT_EDIT . '</a></td></tr><tr><td class="smallText">' . tep_draw_separator('pixel_trans.gif', '2', '1') .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') .'">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><td class="smallText">' . 
                                         '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') .'">' . LOGIN_BOX_ADDRESS_BOOK . '</a></td></tr><tr><td class="smallText">'  . tep_draw_separator('pixel_trans.gif', '', '1') . 
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') .'">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><td class="smallText">' . 
                                         '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') .'">' . LOGIN_BOX_LOGOFF . '</a></td></tr></table>');
 new infoBox($info_box_contents);
<!-- my_account_info_eof //-->

} // END-IF


<!-- // END LOGIN BOX -->
   <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>  <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>  <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?>  </td>
<table border="0" width="100%" cellspacing="0" cellpadding="1">
 <tr class="headerNavigation">
   <td class="headerNavigation">  <?php echo $breadcrumb->trail(' » '); ?></td>
<!-- // BELOW CHANGE For Header LOGIN BOX -->
  <td align="right" class="headerNavigation"><a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>  |  <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a>   </td>
<!-- // </td> -->



Step 2. Add below code to sts_user_code.php

$sts_block_name = 'loginbox';
require(DIR_WS_INCLUDES . 'loginbox.php');
$template['loginbox'] = strip_unwanted_tags($sts_block['loginbox'], 'loginbox');  


Step 3. add below to sts_template.html



Step 4. add below to english.php

// Login Box & My Account in header.php 
define('BOX_LOGINBOXH_EMAIL', 'E-mail address:');
define('BOX_LOGINBOXH_PASSWORD', 'Password:');
define('BOX_LOGINBOXH_TEXT_NEW', 'new client? ');
define('BOX_LOGINBOXH_NEW', '<b><u>create an account</u></b>');
define('BOX_LOGINBOXH_FORGOT_PASSWORD', '<u>(forgotten)</u>');

define('BOX_HEADING_LOGIN_BOX_MY_ACCOUNT','My account info');
define('LOGIN_BOX_ACCOUNT_EDIT','Edit account info.');
define('LOGIN_BOX_ACCOUNT_HISTORY','Account history');
define('LOGIN_BOX_ADDRESS_BOOK','My address book');
define('LOGIN_BOX_PRODUCT_NOTIFICATIONS','Product notifications');
define('LOGIN_BOX_MY_ACCOUNT','General information');
define('LOGIN_BOX_LOGOFF','<b><u>Log off</b></u>');


What am I miss here?? Please help me :(

Thanks for your time!!





I use 5.4 and it works fine.  Just make it it's own file.  Put it in the boxes folder, and name it $loginbox. 


Mine works perfectly.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...