Jump to content

Archived

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

ck234

Creating a new infobox in osCommerce 2.3.1

Recommended Posts

hi=)

my qustion may seem to be stupid but i realy need your help

i want to use standart scripts from my social network

http://vkontakte.ru/developers.php?oid=-1&p=Groups#mode=0&width=200&height=290&oid=-28441028&link=http://vkontakte.ru/club28441028

and i just don't know how to make it work on my site

maybe there's some addon to broadcast script to infobox or something

thank you

Share this post


Link to post
Share on other sites

HI :)

 

I have createt a new box on my side and it works, but I have a strange problem :'(

My footer are now located at the lift side on my site !!!

Why is it so ??? :(

 

Dennis

Share this post


Link to post
Share on other sites

HI :)

 

I have createt a new box on my side and it works, but I have a strange problem :'(

My footer are now located at the lift side on my site !!!

Why is it so ??? :(

 

Dennis

 

go to Admin > Modules > Boxes and click on the box you are having trouble with. Then press the Edit button once the box's title shows up on the right-hand box. Select which side you want the box to appear on.

Share this post


Link to post
Share on other sites

If I move the new box to the left all boxes goes to the left :angry:, but the footer banner and footer text are located in the right place .....

 

I think the error is in here :

 

 

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

class bm_katalog {

var $code = 'bm_katalog';

var $group = 'boxes';

var $title;

var $description;

var $sort_order;

var $enabled = false;

 

function bm_katalog() {

$this->title = MODULE_BOXES_KATALOG_TITLE;

$this->description = MODULE_BOXES_KATALOG_DESCRIPTION;

 

if ( defined('MODULE_BOXES_KATALOG_STATUS') ) {

$this->sort_order = MODULE_BOXES_KATALOG_SORT_ORDER;

$this->enabled = (MODULE_BOXES_KATALOG_STATUS == 'True');

 

$this->group = ((MODULE_BOXES_KATALOG_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_KATALOG_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" align="center" border="0"></a>' .

'</div>';

 

$oscTemplate->addBlock($data, $this->group);

}

 

function isEnabled() {

return $this->enabled;

}

 

function check() {

return defined('MODULE_BOXES_KATALOG_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 katalog Module', 'MODULE_BOXES_KATALOG_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_KATALOG_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_KATALOG_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_KATALOG_STATUS', 'MODULE_BOXES_KATALOG_CONTENT_PLACEMENT', 'MODULE_BOXES_KATALOG_SORT_ORDER');

}

}

?>

Share this post


Link to post
Share on other sites

Looks you're missing a " </div> " in the $data of function_execute().

 

After the last " </div> " add another one.


Remember to backup database, files and pictures.

 

I have a problem for your solution

I reject your reality and substitute my own

My mind not only wanders, it sometimes leaves completely

The problem with the gene pool is that there is no lifeguard

Everyone’s entitled to my opinion

 

Links

Security

SSL Help

Basics for design V2.3+

Share this post


Link to post
Share on other sites

like this ? :

 

 

 

function execute() {

global $oscTemplate;

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_KATALOG_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img"><center>' .

' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a>' .

'</div>';

'</div>';

 

did not help :'(

Share this post


Link to post
Share on other sites

This is great for me, I got it to work to a fashion, but i just want to add simple text to the info box, where shall i place it in the php page and how shall i start it, i dont know how to write code it,

 

id like the box to include the words Claim your discount with

 

many thanks

 

the heading of the infobox? its changed here: /includes/languages/english/modules/boxes/bm_newboxname

@ this line define('MODULE_BOXES_INFORMATION_BOX_TITLE', 'Claim your discount with');


Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

like this ? :

 

 

 

function execute() {

global $oscTemplate;

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_KATALOG_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img"><center>' .

' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a>' .

'</div>';

'</div>';

 

did not help :'(

try "file compare" plugin with notepad++ (free) to compare previous/original file with new one

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

like this ? :

 

 

 

function execute() {

global $oscTemplate;

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_KATALOG_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img"><center>' .

' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a>' .

'</div>';

'</div>';

 

did not help :'(

Like this

   function execute() {
global $oscTemplate;

$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_KATALOG_BOX_TITLE . '</div>' .
' <div class="ui-widget-content infoBoxContents">' .
' <div class="img"><center>' .
' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a>' .
'</div>' .
'</div>';


Remember to backup database, files and pictures.

 

I have a problem for your solution

I reject your reality and substitute my own

My mind not only wanders, it sometimes leaves completely

The problem with the gene pool is that there is no lifeguard

Everyone’s entitled to my opinion

 

Links

Security

SSL Help

Basics for design V2.3+

Share this post


Link to post
Share on other sites

BKtrain

 

This is have it looks now :

 

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_KATALOG_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img"><center>' .

' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a>' .

' </div>' .

' </div>';

and it still dos not help :'( :'(

Share this post


Link to post
Share on other sites

try "file compare" plugin with notepad++ (free) to compare previous/original file with new one

 

Smart tool :thumbsup: but I can't see any errors :'(

I have copy the file from bm_information, is that a mistake ??

Share this post


Link to post
Share on other sites

@@DennisMAX

Can you post a link to your site so we can see what is going on?


Remember to backup database, files and pictures.

 

I have a problem for your solution

I reject your reality and substitute my own

My mind not only wanders, it sometimes leaves completely

The problem with the gene pool is that there is no lifeguard

Everyone’s entitled to my opinion

 

Links

Security

SSL Help

Basics for design V2.3+

Share this post


Link to post
Share on other sites

BKtrain

 

This is have it looks now :

 

 

$data = '<div class="ui-widget infoBoxContainer">' .

' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_KATALOG_BOX_TITLE . '</div>' .

' <div class="ui-widget-content infoBoxContents">' .

' <div class="img"><center>' .

' <a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a>' .

' </div>' .

' </div>';

and it still dos not help :'( :'(

 

get rid of ' <div class="img"><center>' . keep everything else just like you have it

 

if you want it centered try this

' <center><a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a></center>' .


Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

get rid of ' <div class="img"><center>' . keep everything else just like you have it

 

if you want it centered try this

' <center><a href="images/tattini-catalogue-2010-en.pdf" title="klik-her-for-katalog"><img src="images/tattinicatsmall.jpg" border="0" ></a></center>' .

 

Thank you Erik :thumbsup: That seemed to work.

But why dos it effect the footer ???

Share this post


Link to post
Share on other sites

Thank you Erik :thumbsup: That seemed to work.

But why dos it effect the footer ???

effect the footer how? I'm guessing the box "grew" with the image and pushed the footer down....not sure...

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

effect the footer how? I'm guessing the box "grew" with the image and pushed the footer down....not sure...

If I located the new box to the left, all boxes went to the left but the footer banner/text was okay...

If I located the new box to the right the footer banner/text were in the site to the right in the middle (site became double wide) .

Share this post


Link to post
Share on other sites

If I located the new box to the left, all boxes went to the left but the footer banner/text was okay...

If I located the new box to the right the footer banner/text were in the site to the right in the middle (site became double wide) .

Chances are you have another extra or unclosed div somewhere...where I don't know

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

Hello,

 

Maybe this has been answered before in this form thread (I did go through the thread and I did not see - or more likely understand), but how do I change the links in renamed version of the bm_infomation.php module?

 

Basically I want to have a box that has links to various websites. I have done all but step 4 - the one that says "Change the content to what you want in your new box" in the instructions by Jim Keebaugh on page 1 of this thread. I understand that the links are in the execute() { .... } section, but I am not 100% sure what to do next..... any help most welcome... Thanks

Share this post


Link to post
Share on other sites

Hello

I followed the instruction here, but when I go to the admin page/module there is no file to add. What I am doing wrong?

Thank you in advance for any help

 

Cramli

Share this post


Link to post
Share on other sites

The column boxes are modules in 2.3.x. Here's a quick outline of how to create a new box:

  1. Copy catalog/includes/modules/boxes/bm_information.php and give it a new name.
  2. Edit that file and change bm_information to your new box name throughout that file.
  3. Change all of the constants that include _INFORMATION_ to include your new name instead. Keep them in all caps.
  4. Change the content to what you want in your new box. If you are using links to new files, keep the same format as the links in that box. The part that generates the box is in the execute() method.
  5. Copy catalog/includes/languages/english/modules/boxes/bm_information.php and give it a the same name as you did the file in step 1.
  6. Make the same changes to the constants in this file that you made in step 3.
  7. Upload your two new files.
  8. Go to your store Admin > Modules > Boxes and install your new module. Give it a sort order that will place it where you want it.

Regards

Jim

 

Hi Jim,

 

I followed these instructions. I am able to see this in admin module. Installation and removal of the module in admin works fine. I am also able to edit (configure sort order, enable/disable, position) in the admin module. While everything works perfectly in the admin side, the box does not appear on the store page. I am doing some silly mistake. Please help. I am pasting the code here:

 

<?php
 class bm_articles {
   var $code = 'bm_articles';
   var $group = 'boxes';
   var $title;
   var $description;
   var $sort_order;
   var $enabled = false;
   function bm_articles() {
  $this->title = MODULE_BOXES_ARTICLES_TITLE;
  $this->description = MODULE_BOXES_ARTICLES_DESCRIPTION;
  if ( defined('MODULE_BOXES_ARTICLES_STATUS') ) {
    $this->sort_order = MODULE_BOXES_ARTICLES_SORT_ORDER;
    $this->enabled = (MODULE_BOXES_ARTICLE_STATUS == 'True');
    $this->group = ((MODULE_BOXES_ARTICLES_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_ARTICLES_BOX_TITLE . '</div>' .
		  '  <div class="ui-widget-content infoBoxContents">' .
		  '   Try Me ' .
		  '  </div>' .
		  '</div>';
  $oscTemplate->addBlock($data, $this->group);
   }
   function isEnabled() {
  return $this->enabled;
   }
   function check() {
  return defined('MODULE_BOXES_ARTICLES_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 Articles Module', 'MODULE_BOXES_ARTICLES_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_ARTICLES_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_ARTICLES_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_ARTICLES_STATUS', 'MODULE_BOXES_ARTICLES_CONTENT_PLACEMENT', 'MODULE_BOXES_ARTICLES_SORT_ORDER');
   }
 }
?>

 

Corresponding code on the language side is :

 

<?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_ARTICLES_TITLE', 'Articles');
 define('MODULE_BOXES_ARTICLES_DESCRIPTION', 'Show article links');
 define('MODULE_BOXES_ARTICLES_BOX_TITLE', 'Articles');
?>

Share this post


Link to post
Share on other sites

 

Hi Jim,

 

I followed these instructions. I am able to see this in admin module. Installation and removal of the module in admin works fine. I am also able to edit (configure sort order, enable/disable, position) in the admin module. While everything works perfectly in the admin side, the box does not appear on the store page. I am doing some silly mistake. Please help. I am pasting the code here:

 

<?php
class bm_articles {
var $code = 'bm_articles';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;
function bm_articles() {
 $this->title = MODULE_BOXES_ARTICLES_TITLE;
 $this->description = MODULE_BOXES_ARTICLES_DESCRIPTION;
 if ( defined('MODULE_BOXES_ARTICLES_STATUS') ) {
 $this->sort_order = MODULE_BOXES_ARTICLES_SORT_ORDER;
 $this->enabled = (MODULE_BOXES_ARTICLE_STATUS == 'True');
 $this->group = ((MODULE_BOXES_ARTICLES_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_ARTICLES_BOX_TITLE . '</div>' .
		 ' <div class="ui-widget-content infoBoxContents">' .
		 ' Try Me ' .
		 ' </div>' .
		 '</div>';
 $oscTemplate->addBlock($data, $this->group);
}
function isEnabled() {
 return $this->enabled;
}
function check() {
 return defined('MODULE_BOXES_ARTICLES_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 Articles Module', 'MODULE_BOXES_ARTICLES_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_ARTICLES_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_ARTICLES_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_ARTICLES_STATUS', 'MODULE_BOXES_ARTICLES_CONTENT_PLACEMENT', 'MODULE_BOXES_ARTICLES_SORT_ORDER');
}
}
?>

 

Corresponding code on the language side is :

 

<?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_ARTICLES_TITLE', 'Articles');
define('MODULE_BOXES_ARTICLES_DESCRIPTION', 'Show article links');
define('MODULE_BOXES_ARTICLES_BOX_TITLE', 'Articles');
?>

 

Thanks

Ajay

Share this post


Link to post
Share on other sites

×