Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Inserting Images Into TEXT_MAIN


DazJ

Recommended Posts

Posted

I've searched and searched but for the life of me can't seem to find ANYWHERE that has the line of code I need to display an image on my TEXT_MAIN index.php page.

 

The image required is in the /images folder so what do I need to type in TEXT_MAIN?

 

Cheers in advance.

Posted
I've searched and searched but for the life of me can't seem to find ANYWHERE that has the line of code I need to display an image on my TEXT_MAIN index.php page.

 

The image required is in the /images folder so what do I need to type in TEXT_MAIN?

 

Cheers in advance.

 

  define('TEXT_MAIN',
 'I am some text' . tep_image(DIR_WS_IMAGES . 'myImageName.jpg', '100', '100') . ' I am some more text');

Posted

Thankyou but that doesn't work. It just makes the entire page not appear.

 

Here's my code:

 

define('TEXT_MAIN', '<B>100% genuine & licensed games at wholesale prices! Wanna order in bulk? Let us know and we\'ll arrange an even CHEAPER price!!!</B>' .

'tep_image(DIR_WS_IMAGES . 'beijing_olympics.jpg', '100', '100')
');

Posted
Thankyou but that doesn't work.

 

Yes it does .. your interpretation is what doesn't work.

 

define('TEXT_MAIN', '<B>100% genuine & licensed games at wholesale prices! Wanna order in bulk? Let us know and we\'ll arrange an even CHEAPER price!!!</B>' .
tep_image(DIR_WS_IMAGES . 'beijing_olympics.jpg', '100', '100'));

Posted
Yes it does .. your interpretation is what doesn't work.

 

define('TEXT_MAIN', '<B>100% genuine & licensed games at wholesale prices! Wanna order in bulk? Let us know and we\'ll arrange an even CHEAPER price!!!</B>' .
tep_image(DIR_WS_IMAGES . 'beijing_olympics.jpg', '100', '100'));

 

Thankyou but I removed the 100x100 dimensions. It works fine but now I need the image on the next line and in the centre. How would I do that?

Posted
Thankyou but I removed the 100x100 dimensions. It works fine but now I need the image on the next line and in the centre. How would I do that?

 

I don't mind solving a coding issue but I'm not doing your basic html.

Posted
I don't mind solving a coding issue but I'm not doing your basic html.

 

Ok thankyou. Anyone else fancy helping a newbie who isn't a genius? Any help would be appreciated. Once I know I won't have to ask again. Thanks.

Posted

This link is full of ads, but it does have a very nice chart of html tags. You will find it useful to format your pages.

<P> creates a paragraph break

and

<center> text or image here </center> will center your text or image

html tags

Posted
This link is full of ads, but it does have a very nice chart of html tags. You will find it useful to format your pages.

<P> creates a paragraph break

and

<center> text or image here </center> will center your text or image

html tags

 

Excellent! Thankyou for helping me, it's just what I needed and a lot more simple than that complicated code at first.

Posted
Excellent! Thankyou for helping me, it's just what I needed and a lot more simple than that complicated code at first.

 

Less complicated but bear in mind that the <center> element was deprecated in HTML 4.01 and also in oscommerce you should use the PHP function tep_image() for images not simple <img> html, if you don't you'll create all sorts of problems for yourself further down the road .. e.g. secure pages.

Posted
Less complicated but bear in mind that

 

Sorry, I didn't mean for anyone to change the code you provided. I was trying to point the direction to some basic html tags for formatting the rest of the page.

 

Tim

  • 5 weeks later...
Posted
I tried your code, but my image won't display - Can you tell me what I did wrong? Thanks!

 

tep_image (DIR_WS_IMAGES. 'credit_cards_logos.JPG'));

 

are you getting a php error, or is it that you see an empty box where the image should be?

 

if it's a php error, we'd need more code that just what you provided. give us not only the text of the php error, but the code with a few lines above and below where the error is occurring.

 

you might have the file name wrong - try .jpg instead of .JPG. most web servers are unix and they are case sensitive for their file names. also, make sure that the image is actually there. you may have uploaded it to a different directory.

Posted
are you getting a php error, or is it that you see an empty box where the image should be?

 

if it's a php error, we'd need more code that just what you provided. give us not only the text of the php error, but the code with a few lines above and below where the error is occurring.

 

