Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] Banner Box for 2.3


kymation

Recommended Posts

I am ready but need documentation notes. Do you write it? This JS maybe conflict if use other modules the same JS code.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

I cleaned up the documentation. It didn't need much.

 

I'm not worried about the JavaScript. It can be called with different parameters by another rotator. I haven't tested this, but it should work. If necessary, the other instance could use another copy of the JavaScript in a different folder.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi,

 

Is it possible to add a second banner box? The firs one is running fine.

I allready tried copying the bm_banner.php files to bm_cert.php and rename the "banner" strings to "cert", but without luck. Installation via admin works fine, but the shop becomes invisible.

What shoud I do to get another banner box?

 

Regards, Gerrit

Link to comment
Share on other sites

  • 2 weeks later...

hey guys i try to use your addon ..but it's not working ...i mean i upload the files in the right places like it's said in manual ..i go to admin i instal the box ....i set the box to right column i put a order number , title link empty i click save and when i go back ti my store ....the main / index page won't load at all just the site banner and the background nothing else ..when i disable the box ...site load normally !

 

so what it's wrong ?

 

and yes i upload 1 img size 137 pixels with banner manager but i don't see any link with banner box addon ?

 

Hi guys, any solution found for this problem? I've been struggling for about 5 hours to get a 2nd bannerbox underneath the bm_banner and get the exact same problem as stated above. Everything went ok, i recreated a new bm_bpost.php file from the original bm_banner.php, changed my language files english and dutch, installed the module and whe activated the site just wont load. I've tried 2 different contributions all with the same result, module = true site wont load but gives an error page, module = false and everything works just fine. Help would be much appreciated here. The only difference is that i bought a premium template but I don't think it should matter when adding an extra box. Here's the link to my site, www.fixitantwerp.be

The original code:

<?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2011 osCommerce
 Released under the GNU General Public License
