Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Information pages unlimited for 2.3


mediamacher

Recommended Posts

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?
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@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.

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Hi, this happens when I forget to clean up code I adapted to special needs for my work :blush:

Please change MODULE_BOXES_INFORMATIONHEMP_BOX_TITLE to MODULE_BOXES_INFORMATION_BOX_TITLE in the template file.

Best regards

Christoph

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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 &amp; 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...