osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Replacing text in infoBoxHeading with images

This is a discussion on Replacing text in infoBoxHeading with images within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Ok, here's the problem: My client has an unusual font for his logo, and wants as much of the content ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 08-28-2004, 12:39 PM
Member
 
Join Date: Aug 2004
Posts: 43
Thanks: 2
Thanked 4 Times in 3 Posts
Rep Power: 0
jbanda
Default Replacing text in infoBoxHeading with images

Ok, here's the problem:

My client has an unusual font for his logo, and wants as much of the content on his site in that font as possible (not my decision!). Of course, I can't define the font in the stylesheet because if the end-user doesn't have the font installed on their system, their browser will simply default to a more common font.

So, I've come up with a bunch of small graphics for the headers in the info boxes, but I can't seem to figure out how to replace the text with the graphic.

Please, don't tell me to modify the "TD.boxInfoHeading" in the style sheet, because I want a different graphic in the header of each info box.

Heeeeeeeellllllllp.....please....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 08-29-2004, 09:59 AM
Member
 
Join Date: Aug 2004
Posts: 43
Thanks: 2
Thanked 4 Times in 3 Posts
Rep Power: 0
jbanda
Default

Never mind; I figured it out!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 08-31-2004, 07:35 AM
Lurker
 
Join Date: Aug 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
urbancrunchy
Default

could you explain how you did it? i'd really appreciate the hints.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 09-01-2004, 02:37 AM
Member
 
Join Date: May 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
seank123
Default

Did you make new sections in sylesheet.css for each infobox?? Or is there an easier way of doing it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 09-02-2004, 07:20 AM
Member
 
Join Date: Aug 2004
Posts: 43
Thanks: 2
Thanked 4 Times in 3 Posts
Rep Power: 0
jbanda
Default

Sorry it's taken me so long to get back - I've been busy!

Yes, seank123, you must make new sections in the stylesheet.css for infobox, plus change several other files for each header box.

For the "Categories" box, for example:

First things first - make the graphic you want to replace the text.

Add the style and the graphic to stylesheet.css:

TD.infoBoxHeading2 {
background-image: url('images/newgraphic.gif');
background-repeat: no-repeat;
}


Go to catalog/includes/languages/english.php and edit this bit of code:

// categories box text in includes/boxes/categories.php
define('BOX_HEADING_CATEGORIES', 'Categories');

to this:

// categories box text in includes/boxes/categories.php
define('BOX_HEADING_CATEGORIES', '');

Next, go to catalog/includes/classes/boxes.php and change this bit of code:

class infoBoxHeading extends tableBox {
function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
$this->table_cellpadding = '0';

if ($left_corner == true) {
$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
} else {
$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');
}
if ($right_arrow == true) {
$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
} else {
$right_arrow = '';
}
if ($right_corner == true) {
$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');
} else {
$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
}

$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
'text' => $left_corner),
array('params' => 'width="100%" height="14" class="infoBoxHeading"',
'text' => $contents[0]['text']),
array('params' => 'height="14" class="infoBoxHeading" nowrap',
'text' => $right_corner));

$this->tableBox($info_box_contents, true);
}
}

to something like this:

class infoBoxHeading2 extends tableBox {
function infoBoxHeading2($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
$this->table_cellpadding = '0';

if ($left_corner == true) {
$left_corner = tep_image(DIR_WS_IMAGES . 'trans_pixel.gif');
} else {
$left_corner = tep_image(DIR_WS_IMAGES . 'trans_pixel.gif');
}
if ($right_arrow == true) {
$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
} else {
$right_arrow = '';
}
if ($right_corner == true) {
$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'trans_pixel.gif');
} else {
$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
}

$info_box_contents = array();
$info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading2"',
'text' => $left_corner),
array('params' => 'width="100%" height="14" class="infoBoxHeading2"',
'text' => $contents[0]['text']),
array('params' => 'height="14" class="infoBoxHeading" nowrap',
'text' => $right_corner));

$this->tableBox($info_box_contents, true);
}
}

You'll need to change the dimensions in the former bit of code if the size of your graphic is different than what is specified.

Then, go to catalog/includes/boxes/categories.php and change this bit of code:

new infoBoxHeading($info_box_contents, true, false);

to this:

new infoBoxHeading($info_box_contents);

and I believe that's it. You do have to do it for each and every info box you wish to change.

Hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
The Following User Says Thank You to jbanda For This Useful Post:
typhus (02-22-2008)
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Text Greeting, Text Main switch rashunda osCommerce 2.2 Modification Help 2 08-02-2005 10:00 PM
newbie. problem with replacing a text with an image techan osCommerce 2.2 Modification Help 3 05-19-2004 02:36 PM
HELP - trying to edit "infoBoxHeading" text 808casher osCommerce 2.2 Modification Help 2 07-29-2003 07:50 PM
Problem with background image in infoBoxHeading... mac osCommerce 2.2 Modification Help 40 04-14-2003 06:33 AM
Images uploaded in /catalog/images Anonymous osCommerce 2.2 Installation Help 1 12-05-2002 08:15 AM


All times are GMT -8. The time now is 05:01 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax