Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

what is the code for adding image in a box?


tonyv

Recommended Posts

Tony

 

It depends on what type of image you want to put in.

 

tep_image(my_picture.gif) is generally the comand.

 

Just be sure that if your putting it in between html that you <?php echo tep_image(my_picture.gif); ?> the image.

 

As to what file . The boxes are located in catalog/includes/boxes/

 

Hope this helps

PhilipH

Link to comment
Share on other sites

PhilipH

 

this is what I have now in the box file

 

<?php

$info_box_contents = array();

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

 

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>');

 

new infoBox($info_box_contents);

?>

 

 

and I want to take all but one text link out and add just one image,,, can you show me how the code should look.... I would like the image first in the box, and then I want one link under it, so if you rewrite this, just use the image you had before... image.gif is fine and then leave in one of the above links and I will edit it right under the image... thanks again for all your help

Link to comment
Share on other sites

Sorry tony I is conflustered :-)

 

The above code relates to the information box. This has just text. I'm not sure where exactly you're looking to put the image

 

PhilipH

Link to comment
Share on other sites

Sorry tony I is conflustered :-)

 

The above code relates to the information box. This has just text. I'm not sure? where exactly you're looking to put the image

 

PhilipH

 

Once again I failed to make myself clear.... Sorry

 

Ok, from the begining.....

I created a new box in the left column under a box that has links out to "shipping, privacy, conditions, and contact"

 

the new box I created is a duplicate of a box that was already there, called "Informaiton"

 

What I am wanting to do is now delete these links, except one, becuase my plan is to put an image of the secure seal in the box and have a text link under it as well.

 

if you go to This Page and look in the bottom left column you will see that the last box is a duplicate of the information box above it except I was able to change the header to "secure server" now I want to put an image in that box with one text link under it.....

Hope this helps you understand better what I want to do, just need to know the code to put it in.

Thanks.

Link to comment
Share on other sites

As the song goes

I can see clearly now the rain has gone. I can see all obsticles in my way ......

 

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Secure Server');

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>');

new infoBox($info_box_contents);
?>

 

The above is your original. OK so remove all the href's except one - where you'll put the link to your secure page - probably your login.php page.

Now you want to add in your image of your secure cert within the href. OK

 

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Secure Server');

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_LOGIN,'','SSL') . '">' . BOX_TEXT_MY_SECURE_CERT . '</a><br>' . tep_image(my_ssl_cert_image.gif));

new infoBox($info_box_contents);
?>

 

Then in your english.php file insert the following :

define('BOX_TEXT_MY_SECURE_CERT','Please click here to verify my ssl certificate');

 

Hope this works and enjoy :D

 

PhilipH

Link to comment
Share on other sites

As the song goes

 

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Secure Server');

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>');

new infoBox($info_box_contents);
?>

 

The above is your original. OK so remove all the href's except one - where you'll put the link to your secure page - probably your login.php page.

Now you want to add in your image of your secure cert within the href. OK

 

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Secure Server');

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_LOGIN,'','SSL') . '">' . BOX_TEXT_MY_SECURE_CERT . '</a><br>' . tep_image(my_ssl_cert_image.gif));

new infoBox($info_box_contents);
?>

 

Then in your english.php file insert the following :

define('BOX_TEXT_MY_SECURE_CERT','Please click here to verify my ssl certificate');

 

Hope this works and enjoy :D

 

PhilipH

 

 

 

 

once again I left out some information.... what I really want to do is link out externely... the secure company "comodo" is offering me a link out to show that the certificate is good...... I tried what you have here and cant seem to get it working so far,,,, trying to look over the code carefully now and see where I might have gone wrong.

can you show me this code again with an externel link instead? also can we get fancy and ad alt text.? lol

 

editing the php files as you say, brought back errors...... to both the english and the secure.php as I named it.... should have coppied the errors but they were in regards to parse errers, unexpected etc....

 

maybe becuase I changed the directory to the image? you have, " my_ssl_cert_image.gif and I changed it to images/my_ssl_cert_image.gif will this work or not?

 

ok, so far you have come thru for me on everything else, so I know you will on this... thanks again for all your help

Link to comment
Share on other sites

One more thing, I just got it to work actually and I see that the text link is above the image, I would like to reverse it and have the text link out as I mentioned to an external link, and the image to have the same link if I can but to come second under the linking text like this

 

image

linking text

 

and if I can make the image an external link as well that would be great along with alt text if thats not too much to ask lol

 

Thanks Philip

Link to comment
Share on other sites

Sorry Terry my fault

 

I forgot to add the '' to the image. As for the alt :angry:

 

To start finding where things should go check the includes/functions/html_output.php file, it's educational :-"

 

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Secure Server');

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_LOGIN,'','SSL') . '">' . BOX_TEXT_MY_SECURE_CERT . '</a><br>' . tep_image('my_ssl_cert_image.gif', MY_ALT_TEXT));

new infoBox($info_box_contents);
?>

 

As for the external link. NO choice but to hard code - from experience - tep only works on internal links. So now we look like this ....

<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => 'Secure Server');

new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('text' => '<a href="https://www.external_link.com" target="_blank">' . BOX_TEXT_MY_SECURE_CERT . '</a><br>' . tep_image('my_ssl_cert_image.gif', MY_ALT_TEXT));

new infoBox($info_box_contents);
?>

 

oh yeh and stick another define in the english file :

 

define('MY_ALT_TEXT','My alternative text');

 

PhilipH

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...