joshianupk Posted December 30, 2010 Posted December 30, 2010 Hello, How to add login box in right column? I am using V2.3.1 Thanks in advance
PupStar Posted December 31, 2010 Posted December 31, 2010 ok try this but bear in mind that it is totally untested, just something I knocked together over a cup of tea :-" First of all in catalog/includes/modules/boxes create a new .php called bm_login.php and add this code <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ class bm_login { var $code = 'bm_login'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_login() { $this->title = MODULE_BOXES_LOGIN_TITLE; $this->description = MODULE_BOXES_LOGIN_DESCRIPTION; if ( defined('MODULE_BOXES_LOGIN_STATUS') ) { $this->sort_order = MODULE_BOXES_LOGIN_SORT_ORDER; $this->enabled = (MODULE_BOXES_LOGIN_STATUS == 'True'); $this->group = ((MODULE_BOXES_LOGIN_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate; $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_LOGIN_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents" style="text-align: center;">' . ' ' . 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-10) . 'px"') . '<br>' . ' ' . BOX_LOGINBOX_PASSWORD . '' . ' ' . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-10) . 'px"') . '<br>' . ' <a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . ' ' . BOX_LOGINBOX_FORGOT_PASSWORD . '</a>' . ' ' . tep_draw_button(IMAGE_BUTTON_LOGIN, 'key', null, 'primary') . '</form><br>' . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_LOGIN_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Search Module', 'MODULE_BOXES_LOGIN_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_LOGIN_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_LOGIN_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_LOGIN_STATUS', 'MODULE_BOXES_LOGIN_CONTENT_PLACEMENT', 'MODULE_BOXES_LOGIN_SORT_ORDER'); } } ?> then create a new .php in catalog/includes/languages/english/modules/boxes called bm_login.php and add this code define('MODULE_BOXES_LOGIN_BOX_TITLE', 'Login'); define('BOX_LOGINBOX_EMAIL', '<center>E-mail Address:</center>'); define('BOX_LOGINBOX_PASSWORD', '<center>Password:<center>'); define('BOX_LOGINBOX_FORGOT_PASSWORD', '<center>(<i>recovery</i>)</center><br>'); define('MODULE_BOXES_LOGIN_DESCRIPTION', 'Show the customer login box'); define('MODULE_BOXES_LOGIN_TITLE', 'Customer Login Box'); Like I said its totally untested and may require a few changes. Regards Mark
jbhz_finisher Posted January 1, 2011 Posted January 1, 2011 I tested it and it dose not log in. after clicking "log on" it switches to login.php page. and the box dose not change I added ' <form>' . to open form code and now it just dosent log on. only refeshes index page
Ausgirl Posted January 1, 2011 Posted January 1, 2011 Try This Add On I installed it & it works like a charm :)
PupStar Posted January 1, 2011 Posted January 1, 2011 Try This Add On I installed it & it works like a charm :) well that was not that there whilst I was having a cup of tea and popping that code together. Looks like no need to fix it now >_<
joshianupk Posted January 7, 2011 Author Posted January 7, 2011 Try This Add On I installed it & it works like a charm :) Thanks Ruth it's work fine...
Guest Posted April 23, 2012 Posted April 23, 2012 Try This Add On I installed it & it works like a charm Hi ruth, I just installed this and the log in box in the admin panel does not let me select to edit any suggestions. I am kinda new to OS. Thank you K
Recommended Posts
Archived
This topic is now archived and is closed to further replies.