*/
 class bm_banner {
   var $code = 'bm_banner';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;
   function bm_banner() {
  $this->title = MODULE_BOXES_BANNER_COLUMN_TITLE;
  $this->description = MODULE_BOXES_BANNER_COLUMN_DESCRIPTION;
  $this->box_title = MODULE_BOXES_BANNER_COLUMN_BOX_TITLE;
  if ( defined('MODULE_BOXES_BANNER_COLUMN_STATUS') ) {
    $this->sort_order = MODULE_BOXES_BANNER_COLUMN_SORT_ORDER;
    $this->enabled = (MODULE_BOXES_BANNER_COLUMN_STATUS == 'True');
	 $this->group = ((MODULE_BOXES_BANNER_COLUMN_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
  }
   }
   function execute() {
  global $oscTemplate;

  $data = '';
  $execute = false;
  if($banner3 = tep_banner_exists('dynamic', 'banner3')){
    $data .= '<div class="infoBoxWrapper">'.tep_display_banner('static', $banner3).'</div>';
 $execute = true;
  }
  if($execute){
   $oscTemplate->addBlock($data, $this->group);
  }
   }
   function isEnabled() {
  return $this->enabled;
   }
   function check() {
  return defined('MODULE_BOXES_BANNER_COLUMN_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 Banner Column Module', 'MODULE_BOXES_BANNER_COLUMN_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_BANNER_COLUMN_CONTENT_PLACEMENT', 'Left Column', 'The module should be loaded in the footer block only', '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_BANNER_COLUMN_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_BANNER_COLUMN_STATUS', 'MODULE_BOXES_BANNER_COLUMN_CONTENT_PLACEMENT', 'MODULE_BOXES_BANNER_COLUMN_SORT_ORDER');
   }
 }
?>

 

The one I recreated for the 2nd Box:

<?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2011 osCommerce
 Released under the GNU General Public License
*/
 class bm_bpost {
   var $code = 'bm_bpost';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;
   function bm_bpost() {
  $this->title = MODULE_BOXES_BPOST_COLUMN_TITLE;
  $this->description = MODULE_BOXES_BPOST_COLUMN_DESCRIPTION;
  $this->box_title = MODULE_BOXES_BPOST_COLUMN_BOX_TITLE;
  if ( defined('MODULE_BOXES_BPOST_COLUMN_STATUS') ) {
    $this->sort_order = MODULE_BOXES_BPOST_COLUMN_SORT_ORDER;
    $this->enabled = (MODULE_BOXES_BPOST_COLUMN_STATUS == 'True');
	 $this->group = ((MODULE_BOXES_BPOST_COLUMN_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
  }
   }
   function execute() {
  global $oscTemplate;

  $data = '';
  $execute = false;
  if($bpost = tep_BPOST_exists('dynamic', 'bpost')){
    $data .= '<div class="infoBoxWrapper">'.tep_display_BPOST('static', $bpost).'</div>';
 $execute = true;
  }
  if($execute){
   $oscTemplate->addBlock($data, $this->group);
  }
   }
   function isEnabled() {
  return $this->enabled;
   }
   function check() {
  return defined('MODULE_BOXES_BPOST_COLUMN_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 BPOST Column Module', 'MODULE_BOXES_BPOST_COLUMN_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_BPOST_COLUMN_CONTENT_PLACEMENT', 'Left Column', 'The module should be loaded in the footer block only', '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_BPOST_COLUMN_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_BPOST_COLUMN_STATUS', 'MODULE_BOXES_BPOST_COLUMN_CONTENT_PLACEMENT', 'MODULE_BOXES_BPOST_COLUMN_SORT_ORDER');
   }
 }
?>

 

Thanks in advance,

Erwin

Link to comment
Share on other sites

I've uploaded the new box code with the rotator option to the Addons area. All of the credit goes to Gergely for adding the rotator code, and for fixing the insidious language bug. Instructions are provided if you need to upgrade from the previous version.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Installed as per your instructions - ERROR

 

Fatal error: Cannot redeclare class language in /home/content/g/e/o/georgefasal/html/FASAL/business/includes/classes/language.php on line 16

 

 

Hello,

This error occurs when you already have a class with this name declared in anywhere else on your website. Any other addon using the same class name. You can try replicating this error by just writing the whole class part in the same file itself.

Link to comment
Share on other sites

You're not; the box is broken. I need to figure out how to fix this bug. Back here when I get it tamed....

 

Regards

Jim

 

 

Hi Jim,

 

why dont you use my edited box?

:-)

 

(look at my previous posts. There is a link)

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

  • 4 weeks later...

Hello Jim,

 

Thank you for you work.

I have a question. I installed it to a web shop with only one language and works great. I tried to install it in another web shop with 2 languages. It works for english but for the second language it says the following on top : Warning: constant() [function.constant]: Couldn't find constant MODULE_BOXES_BANNER_TITLE_SWEDISH in /home/.../public_html/catalog/includes/modules/boxes/bm_banner.php on line 42

Can you please help?

Of course I added the bm_banner.php in catalog/includes/languages/swedish/modules/boxes/

 

Best Regards and Thank you in advance for your time.

Stefanos

Link to comment
Share on other sites

This is probably caused by the way your language is installed. Try replacing this code in catalog/includes/modules/boxes/bm_banner.php (two places):

 

    $this->languages_array[$this_language['id']] = $this_language['name'];

with this:

 

	    $this->languages_array[$this_language['id']] = $this_language['directory'];

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Hi there,

 

I installed everything as written in the manual.

I get this error when i set an banner rotation:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MAX_DISPLAY_BANNER_ROTATOR' at line 16

 

select banners_id, banners_url, banners_image, banners_html_text, status from banners where banners_group = 'box_module' and language_id = '4' and status = 1 order by BANNER_ORDER limit MAX_DISPLAY_BANNER_ROTATOR

 

[TEP STOP]

 

Can you help/advise me pls.

 

Thanx,

Excaliber

Link to comment
Share on other sites

  • 2 weeks later...

Hi!

I installed this successfully. The title link was working to link to an outside page. All of a sudden, I hear it's not working anymore, as it's trying to go to catalog/http... <outside page>

 

Any idea why this could be?

Thanks!

Link to comment
Share on other sites

If it was working before, it's something that you changed. Have you made changes to your configure.php? Have you moved to a different server?

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I have neither changed configure or moved the site. :wacko:

The only that could have affected it was on the CSS file (I know it wasn't likely), but I reverted that.

 

I want it to go to outsidepage.com but it goes to mypage.com/catalog/outsidepage.com

(mypage.com/catalog is my page.)

 

I am fine not having that title, esp since I'll make it into a banner, but *when you have time*, if you have another idea of why this could be happening, let me know. I like to be in control of my site and I need to figure out why something would stop working.

 

THANKS!

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