JB04 Posted December 19, 2004 Posted December 19, 2004 How would i make it so i could not display something whenever a user is logged in, i already have the code, if tep session is registered, that piece, however i'm new to this so cannot work it out, is there an opposite so i can make some text disappear whenever the user log's in, for instance when the user is on the main page and already logged in a session it would give different info to them while hiding the text which was there on the main page before to unregistered users, sort of vica versa thing, Ta Muchas gracious
boxtel Posted December 19, 2004 Posted December 19, 2004 How would i make it so i could not display something whenever a user is logged in, i already have the code, if tep session is registered, that piece, however i'm new to this so cannot work it out, is there an opposite so i can make some text disappear whenever the user log's in, for instance when the user is on the main page and already logged in a session it would give different info to them while hiding the text which was there on the main page before to unregistered users, sort of vica versa thing, Ta Muchas gracious <{POST_SNAPBACK}> well, I use this for instance: <?php if ((!tep_session_is_registered('customer_id'))) {?> <tr> <td class="main"><?php include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> Treasurer MFC
JB04 Posted December 19, 2004 Author Posted December 19, 2004 Ye, sort of, I mean the opposite like: if session is registered display this if session is not registered display this instead I've benn trying to work out a little script but keep failing
boxtel Posted December 19, 2004 Posted December 19, 2004 Ye, sort of, I mean the opposite like: if session is registered display this if session is not registered display this instead I've benn trying to work out a little script but keep failing <{POST_SNAPBACK}> well, that is what this does, if the customer id NOT logged in, I display the main text. otherwise I don't. Treasurer MFC
JB04 Posted December 19, 2004 Author Posted December 19, 2004 Ideal setup would be for example the login link, and logoff link, display one when logged in and the other when not, i need to be able to extend this to other areas but cannot find the code? I need to remove some text when not registered and display some other when not, the above example is not sufficent. Thanks anyway
Zedes Posted December 19, 2004 Posted December 19, 2004 Hello! How can I use a different login page what redirect to admin site? I can't use the apache .htacces the on my internet server. The AdminLogin0.0.6 solve this problem? Regards Zsolt
JB04 Posted December 20, 2004 Author Posted December 20, 2004 I've sorted it so decided to post it here for others, i find it helpful for displaying different content to users logged in & users not logged in, place this wherever you need it: <?php if (tep_session_is_registered('customer_id')) { ?> <?php // display something to registered users echo 'Type some words etc here to display to registered users'; ?> <?php } else { ?> <?php // display something to everyone else echo 'Type some words etc here to display to everyone else'; ?> <?php } ?> Hope this is useful to some others aswell
Recommended Posts
Archived
This topic is now archived and is closed to further replies.