Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding Image to Log Out page


Guest

Recommended Posts

Anybody?

 

hi

 

where abouts do you want to put your image, above the main text or after it?

 

First, open your logoff.php file in your main directory,

 

and where it says this

 

<div class="contentContainer">
 <div class="contentText">
<?php echo TEXT_MAIN; ?>
 </div>

 

 

You can add in your image inside the div like ive done below. Just change the image name and alternate text to your own images and it will show up. As long as your image is in the default "images" folder, it will work.

 

<div class="contentContainer">
 <div class="contentText">
<?php echo tep_image(DIR_WS_IMAGES . 'yourimagename.jpg', 'Alt Text For Image');?>
<?php echo TEXT_MAIN; ?>
 </div>

 

So above, you will see your image before the main text.

 

If you want it after it, just move your image to after the <?php echo TEXT_MAIN; ?> tag.

Edited by vampirehunter
Link to comment
Share on other sites

It looks great but where do i put the code to center the image?

 

Cheers

 

hi

 

Thats easy. I'll just explain the tep_image function so you can use it again easily.

 

Basically, so you can do this anytime you need a custom specific image on a page,

 

the tep_image function has 5 parameters which you can use.

 

 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '')

 

So

1) $src refers to the location of your image.

 

2) $alt refers the alternate text which shows if your image for some reason won't display on the page.

 

3) $width to image width (if you want to specify it, but i would just make sure my image is the correct size already rather than declare it in html)

 

4) $height of the image (again, i would just make my image size exact so i don't need to declare it)

 

5) $parameters - this is the bit where you can add your custom text which will show as part of the <img> code. So this is where we put in the class name so that we can call it from our css stylesheet.

 

 

So for your example just do this:

 

  <?php echo tep_image(DIR_WS_IMAGES . 'yourimagename.jpg', 'Alt Text For Image', ' ',' ', 'class="myclass"');?>

 

and your html should look like this when its outputted.

 

<img class="myclass" title="Alt Text For Image" alt="Alt Text For Image" src="images/yourimagename.jpg">

 

So basically, you are putting your

 

1.) Image location = DIR_WS_IMAGES . 'yourimagename.jpg'

2.) Your image alt text = 'Alt Text For Image'

3.) Image width we can leave blank = ' '

4.) Image height we can leave blank = ' '

5.) We add our custom text such as a css class = ' class="myclass" '

 

Now you can open up your stylesheet.css file

 

and at the end just put in this (whatever name you are giving your css class):

 

.myclass {

align:center;

}

 

You could add other stuff for your image class like padding, margins etc as you wanted.

 

 

let me know if you have any trouble.

Edited by vampirehunter
Link to comment
Share on other sites

  • 3 months later...

Vampire hunter that is the best explanation to a post I have seen so far, and I have looked and looked for some knowledge and failed miserably.

Your makes a little sense to me ( trust me that's good lol ).

 

Can I use the same for my index page.php I have put 4 images on using html and I have tried ahref linking to a product page within osc 2.3 but my site goes down.

 

Thanks in advance and a Happy and Healthy New Year

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

Thanks for the quick class on adding images. I would like to add some banner images on my home page which links to the various catalogue links within oscommerce.

Can you help me with the coding. I have added images but when I try adding links my site just crashes.

The images I have at the moments just sit there doing nothing.

See my code below, well some of the page anyway..

 

define('TEXT_MAIN', "

<center/><image src=images/baby-wear.gif>

<image src=images/web-image-link.gif>

<image src=images/web-image-link.gif>

<image src=images/hi-viz.gif>

<image src=images/pp.gif>

<image src=images/pp2.gif>

<image src=images/comodo_secure_100x85_transp.png><center/>

");

 

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

 

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

 

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

 

define('HEADING_TITLE', 'Welcome to ' . STORE_NAME);

 

Thanks in advance

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...