Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add an image into an InfoBox?


Guest

Recommended Posts

Hi once again,

 

I'm not sure has this topic been posted before or not, if it has please do accept my apologies. I've been trying to find some information for this but i couldn't find any.

Basicly what i want to do is an image into my "LiveHelp" InfoBox. How do i do that? I can add text fine, but with images i just somehow can not.

 

Anybody got any ideas? I would be very grateful. Thank you in advance for any help.

 

 

Best regards,

 

 

 

Kevin Doan

Link to comment
Share on other sites

Hi kevin,

Try using the tep_image() function:

tep_image(DIR_WS_IMAGES . 'my-image.gif');

 

Let me know if you are uncertain how to use this in the file.

Link to comment
Share on other sites

Hi kevin,

Try using the tep_image() function:

tep_image(DIR_WS_IMAGES . 'my-image.gif');

 

Let me know if you are uncertain how to use this in the file.

Hi Rene,

 

Thank you very much for your respond and help. I'm sorry to bug you again, may i ask you that on which file should i try to use tep_image() function? The new infobox file, perhaps?

 

Basicly what i really want to do is add this picture live_support.gif into the new InfoBox i created under the name live support. I already have there yahooIM...but is it possible to add that picture just above the yahoo text?

 

Anyway here is a link to my site My Webpage. I'm really grateful if you could help me out with this problem. Hope someone can help me soon. Thank you in advance.

 

Good night everyone (3am) already...and see you again in the morning :).

 

Best regards

 

 

Kevin Doan

Link to comment
Share on other sites

Hi Kevin,

Yes, you need to add it in the infobox file - something like this:

'text' => tep_image(DIR_WS_IMAGES, 'my_image.gif') . '<br />Yahoo Messenger etc etc ';

 

where you now have something like:

'text' => 'Yahoo Messenger etc etc ';

 

Hope this helps.

Link to comment
Share on other sites

Hi Kevin,

Yes, you need to add it in the infobox file - something like this:

'text' => tep_image(DIR_WS_IMAGES, 'my_image.gif') . '<br />Yahoo Messenger etc etc ';

 

where you now have something like:

'text' => 'Yahoo Messenger etc etc ';

 

Hope this helps.

Hi, thank you so much for your respond :).

 

I want to apologise for being so dump, because i still can't get it work :(. Please can you look at my code below:

 

<?php

$info_box_contents = array();

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

 

new infoBoxHeading($info_box_contents, false, false);

 

$info_box_contents = array();

$info_box_contents[] = array('text' => tep_image(DIR_WS_IMAGES, 'live_support.gif') . '</a>');

 

 

new infoBox($info_box_contents);

?>

 

 

I really can't see where did i go wrong.

 

Hope to hear from you soon, thanks again :)

Link to comment
Share on other sites

you have the closing tag </a> does this mean that you wish the image to be a link if so then try

 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . tep_image(DIR_WS_IMAGES, 'live_support.gif') . '</a>');

where the FILENAME_CONTACT_US is the file you wish to link to

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.

Link to comment
Share on other sites

This is just to display an image.

 

$info_box_contents[] = array('text' => '<img src="images/yourimage.gif"><br>');

 

To use the image as a link then use this:

 

$info_box_contents[] = array('text' => '<a href="http://www.somewhere.com"><img src="images/yourimage.gif"></a><br>');

 

if you wish to place another link below it then you'd use this:

 

$info_box_contents[] = array('text' => '<a href="http://www.somewhere.com"><img src="images/yourimage.gif"></a><br>' .

 

and then place the next link on the next line, ending with ); instead of a dot (period).

 

Vger

Link to comment
Share on other sites

you have the closing tag </a> does this mean that you wish the image to be a link if so then try
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . '</a>tep_image(DIR_WS_IMAGES, 'live_support.gif') . '</a>');

where the FILENAME_CONTACT_US is the file you wish to link to

 

Hi, thanks for a quick respond. I tried your code, unfortunately the picture does not still display :(. May i ask you that do you think i need something else?

 

Best regards

 

 

Kevin Doan

Link to comment
Share on other sites

I made a mistake with the code should have been

 		$info_box_contents[] = array('text'  => '<a href="' . FILENAME_LIVE_SUPPORT . '">' . tep_image(DIR_WS_IMAGES . 'live_support.gif', IMAGE_LIVE_SUPPORT_AVAILABLE) . '</a>');

then your image needs to be in the images directory and set permission CHMOD 777

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.

Link to comment
Share on other sites

This is just to display an image.

 

$info_box_contents[] = array('text' => '<img src="images/yourimage.gif"><br>');

 

To use the image as a link then use this:

 

$info_box_contents[] = array('text' => '<a href="http://www.somewhere.com"><img src="images/yourimage.gif"></a><br>');

 

if you wish to place another link below it then you'd use this:

 

$info_box_contents[] = array('text' => '<a href="http://www.somewhere.com"><img src="images/yourimage.gif"></a><br>' .

 

and then place the next link on the next line, ending with ); instead of a dot (period).

 

Vger

 

Hi all,

 

Wow...Vger thank you for your codes. It worked perfectly. You are sooooooooo good :). I also would like to say thank you to ebbe and 241 for helping me out.

 

Once again thank you very much to everyone who help me out :). Well i got enough for today, i wish you all a good evening. Merry early christmas :).

 

 

Best regards,

 

 

 

From LONDON ;)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...