Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need a code snippit


timmaggs

Recommended Posts

Can someone help me out and give me the code that will display Login when your not logged in and log off when you are! At the moment log-off just comes up when your logged in and there is no text when your not.

 

Is this nice and simple?

 

Thanks,

 

Tim

Link to comment
Share on other sites

Try:

 

<td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } else { ?><a href="<?php echo tep_href_link(FILENAME_LOGIN,'','SSL');?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a>  |  <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a>  |  <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>

 

on line 64 in includes/header.php

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

<?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> ?|? <?php } else { ?><a href="<?php echo tep_href_link(FILENAME_LOGIN,'','SSL');?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a>

This worked perfect,

 

I hope this helps someone else in the future.

 

Tim

Link to comment
Share on other sites

  • 1 month later...
<?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> ?|? <?php } else { ?><a href="<?php echo tep_href_link(FILENAME_LOGIN,'','SSL');?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a>

This worked perfect,

 

I hope this helps someone else in the future.

 

Tim

 

 

Hi, can somebodu tell me how the code would look with sts template ? It should go in the sts_display_output.php file.

 

Thanks:-)

Kjolebutikken

Best regards

Kjolebutikken

Link to comment
Share on other sites

Hi, can somebodu tell me how the code would look with sts template ? It should go in the sts_display_output.php file.

 

Thanks:-)

Kjolebutikken

 

Never mind, solved it:-). If anyone wonders, here is the code:

 

if (tep_session_is_registered('customer_id')) {
$template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
$template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
$template['logoff'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL')  . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';
$template['urllogoff'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');
$template['myaccountlogoff'] = $template['myaccount'] . " | " . $template['logoff'];
$template['login'] = '<a href=' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_LOGOFF . '</a>';
$template['urllogin'] = tep_href_link(FILENAME_LOGOFF, '', 'SSL');
 } else {
$template['myaccount'] = '<a href=' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
$template['urlmyaccount'] = tep_href_link(FILENAME_ACCOUNT, '', 'SSL');
$template['login'] = '<a href=' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . ' class="headerNavigation">' . HEADER_TITLE_LOGIN . '</a>';
$template['urllogin'] = tep_href_link(FILENAME_LOGIN, '', 'SSL');
$template['logoff'] = '';
$template['urllogoff'] = '';
$template['myaccountlogoff'] = $template['myaccount'];
 }

 

Best regards

Kjolebutikken:-)

Best regards

Kjolebutikken

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...