rumi Posted December 5, 2006 Posted December 5, 2006 Hi Everyone, I need help moving the login information from the center main page area to a box in the left column. I have removed all the boxes on the right column. Is there a way to do this? :blink:
bill110 Posted December 5, 2006 Posted December 5, 2006 To add the original login box to the left column add this code in the cotelog/includes/column_left.php where you want it to appear. require(DIR_WS_BOXES . 'loginbox.php'); then to remove the login stuff in the middle catelog/index.php find this code and remove <tr> <td class="main"><?php echo tep_customer_greeting(); ?></td> </tr> My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
rumi Posted December 5, 2006 Author Posted December 5, 2006 I did as you suggested and came up with this error:Warning: main(includes/boxes/loginbox.php): failed to open stream: No such file or directory in /var/www/html/catalog/includes/column_left.php on line 31 Fatal error: main(): Failed opening required 'includes/boxes/loginbox.php' (include_path='.:/php/includes:/usr/share/php') in /var/www/html/catalog/includes/column_left.php on line 31 I did manage to remove the "welcome guest would you like to log yourself in?" Wonder what Ive done now! By the way, Thank you. Marion
bill110 Posted December 6, 2006 Posted December 6, 2006 I'm not sure what happened on my end either but I can't find the loginbox.php in my original zip file. So...., create a new file and call it loginbox.php paste this code in it <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License IMPORTANT NOTE: This script is not part of the official osC distribution but an add-on contributed to the osC community. Please read the README and INSTALL documents that are provided with this file for further information and installation notes. loginbox.php - Version 5.4 This puts a login request in a box with a login button. If already logged in, will not show anything. Modified to utilize SSL to bypass Security Alert */ // WebMakers.com Added: Do not show if on login or create account if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) { ?> <!-- loginbox //--> <?php if (!tep_session_is_registered('customer_id')) { ?> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_LOGIN_BOX); new infoBoxHeading($info_box_contents, false, false); $loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')) . BOX_LOGINBOX_EMAIL . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"') .'<br><br>' . BOX_LOGINBOX_PASSWORD . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"') .'<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . BOX_LOGINBOX_FORGOT_PASSWORD . '</a>' . tep_image_submit('/button_login.gif', IMAGE_BUTTON_LOGIN) . '</form><br><br>' . BOX_LOGINBOX_TEXT_NEW . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . BOX_LOGINBOX_NEW . '</a>' ; $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $loginboxcontent); new infoBox($info_box_contents); ?> </td> </tr> <?php } else { // If you want to display anything when the user IS logged in, put it // in here... Possibly a "You are logged in as :" box or something. } ?> <!-- loginbox_eof //--> <?php // WebMakers.com Added: My Account Info Box } else { if (tep_session_is_registered('customer_id')) { ?> <!-- my_account_info //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- my_account_info_eof //--> <?php } } ?> save it to catelog/includes/boxes Then do the code from the previous post and it should work. My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
rumi Posted December 6, 2006 Author Posted December 6, 2006 I'm not sure what happened on my end either but I can't find the loginbox.php in my original zip file.So...., create a new file and call it loginbox.php paste this code in it <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License IMPORTANT NOTE: This script is not part of the official osC distribution but an add-on contributed to the osC community. Please read the README and INSTALL documents that are provided with this file for further information and installation notes. loginbox.php - Version 5.4 This puts a login request in a box with a login button. If already logged in, will not show anything. Modified to utilize SSL to bypass Security Alert */ // WebMakers.com Added: Do not show if on login or create account if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) and (!strstr($_SERVER['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') ) { ?> <!-- loginbox //--> <?php if (!tep_session_is_registered('customer_id')) { ?> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_LOGIN_BOX); new infoBoxHeading($info_box_contents, false, false); $loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL')) . BOX_LOGINBOX_EMAIL . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"') .'<br><br>' . BOX_LOGINBOX_PASSWORD . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"') .'<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . BOX_LOGINBOX_FORGOT_PASSWORD . '</a>' . tep_image_submit('/button_login.gif', IMAGE_BUTTON_LOGIN) . '</form><br><br>' . BOX_LOGINBOX_TEXT_NEW . '<a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . BOX_LOGINBOX_NEW . '</a>' ; $info_box_contents = array(); $info_box_contents[] = array('align' => 'center', 'text' => $loginboxcontent); new infoBox($info_box_contents); ?> </td> </tr> <?php } else { // If you want to display anything when the user IS logged in, put it // in here... Possibly a "You are logged in as :" box or something. } ?> <!-- loginbox_eof //--> <?php // WebMakers.com Added: My Account Info Box } else { if (tep_session_is_registered('customer_id')) { ?> <!-- my_account_info //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT); new infoBoxHeading($info_box_contents, false, false); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'); new infoBox($info_box_contents); ?> </td> </tr> <!-- my_account_info_eof //--> <?php } } ?> save it to catelog/includes/boxes Then do the code from the previous post and it should work.
rumi Posted December 6, 2006 Author Posted December 6, 2006 Hi Bill, thank you. My login box is now in the left column. However, my left column width has increased making my main content area out of proportion. Also, the box heading says "BOX_LOGINBOX_EMAIL" in the heading and says similar things before the password field, etc. Here is a look at my site: The code you provided was a contrib? thank you
bill110 Posted December 6, 2006 Posted December 6, 2006 Yes it is. I have had it so long forgot that it was. It is Loginbox v5.4 in contributions. You need to download that to use this script. It has additional edits. Simple though. Sorry for the oversight. Long nights! My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
rumi Posted December 7, 2006 Author Posted December 7, 2006 Yes it is. I have had it so long forgot that it was. It is Loginbox v5.4 in contributions. You need to download that to use this script. It has additional edits. Simple though. Sorry for the oversight. Long nights!
rumi Posted December 7, 2006 Author Posted December 7, 2006 Yes it is. I have had it so long forgot that it was. It is Loginbox v5.4 in contributions. You need to download that to use this script. It has additional edits. Simple though. Sorry for the oversight. Long nights! For now I just commented it out of column_left. But thanks for the contrib version. I will check it out. Much gratitude. Marion
Recommended Posts
Archived
This topic is now archived and is closed to further replies.