Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with infobox footer image


tayl1684

Recommended Posts

Posted

Hi

 

Im nearly finished with my site now and would just like to make a small cosmetic change to finish it off.

 

I want to put a footer image on the infoboxes but cant use the normal method because of the simple template system.

 

Diamonsea says the way to do it is to code it into includes/classes/boxes.php, I have tried but my php knowledge is shakey to say the least and so far no success.

 

If any one can help or give me pointers Id really appreciate it. Just this one thing left and the tiny mater of taking and editing 3000 photo's and I'm there Hurah!!! ;)

 

Thanks in advance

 

Ian

Posted

In includes/classes/boxes.php after the code section for class infoBoxHeading add this code

 

  class infoBoxFooting extends tableBox {
   function infoBoxFooting($contents, $left_corner_bottom = true, $right_corner_bottom = true, $right_arrow_bottom = false) {
     $this->table_cellpadding = '0';

     if ($left_corner_bottom == true) {
       $left_corner_bottom = tep_image(DIR_WS_IMAGES . 'infobox/corner_left_bottom.gif');
     } else {
       $left_corner_bottom = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left_bottom.gif');
     }
     if ($right_arrow_bottom == true) {
       $right_arrow_bottom = '<a href="' . $right_arrow_bottom . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right_bottom.gif', ICON_ARROW_RIGHT) . '</a>';
     } else {
       $right_arrow_botom = '';
     }
     if ($right_corner_bottom == true) {
       $right_corner_bottom = $right_arrow_bottom . tep_image(DIR_WS_IMAGES . 'infobox/corner_right_bottom.gif');
     } else {
       $right_corner_bottom = $right_arrow_bottom . tep_draw_separator('pixel_trans.gif', '11', '14');
     }

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

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

you can of course reduce the elements in this code if you want.

 

take your images and save in catalog/images/infobox/ as:

 

corner_left_bottom.gif

corner_right_left_bottom.gif

arrow_right_bottom.gif

corner_right_bottom.gif

 

Add this to catalog/stylesheet.css

 

TD.infoBoxFooting {
 font-family: Verdana, Arial, sans-serif;
 font-size: 10px;
 font-weight: bold;
 background: #bbc3d3;
 color: #ffffff;
}

again you can expand on the class elements with contents and hover etc and change infobox calls in the class code given for infoBoxFooting to give greater control of the section.

 

Then we take a box example catalog/includes/boxes/information.php

 

<?php
/*
 $Id: information.php,v 1.6 2003/02/10 22:31:00 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- information //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .
          '<a href="' . tep_href_link(FILENAME_CAT_REQUEST) . '">' . BOX_INFORMATION_CAT_REQUEST . '</a>');

 new infoBox($info_box_contents);

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

 new infoBoxFooting($info_box_contents, false, false);
?>
           </td>
         </tr>
<!-- information_eof //-->

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

hold on missed a bit of code this adds an image to the center cell, you can also do that in the infobox itself for seperate images, if doing in box itself ignore this code

 

class="infoBoxFooting"',
                                       'text' => $left_corner_bottom),
                                 array('params' => 'width="100%" height="14" class="infoBoxFooting"',
                                       'text' => $contents[0]['text']),
                                 array('params' => 'height="14" class="infoBoxFooting" nowrap',
                                       'text' => $right_corner_bottom));

can be changed to

class="infoBoxFooting"',
                                       'text' => $left_corner_bottom),
                                 array('params' => 'width="100%" height="14" class="infoBoxFooting" background="' . (DIR_WS_IMAGES . 'infobox/center_bottom.gif') . '"',
                                       'text' => $contents[0]['text']),
                                 array('params' => 'height="14" class="infoBoxFooting" nowrap',
                                       'text' => $right_corner_bottom));

adding an image to the center cell called center_bottom.gif again this image would be located in catalog/images/infobox

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

Thanks Steve had to restore to an earlier boxes.php cos I'd messed around with the latest one so much.

 

I only wanted a single bottom image so I commented out the everything apart from bottom left and used an image of the right width.

 

Will probably do it agin to use infobox background incase I need to have different footers.

 

I really appreciate your showing me how to do this, your a true gent!

 

Now just those photo's and then maybe a holiday.

 

Thanks again.

 

Ian

  • 3 weeks later...
Posted

Now I'm a novice, trying to make sense of it all and will probably ask a stupid question here, but these images you refer to actually don't exist yet, so I'm assuming the need to be created. And manually turned upside down for effect. Am I right?

 

I would like to know this before I start playing around with files.

 

Thanks.

RojanUK

Posted

This solution didn't work for me at all. The coding caused several parse errors... :(

RojanUK

Posted

found the problem. I put the add-on code you put in later in the thread in the wrong place. It's working like a charm now. Thanks!

RojanUK

Posted
This solution didn't work for me at all. The coding caused several parse errors... :(

the thread does say that you need to place the images in the images/infobox directory, which in itself would imply that you need these images.

The codes given work fine if placed in the proper place, however are stated as an example code, also stated that you can alter the codes to your needs.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted
the thread does say that you need to place the images in the images/infobox directory, which in itself would imply that you need these images.

The codes given work fine if placed in the proper place, however are stated as an example code, also stated that you can alter the codes to your needs.

You added a bit of code later, which you'd forgotten to put in before. That's the one I ended up placing in the wrong place. The rest was already done properly.

 

And what the images were concerned: That's what I said. I simply was doublechecking. I thought that was clear?

RojanUK

Archived

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

×
×
  • Create New...