Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

infobox header background--- change to image


Guest

Recommended Posts

Ok I know how to deal with the corners on the infobox header... by either creating new ones (which I did), or playing the true false game .... but how do I change from a solid background color to a image?

 

It's probably something so simple that I'll slap myself. :blink:

 

from the style sheet:

 

TD.infoBoxHeading {
?font-family: Verdana, Arial, sans-serif;
?font-size: 11px;
?font-weight: bold;
?background: WHAT DO I ENTER HERE???????;
?color: #ffffff;
}

 

I know it has to be a url that goes above.. but for the life of me I can not figure out how to type it in so the site recognizes the code.

 

The location of the image i want to use for the background is located at:

http://www.extremeoutdoorgear.co.uk/images/infobox/infoboxheader_background.gif

 

thanks in advance.. I'm sure someone will be able to answer this one quickly for me.

Link to comment
Share on other sites

Ok resolved that question with a bit more digging into the search engine... now a new one has come about.

 

When I changed the background color to a background image my border went poof. So how do I get the border back around my boxes?

Link to comment
Share on other sites

I wrote a small mod for changing/adding/rmoving borders from my boxes very fast, when my customer changes his mind (which happens too often)

 

see this example of the currency box, all boxes need to be adjusted for the opening/closing <tr><td> tags

<?php
/*
 $Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 if (isset($currencies) && is_object($currencies)) {
?>
<!-- currencies //-->
<?php

echo BOX_DEF_START;

   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_CURRENCIES);

   new infoBoxHeading($info_box_contents, false, false);

   reset($currencies->currencies);
   $currencies_array = array();
   while (list($key, $value) = each($currencies->currencies)) {
     $currencies_array[] = array('id' => $key, 'text' => $value['title']);
   }

   $hidden_get_variables = '';
   reset($HTTP_GET_VARS);
   while (list($key, $value) = each($HTTP_GET_VARS)) {
     if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
       $hidden_get_variables .= tep_draw_hidden_field($key, $value);
     }
   }

   $info_box_contents = array();
   $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
                                'align' => 'center',
                                'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

   new infoBox($info_box_contents);

echo BOX_DEF_END;
?>
<!-- currencies_eof //-->
<?php
 }
?>

 

I added this to application_top.php right before the closing php tag

// define the look of the borders for boxes
define('BOX_DEF_START', '<tr><td><table class="tableborder" width="100%" cellspacing="0" cellpadding="0"><tr><td>');
define('BOX_DEF_END', '</td></tr></table></td></tr>');

 

I then define in stysheet the class for the border

TABLE.tableborder {
 border: solid; 
 border-width: 1px; 
 border-color: #9999CC; 
}

 

You can use solid, dashed, dotted .... change to a wider border in seconds, change the color fast ... have fun!

 

Just important to go through all your boxes once and replace the current hardcoded box start/end with the new dynamic ones.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

I wrote a small mod for changing/adding/rmoving borders from my boxes very fast, when my customer changes his mind (which happens too often)

 

see this example of the currency box, all boxes need to be adjusted for the opening/closing <tr><td> tags

<?php
/*
?$Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

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

?Copyright (c) 2003 osCommerce

?Released under the GNU General Public License
*/

?if (isset($currencies) && is_object($currencies)) {
?>
<!-- currencies //-->
<?php

echo BOX_DEF_START;

? ?$info_box_contents = array();
? ?$info_box_contents[] = array('text' => BOX_HEADING_CURRENCIES);

? ?new infoBoxHeading($info_box_contents, false, false);

? ?reset($currencies->currencies);
? ?$currencies_array = array();
? ?while (list($key, $value) = each($currencies->currencies)) {
? ? ?$currencies_array[] = array('id' => $key, 'text' => $value['title']);
? ?}

? ?$hidden_get_variables = '';
? ?reset($HTTP_GET_VARS);
? ?while (list($key, $value) = each($HTTP_GET_VARS)) {
? ? ?if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
? ? ? ?$hidden_get_variables .= tep_draw_hidden_field($key, $value);
? ? ?}
? ?}

? ?$info_box_contents = array();
? ?$info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'align' => 'center',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

? ?new infoBox($info_box_contents);

echo BOX_DEF_END;
?>
<!-- currencies_eof //-->
<?php
?}
?>

 

I added this to application_top.php right before the closing php tag

// define the look of the borders for boxes
define('BOX_DEF_START', '<tr><td><table class="tableborder" width="100%" cellspacing="0" cellpadding="0"><tr><td>');
define('BOX_DEF_END', '</td></tr></table></td></tr>');

 

I then define in stysheet the class for the border

TABLE.tableborder {
?border: solid; 
?border-width: 1px; 
?border-color: #9999CC; 
}

 

You can use solid, dashed, dotted .... change to a wider border in seconds, change the color fast ... have fun!

 

Just important to go through all your boxes once and replace the current hardcoded box start/end with the new dynamic ones.

 

ok I've tried the above and this is not working. I duplicated your currency configuration and noted that you had removed the <tr>/<td> tags from it and added in the "echo BOX_DEF_BEGIN & END tags and all this did was show that text up above and below my currency box. I also tried some other adjustments and it would completely offset the row of boxes making them what looks to be 100% wide even when I adjusted the width to 20% just as a test. So I'm not sure where the problem is coming about.

 

