KJ666 Posted September 29, 2009 Posted September 29, 2009 I have been looking all around for a login box to go in the header on the top right of my website. What i want is E-mail Password loginbutton Then when you logged in it will say somthing like First name last name, Welcome to websitename Anyhelp on this please.
Guest Posted September 29, 2009 Posted September 29, 2009 Kieron, Try this, you can easily alter it to suite your needs. http://addons.oscommerce.com/info/2179 Chris
KJ666 Posted September 29, 2009 Author Posted September 29, 2009 Thanks for your help, Need abit more tho. I would like the e-mail and password writing already in the form areas that you click like where you write your e-mail address instead of next to it. <td valign="top" align="right"><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr> <td class="smallText"><?php echo ENTRY_LOGIN_EMAIL_ADDRESS; ?></td> <td><?php echo tep_draw_input_field('email_address'); ?></td> <td></td> <td class="smallText"><?php echo ENTRY_LOGIN_PASSWORD; ?></td> <td><?php echo tep_draw_password_field('password'); ?></td> <td><?php echo tep_image_submit('button_go.gif', IMAGE_BUTTON_GO); ?></td> </tr> </table></td> </tr> </table></form></td>
♥ecartz Posted October 1, 2009 Posted October 1, 2009 Maybe: <td valign="top" align="right"><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); ?> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="3"> <tr> <td><?php echo tep_draw_input_field('email_address', ENTRY_LOGIN_EMAIL_ADDRESS); ?></td> <td><?php echo tep_draw_password_field('password', ENTRY_LOGIN_PASSWORD); ?></td> <td><?php echo tep_image_submit('button_go.gif', IMAGE_BUTTON_GO); ?></td> </tr> </table></td> </tr> </table></form></td> For anything more elaborate, you'd probably need to use javascript. Always back up before making changes.
KJ666 Posted October 1, 2009 Author Posted October 1, 2009 Ummm that is kinda what i wanted but when you click the box it disappers as other wise you have to delte the e-mail address bit your self, which takes more time.
KJ666 Posted October 2, 2009 Author Posted October 2, 2009 I have a really big problem now, I used the login, and now it has gone i wanted it so it still there saying somthing like welcome back with a logoff button :( anyideas ??
KJ666 Posted October 6, 2009 Author Posted October 6, 2009 Can some one help me with this, so when they log in it will display there name and a log off button as well ?? Also sort the username and password writing ?
Xpajun Posted October 17, 2009 Posted October 17, 2009 I used the login from this post and Matt's bit of mod - the only time mine vanishes is when the full login page appears, I changed or removed a lot of the headings which I didn't think was necessary (they can be accessed from my admin) after login as I only have a narrow header at that point. My header is not standard though and I have a seperate header_login.php file: <?php // added for loginbox if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_CREATE_ACCOUNT) && !tep_session_is_registered('customer_id')) { if (!tep_session_is_registered('customer_id')) { // loginbox echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); echo tep_draw_input_field('email_address', ENTRY_LOGIN_EMAIL_ADDRESS); echo tep_draw_password_field('password', ENTRY_LOGIN_PASSWORD); echo tep_image_submit('button_go.gif', IMAGE_BUTTON_GO . ' '); echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '" class="loginboxarea">' . TEXT_LOGIN_PASSWORD_FORGOTTEN . '</a>'; echo '</form>'; ?> <?php } // close !tep_session_is_registered } else { if (!tep_session_is_registered('customer_id')) { // If you want something to show in place of the loginbox when logge in or on login or create account page, // place that code between the <td align="left"></td> below ?> <td align="right"></td> <?php } //close !tep_session_is_registered } // close if // end loginbox ?> <?php // added for my account nav bar links for loginbox if (tep_session_is_registered('customer_id')) { // my_account_info //--> echo '<strong>' . HEADER_LOGIN_TITLE_GREETING . ' ' . $customer_first_name . '</strong>' . ' | '; echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') .'" class="loginboxarea">' . HEADER_LOGIN_TITLE_MY_ACCOUNT . '</a> | '; echo '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') .'" class="loginboxarea">' . HEADER_LOGIN_TITLE_LOGOFF . '</a>'; } // close if // end my account nav bar links for loginbox ?> Note line after my_account_info This will put the login title greeting (from languages) and the customer's first name My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary
KJ666 Posted November 3, 2009 Author Posted November 3, 2009 Bit of help with that code works great though, how can i get it to display on the create account page and the login page ? Somthing to do with this part of the code ? // added for loginbox if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_CREATE_ACCOUNT) && !tep_session_is_registered('customer_id')) { if (!tep_session_is_registered('customer_id')) {
KJ666 Posted November 4, 2009 Author Posted November 4, 2009 Any help on this, as my website dont display right (well the header) only one them two pages ?
KJ666 Posted November 4, 2009 Author Posted November 4, 2009 Any help here is the problem look at the header (nav bar), http://kjexotics.co.uk/euro/login.php and on http://kjexotics.co.uk/euro/create_account.php No problem on the other pages, so i think it is to do with the login box as the login box is not on them two pages.
Xpajun Posted November 4, 2009 Posted November 4, 2009 It doesn't show on the create account page or the login page as it's not needed on those pages - if you think about it!!! My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary
KJ666 Posted November 4, 2009 Author Posted November 4, 2009 Yer i know but if you look at my website you what it does to my header ?? Any idea how to sort this ? I thought the easyist way would be to make it show on them two pages ?
wtpjoco Posted November 5, 2009 Posted November 5, 2009 hmm.. is your databank name right? right name? right localhost, right root? Jon. -------------
KJ666 Posted November 5, 2009 Author Posted November 5, 2009 Yes it is? Sorry but i dont understand what that has to do with adding the login bit to the header of them two pages ? (sorry not meant to sound rude just asking)
Xpajun Posted November 5, 2009 Posted November 5, 2009 I had a look at your site last night - I can see your problem but not the solution because you are putting the code in the header it should look the same for every page... can you post up your header.php file? My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary
KJ666 Posted November 5, 2009 Author Posted November 5, 2009 Header.php <?php /* $Id: header.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ // check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } } // check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } } // check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } } // check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } ?> <table width="1000" align="center" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="header"> <td align="left" class="languageboxarea"><?php require(DIR_WS_BOXES . 'header_languages.php'); ?></td> <tr> <td align="right"> <?php require(DIR_WS_BOXES . 'login.php'); ?> </td> </tr> <tr> <td><a href="index.php"><img src="images/logo.gif" alt="KJExotics logo" width="500" height="125" align="left" border="none"></a></td> </tr> <tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="top-menu"> <tr><td><table border="0" cellspacing="0" cellpadding="0"><tr> <td><a href="index.php"><img src="images/layout/home.gif" alt="Home" border="none"></a></td> <td><img src="images/layout/nav_div.gif"></td> <td><a href="about_us.php"><img src="images/layout/aboutus.gif" alt="About us" border="none"></a></td> <td><img src="images/layout/nav_div.gif"></td> <td><a href="livestock-c-21.html"><img src="images/layout/livestock.gif" alt="Livestock" border="none"></a></td> <td><img src="images/layout/nav_div.gif"></td> <td><a href="account.php"><img src="images/layout/myaccount.gif" alt="My account" border="none"></a></td> <td><img src="images/layout/nav_div.gif"></td> <td><a href="shopping_cart.php"><img src="images/layout/shoppingcart.gif" alt="Shopping cart" border="none"></a></td> </tr> </table></td> <td align="right"> <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_hide_session_id() .tep_image_submit('mini_search.gif', BOX_HEADING_ADVSEARCH, 'align=""') . '</form>'; ?> </td> </tr> </table></td> </tr> <tr><td> <table class="breadcrumb"> <tr> <td><?php echo $breadcrumb->trail(' - '); ?></td> </tr> </table> </td> </tr> </table></td> </tr> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div class="top"><div class="middle"> Login.php <?php // added for loginbox if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_CREATE_ACCOUNT) && !tep_session_is_registered('customer_id')) { if (!tep_session_is_registered('customer_id')) { // loginbox echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')); echo tep_draw_input_field('email_address', ENTRY_LOGIN_EMAIL_ADDRESS); echo tep_draw_password_field('password', ENTRY_LOGIN_PASSWORD); echo tep_image_submit('button_go.gif', IMAGE_BUTTON_GO . ''); echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '" class="loginboxarea">' . TEXT_LOGIN_PASSWORD_FORGOTTEN . '</a>'; echo '</form>'; ?> <?php } // close !tep_session_is_registered } else { if (!tep_session_is_registered('customer_id')) { // If you want something to show in place of the loginbox when logge in or on login or create account page, // place that code between the <td align="left"></td> below ?> <td align="right"></td> <?php } //close !tep_session_is_registered } // close if // end loginbox ?> <?php // added for my account nav bar links for loginbox if (tep_session_is_registered('customer_id')) { // my_account_info //--> echo '<strong>' . HEADER_LOGIN_TITLE_GREETING . ' ' . $customer_first_name . '</strong>' . ' | '; echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') .'" class="loginboxarea">' . HEADER_LOGIN_TITLE_MY_ACCOUNT . '</a> | '; echo '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') .'" class="loginboxarea">' . HEADER_LOGIN_TITLE_LOGOFF . '</a>'; } // close if // end my account nav bar links for loginbox ?>
KJ666 Posted November 6, 2009 Author Posted November 6, 2009 Anybody have an idea what might be wrong ?
KJ666 Posted November 6, 2009 Author Posted November 6, 2009 Anyone this is really bugging me now, i tried a few ways myself cant work it
Xpajun Posted November 8, 2009 Posted November 8, 2009 Try this for the header.php (table part): <table width="1000" align="center" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="header"> <tr> <td align="left" class="languageboxarea"> <?php require(DIR_WS_BOXES . 'header_languages.php'); ?> </td> <td align="right"> <?php require(DIR_WS_BOXES . 'login.php'); ?> </td> </tr> <tr> <td colspan="2"> <a href="index.php"><img src="images/logo.gif" alt="KJExotics logo" width="500" height="125" align="left" border="none"></a></td> </tr> <tr> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="top-menu"> <td> <a href="index.php"><img src="images/layout/home.gif" alt="Home" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="about_us.php"><img src="images/layout/aboutus.gif" alt="About us" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="livestock-c-21.html"><img src="images/layout/livestock.gif" alt="Livestock" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="account.php"><img src="images/layout/myaccount.gif" alt="My account" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="shopping_cart.php"><img src="images/layout/shoppingcart.gif" alt="Shopping cart" border="none"></a> </td> <td align="right"> <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_hide_session_id() .tep_image_submit('mini_search.gif', BOX_HEADING_ADVSEARCH, 'align=""') . '</form>'; ?>search </td> </tr> </table> </td> </tr> <tr> <td> <table class="breadcrumb"> <tr> <td> <?php echo $breadcrumb->trail(' - '); ?> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div class="top"><div class="middle"> </td> </tr> </table> </td> <tr> </table> The last 6 lines closes off the opening table, this may be done elsewhere e.g. in your footer.php so you may not need them My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary
KJ666 Posted November 8, 2009 Author Posted November 8, 2009 That kinda works better, but if you look at the home page, you can see that the gap from the nav titles and the nav_div is huge. If you go to the contact us page and the create account page, has moved the search bar to the left too much. Also there is the word search next to the search image. http://www DOT kjexotics.co.uk/euro
Xpajun Posted November 8, 2009 Posted November 8, 2009 ok so let's try: <table width="1000" align="center" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="header"> <tr> <td align="left" class="languageboxarea"> <?php require(DIR_WS_BOXES . 'header_languages.php'); ?> </td> <td align="right"> <?php require(DIR_WS_BOXES . 'login.php'); ?> </td> </tr> </table> <tr> <td> <a href="index.php"><img src="images/logo.gif" alt="KJExotics logo" width="500" height="125" align="left" border="none"></a></td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="top-menu"> <td align="left"> <table width="70%" border="0" cellspacing="0" cellpadding="0"> <td> <a href="index.php"><img src="images/layout/home.gif" alt="Home" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="about_us.php"><img src="images/layout/aboutus.gif" alt="About us" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="livestock-c-21.html"><img src="images/layout/livestock.gif" alt="Livestock" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="account.php"><img src="images/layout/myaccount.gif" alt="My account" border="none"></a> </td> <td> <img src="images/layout/nav_div.gif"> </td> <td> <a href="shopping_cart.php"><img src="images/layout/shoppingcart.gif" alt="Shopping cart" border="none"></a> </td> </table> </td> <td align="right"> <?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_hide_session_id() .tep_image_submit('mini_search.gif', BOX_HEADING_ADVSEARCH, 'align=""') . '</form>'; ?> </td> </table> </td> </tr> <tr> <td> <table class="breadcrumb"> <tr> <td> <?php echo $breadcrumb->trail(' - '); ?> </td> </tr> </table> </td> </tr> </td> </tr> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <div class="top"><div class="middle"> </td> </tr> </table> </td> <tr> </table> The width of the nav table I've set to 70% you can make it bigger or smaller if you need to <EDIT> I left the borders in - taken them out now :rolleyes: </EDIT> My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary
KJ666 Posted November 8, 2009 Author Posted November 8, 2009 Umm that messed up, the header pic on the right is pushed really far up.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.