you might have the file name wrong - try .jpg instead of .JPG. most web servers are unix and they are case sensitive for their file names. also, make sure that the image is actually there. you may have uploaded it to a different directory.

 

I inserted the credit card image under the authorize.net seal. The seal displays on my right column. The credit cards logo just displays the "x" on my site - like a broken link. I changed the JPG to lower case and double checked the logo. I still need help!

 

src="//verify.authorize.net/anetseal/seal.js" ></script>

 

<br> tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg'));

 

</center> </td> </tr>

Posted
src="//verify.authorize.net/anetseal/seal.js" ></script>

 

<br> tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg'));

 

</center> </td> </tr>

 

it appears that your tep_image() call is not inside php tags. try this:

 

<br><?php echo tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg')); ?>

 

if that doesn't work, you will need to post more of the surrounding code, up to and including any <?php and ?> tags so that someone can get an idea of exactly how you're trying to use this.

Posted
it appears that your tep_image() call is not inside php tags. try this:

 

<br><?php echo tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg')); ?>

 

if that doesn't work, you will need to post more of the surrounding code, up to and including any <?php and ?> tags so that someone can get an idea of exactly how you're trying to use this.

 

 

Arietis - Thanks for your assistance, but I still haven't been able to view my credit cards' logo. I'm trying to put it on the right column under the reviews box - I've included more code work leading up to this. Of course, I modified authorize.net info. I want to place credit card logo under the authorize.net logo. Hope this makes sense. :blink:

 

require(DIR_WS_BOXES . 'reviews.php');

 

?>

 

<tr><td><br><center>

 

 

<!-- © 2005, 2008. Authorize.Net is a registered trademark of CyberSource Corporation --> <div class="AuthorizeNetSeal"> <script type="text/javascript" language="javascript">var ANS_customer_id="12345";</script> <script type="text/javascript" language="javascript" src="//verify.authorize.net/aneseal/seal.js" ></script>

 

<br>echo tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg'));

 

 

</center> </td> </tr>

Posted

it appears you missed the php tags in the example i gave you in my previous post. make sure that you have the <?php before the 'echo' and a ?> at the end.

Posted
it appears you missed the php tags in the example i gave you in my previous post. make sure that you have the <?php before the 'echo' and a ?> at the end.

 

 

Ok, I will try it again. The last time I did, the whole right column disappeared!

Posted
Ok, I will try it again. The last time I did, the whole right column disappeared!

 

<br><?php echo tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg'));?>

 

</center> </td> </tr>

 

 

I tried it and the same thing happened - right column disappeared except for the error message displayed.

Posted
<br><?php echo tep_image (DIR_WS_IMAGES.'credit_cards_logos.jpg'));?>

 

</center> </td> </tr>

 

 

I tried it and the same thing happened - right column disappeared except for the error message displayed.

 

Your first mistake in the above code is that THERE IS NO SPACE BETWEEN tep_image and the opening bracket ( ... it should read like this: tep_image(DIR_WS_IMAGES...

Your second mistake is your double closing brackets ... it should read:

<?php echo tep_image(DIR_WS_IMAGES . 'credit_cards_logos.jpg'); ?>

Posted
Your first mistake in the above code is that THERE IS NO SPACE BETWEEN tep_image and the opening bracket ( ... it should read like this: tep_image(DIR_WS_IMAGES...

Your second mistake is your double closing brackets ... it should read:

<?php echo tep_image(DIR_WS_IMAGES . 'credit_cards_logos.jpg'); ?>

 

 

Wow - that was it! It worked!!! Thank you, thank you to both of you! B)

  • 7 months later...
Posted
Your first mistake in the above code is that THERE IS NO SPACE BETWEEN tep_image and the opening bracket ( ... it should read like this: tep_image(DIR_WS_IMAGES...

Your second mistake is your double closing brackets ... it should read:

<?php echo tep_image(DIR_WS_IMAGES . 'credit_cards_logos.jpg'); ?>

 

 

 

Hi,

Can someone help me to insert an image in the index page. I tried so many ways, it is still not working. I have pasted how I have done it.

 

inspired jewelry, swarovski jewelry and cz jewelry. Also available are necklace, ring, earring, bangles/bracelet, pearls & stud earrings.

 

 

tep_image(DIR_WS_IMAGES.'front 1.gif');

 

<font color="#00000"><b>' . '</b> </font>.');

 

 

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

Archived

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

×
×
  • Create New...