Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add login box in right column v2.3.1


joshianupk

Recommended Posts

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

Link to comment
Share on other sites

  • 1 year later...

Try This Add On I installed it & it works like a charm smile.gif

 

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...