RAC Posted September 8, 2017 Share Posted September 8, 2017 I have just installed the module which shows in my admin, I created a page called 1st test. On the shop site the text below appears in the right column as expected, but there is no box, (the text is in the column on its own). MODULE_BOXES_INFORMATION_BOX_TITLE 1st test Do I have to create a box somewhere? Any suggestions? Quote Link to comment Share on other sites More sharing options...
♥beerbee Posted September 8, 2017 Share Posted September 8, 2017 If recall correctly you'd have to edit the original information box by commenting out the links there and insert function call like: <?php /* <li><a href="<?php echo tep_href_link('shipping.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_SHIPPING; ?></a></li> <li><a href="<?php echo tep_href_link('privacy.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_PRIVACY; ?></a></li> <li><a href="<?php echo tep_href_link('conditions.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_CONDITIONS; ?></a></li> <li><a href="<?php echo tep_href_link('contact_us.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_CONTACT; ?></a></li> */ echo tep_information_show_category(1); ?> Best regards Christoph Quote Link to comment Share on other sites More sharing options...
RAC Posted September 8, 2017 Share Posted September 8, 2017 Yes that was already done, I have looked through the installation instructions again, but cannot find an obvious problem. My Shop/includes/modules/boxes/bm_information.php is : <?php /* $Id$ adapted for Information Pages Unlimited v2.05 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ class bm_information { var $code = 'bm_information'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_information() { $this->title = MODULE_BOXES_INFORMATION_TITLE; $this->description = MODULE_BOXES_INFORMATION_DESCRIPTION; if ( defined('MODULE_BOXES_INFORMATION_STATUS') ) { $this->sort_order = MODULE_BOXES_INFORMATION_SORT_ORDER; $this->enabled = (MODULE_BOXES_INFORMATION_STATUS == 'True'); $this->group = ((MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate; // BOF: Information Pages Unlimited require_once(DIR_WS_FUNCTIONS . 'information.php'); // EOF: Information Pages Unlimited //ob_start(); //include('includes/modules/boxes/templates/information.php'); //$data = ob_get_clean(); $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXE_INFORMATION_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . tep_information_show_category(1) . ' <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOXES_INFORMATION_BOX_SHIPPING . '</a><br />' . // ' <a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . MODULE_BOXES_INFORMATION_BOX_PRIVACY . '</a><br />' . // ' <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' . // ' //<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_INFORMATION_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 Information Module', 'MODULE_BOXES_INFORMATION_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_INFORMATION_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_INFORMATION_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_INFORMATION_STATUS', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'MODULE_BOXES_INFORMATION_SORT_ORDER'); } } Does that look OK? Quote Link to comment Share on other sites More sharing options...
♥beerbee Posted September 8, 2017 Share Posted September 8, 2017 Hi if you are installing on BS Edge you'd need to edit the template file. You have commented out //ob_start(); //include('includes/modules/boxes/templates/information.php'); //$data = ob_get_clean(); why? Best regards Christoph Quote Link to comment Share on other sites More sharing options...
RAC Posted September 8, 2017 Share Posted September 8, 2017 Hello again Christoph I do not know why the section was commented out! Could it be in any instructions following an addon? I have removed the //'s on my above posted file, with no change, do I need to do this anywhere else? Thanks in advance Shaun Quote Link to comment Share on other sites More sharing options...
♥beerbee Posted September 8, 2017 Share Posted September 8, 2017 Hi, my function execute() in bm_information.php looks like this: function execute() { global $oscTemplate, $PHP_SELF; // BOF: Information Pages Unlimited require_once('includes/functions/' . 'information.php'); // EOF: Information Pages Unlimited ob_start(); include('includes/modules/boxes/templates/information.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } and the includes/modules/boxes/templates/information.php like this: <div class="panel panel-default"> <div class="panel-heading"><?php echo MODULE_BOXES_INFORMATIONHEMP_BOX_TITLE; ?></div> <div class="panel-body"> <?php /* <li><a href="<?php echo tep_href_link('shipping.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_SHIPPING; ?></a></li> <li><a href="<?php echo tep_href_link('privacy.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_PRIVACY; ?></a></li> <li><a href="<?php echo tep_href_link('conditions.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_CONDITIONS; ?></a></li> <li><a href="<?php echo tep_href_link('contact_us.php'); ?>"><?php echo MODULE_BOXES_INFORMATION_BOX_CONTACT; ?></a></li> */ echo tep_information_show_category(1); ?> </div> </div> Best regards Christoph Quote Link to comment Share on other sites More sharing options...
RAC Posted September 9, 2017 Share Posted September 9, 2017 Hi Christoph Both of your files are similar, with obvious differences. I am no coder and do not understand what the differences are of whether I could use your code with no ill effects, so as a test I copied your files but it broke my shop side, I just had a blank white page. I have now put things back! I think my problem is with a module that I added, removed then added again a few days ago, I did not upload it, I think that it was part of my Edge download ? It was in the admin/modules/boxes page, MODULES_BOXES_INFORMATION_TITLE. I installed it and it gave me a box in the right column, but the information text was all in CAPITALS and spilled out of the side of the box on to the page. I was searching for an answer to this problem when I came across this Extra Pages module, which seemed to be exactly what I was looking for, so I installed that as well. The text from the Extra Pages as in my op was situated below the stock information module so I did not think there would be a problem and uninstalled it, when I realised the Extra Pages module uses the existing module box, I reinstalled the MODULES_BOXES_INFORMATION_TITLE, now there is no box at all, but there is still the text. What a pickle! Any idiot proof advice will be much appreciated. Thanks in advance, Shaun Quote Link to comment Share on other sites More sharing options...
RAC Posted September 9, 2017 Share Posted September 9, 2017 Hello again Now if I comment in the shipping module the text MODULE_BOXES_INFORMATION_BOX_SHIPPING is below my previous text. Quote Link to comment Share on other sites More sharing options...
♥frankl Posted September 9, 2017 Share Posted September 9, 2017 @RAC Change this line require_once(DIR_WS_FUNCTIONS . 'information.php'); to this include('includes/modules/boxes/templates/information.php'); and see if it makes a difference. I think that's what was causing your blank page. Quote osCommerce user since 2003! Link to comment Share on other sites More sharing options...
♥beerbee Posted September 9, 2017 Share Posted September 9, 2017 Hi, the template file I posted was complete, but from the bm_information.php I only posted the relevant function. both the function and the template file have to be included correctly so it should read: for the function file require_once('includes/functions/information.php'); for the template file include('includes/modules/boxes/templates/information.php'); And there should be a language file in includes/YourLanguage/modules/boxes/bm_information.php. This would be my complete bm_information.php for includes/modules/boxes/ <?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_information { var $code = 'bm_information'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_information() { $this->title = MODULE_BOXES_INFORMATION_TITLE; $this->description = MODULE_BOXES_INFORMATION_DESCRIPTION; if ( defined('MODULE_BOXES_INFORMATION_STATUS') ) { $this->sort_order = MODULE_BOXES_INFORMATION_SORT_ORDER; $this->enabled = (MODULE_BOXES_INFORMATION_STATUS == 'True'); $this->group = ((MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate, $PHP_SELF; // BOF: Information Pages Unlimited require_once('includes/functions/' . 'information.php'); // EOF: Information Pages Unlimited ob_start(); include('includes/modules/boxes/templates/information.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_INFORMATION_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_INFORMATION_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 configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_INFORMATION_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 configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_INFORMATION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_INFORMATION_STATUS', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'MODULE_BOXES_INFORMATION_SORT_ORDER'); } } Best regards Christoph Quote Link to comment Share on other sites More sharing options...
RAC Posted September 10, 2017 Share Posted September 10, 2017 OK Cristoph, I now have the box in the right column with my "1st test" inside thank you, however in the box title area "MODULE_BOXES_INFORMATIONHEMP_BOX_TITLE" is displayed rather than the box title. Regards Shaun Quote Link to comment Share on other sites More sharing options...
RAC Posted September 10, 2017 Share Posted September 10, 2017 Hi again, only me! When I click on the link I have just created in the box it takes me to the page, as expected, but there seems to be the whole includes/language/english/moduels/boxes/bm_information.php file in text, in full, including the oscommerce info, displayed above the header of the page. Regards Shaun Quote Link to comment Share on other sites More sharing options...
RAC Posted September 10, 2017 Share Posted September 10, 2017 The above message applies to all pages on my site. Quote Link to comment Share on other sites More sharing options...
RAC Posted September 10, 2017 Share Posted September 10, 2017 OK I have just <!-- --> the page, now the code above the header has gone, this is solved, however my first point today still has not. Thanks in advance. Shaun Quote Link to comment Share on other sites More sharing options...
♥beerbee Posted September 10, 2017 Share Posted September 10, 2017 Hi, this happens when I forget to clean up code I adapted to special needs for my work . Please change MODULE_BOXES_INFORMATIONHEMP_BOX_TITLE to MODULE_BOXES_INFORMATION_BOX_TITLE in the template file. Best regards Christoph Quote Link to comment Share on other sites More sharing options...
RAC Posted September 10, 2017 Share Posted September 10, 2017 5 hours ago, RAC said: "MODULE_BOXES_INFORMATIONHEMP_BOX_TITLE" Hi Christoph, No sorry, I didn't even notice the "HEMP" in the title, doh! But anyway you misunderstand, on my shop site, when I look at the wonderful new box you helped me create in my right column, the title I can actually see is not "Information", or whatever title that's associated with this new box, but "MODULE_BOXES_INFORMATION_BOX_TITLE". This title exits the box and continues on, (see screen shot). Regards Shaun My page.docx Quote Link to comment Share on other sites More sharing options...
♥beerbee Posted September 10, 2017 Share Posted September 10, 2017 Hi that is a missing language definition then..look for bm_information.php in includes/languages/english/modules/boxes/ that is the place where it should be defined. Maybe you missed to upload it? Best regards Christoph Quote Link to comment Share on other sites More sharing options...
RAC Posted September 11, 2017 Share Posted September 11, 2017 There is such a file in catalog/includes/languages/english/moduels/boxes/information.php but it is commented out, (I don't know why, however if I comment it in the entire box text can be seen above the header on all of my shop pages. <!--?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ define('MODULE_BOXES_INFORMATION_TITLE', 'Information'); define('MODULE_BOXES_INFORMATION_DESCRIPTION', 'Show information page links'); define('MODULE_BOXES_INFORMATION_BOX_TITLE', 'Information'); //define('MODULE_BOXES_INFORMATION_BOX_PRIVACY', 'Privacy Notice'); //define('MODULE_BOXES_INFORMATION_BOX_CONDITIONS', 'Conditions of Use'); //define('MODULE_BOXES_INFORMATION_BOX_SHIPPING', 'Delivery & Returns'); //define('MODULE_BOXES_INFORMATION_BOX_GRADING', 'Grading Books'); //define('MODULE_BOXES_INFORMATION_BOX_CONTACT', 'Contact Us'); ? --> In the files to be uploaded there was no such file included. There were only four files on the shop side, catalog/information.php catalog/includes/functions/information.php catalog/includes/languages/english/information.php includes/modules/boxes/bm_information Regards Shaun Quote Link to comment Share on other sites More sharing options...
RAC Posted September 11, 2017 Share Posted September 11, 2017 On 9/9/2017 at 5:51 AM, RAC said: I think my problem is with a module that I added, removed then added again a few days ago, I did not upload it, I think that it was part of my Edge download ? It was in the admin/modules/boxes page, MODULES_BOXES_INFORMATION_TITLE. I installed it and it gave me a box in the right column, but the information text was all in CAPITALS and spilled out of the side of the box on to the page. I was searching for an answer to this problem when I came across this Extra Pages module, which seemed to be exactly what I was looking for, so I installed that as well. The text from the Extra Pages as in my op was situated below the stock information module so I did not think there would be a problem and uninstalled it, when I realised the Extra Pages module uses the existing module box, I reinstalled the MODULES_BOXES_INFORMATION_TITLE, now there is no box at all, but there is still the text. I am only guessing here. I am at a loss. Regards Shaun Quote Link to comment Share on other sites More sharing options...
♥beerbee Posted September 11, 2017 Share Posted September 11, 2017 (edited) Hi, in the attachment is the language file you could try to upload it and see what happens. In my includes/languages/english/modules/boxes/ folder all filenames start with bm_ Best regards Christoph bm_information.php Edited September 11, 2017 by beerbee Quote Link to comment Share on other sites More sharing options...
RAC Posted September 11, 2017 Share Posted September 11, 2017 Hi Christoph, thanks again for the file. You are a STAR, all sorted, thank you for your persistence. Kind regards Shaun Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.