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
Latest News: (loading..)
add new page for register user only
Started by scriptlover, Jul 17 2012 09:46 AM
4 replies to this topic
#1
Posted 17 July 2012 - 09:46 AM
#2
Posted 17 July 2012 - 11:01 AM
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
I am not a coder, so dont bother sending PMs asking for help as you wont get any.
OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.
I am not a coder, so dont bother sending PMs asking for help as you wont get any.
OSC has a steep learning curve, but in general the program does work. If it doesnt work, the chances are it is something you have done.
#3
Posted 17 July 2012 - 11:30 AM
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
Just after
Example you can see eg at checkout_shipping.php
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
Posted 17 July 2012 - 12:17 PM
hi
this my header code
also did i must add some thing in filenames.php or other file
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
Posted 17 July 2012 - 07:26 PM
hi any help ?









