Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

InfoBox Image Will Not Display


AllThingsTrendy

Recommended Posts

Posted

With no luck, I've searched for an answer to this issue in the forums... If I've missed this please point me to the post. :'(

 

I can not get new infoboxes to display an image in the heading. I have copied the existing files for the information box (which has an image in the header) to create a new infobox with the file name of dealoftheday.php (see the "Deal of the Day" box on AllThingsTrendy.com). I have created an image for the Deal of the Day header ( http://www.allthingstrendy.com/catalog/ima...ealoftheday.gif ) and put it in the same directory as the images for the rest of my infoboxes.

 

Unfortunately, I can not figure out why this image will not display in the header. I have searched the code pages to determine how I designate such an image file for a particular box. I have even downloaded my entire site and searched the files for the files names of the images used on the other boxes. All that I have found is the following in classes/boxes.php Does this not indicate that the image for the infobox header must be named the same as the infobox file (which I have done)?

 

This has got to be something really silly and simple... I am just baffled! Any help is greatly appreciated!

 

Thanks,

Wayne

 

$right_corner = '';

 

$filename = $contents[0]['text'];

$filename = ereg_replace("[^a-zA-Z0-9]", "", $filename);

$filename = strtolower($filename);

 

$fileloc = DIR_WS_IMAGES . 'infobox/' . $filename . '.gif';

 

$info_box_contents = array();

 

if (file_exists($fileloc))

{

$headerName = tep_image($fileloc, $contents[0]['text'] );

}

else

{

$headerName = $contents[0]['text'];

}

if ($right_arrow == true) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Anthony David

AllThingsTrendy.com

Posted
This has got to be something really silly and simple... I am just baffled! Any help is greatly appreciated!

 

Thanks,

Wayne

 

Hi Wayne

 

I did this once on a site a couple of years ago, but I'm pretty sure I followed the instructions in this contribution:

 

http://addons.oscommerce.com/info/867

 

There is also some advice for doing it using CSS here: http://addons.oscommerce.com/info/4194, but I've never used them, so I can't tell you how good they are.

 

Hope this helps

 

Simon

Posted

Simon,

 

Thanks for the quick reply. However, I'm still stumped. All of my other boxes are using images yet my site is not using either of the methods described in your suggested posts. I have checked my CSS and there is no reference to images as suggested by the contribution. I also checked the OSC addon's link.... it indicates referencing the image directly in the infobox.php while creating a directory for these images in the ..language../boxes directory. Problem is that NONE of my infoboxes have any code in them that reference an image file. Below is the full code from my current "information.php". As you can see, there is nothing referencing a header image... yet, there is a header image displaying on my site. This is why I though the class/boxes.php reference above was determing the image.

 

<?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 © 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 class="otherA" href="' . tep_href_link(FILENAME_SATISFACTION) . '">' . BOX_INFORMATION_SATISFACTION . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_SECURE . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_LOYALTY) . '">' . BOX_INFORMATION_LOYALTY . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_ANTHONYDAVID) . '">' . BOX_INFORMATION_ANTHONYDAVID . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_WHOLESALE) . '">' . BOX_WHOLESALE_INQUIRY . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_GV_FAQ, '', 'NONSSL') . '">' . BOX_INFORMATION_GV . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_TRENDZY_RESOURCE1A, '', 'NONSSL') . '">' . BOX_INFORMATION_TRENDZY_RESOURCE1A . '</a><br>' .

'<a class="otherA" href="' . tep_href_link(FILENAME_ANTHONY_DAVID_SWAROVSKI_CRYSTAL, '', 'NONSSL') . '">' . BOX_INFORMATION_ANTHONY_DAVID_SWAROVSKI_CRYSTAL . '</a>');

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- information_eof //-->

Anthony David

AllThingsTrendy.com

Posted

I have continued digging and still can not find how these images are being pulled into the infoboxes. Any help would be greatly appreciated.

 

Thanks,

Wayne

Anthony David

AllThingsTrendy.com

Posted
It could be in your includes/languages/english.php file. Have a look at this

 

http://www.oscommerce.info/kb/osCommerce/C...g_Area/Boxes/44

 

Brian, thanks for the suggestion. I've been down that path. No heading images are defined in the languages/english.php file. I can only decipher that these images are determined in the classes/boxes.php as shown above by using the file name of the box and adding .gif. Yet, I have an image with that filename + .gif and that image is in the same directory as the images that are showing for all of my other infoboxes. Hence... still stumped!

 

Thanks,

Wayne

Anthony David

AllThingsTrendy.com

Posted

I may be off here, but I think the problem is here:

 

if (file_exists($fileloc))
{
$headerName = tep_image($fileloc, $contents[0]['text'] );
}

I don't think it's passing that "if" test because the PHP function file_exists expects a "full path name".

 

Earlier in the code, your last assignment was this:

 

$fileloc = DIR_WS_IMAGES . 'infobox/' . $filename . '.gif';

That gives it a "relative" location within your web site.

 

I think you need an "absolute path" from the root.

 

Try this for the "if" condition:

 

if (file_exists(DIR_FS_CATALOG . $fileloc))

That should give it an "abolute path" from the root.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Archived

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

×
×
  • Create New...