Jump to content



Photo
- - - - -

add new page for register user only


This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1   scriptlover

scriptlover
  • Members
  • 39 posts

Posted 17 July 2012 - 09:46

hi
how i can add a new page to allow only for register user
also can i add a link for it in menu_header only for register user
best regards

#2   14steve14

14steve14
  • Members
  • 3,577 posts

Posted 17 July 2012 - 11:01

Have a look in your includes/header.php file. There is a section of code there that adds a 'my account' button next to the other buttons near the top of the page. You may be able to utilise something similar.

REMEMBER BACKUP, BACKUP AND BACKUP

Don't take life too seriously. no one gets out alive anyway.


#3   multimixer

multimixer

    Lemons or Melons ?

  • Partner
  • 4,627 posts

Posted 17 July 2012 - 11:30

You can take a look here for illustrated examples about how to add buttons to header, for registered, unregistered or all users

To make the new page accessible only for registered users, add to the top of the file

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }

Just after

  require('includes/application_top.php');

Example you can see eg at checkout_shipping.php

#4   scriptlover

scriptlover
  • Members
  • 39 posts

Posted 17 July 2012 - 12:17

hi
this my header code
<?php
/*
  $Id$
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  Released under the GNU General Public License
*/
  if ($messageStack->size('header') > 0) {
    echo '<div class="grid_24">' . $messageStack->output('header') . '</div>';
  }
?>
<?php
		    if ($oscTemplate->hasBlocks('boxes_header')) {
?>
<div id="header"><?php echo $oscTemplate->getBlocks('boxes_header'); ?></div>
<?php
	  }
?>
 
<?php
  if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="headerError">
    <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td>
  </tr>
</table>
<?php
  }
  if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr class="headerInfo">
    <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td>
  </tr>
</table>
<?php
  }
?>

<?php
?>
i am sorry i dont found code like the same you give me
also did i must add some thing in filenames.php or other file

#5   scriptlover

scriptlover
  • Members
  • 39 posts

Posted 17 July 2012 - 19:26

hi any help ?