Here is a copy of my currency box as it is now before any adjustments:

<?php
/*
 $Id: currencies.php,v 1.16 2003/02/12 20:27:31 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 if (isset($currencies) && is_object($currencies)) {
?>
<!-- currencies //-->
         <tr>
           <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text' => BOX_HEADING_CURRENCIES);

   new infoBoxHeading($info_box_contents, false, false);

   reset($currencies->currencies);
   $currencies_array = array();
   while (list($key, $value) = each($currencies->currencies)) {
     $currencies_array[] = array('id' => $key, 'text' => $value['title']);
   }

   $hidden_get_variables = '';
   reset($HTTP_GET_VARS);
   while (list($key, $value) = each($HTTP_GET_VARS)) {
     if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
       $hidden_get_variables .= tep_draw_hidden_field($key, $value);
     }
   }

   $info_box_contents = array();
   $info_box_contents[] = array('form' => tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get'),
                                'align' => 'center',
                                'text' => tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id());

   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- currencies_eof //-->
<?php
 }
?>

 

and here is a copy of my application_top file as it is now with no adjustments:

 

<?php
/*
 $Id: application_top.php,v 1.162 2003/07/12 09:39:03 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// Start the clock for the page parse time log
 define('PAGE_PARSE_START_TIME', microtime());

// Set the level of error reporting
 error_reporting(E_ALL & ~E_NOTICE);

// Check if register_globals is enabled.
// Since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
 if (function_exists('ini_get')) {
   ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
 }

// Set the local configuration parameters - mainly for developers
 if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

// Include application configuration parameters
 require('includes/configure.php');

// Define the project version
 define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

// set php_self in the local scope
 $PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

// Used in the "Backup Manager" to compress backups
 define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
 define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
 define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
 define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');

// include the list of project filenames
 require(DIR_WS_INCLUDES . 'filenames.php');

// include the list of project database tables
 require(DIR_WS_INCLUDES . 'database_tables.php');

// customization for the design layout
 define('BOX_WIDTH', 125); // how wide the boxes should be in pixels (default: 125)

// Define how do we update currency exchange rates
// Possible values are 'oanda' 'xe' or ''
 define('CURRENCY_SERVER_PRIMARY', 'oanda');
 define('CURRENCY_SERVER_BACKUP', 'xe');

// include the database functions
 require(DIR_WS_FUNCTIONS . 'database.php');

// make a connection to the database... now
 tep_db_connect() or die('Unable to connect to database server!');

// set application wide parameters
 $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
 while ($configuration = tep_db_fetch_array($configuration_query)) {
   define($configuration['cfgKey'], $configuration['cfgValue']);
 }

// define our general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

// initialize the logger class
 require(DIR_WS_CLASSES . 'logger.php');

// include shopping cart class
 require(DIR_WS_CLASSES . 'shopping_cart.php');

// some code to solve compatibility issues
 require(DIR_WS_FUNCTIONS . 'compatibility.php');

// check to see if php implemented session management functions - if not, include php3/php4 compatible session class
 if (!function_exists('session_start')) {
   define('PHP_SESSION_NAME', 'osCAdminID');
   define('PHP_SESSION_PATH', '/');
   define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

   include(DIR_WS_CLASSES . 'sessions.php');
 }

// define how the session functions will be used
 require(DIR_WS_FUNCTIONS . 'sessions.php');

// set the session name and save path
 tep_session_name('osCAdminID');
 tep_session_save_path(SESSION_WRITE_DIRECTORY);

// set the session cookie parameters
  if (function_exists('session_set_cookie_params')) {
   session_set_cookie_params(0, DIR_WS_ADMIN);
 } elseif (function_exists('ini_set')) {
   ini_set('session.cookie_lifetime', '0');
   ini_set('session.cookie_path', DIR_WS_ADMIN);
 }

// lets start our session
 tep_session_start();

// set the language
 if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
   if (!tep_session_is_registered('language')) {
     tep_session_register('language');
     tep_session_register('languages_id');
   }

   include(DIR_WS_CLASSES . 'language.php');
   $lng = new language();

   if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
     $lng->set_language($HTTP_GET_VARS['language']);
   } else {
     $lng->get_browser_language();
   }

   $language = $lng->language['directory'];
   $languages_id = $lng->language['id'];
 }

// include the language translations
 require(DIR_WS_LANGUAGES . $language . '.php');
 $current_page = basename($PHP_SELF);
 if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
   include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
 }

// define our localization functions
 require(DIR_WS_FUNCTIONS . 'localization.php');

// Include validation functions (right now only email address)
 require(DIR_WS_FUNCTIONS . 'validations.php');

// setup our boxes
 require(DIR_WS_CLASSES . 'table_block.php');
 require(DIR_WS_CLASSES . 'box.php');

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// split-page-results
 require(DIR_WS_CLASSES . 'split_page_results.php');

// entry/item info classes
 require(DIR_WS_CLASSES . 'object_info.php');

// email classes
 require(DIR_WS_CLASSES . 'mime.php');
 require(DIR_WS_CLASSES . 'email.php');

// file uploading class
 require(DIR_WS_CLASSES . 'upload.php');

// calculate category path
 if (isset($HTTP_GET_VARS['cPath'])) {
   $cPath = $HTTP_GET_VARS['cPath'];
 } else {
   $cPath = '';
 }

 if (tep_not_null($cPath)) {
   $cPath_array = tep_parse_category_path($cPath);
   $cPath = implode('_', $cPath_array);
   $current_category_id = $cPath_array[(sizeof($cPath_array)-1)];
 } else {
   $current_category_id = 0;
 }

// default open navigation box
 if (!tep_session_is_registered('selected_box')) {
   tep_session_register('selected_box');
   $selected_box = 'configuration';
 }

 if (isset($HTTP_GET_VARS['selected_box'])) {
   $selected_box = $HTTP_GET_VARS['selected_box'];
 }

// the following cache blocks are used in the Tools->Cache section
// ('language' in the filename is automatically replaced by available languages)
 $cache_blocks = array(array('title' => TEXT_CACHE_CATEGORIES, 'code' => 'categories', 'file' => 'categories_box-language.cache', 'multiple' => true),
                       array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers', 'file' => 'manufacturers_box-language.cache', 'multiple' => true),
                       array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased', 'file' => 'also_purchased-language.cache', 'multiple' => true)
                      );

// check if a default currency is set
 if (!defined('DEFAULT_CURRENCY')) {
   $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
 }

// check if a default language is set
 if (!defined('DEFAULT_LANGUAGE')) {
   $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
 }

 if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
   $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
 }
 
// Include OSC-AFFILIATE
 require('includes/affiliate_application_top.php');

// Live Support
  // Control options for Live Support
  // Colors Available blue, green, red, white, yellow
  // Archive: set to false to delete conversation when user leaves
  // warning set what warning you wish to use:
  //   include the name of the .wav or .midi file and be sure to upload to the live_support folder

  define('LS_COLOR', 'white');
  define('LS_ARCHIVE', 'false');
  define('LS_WARNING', 'warning.wav');

// Low Stock
 define('FILENAME_STATS_LOW_STOCK', 'stats_low_stock.php');

// PDF Catalog  
 define('FILENAME_PDF_CATALOGUE', 'pdf_catalogue.php'); 

 
// WebMakers.com Added: Includes Functions for Attribute Sorter and Copier
require(DIR_WS_FUNCTIONS . 'webmakers_added_functions.php');

// Admin Access
//------------------------------------------------
// include the password crypto functions
 require(DIR_WS_FUNCTIONS . 'password_funcs.php');
//------------------------------------------------
//------------------------------------------------
// check login  
 if (basename($PHP_SELF) != FILENAME_LOGIN && basename($PHP_SELF) != FILENAME_PASSWORD_FORGOTTEN && basename($PHP_SELF) != FILENAME_CRON_CURRENCIES) { 
   tep_admin_check_login(); 
 } 
//------------------------------------------------  
?>

 

All I'm trying to do on my site which is www.extremeoutdoorgear.co.uk/index.php is create the borders back around the boxes. When i removed the background color form the header of the boxes and replaced it with the background image the borders disappeared.

 

So hopefully you can either enter in the code for me to copy back over and past just as I should have it to make a 1px black border or someone else can figure out how to resolve what would seem to be a simple problem, but really is doing my head in.

 

thanks in advance,

Joe

Link to comment
Share on other sites

Hi Joe, there really is no other trick then what I posted. If you'd like to, pm me your ftp infos and I'll play with it for you.

 

You can see it in action here, but I've used it several times already ...

 

http://www.noahsark4kids.com/test/

 

on the link you gave me it looks like only the header part has a border ... my code puts a border around the whole box.

 

Maybe I misunderstood what you needed.

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Ok resolved that question with a bit more digging into the search engine... now a new one has come about.

 

When I changed the background color to a background image my border went poof. So how do I get the border back around my boxes?

 

Hi In the first part you said you found the image fix: This is from my CSS which did not affect the box border color at all.

 

TD.infoBoxHeading {

font-family: Verdana, Arial, sans-serif;

font-size: 10px;

font-weight: bold;

background: #9900CC;

background-image: url('images/infobox/bar22.gif');

background-attachment: fixed;

background-repeat: repeat;

color: #ffffff;

}

 

Check above image call section for the following: background: #YOUR COLOR; I think you must still have a background color behind any image. I tried removing mine, and nothing happened. However... above this section you should find:

 

.infoBox {

background: #9900CC;

}

 

This definately changes the border color. It may be set to white or a color that is neutral to your page. Just some thoughts, to add to your experiment. Hope this is of some help to you. :rolleyes:

We help each other, to help ourselves!

Aloha Allison!

 

Liken to wrinkles, the many paths of my life not only altered my destiny, but my appearance.

 

Poetry, the artistry of plying ones soul to the empty canvases of life. A vision without sight. A verse without darkness. Lighting each day with a prose of beauty and love.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...