Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add images between module boxes?


AaronHaach

Recommended Posts

Posted

Hi guys, i know it can be done because ive seen it but im really struggling to find a solution

 

i want to add a small image on the left hand side of the page in between 'Manufacturers' & 'Whats New' modules boxes

 

i thought maybe it was something i could do through the OS Commerce dashboard, but ive had no luck

 

 

the website is http://absolutesuppl...dug42lngitji9d1

 

any ideas?

 

thanks in advance

 

 

Al

Posted

oscommerce-2.3.1\oscommerce-2.3.1\catalog\includes\modules\boxes

 

first you will have to create a .php file and upload to this folder.

 

Then using admin set its column and sort order.

Also you will have to create language file.

 

you can also check here: http://www.oscommerce.com/forums/topic/367702-creating-a-new-infobox-in-oscommerce-231/

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Posted

This new forum is going to take some getting used to. Took me a couple of minutes to find where they hid the CODE tags.

 

Anyway, paste this code in a file named bm_banner.php and upload it to your /includes/modules/boxes/ directory:

 

<?php
/*
 $Id: bm_banner.php v1.0 Kymation $
 $Loc: catalog/includes/modules/boxes/ $
 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_TITLE;
 	$this->description = MODULE_BOXES_BANNER_DESCRIPTION;
 	if ( defined( 'MODULE_BOXES_BANNER_STATUS' ) ) {
   	$this->sort_order = MODULE_BOXES_BANNER_SORT_ORDER;
   	$this->enabled = (MODULE_BOXES_BANNER_STATUS == 'True');
   	$this->group = ((MODULE_BOXES_BANNER_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
 	}
 	include_once( DIR_WS_CLASSES . 'language.php' );
 	$bm_banner_language_class = new language;
 	$languages = $bm_banner_language_class->catalog_languages;
 	foreach( $languages as $this_language ) {
   	$this->languages_array[$this_language['id']] = $this_language['name'];
 	}
}
function execute() {
 	global $language, $oscTemplate;
 	if ($banner = tep_banner_exists('dynamic', 'box_module')) {
   	$module_contents = '<div class="ui-widget infoBoxContainer">' . PHP_EOL;
   	if( tep_not_null( constant( 'MODULE_BOXES_BANNER_TITLE_' . strtoupper( $language ) ) ) ) {
     	$module_contents .= '  <div class="ui-widget-header infoBoxHeading">' . PHP_EOL;
     	if( tep_not_null( MODULE_BOXES_BANNER_TITLE_LINK ) ) {
       	$module_contents .= '	<a href="' . tep_href_link(MODULE_BOXES_BANNER_TITLE_LINK) . '">';
     	}
     	$module_contents .= constant( 'MODULE_BOXES_BANNER_TITLE_' . strtoupper( $language ) );
     	if( tep_not_null( MODULE_BOXES_BANNER_TITLE_LINK ) ) {
       	$module_contents .= '</a>';
     	}
     	$module_contents .= PHP_EOL;
     	$module_contents .= '  </div>' . PHP_EOL;
   	} // if( tep_not_null( 'MODULE_BOXES_BANNER_TITLE_
   	$module_contents .= '  <div class="ui-widget-content infoBoxContents" style="text-align: ' . MODULE_BOXES_BANNER_CONTENT_ALIGNMENT . ';">' . PHP_EOL;
   	$module_contents .=  tep_display_banner('static', $banner);
   	$module_contents .= '  </div>' . PHP_EOL;
   	$module_contents .= '</div>' . PHP_EOL;
   	$oscTemplate->addBlock( $module_contents, $this->group );
 	}
}
function isEnabled() {
 	return $this->enabled;
}
function check() {
 	return defined('MODULE_BOXES_BANNER_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 Module', 'MODULE_BOXES_BANNER_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '0', '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, date_added) values ('Sort Order', 'MODULE_BOXES_BANNER_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.', '6', '1', 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_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '2', '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 ('Title Link', 'MODULE_BOXES_BANNER_TITLE_LINK', 'index.php', 'Link the title of the box to a page (Leave empty for no link.)', '6', '3', 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 Alignment', 'MODULE_BOXES_BANNER_CONTENT_ALIGNMENT', 'center', 'Align the banner to the left, center, or right?', '6', '5', 'tep_cfg_select_option(array(\'left\', \'center\', \'right\'), ', now())");
foreach( $this->languages_array as $language_name ) {
   	tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ( '" . ucwords( $language_name ) . " Title', 'MODULE_BOXES_BANNER_TITLE_" . strtoupper( $language_name ) . "', 'Generic Title', 'Enter the title that you want on your box in " . $language_name . "', '6', '10', now())" );
 	}
}
function remove() {
 	tep_db_query( "delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
$keys = array();
$keys[] = 'MODULE_BOXES_BANNER_STATUS';
$keys[] = 'MODULE_BOXES_BANNER_SORT_ORDER';
$keys[] = 'MODULE_BOXES_BANNER_TITLE_LINK';
$keys[] = 'MODULE_BOXES_BANNER_CONTENT_PLACEMENT';
$keys[] = 'MODULE_BOXES_BANNER_CONTENT_ALIGNMENT';
foreach( $this->languages_array as $language_name ) {
  	$keys[] = 'MODULE_BOXES_BANNER_TITLE_' . strtoupper( $language_name );
}
 	return $keys;
}
 }
?>

This one is also named bm_banner.php and goes in your /includes/languages/english/modules/boxes/ directory:

 

<?php
/*
 $Id: bm_banner.php v1.0 Kymation $
 $Loc: catalog/includes/languages/english/modules/boxes/ $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2011 osCommerce

 Released under the GNU General Public License
*/

 define( 'MODULE_BOXES_BANNER_TITLE', 'Banner Box' );
 define( 'MODULE_BOXES_BANNER_DESCRIPTION', 'Show the banner box in a column.' );
?>

Next, log in to your Admin, go to Modules >> Boxes and install the Banners box.

 

Finally, go to the Banner Manger and upload your image, using box_module as the Banner Group.

 

Yes, I really should get around to uploading this thing to the Addons section.

 

Regards

Jim

 

Edit: Bleah. Stupid forum removed all the formatting from the code.

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

Archived

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

×
×
  • Create New...